Skip to content
Snippets Groups Projects
Commit 16338bf6 authored by User expired's avatar User expired
Browse files

fix broken tests

parent 175da22b
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import org.slf4j.Logger;
......@@ -158,12 +159,20 @@ public final class ComparisonTest {
LOGGER.debug(" - comparing for isochrone duration: " + params.getDuration());
final MemoryOutput o1 = AlgorithmHelper.run(clazz1, params).getOutput();
final MemoryOutput o2 = AlgorithmHelper.run(clazz2, params).getOutput();
final Collection<Link> l1 = o1.getLinks();
final Collection<Link> l2 = o2.getLinks();
Assert.assertEquals(l1, l2, n1 + " != " + n2);
Assert.assertEquals(getIds(o1.getNodes()), getIds(o2.getNodes()), "Nodes for class \"" + n1 + "\"" + " != nodes for class \"" + n2 + "\"");
Assert.assertEquals(getIds(o1.getLinks()), getIds(o2.getLinks()), "Links for class \"" + n1 + "\"" + " != links for class \"" + n2 + "\"");
}
LOGGER.info("-----------------------------");
}
}
private static Collection<Integer> getIds(final Collection<? extends NetworkEntity> l1) {
final SortedSet<Integer> i1 = new TreeSet<>();
for (final NetworkEntity l : l1) {
i1.add(l.getId());
}
return i1;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment