trellis-ldp / trellis

Trellis is a platform for building scalable Linked Data applications
https://www.trellisldp.org
Apache License 2.0
105 stars 21 forks source link

Factor out tests for nonBasic containers #88

Closed ajs6f closed 6 years ago

ajs6f commented 6 years ago

The current org.trellisldp.test.ResourceServiceTests tests the behavior of nonBasic container types like DC and IC. I haven't implemented them in trellis-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.

acoburn commented 6 years ago

Would it make sense to use Junit's Conditional Test Execution mechanism for this?

ajs6f commented 6 years ago

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.

acoburn commented 6 years ago

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.

ajs6f commented 6 years ago

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....?

acoburn commented 6 years ago

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!)

ajs6f commented 6 years ago

One potential niceness might be earlier failing of requests with unsupported interaction models, before execution gets all the way to trying to persist.