Skip to content

Commit

Permalink
Make tests pass by ignoring jar-file-related classes
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Aug 25, 2019
1 parent 79c1b0a commit 574a39d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pom.xml
Expand Up @@ -271,6 +271,9 @@
--add-opens java.base/jdk.internal.misc=ALL-UNNAMED
--add-opens java.base/jdk.internal.loader=ALL-UNNAMED
--add-opens java.base/jdk.internal.ref=ALL-UNNAMED
--add-opens java.base/jdk.internal.util=ALL-UNNAMED
--add-opens java.base/jdk.internal.util.jar=ALL-UNNAMED
--add-opens java.base/jdk.internal.module=ALL-UNNAMED
</argLine>
<!-- Jenkins needs XML test reports to determine whether the build is stable. -->
<disableXmlReport>false</disableXmlReport>
Expand Down
Expand Up @@ -13,10 +13,13 @@
import org.opentripplanner.routing.vertextype.TransitStation;

import java.io.File;
import java.io.RandomAccessFile;
import java.lang.ref.Cleaner;
import java.lang.reflect.Method;
import java.util.BitSet;
import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.jar.JarFile;
import java.util.stream.Collectors;

import static org.junit.Assert.assertFalse;
Expand Down Expand Up @@ -88,8 +91,8 @@ public void compareGraphToItself () {
objectDiffer.ignoreFields("incoming", "outgoing");
objectDiffer.useEquals(BitSet.class, LineString.class, Polygon.class);
// ThreadPoolExecutor contains a weak reference to a very deep chain of Finalizer instances.
// Method instances usually are part of a proxy which is totally un-reflectable in Java 11
objectDiffer.ignoreClasses(WeakValueHashMap.class, ThreadPoolExecutor.class, Method.class);
// Method instances usually are part of a proxy which are totally un-reflectable in Java 11
objectDiffer.ignoreClasses(WeakValueHashMap.class, ThreadPoolExecutor.class, Method.class, JarFile.class);
// This setting is critical to perform a deep test of an object against itself.
objectDiffer.enableComparingIdenticalObjects();
objectDiffer.compareTwoObjects(originalGraph, originalGraph);
Expand Down

0 comments on commit 574a39d

Please sign in to comment.