mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Fixed faulty tests.
This commit is contained in:
@@ -35,7 +35,7 @@ public class MapMaker {
|
|||||||
private XMLGenerator xmlGenerator = new XMLGenerator();
|
private XMLGenerator xmlGenerator = new XMLGenerator();
|
||||||
|
|
||||||
private List<String> maps = new ArrayList<>(
|
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() {
|
public static MapMaker getInstance() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
|
|||||||
@@ -48,9 +48,10 @@ public class ServerTableTest {
|
|||||||
|
|
||||||
serverTable.addServer(listing);
|
serverTable.addServer(listing);
|
||||||
|
|
||||||
|
listing.decrementTtl();
|
||||||
listing.decrementTtl();
|
listing.decrementTtl();
|
||||||
|
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1500);
|
||||||
|
|
||||||
assertTrue(!serverTable.getAllServers().contains(listing));
|
assertTrue(!serverTable.getAllServers().contains(listing));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ package steps;
|
|||||||
import cucumber.api.java.en.Given;
|
import cucumber.api.java.en.Given;
|
||||||
import cucumber.api.java.en.Then;
|
import cucumber.api.java.en.Then;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Comparator;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import seng302.visualiser.MapMaker;
|
import seng302.visualiser.MapMaker;
|
||||||
|
|
||||||
@@ -29,11 +32,11 @@ public class CustomMapsSteps {
|
|||||||
@Then("^all of them can be seen$")
|
@Then("^all of them can be seen$")
|
||||||
public void all_of_them_can_be_seen() throws Throwable {
|
public void all_of_them_can_be_seen() throws Throwable {
|
||||||
File[] files = new File(this.getClass().getResource("/maps/").getPath()).listFiles();
|
File[] files = new File(this.getClass().getResource("/maps/").getPath()).listFiles();
|
||||||
|
Arrays.sort(files);
|
||||||
for (File file : files) {
|
for (File file : files) {
|
||||||
if (file.isFile()) {
|
if (file.isFile()) {
|
||||||
Assert.assertTrue(file.getAbsolutePath().equals(mapMaker.getCurrentRacePath()));
|
Assert.assertTrue(file.getAbsolutePath().endsWith(mapMaker.getCurrentRacePath()));
|
||||||
mapMaker.next();
|
mapMaker.next();
|
||||||
System.out.println(file.getAbsolutePath());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user