Merge remote-tracking branch 'remotes/origin/splitIntoTwoModules' into NetworkedVisualiser
# Conflicts: # visualiser/src/main/java/seng302/VisualiserInput.java
This commit is contained in:
@@ -49,8 +49,4 @@ public class StreamedBoat extends Boat {
|
|||||||
}
|
}
|
||||||
return azimuth;
|
return azimuth;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSourceID() {
|
|
||||||
return sourceID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package seng302.Networking;
|
package seng302;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
import seng302.Mock.*;
|
import seng302.Mock.*;
|
||||||
import seng302.Networking.BinaryMessageDecoder;
|
import seng302.Networking.BinaryMessageDecoder;
|
||||||
@@ -37,14 +37,13 @@ public class VisualiserInput implements Runnable
|
|||||||
|
|
||||||
private Map<Integer, BoatLocationMessage> boatLocation;
|
private Map<Integer, BoatLocationMessage> boatLocation;
|
||||||
|
|
||||||
public VisualiserInput(Socket connectionSocket) throws IOException{
|
public VisualiserInput(StreamedCourse course) throws IOException{
|
||||||
|
|
||||||
//connectionSocket = new Socket(InetAddress.getLocalHost(), 4942);
|
//connectionSocket = new Socket(InetAddress.getLocalHost(), 4942);
|
||||||
this.connectionSocket = connectionSocket;
|
this.connectionSocket = new Socket("livedata.americascup.com",4941);
|
||||||
|
|
||||||
this.course = new StreamedCourse();
|
this.course = course;
|
||||||
this.boatLocation = new HashMap<>();
|
this.boatLocation = new HashMap<>();
|
||||||
this.connectionSocket = connectionSocket;
|
|
||||||
|
|
||||||
|
|
||||||
//start Time
|
//start Time
|
||||||
@@ -209,9 +208,7 @@ public class VisualiserInput implements Runnable
|
|||||||
|
|
||||||
public static void main(String argv[]) throws Exception
|
public static void main(String argv[]) throws Exception
|
||||||
{
|
{
|
||||||
//this is the test data that streams form the AC35 website
|
VisualiserInput receiver = new VisualiserInput(new StreamedCourse());
|
||||||
Socket socket = new Socket("livedata.americascup.com",4941);
|
|
||||||
VisualiserInput receiver = new VisualiserInput(socket);
|
|
||||||
receiver.run();
|
receiver.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,11 +21,6 @@ import static org.junit.Assert.assertTrue;
|
|||||||
public class FailBoatXMLTest {
|
public class FailBoatXMLTest {
|
||||||
String path = "mockXML/boatXML/";
|
String path = "mockXML/boatXML/";
|
||||||
|
|
||||||
@Test(expected = SAXException.class)
|
|
||||||
public void emptyFile() throws SAXException, ParserConfigurationException, ParseException, IOException {
|
|
||||||
new BoatXMLReader("empty.xml");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(expected = NumberFormatException.class)
|
@Test(expected = NumberFormatException.class)
|
||||||
public void invalidSourceID() throws SAXException, ParserConfigurationException, ParseException, IOException {
|
public void invalidSourceID() throws SAXException, ParserConfigurationException, ParseException, IOException {
|
||||||
new BoatXMLReader(path + "invalidSourceID.xml");
|
new BoatXMLReader(path + "invalidSourceID.xml");
|
||||||
|
|||||||
Reference in New Issue
Block a user