Archived
0

implement parsing Shipyard from EDCE

This commit is contained in:
iMoHax
2015-10-14 13:03:08 +03:00
parent 75a3e1507c
commit f7bc506508
8 changed files with 131 additions and 26 deletions

View File

@@ -186,4 +186,23 @@ public class ParseTest extends Assert {
assertNotNull(ship);
}
@Test
public void testParseShipyard() throws Exception {
LOG.info("Test parse json9");
InputStream is = getClass().getResourceAsStream("/edce/edce9.json");
String json = read(is);
LOG.trace("Parse json:");
LOG.trace("{}", json);
EDPacket packet = EDCEParser.parseJSON(json);
Commander commander = packet.getCommander();
assertNotNull(commander);
System system = packet.getLastSystem();
assertNotNull(system);
Starport starport = packet.getLastStarport();
assertNotNull(starport);
Shipyard shipyard = starport.getShips();
assertNotNull(shipyard);
assertEquals(23, shipyard.getShips().size());
}
}