Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [capra-dev] Is a file related to a artifact?

Hey Jens,

> This seems to be an important a Capra design question, so I think it is good to discuss it with the rest of the group.

It is!

> In my code I get from Mylyn an ITestResult object from which I can get the file names of the test case files. I need a way to determine whether a given artifact (connected as the child of a Requirement) is for a given test file.

I am not sure if I quite understand this. The link that exists is between a requirement and a test case, right? The test case is defined in a test file then, correct? Do you use the CDT handler to link between the requirement and a function?

> There are a few solutions to this problem:
> * Have ArtifactMetaModelAdapter#getArtifactUri return a real URI that can be used to locate a file. (Right now that method doesn't return URI:s, it returns some artifact handler specific ID string.)

Yes, that is an issue that is independent of the concrete problem that you describe. The contract of that method is broken. For the OfficeHandler, e.g., we needed to introduce an addressing scheme, that would include the worksheet and row in an Excel file. That’s why it does no longer return a URI. Maybe we should change the behaviour here to return the URI of the _enclosing_ resource and have another method that gives the unique identifier (as defined by the handler).

> * Add some new method to test this, possible on TraceMetaModelAdapter. It's not clear to me exactly how that method should look, but it should be possible to work out something.

It’s not clear to me, either. Would the solution via ArtifactMetaModelAdapter#getArtifactUri address your issue?

Best,
Jan-Philipp

Back to the top