New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests fail in Eclipse on Windows #77

Closed
GoogleCodeExporter opened this Issue Mar 29, 2015 · 5 comments

Comments

Projects
None yet
1 participant
@GoogleCodeExporter

GoogleCodeExporter commented Mar 29, 2015

What steps will reproduce the problem?
1. Install Eclipse
2. Import the EqualsVerifier project into Eclipse.
3. Resolve the Ivy dependencies.
4. Run the tests in the test folder


What is the code (equals method, hashCode method, relevant fields) that
triggers the problem?
- nl.jqno.equalsverifier.util.FieldIterableTest.simpleFields
- nl.jqno.equalsverifier.util.FieldIterableTest.subHasNoFields
- 
nl.jqno.equalsverifier.AbstractDelegationTest.hashCodeDelegatesToAbstractMethod
- nl.jqno.equalsverifier.AbstractDelegationTest.equalsDelegatesToAbstractMethod


What error message does EqualsVerifier give?
See attached file for a failure trace of each test.

What version of EqualsVerifier are you using?
Source on Github from 18-03-2013.

Original issue reported on code.google.com by tonnitie...@gmail.com on 18 Mar 2013 at 6:30

Attachments:

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Mar 29, 2015

Eclipse, by default, uses a single JVM to run all tests. After some more 
testing it appears that the tests succeed when running each in a separate JVM.

The first two failures are caused by the fact that 
nl.jqno.equalsverifier.util.FieldIterableTest.classInTheMiddleHasNoFields adds 
an additional field to 
nl.jqno.equalsverifier.util.FieldIterableTest.FIELD_CONTAINER_FIELDS, but does 
not remove it. Removing it at the end of the test, resolves the first two 
failures.

Original comment by tonnitie...@gmail.com on 18 Mar 2013 at 6:45

  • Added labels: ****
  • Removed labels: ****
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Mar 29, 2015

The other two failures seem to be caused by the JVM itself. I have no clue 
what's going wrong there, only that it does not occur when running the tests in 
a separate JVM.

For some reason the java.lang.AbstractMethodError's message is null. It is 
indirectly triggered by AbstractDelegationChecker.

Original comment by tonnitie...@gmail.com on 18 Mar 2013 at 7:19

  • Added labels: ****
  • Removed labels: ****
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Mar 29, 2015

Hi Tonni,

Thanks for submitting this issue.


@FieldIterableTest: you're completely right; I've been modifying a private 
static final Set which I assumed to be immutable. Naughty me. My Eclipse 
happens to execute the tests in an order where this doesn't matter, but when I 
shuffle them around, I get the same exception.
In the end, I've opted for a different solution than the one in your pull 
request, though it did help me to localize the problem, so I'd like to thank 
you for it anyway! In case you're curious: 
https://github.com/jqno/equalsverifier/commit/9ef7b70a1f56ccdad9b402873b3168e088
6a5f87


@AbstractDelegationTest: Yeah, I've noticed that AbstractMethodError sometimes 
doesn't have a message. Like you, I have no idea why; even on my JVM it gets 
one in certain cases, but not in others. I suppose this behaviour isn't 
unspecified.
I modified the tests to no longer check the AME's original message, and I've 
added a new one that throws one explicitly, so I can test that that, if a 
message does exist, it gets included in EqualsVerifier's error message.
https://github.com/jqno/equalsverifier/commit/a19895928eb9a310da54c2490abc13b72c
ae8d1c


I have one request for you, though: can you check if this fixes the tests for 
you?
Or otherwise, could you tell me precisely which JVM (vendor, version) you use, 
and which version of Eclipse?

Original comment by jan.ouw...@gmail.com on 23 Mar 2013 at 2:31

  • Changed state: Accepted
  • Added labels: ****
  • Removed labels: ****
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Mar 29, 2015

Hi Jan,

Works now! Thanks.

Original comment by tonnitie...@gmail.com on 31 Mar 2013 at 6:43

  • Added labels: ****
  • Removed labels: ****
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Mar 29, 2015

Thanks for reporting back! I'm closing the issue.

Original comment by jan.ouw...@gmail.com on 6 Apr 2013 at 10:34

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment