Fixed Maven Error where ID wasn't set as the database did not establish the index before the creation of the table

This commit is contained in:
YaFedImYaEatIm
2016-09-24 14:15:16 +12:00
parent 5f576595c0
commit 267a08ce68
4 changed files with 33 additions and 7 deletions
@@ -32,6 +32,11 @@ public class DatasetTest {
fail("The sample file is missing");
}
assertTrue(dataset.getAirlines().size() == dataset.getAirlineDictionary().size());
try {
assertTrue(dataset.getAirlines().get(0).getID() == 1);
} catch (DataException e) {
fail("The first index of Airlines should have an id of 1 as there has been no tampering with the data yet");
}
try {
dataset.importAirport("res/Reduced Samples/Airports.txt");
@@ -41,6 +46,11 @@ public class DatasetTest {
assertTrue(dataset.getAirports().size() == dataset.getAirportDictionary().size());
assertTrue(dataset.getCities().size() == dataset.getCityDictionary().size());
assertTrue(dataset.getCountries().size() == dataset.getCountryDictionary().size());
try {
assertTrue(dataset.getAirports().get(0).getID() == 1);
} catch (DataException e) {
fail("The first index of Airports should have an id of 1 as there has been no tampering with the data yet");
}
try {
dataset.importRoute("res/Reduced Samples/Routes.txt");
@@ -48,6 +58,11 @@ public class DatasetTest {
fail("The sample file is missing");
}
assertTrue(dataset.getRoutes().size() == dataset.getRouteDictionary().size());
try {
assertTrue(dataset.getRoutes().get(0).getID() == 1);
} catch (DataException e) {
fail("The first index of Routes should have an id of 1 as there has been no tampering with the data yet");
}
try {
dataset.importFlight("res/Reduced Samples/NZCH-WSSS.csv");
@@ -55,6 +70,11 @@ public class DatasetTest {
fail("The sample file is missing");
}
assertTrue(dataset.getFlightPaths().size() == dataset.getFlightPathDictionary().size());
try {
assertTrue(dataset.getFlightPaths().get(0).getID() == 1);
} catch (DataException e) {
fail("The first index of Flight Paths should have an id of 1 as there has been no tampering with the data yet");
}
dataset.createDataLinks();
@@ -185,6 +205,8 @@ public class DatasetTest {
fail("The sample file is missing");
}
assertTrue(dataset.getFlightPaths().get(0).getFlightPoints().get(0).getID() == 1);
FlightPoint flightPoint = dataset.getFlightPaths().get(0).getFlightPoints().get(6);
FlightPoint flightPoint1 = dataset.getFlightPaths().get(0).getFlightPoints().get(5);
dataset.deleteFlightPoint(1, 5);