Closed ajs6f closed 6 years ago
Would it make sense to use Junit's Conditional Test Execution mechanism for this?
Could be. The question I would ask is whether there is a solid programmatic way to understand whether a given impl supports nonBasic containers. E.g. some kind of characterizing method, or potentially a marker type or the like.
I don't believe that LDP provides a mechanism for discovering that -- other than creating a resource with the defined type and verifying that the request succeeds. And Trellis doesn't have a mechanism for that at present. Though perhaps the ResourceService
interface could have a new method returning a list of supported interaction models.
Yeah, I meant something Trellis-specific (in the Java). Absent some characterizing technique like the method you propose, it's not clear to me how conditional test execution knows when to run the extra tests....?
I suspect the cleanest approach would include an addition to the JAVA API. The current HTTP layer could even make use of that to control for "valid interaction models". Otherwise, in the testing code one would have to depend on system properties or the like (yuck!)
One potential niceness might be earlier failing of requests with unsupported interaction models, before execution gets all the way to trying to persist.
The current
org.trellisldp.test.ResourceServiceTests
tests the behavior of nonBasic container types like DC and IC. I haven't implemented them intrellis-cassandra
yet, so these tests are failing. I can override those test methods for now, but it might be better at some point to factor them out to their own class.