# Conflicts: # visualiser/src/main/java/seng302/VisualiserInput.javamain
commit
b1db9ee5be
@ -0,0 +1,39 @@
|
||||
package seng302.Mock;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Created by jjg64 on 1/05/17.
|
||||
*/
|
||||
public class FailBoatXMLTest {
|
||||
String path = "mockXML/boatXML/";
|
||||
|
||||
@Test(expected = SAXException.class)
|
||||
public void emptyFile() throws SAXException, ParserConfigurationException, ParseException, IOException {
|
||||
new BoatXMLReader("empty.xml");
|
||||
}
|
||||
|
||||
@Test(expected = NumberFormatException.class)
|
||||
public void invalidSourceID() throws SAXException, ParserConfigurationException, ParseException, IOException {
|
||||
new BoatXMLReader(path + "invalidSourceID.xml");
|
||||
}
|
||||
|
||||
@Test(expected = NullPointerException.class)
|
||||
public void insufficientInformation() throws SAXException, ParserConfigurationException, ParseException, IOException {
|
||||
new BoatXMLReader(path + "insufficientInformation.xml");
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,249 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<BoatConfig>
|
||||
|
||||
<Modified>2012-05-17T07:49:40+0200</Modified>
|
||||
|
||||
<Version>12</Version>
|
||||
|
||||
<Settings>
|
||||
|
||||
<RaceBoatType Type="AC45"/>
|
||||
|
||||
<BoatDimension BoatLength="14.019" HullLength="13.449"/>
|
||||
|
||||
<ZoneSize MarkZoneSize="40.347" CourseZoneSize="40.347"/>
|
||||
|
||||
<ZoneLimits Limit1="200" Limit2="100" Limit3="40.347" Limit4="0" Limit5="-100"/>
|
||||
|
||||
</Settings>
|
||||
|
||||
<BoatShapes>
|
||||
|
||||
<BoatShape ShapeID="0">
|
||||
|
||||
<Vertices>
|
||||
|
||||
<Vtx Seq="1" Y="0" X="-2.659"/>
|
||||
|
||||
<Vtx Seq="2" Y="18.359" X="-2.659"/>
|
||||
|
||||
<Vtx Seq="3" Y="18.359" X="2.659"/>
|
||||
|
||||
<Vtx Seq="4" Y="0" X="2.659"/>
|
||||
|
||||
</Vertices>
|
||||
|
||||
</BoatShape>
|
||||
|
||||
<BoatShape ShapeID="1">
|
||||
|
||||
<Vertices>
|
||||
|
||||
<Vtx Seq="1" Y="0" X="-1.278"/>
|
||||
|
||||
<Vtx Seq="2" Y="8.876" X="-1.278"/>
|
||||
|
||||
<Vtx Seq="3" Y="8.876" X="1.278"/>
|
||||
|
||||
<Vtx Seq="4" Y="0" X="1.278"/>
|
||||
|
||||
</Vertices>
|
||||
|
||||
</BoatShape>
|
||||
|
||||
<BoatShape ShapeID="2">
|
||||
|
||||
<Vertices>
|
||||
|
||||
<Vtx Seq="1" Y="0" X="-1.1"/>
|
||||
|
||||
<Vtx Seq="2" Y="8.3" X="-1.1"/>
|
||||
|
||||
<Vtx Seq="3" Y="8.3" X="1.1"/>
|
||||
|
||||
<Vtx Seq="4" Y="0" X="1.1"/>
|
||||
|
||||
</Vertices>
|
||||
|
||||
</BoatShape>
|
||||
|
||||
<BoatShape ShapeID="3">
|
||||
|
||||
<Vertices>
|
||||
|
||||
<Vtx Seq="1" Y="0" X="-0.75"/>
|
||||
|
||||
<Vtx Seq="2" Y="3" X="-0.75"/>
|
||||
|
||||
<Vtx Seq="3" Y="3" X="0.75"/>
|
||||
|
||||
<Vtx Seq="4" Y="0" X="0.75"/>
|
||||
|
||||
</Vertices>
|
||||
|
||||
</BoatShape>
|
||||
|
||||
<BoatShape ShapeID="4">
|
||||
|
||||
<Vertices>
|
||||
|
||||
<Vtx Seq="1" Y="0" X="-3.46"/>
|
||||
|
||||
<Vtx Seq="2" Y="13.449" X="-3.46"/>
|
||||
|
||||
<Vtx Seq="3" Y="14.019" X="0"/>
|
||||
|
||||
<Vtx Seq="4" Y="13.449" X="3.46"/>
|
||||
|
||||
<Vtx Seq="5" Y="0" X="3.46"/>
|
||||
|
||||
</Vertices>
|
||||
|
||||
<Catamaran>
|
||||
|
||||
<Vtx Seq="1" Y="1.769" X="-2.752"/>
|
||||
|
||||
<Vtx Seq="2" Y="0" X="-2.813"/>
|
||||
|
||||
<Vtx Seq="3" Y="0" X="-3.34"/>
|
||||
|
||||
<Vtx Seq="4" Y="5.351" X="-3.46"/>
|
||||
|
||||
<Vtx Seq="5" Y="10.544" X="-3.387"/>
|
||||
|
||||
<Vtx Seq="6" Y="13.449" X="-3.075"/>
|
||||
|
||||
<Vtx Seq="7" Y="10.851" X="-2.793"/>
|
||||
|
||||
<Vtx Seq="8" Y="6.669" X="-2.699"/>
|
||||
|
||||
<Vtx Seq="9" Y="6.669" X="2.699"/>
|
||||
|
||||
<Vtx Seq="10" Y="10.851" X="2.793"/>
|
||||
|
||||
<Vtx Seq="11" Y="13.449" X="3.075"/>
|
||||
|
||||
<Vtx Seq="12" Y="10.544" X="3.387"/>
|
||||
|
||||
<Vtx Seq="13" Y="5.351" X="3.46"/>
|
||||
|
||||
<Vtx Seq="14" Y="0" X="3.34"/>
|
||||
|
||||
<Vtx Seq="15" Y="0" X="2.813"/>
|
||||
|
||||
<Vtx Seq="16" Y="1.769" X="2.752"/>
|
||||
|
||||
</Catamaran>
|
||||
|
||||
<Bowsprit>
|
||||
|
||||
<Vtx Seq="1" Y="6.669" X="-0.2"/>
|
||||
|
||||
<Vtx Seq="2" Y="11.377" X="-0.2"/>
|
||||
|
||||
<Vtx Seq="3" Y="14.019" X="0"/>
|
||||
|
||||
<Vtx Seq="4" Y="11.377" X="0.2"/>
|
||||
|
||||
<Vtx Seq="5" Y="6.669" X="0.2"/>
|
||||
|
||||
</Bowsprit>
|
||||
|
||||
<Trampoline>
|
||||
|
||||
<Vtx Seq="1" Y="2" X="-2.699"/>
|
||||
|
||||
<Vtx Seq="2" Y="6.438" X="-2.699"/>
|
||||
|
||||
<Vtx Seq="3" Y="6.438" X="2.699"/>
|
||||
|
||||
<Vtx Seq="4" Y="2" X="2.699"/>
|
||||
|
||||
</Trampoline>
|
||||
|
||||
</BoatShape>
|
||||
|
||||
<BoatShape ShapeID="5"/>
|
||||
|
||||
</BoatShapes>
|
||||
|
||||
<Boats>
|
||||
|
||||
<Boat Type="RC" SourceID="121" ShapeID="0" HullNum="RG01" StoweName="PRO" ShortName="PRO"
|
||||
|
||||
BoatName="Regardless">
|
||||
|
||||
<GPSposition Z="6.840" Y="7.800" X="0.000"/>
|
||||
|
||||
<FlagPosition Z="0.000" Y="7.800" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
<Boat Type="Mark" SourceID="122" ShapeID="1" HullNum="LC05" StoweName="CON" ShortName="Constellation"
|
||||
|
||||
BoatName="Constellation">
|
||||
|
||||
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
|
||||
|
||||
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
<Boat Type="Mark" SourceID="123" ShapeID="1" HullNum="LC04" StoweName="MIS" ShortName="Mischief"
|
||||
|
||||
BoatName="Mischief">
|
||||
|
||||
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
|
||||
|
||||
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
<Boat Type="Mark" SourceID="124" ShapeID="1" HullNum="LC03" ShortName="Atalanta" BoatName="Atalanta">
|
||||
|
||||
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
|
||||
|
||||
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
<Boat SourceID="125" ShapeID="1" StoweName="VOL" HullNum="LC01" ShortName="Volunteer"
|
||||
|
||||
BoatName="Volunteer">
|
||||
|
||||
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
|
||||
|
||||
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
<Boat Type="Mark" SourceID="126" ShapeID="1" HullNum="LC13" StoweName="MS2" ShortName="Defender"
|
||||
|
||||
BoatName="Defender">
|
||||
|
||||
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
|
||||
|
||||
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
<Boat Type="Mark" SourceID="128" ShapeID="1" HullNum="LC01" ShortName="Shamrock" BoatName="Shamrock">
|
||||
|
||||
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
|
||||
|
||||
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
<Boat Type="Yacht" SourceID="101">
|
||||
|
||||
<GPSposition Z="1.738" Y="0.625" X="0.001"/>
|
||||
|
||||
<MastTop Z="21.496" Y="4.233" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
</Boats>
|
||||
|
||||
</BoatConfig>
|
||||
@ -0,0 +1,251 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<BoatConfig>
|
||||
|
||||
<Modified>2012-05-17T07:49:40+0200</Modified>
|
||||
|
||||
<Version>12</Version>
|
||||
|
||||
<Settings>
|
||||
|
||||
<RaceBoatType Type="AC45"/>
|
||||
|
||||
<BoatDimension BoatLength="14.019" HullLength="13.449"/>
|
||||
|
||||
<ZoneSize MarkZoneSize="40.347" CourseZoneSize="40.347"/>
|
||||
|
||||
<ZoneLimits Limit1="200" Limit2="100" Limit3="40.347" Limit4="0" Limit5="-100"/>
|
||||
|
||||
</Settings>
|
||||
|
||||
<BoatShapes>
|
||||
|
||||
<BoatShape ShapeID="0">
|
||||
|
||||
<Vertices>
|
||||
|
||||
<Vtx Seq="1" Y="0" X="-2.659"/>
|
||||
|
||||
<Vtx Seq="2" Y="18.359" X="-2.659"/>
|
||||
|
||||
<Vtx Seq="3" Y="18.359" X="2.659"/>
|
||||
|
||||
<Vtx Seq="4" Y="0" X="2.659"/>
|
||||
|
||||
</Vertices>
|
||||
|
||||
</BoatShape>
|
||||
|
||||
<BoatShape ShapeID="1">
|
||||
|
||||
<Vertices>
|
||||
|
||||
<Vtx Seq="1" Y="0" X="-1.278"/>
|
||||
|
||||
<Vtx Seq="2" Y="8.876" X="-1.278"/>
|
||||
|
||||
<Vtx Seq="3" Y="8.876" X="1.278"/>
|
||||
|
||||
<Vtx Seq="4" Y="0" X="1.278"/>
|
||||
|
||||
</Vertices>
|
||||
|
||||
</BoatShape>
|
||||
|
||||
<BoatShape ShapeID="2">
|
||||
|
||||
<Vertices>
|
||||
|
||||
<Vtx Seq="1" Y="0" X="-1.1"/>
|
||||
|
||||
<Vtx Seq="2" Y="8.3" X="-1.1"/>
|
||||
|
||||
<Vtx Seq="3" Y="8.3" X="1.1"/>
|
||||
|
||||
<Vtx Seq="4" Y="0" X="1.1"/>
|
||||
|
||||
</Vertices>
|
||||
|
||||
</BoatShape>
|
||||
|
||||
<BoatShape ShapeID="3">
|
||||
|
||||
<Vertices>
|
||||
|
||||
<Vtx Seq="1" Y="0" X="-0.75"/>
|
||||
|
||||
<Vtx Seq="2" Y="3" X="-0.75"/>
|
||||
|
||||
<Vtx Seq="3" Y="3" X="0.75"/>
|
||||
|
||||
<Vtx Seq="4" Y="0" X="0.75"/>
|
||||
|
||||
</Vertices>
|
||||
|
||||
</BoatShape>
|
||||
|
||||
<BoatShape ShapeID="4">
|
||||
|
||||
<Vertices>
|
||||
|
||||
<Vtx Seq="1" Y="0" X="-3.46"/>
|
||||
|
||||
<Vtx Seq="2" Y="13.449" X="-3.46"/>
|
||||
|
||||
<Vtx Seq="3" Y="14.019" X="0"/>
|
||||
|
||||
<Vtx Seq="4" Y="13.449" X="3.46"/>
|
||||
|
||||
<Vtx Seq="5" Y="0" X="3.46"/>
|
||||
|
||||
</Vertices>
|
||||
|
||||
<Catamaran>
|
||||
|
||||
<Vtx Seq="1" Y="1.769" X="-2.752"/>
|
||||
|
||||
<Vtx Seq="2" Y="0" X="-2.813"/>
|
||||
|
||||
<Vtx Seq="3" Y="0" X="-3.34"/>
|
||||
|
||||
<Vtx Seq="4" Y="5.351" X="-3.46"/>
|
||||
|
||||
<Vtx Seq="5" Y="10.544" X="-3.387"/>
|
||||
|
||||
<Vtx Seq="6" Y="13.449" X="-3.075"/>
|
||||
|
||||
<Vtx Seq="7" Y="10.851" X="-2.793"/>
|
||||
|
||||
<Vtx Seq="8" Y="6.669" X="-2.699"/>
|
||||
|
||||
<Vtx Seq="9" Y="6.669" X="2.699"/>
|
||||
|
||||
<Vtx Seq="10" Y="10.851" X="2.793"/>
|
||||
|
||||
<Vtx Seq="11" Y="13.449" X="3.075"/>
|
||||
|
||||
<Vtx Seq="12" Y="10.544" X="3.387"/>
|
||||
|
||||
<Vtx Seq="13" Y="5.351" X="3.46"/>
|
||||
|
||||
<Vtx Seq="14" Y="0" X="3.34"/>
|
||||
|
||||
<Vtx Seq="15" Y="0" X="2.813"/>
|
||||
|
||||
<Vtx Seq="16" Y="1.769" X="2.752"/>
|
||||
|
||||
</Catamaran>
|
||||
|
||||
<Bowsprit>
|
||||
|
||||
<Vtx Seq="1" Y="6.669" X="-0.2"/>
|
||||
|
||||
<Vtx Seq="2" Y="11.377" X="-0.2"/>
|
||||
|
||||
<Vtx Seq="3" Y="14.019" X="0"/>
|
||||
|
||||
<Vtx Seq="4" Y="11.377" X="0.2"/>
|
||||
|
||||
<Vtx Seq="5" Y="6.669" X="0.2"/>
|
||||
|
||||
</Bowsprit>
|
||||
|
||||
<Trampoline>
|
||||
|
||||
<Vtx Seq="1" Y="2" X="-2.699"/>
|
||||
|
||||
<Vtx Seq="2" Y="6.438" X="-2.699"/>
|
||||
|
||||
<Vtx Seq="3" Y="6.438" X="2.699"/>
|
||||
|
||||
<Vtx Seq="4" Y="2" X="2.699"/>
|
||||
|
||||
</Trampoline>
|
||||
|
||||
</BoatShape>
|
||||
|
||||
<BoatShape ShapeID="5"/>
|
||||
|
||||
</BoatShapes>
|
||||
|
||||
<Boats>
|
||||
|
||||
<Boat Type="RC" SourceID="afdhg" ShapeID="0" HullNum="RG01" StoweName="PRO" ShortName="PRO"
|
||||
|
||||
BoatName="Regardless">
|
||||
|
||||
<GPSposition Z="6.840" Y="7.800" X="0.000"/>
|
||||
|
||||
<FlagPosition Z="0.000" Y="7.800" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
<Boat Type="Mark" SourceID="122" ShapeID="1" HullNum="LC05" StoweName="CON" ShortName="Constellation"
|
||||
|
||||
BoatName="Constellation">
|
||||
|
||||
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
|
||||
|
||||
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
<Boat Type="Mark" SourceID="123" ShapeID="1" HullNum="LC04" StoweName="MIS" ShortName="Mischief"
|
||||
|
||||
BoatName="Mischief">
|
||||
|
||||
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
|
||||
|
||||
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
<Boat Type="Mark" SourceID="124" ShapeID="1" HullNum="LC03" ShortName="Atalanta" BoatName="Atalanta">
|
||||
|
||||
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
|
||||
|
||||
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
<Boat SourceID="125" ShapeID="1" StoweName="VOL" HullNum="LC01" ShortName="Volunteer"
|
||||
|
||||
BoatName="Volunteer">
|
||||
|
||||
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
|
||||
|
||||
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
<Boat Type="Mark" SourceID="126" ShapeID="1" HullNum="LC13" StoweName="MS2" ShortName="Defender"
|
||||
|
||||
BoatName="Defender">
|
||||
|
||||
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
|
||||
|
||||
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
<Boat Type="Mark" SourceID="128" ShapeID="1" HullNum="LC01" ShortName="Shamrock" BoatName="Shamrock">
|
||||
|
||||
<GPSposition Z="5.334" Y="3.804" X="0.000"/>
|
||||
|
||||
<FlagPosition Z="0.000" Y="3.426" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
<Boat Type="Yacht" SourceID="101" ShapeID="4" HullNum="AC4501" StoweName="KOR" ShortName="TEAM KOREA"
|
||||
|
||||
BoatName="TEAM KOREA" Country="KOR">
|
||||
|
||||
<GPSposition Z="1.738" Y="0.625" X="0.001"/>
|
||||
|
||||
<MastTop Z="21.496" Y="4.233" X="0.000"/>
|
||||
|
||||
</Boat>
|
||||
|
||||
</Boats>
|
||||
|
||||
</BoatConfig>
|
||||
Loading…
Reference in new issue