mock.app.App now tells mock.app.Event that the xml file strings are XMLFileType.Contents.

Made network.MessageEncoders.RaceVisionByteEncoder methods static (they were effectively static already).

shared.dataInput.XMLReader#readXMLFileToString(..) now throws an XMLReaderException if the file cannot be found.

visualiser.Controllers.StartController assumed XML messages were resource paths instead of file contents - fixed.

Testing:
networking tests now work again.
This commit is contained in:
fjc40
2017-07-20 01:01:29 +12:00
parent 4bcfc01ceb
commit 5cddaaed8e
24 changed files with 1031 additions and 142 deletions
@@ -4,6 +4,7 @@ package shared.dataInput;
import org.junit.Before;
import org.junit.Test;
import org.xml.sax.SAXException;
import shared.enums.XMLFileType;
import shared.exceptions.InvalidBoatDataException;
import shared.exceptions.XMLReaderException;
import shared.model.Boat;
@@ -46,7 +47,7 @@ public class BoatXMLReaderTest {
try {
boatData = new BoatXMLReader(boatXMLString);
boatData = new BoatXMLReader(boatXMLString, XMLFileType.Contents);
boats = new ArrayList<>(boatData.getBoats().values());
marks = new ArrayList<>(boatData.getMarkerBoats().values());
@@ -2,6 +2,7 @@ package shared.dataInput;
import org.junit.Before;
import org.junit.Test;
import shared.enums.XMLFileType;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
@@ -16,7 +17,7 @@ public class RegattaXMLReaderTest {
@Before
public void findFile() {
try {
regatta = new RegattaXMLReader("mockXML/regattaXML/regattaTest.xml");
regatta = new RegattaXMLReader("shared/mockXML/regattaXML/regattaTest.xml", XMLFileType.ResourcePath);
} catch (Exception e) {
fail("Cannot find mockXML/regattaXML/regattaTest.xml in the resources folder");
}