Fixed faulty tests.

This commit is contained in:
Kusal Ekanayake
2017-09-28 15:35:58 +13:00
parent 6d0835b0cf
commit 77ee1ebbc0
3 changed files with 8 additions and 4 deletions
@@ -35,7 +35,7 @@ public class MapMaker {
private XMLGenerator xmlGenerator = new XMLGenerator();
private List<String> maps = new ArrayList<>(
Arrays.asList("default.xml", "horseshoe.xml", "madagascar.xml", "loop.xml"));
Arrays.asList("default.xml", "horseshoe.xml", "loop.xml", "madagascar.xml"));
public static MapMaker getInstance() {
if (instance == null) {
@@ -48,9 +48,10 @@ public class ServerTableTest {
serverTable.addServer(listing);
listing.decrementTtl();
listing.decrementTtl();
Thread.sleep(1000);
Thread.sleep(1500);
assertTrue(!serverTable.getAllServers().contains(listing));
}
+5 -2
View File
@@ -3,6 +3,9 @@ package steps;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import java.io.File;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Comparator;
import org.junit.Assert;
import seng302.visualiser.MapMaker;
@@ -29,11 +32,11 @@ public class CustomMapsSteps {
@Then("^all of them can be seen$")
public void all_of_them_can_be_seen() throws Throwable {
File[] files = new File(this.getClass().getResource("/maps/").getPath()).listFiles();
Arrays.sort(files);
for (File file : files) {
if (file.isFile()) {
Assert.assertTrue(file.getAbsolutePath().equals(mapMaker.getCurrentRacePath()));
Assert.assertTrue(file.getAbsolutePath().endsWith(mapMaker.getCurrentRacePath()));
mapMaker.next();
System.out.println(file.getAbsolutePath());
}
}
}