Reputation: 46482
Out of curiosity, I wrote an own simple implementation of Set
for a special case (where the set of all possible entries is fixed, but it's no enum
). It was actually quite easy, but obviously, my implementation is unusable without a lot of tests (and maybe even then, but that's another topic; it was mainly an exercise).
So is there any testsuite available I could use for unit-testing it?
Upvotes: 19
Views: 1555
Reputation: 40851
Use the Guava SetTestSuiteBuilder
.
Examples:
It is released as part of "guava-testlib" in maven central.
Upvotes: 30
Reputation: 18437
Oracle refuses to open source the test suite for java, this is the heart of a debate between the OSS community and Oracle.
See here for more info:
So I doubt there is anything you can do to verify you conform to the standard.
Here's an excerpt:
The heart of the issue is that Apache can't certify that its open source Java implementation—called Harmony—conforms with the Java language standards because Oracle refuses to supply the necessary test suites under a suitably open license. Oracle's position on the issue falls afoul of JCP policies, which stipulate that standards and other relevant materials must be freely redistributable and made available under terms that are conducive to enabling third-party open source implementations.
This conflict has been a subject of considerable friction for quite some time, because Sun similarly denied the ASF appropriate access to the test suite prior to Oracle's acquisition of the company. Oracle had initially sided with Apache in calling for the test suites to be published under open terms, but reversed its position after acquiring Sun. Oracle's approach to this issue suggested very strongly that the company would likely not be willing to fix any of the long-standing JCP governance problems that had arisen under Sun.
Upvotes: 7