Skip to content

Conversation

@stefanbirkner
Copy link
Contributor

No description provided.

@stefanbirkner stefanbirkner added this to the 4.13 milestone Feb 19, 2018
@stefanbirkner stefanbirkner force-pushed the jdk9 branch 3 times, most recently from 601d6e2 to 7f66629 Compare February 19, 2018 14:42
//Java < 9:
equalTo(asList("methodA", "methodB", "methodC")),
//Java >= 9 has annotations on methods of java.lang.Object:
equalTo(asList("clone", "finalize", "getClass", "hashCode",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest ignoring the jdk.internal.* annotations completely.

Copy link
Contributor Author

@stefanbirkner stefanbirkner Feb 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I understand your motivation I would like to keep it like it is, because the implemented method does nothing wrong. The test has a wrong assumption about the class. IMHO the problem here is that the test is not good enough. I write a better test.

Copy link
Member

@kcooney kcooney Feb 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Alex. The tests would be less.fragile if you filtered out the jdk.internal.* annotations. They are, after all, internal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rewrote the tests so that they are less fragile. Therefore I don't have to change getAnnotatedMethods by adding a filter.

JDK 9 uses classes from the package jdk.internal.reflect instead of
sun.reflect.
Use same coding style within TestClassTest.
Make the test less fragile. The number of annotated methods varies
because Java 9 introduces new annotations for some methods of Object.
Make the test providesAnnotatedMethodsSortedByName less fragile. (Before
the test failed on JDK 9 because Java 9 introduces new annotations for
some methods of Object.)
Developers with a current JDK 9 on their machines are currently not able
to easily build JUnit. This commit makes it possible to develop with
JDK 9 and ensures that JUnit can be build with JDK 0.
@stefanbirkner stefanbirkner merged commit 9b061ea into junit-team:master Mar 8, 2018
@stefanbirkner stefanbirkner deleted the jdk9 branch March 8, 2018 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants