Skip to content
Snippets Groups Projects
Commit 9623e185 authored by Nikolaus Krismer's avatar Nikolaus Krismer
Browse files

fixed problem which caused test skipping

parent a4bef35c
No related branches found
No related tags found
No related merge requests found
......@@ -22,8 +22,6 @@ public class DatabaseTest {
private static final int EXPECTED_NODE_COUNT = 2687;
private static final int LINK_ID = 1846;
private static final int NODE_ID = 5013;
private Database db;
private Map<Integer, Node> nodes;
private Map<Integer, Link> links;
......@@ -31,9 +29,6 @@ public class DatabaseTest {
public void setUp() {
nodes = new HashMap<Integer, Node>();
links = new LinkedHashMap<Integer, Link>();
db = new Database(Dataset.BZ, Mode.MULTIMODAL, Direction.INCOMING);
db.readNetwork(nodes, links);
}
@AfterTest
......@@ -47,6 +42,7 @@ public class DatabaseTest {
@Test
public void testCreateDatabaseObject() {
final Database db = new Database(Dataset.BZ, Mode.MULTIMODAL, Direction.INCOMING);
Assert.assertNotNull(db, "Database object could not be created!");
}
......@@ -56,12 +52,16 @@ public class DatabaseTest {
final LinkedHashMap<Integer, Link> compareLinks = new LinkedHashMap<Integer, Link>();
fillHashMaps(compareNodes, compareLinks);
initDb();
Assert.assertEquals(nodes.get(NODE_ID), compareNodes.get(NODE_ID), "Nodes comparison");
Assert.assertEquals(links.get(LINK_ID), compareLinks.get(LINK_ID), "Links comparison");
}
@Test
public void testCountEdges() {
initDb();
// 2687 Doesn't correspond to the number of nodes in
// the nodes table, but the number of distinct
// target/source node in the edges table
......@@ -71,6 +71,13 @@ public class DatabaseTest {
// Private methods
private Database initDb() {
final Database db = new Database(Dataset.BZ, Mode.MULTIMODAL, Direction.INCOMING);
db.readNetwork(nodes, links);
return db;
}
private void fillHashMaps(final HashMap<Integer, Node> nodeHashMap, final LinkedHashMap<Integer, Link> linkHashMap) {
final Node n1 = new Node(NODE_ID);
......
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