-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #22 seems to be fixed already.
- Loading branch information
1 parent
c483ce9
commit 38670b0
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
tests/issues/src/test/java/org/jvnet/jaxb2_commons/tests/issues/GH22Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.jvnet.jaxb2_commons.tests.issues; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; | ||
|
||
public class GH22Test { | ||
@Test | ||
public void testJAXBEqualsSymmetryConcreteClassAndEnum() { | ||
Assert.assertFalse(JAXBEqualsStrategy.INSTANCE.equals(null, null, | ||
new SomeConcreteClass(), SomeEnum.ENUM)); | ||
} | ||
|
||
@Test | ||
public void testJAXBEqualsSymmetryEnumAndConcreteClass() { | ||
// This test fails and throws a ClassCastException | ||
Assert.assertFalse(JAXBEqualsStrategy.INSTANCE.equals(null, null, | ||
SomeEnum.ENUM, new SomeConcreteClass())); | ||
} | ||
|
||
private static class SomeConcreteClass { | ||
} | ||
|
||
private enum SomeEnum { | ||
ENUM; | ||
} | ||
} |