Changeset View
Changeset View
Standalone View
Standalone View
java/src/test/java/org/softwareheritage/graph/GraphTest.java
Show All 9 Lines | |||||
import it.unimi.dsi.big.webgraph.LazyLongIterator; | import it.unimi.dsi.big.webgraph.LazyLongIterator; | ||||
import it.unimi.dsi.big.webgraph.LazyLongIterators; | import it.unimi.dsi.big.webgraph.LazyLongIterators; | ||||
import org.hamcrest.MatcherAssert; | import org.hamcrest.MatcherAssert; | ||||
import org.junit.jupiter.api.BeforeAll; | import org.junit.jupiter.api.BeforeAll; | ||||
import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder; | import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder; | ||||
public class GraphTest { | public class GraphTest { | ||||
static Graph graph; | static SwhBidirectionalGraph graph; | ||||
@BeforeAll | @BeforeAll | ||||
public static void setUp() throws IOException { | public static void setUp() throws IOException { | ||||
Path graphPath = Paths.get("..", "swh", "graph", "tests", "dataset", "output", "example"); | Path graphPath = Paths.get("..", "swh", "graph", "tests", "dataset", "output", "example"); | ||||
graph = Graph.loadMapped(graphPath.toString()); | graph = SwhBidirectionalGraph.loadMapped(graphPath.toString()); | ||||
} | } | ||||
public Graph getGraph() { | public SwhBidirectionalGraph getGraph() { | ||||
return graph; | return graph; | ||||
} | } | ||||
public static SWHID fakeSWHID(String type, int num) { | public static SWHID fakeSWHID(String type, int num) { | ||||
return new SWHID(String.format("swh:1:%s:%040d", type, num)); | return new SWHID(String.format("swh:1:%s:%040d", type, num)); | ||||
} | } | ||||
public static <T> void assertEqualsAnyOrder(Collection<T> expecteds, Collection<T> actuals) { | public static <T> void assertEqualsAnyOrder(Collection<T> expecteds, Collection<T> actuals) { | ||||
Show All 10 Lines |