Added Flight Point order switch JUnitTests
This commit is contained in:
@@ -668,7 +668,6 @@ public class Dataset {
|
||||
while(IDResult.next()){
|
||||
nextID = Integer.parseInt(IDResult.getString("seq")) + 1;//for some reason sqlite3 stores incremental values as a string...
|
||||
}
|
||||
System.out.println(nextID);
|
||||
stmt.close();
|
||||
stmt = c.createStatement();
|
||||
//ADDED
|
||||
@@ -729,7 +728,6 @@ public class Dataset {
|
||||
c.close();
|
||||
|
||||
flightPaths.add(flightPathToAdd);
|
||||
System.out.println(flightPathToAdd.getFlightPoints().get(0).getID());
|
||||
updateFlightPointInfo(flightPathToAdd);
|
||||
flightPathDictionary.put(flightPathToAdd.getID(), flightPathToAdd);
|
||||
} catch ( Exception e ) {
|
||||
|
||||
@@ -220,6 +220,15 @@ public class DatasetTest {
|
||||
assertEquals(dataset.getFlightPaths().get(0).getFlightPoints().get(5).getName(), flightPoint1.getName());
|
||||
assertEquals(dataset.getFlightPaths().get(0).getFlightPoints().get(6).getName(), flightPoint.getName());
|
||||
|
||||
//edit order
|
||||
FlightPoint wasLast = dataset.getFlightPaths().get(0).getFlightPoints().get(dataset.getFlightPaths().get(0).getFlightPoints().size() - 1);
|
||||
FlightPoint wasSecondToLast = dataset.getFlightPaths().get(0).getFlightPoints().get(dataset.getFlightPaths().get(0).getFlightPoints().size() - 2);
|
||||
FlightPoint wasFirst = dataset.getFlightPaths().get(0).getFlightPoints().get(0);
|
||||
dataset.moveFlightPoint(wasLast, 0);
|
||||
assertTrue(dataset.getFlightPaths().get(0).getFlightPoints().indexOf(wasLast) == 0);
|
||||
assertTrue(dataset.getFlightPaths().get(0).getFlightPoints().indexOf(wasSecondToLast) == dataset.getFlightPaths().get(0).getFlightPoints().size() - 1);
|
||||
assertTrue(dataset.getFlightPaths().get(0).getFlightPoints().indexOf(wasFirst) == 1);
|
||||
|
||||
app.deleteDataset(app.getCurrentDataset());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user