RFR: jsr166 jdk9 integration wave 12
jbluettduncan at gmail.com
Wed Oct 19 23:40:32 UTC 2016
By collections infrastructure, do you mean something like the collection
testers in guava-testlib?
If so, I agree that JUnit 5's dynamic tests look promising for implementing
such an infrastructure. I admit I don't have all the context here, but
would using guava-testlib in the meantime be a viable medium- or short-term
solution? Or would its dependence on JUnit 3/4 make switching impractical?
Or, perhaps, has development into CollectionTest gone so far that, for that
reason instead, it would be impractical until switch, at least until
something superior using e.g. JUnit 5's dynamic tests is made?
On 19 October 2016 at 23:21, Martin Buchholz <martinrb at google.com> wrote:
> These tests are maintained outside of openjdk and have only recently been
> made available within openjdk.
> There may be a future where all the consumers of these tests are willing to
> accept a good test framework. Junit 5 dynamic tests look promising
> but it may be a decade before we can use it.
> Probably code bases that include interfaces (e.g. Collection) should
> provide infrastructure to test those interfaces for any implementation, but
> openjdk does not try to do so. CollectionTest is an experimental step in
> that direction, but it looks we could do better with Junit 5 some day. The
> openjdk and jtreg projects can try to help by supporting junit 5 earlier
> rather than later.
> On Wed, Oct 19, 2016 at 12:19 PM, Stuart Marks <stuart.marks at oracle.com>
> > On 10/18/16 11:00 AM, Martin Buchholz wrote:
> >> There's already a certain amount of mixing, e.g. stream tests sometimes
> >> test
> >> j.u.c. and Queue tests sometimes test all the Queue implementations.
> >> Unlike
> >> non-test code, some redundancy and divergence of testing frameworks and
> >> styles
> >> is fine. I still haven't found a way of writing shared tests for
> >> implementations of an interface that I really like.
> > It's probably the case that divergence of testing frameworks is
> > unavoidable, or at least it's impractical. I doubt that it's worthwhile
> > rewrite all the straight jtreg tests into TestNG, or JUnit, or whatever.
> > But I'd draw the line before saying this is "fine." 
> > Maintaining the tests' organization is pretty important. Most of the
> > collections tests are in jdk/test/java/util though they're spread around
> > bit uncomfortably even here. But now it's, oh, ArrayDeque and
> > ArrayList.removeIf tests are over *here* instead. Having things spread
> > around increases the likelihood of cases being missed or being tested
> > redundantly.
> > The test groups have to be maintained as well. I know I've been bitten by
> > problems (not in collections) where I *thought* I had run the right set
> > tests, but it ended up that I hadn't, resulting in me breaking the build.
> > As it turns out, jdk_collections_core doesn't include any ArrayDeque
> > Hmmm. Well, maybe jdk_collections_core isn't useful. It would have been
> > nice to know this when I added it last year. :-/ 
> > As things stand, I'm basically OK with this changeset going in. But it
> > does seem to highlight some areas that need some future cleanup,
> > particularly in the tests and the test group declarations.
> > s'marks
> >  http://knowyourmeme.com/memes/this-is-fine
> >  http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/7a0c06013ae6
More information about the core-libs-dev