From 54bcc75920457b099824272ea717ddf2f4593b46 Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Fri, 28 Feb 2014 22:19:46 +0100 Subject: [PATCH] working towards fixing the SwissTiming test cases after migrating the sample data to the new format --- .../resources/InitMessagesScript.txt | 10 +++---- .../SailMasterDataInterfaceRACandSTL.txt | 2 +- ...ActivelyConnectingStoreAndForwardTest.java | 2 +- .../EndToEndListeningStoreAndFowardTest.java | 26 +++++++++---------- ...rlappingStoredAndReceivedMessagesTest.java | 4 +-- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/java/com.sap.sailing.domain.swisstimingadapter.test/resources/InitMessagesScript.txt b/java/com.sap.sailing.domain.swisstimingadapter.test/resources/InitMessagesScript.txt index eda1d34e6a3..388717a64b8 100644 --- a/java/com.sap.sailing.domain.swisstimingadapter.test/resources/InitMessagesScript.txt +++ b/java/com.sap.sailing.domain.swisstimingadapter.test/resources/InitMessagesScript.txt @@ -1,5 +1,5 @@ -0|RAC|2|4711;A wonderful test race|4712;Not such a wonderful race -1|STL|4711|2|GER 8414;GER;Polgar/Koy|GER 8140;GER;Schlonski/Bohn -2|STL|4712|3|GER 8340;GER;Stanjek/Kleen|GER 8433;GER;Babendererde/Jacobs|GER 8299;GER;Elsner/Schulz -3|CCG|4711|2|0;Mark1 Description;SailNumber1;SailNumber2|1;Mark2 Description;SailNumber3 -4|CCG|4712|2|0;Mark2 Description;SailNumber1;SailNumber2|1;Mark7 Description;SailNumber4 +0|RAC|2|c34c423c-0295-4fe5-91ca-336681624711;A wonderful test race|c34c423c-0295-4fe5-91ca-336681624712;Not such a wonderful race +1|STL|c34c423c-0295-4fe5-91ca-336681624711|2|GER 8414;GER;Polgar/Koy|GER 8140;GER;Schlonski/Bohn +2|STL|c34c423c-0295-4fe5-91ca-336681624712|3|GER 8340;GER;Stanjek/Kleen|GER 8433;GER;Babendererde/Jacobs|GER 8299;GER;Elsner/Schulz +3|CCG|c34c423c-0295-4fe5-91ca-336681624711|2|0;Mark1 Description;SailNumber1;SailNumber2|1;Mark2 Description;SailNumber3 +4|CCG|c34c423c-0295-4fe5-91ca-336681624712|2|0;Mark2 Description;SailNumber1;SailNumber2|1;Mark7 Description;SailNumber4 diff --git a/java/com.sap.sailing.domain.swisstimingadapter.test/resources/SailMasterDataInterfaceRACandSTL.txt b/java/com.sap.sailing.domain.swisstimingadapter.test/resources/SailMasterDataInterfaceRACandSTL.txt index 8d03acfe4e2..e39ef3fea6b 100644 --- a/java/com.sap.sailing.domain.swisstimingadapter.test/resources/SailMasterDataInterfaceRACandSTL.txt +++ b/java/com.sap.sailing.domain.swisstimingadapter.test/resources/SailMasterDataInterfaceRACandSTL.txt @@ -1,3 +1,3 @@ -0|RAC|1|W4702;A simulated SwissTiming race +0|RAC|1|c34c423c-0295-4fe5-91ca-336681624702;A simulated SwissTiming race 1|STL|c34c423c-0295-4fe5-91ca-336681624702|46|GER 12;GER;Competitor 25|GBR 812;GBR;Competitor 19|NED 24;NED;Competitor 35|CRO 111;CRO;Competitor 11|ARG 8;ARG;Competitor 0|FRA 12;FRA;Competitor 16|CAN 610;CAN;Competitor 6|CHN 616;CHN;Competitor 10|CHN 1261;CHN;Competitor 8|ESP 133;ESP;Competitor 13|GER 72;GER;Competitor 29|EST 20;EST;Competitor 15|NZL 75;NZL;Competitor 36|SLO 64;SLO;Competitor 39|GBR 831;GBR;Competitor 20|RUS 12;RUS;Competitor 37|ITA 23;ITA;Competitor 31|ESP 696;ESP;Competitor 14|GBR 847;GBR;Competitor 22|DEN 143;DEN;Competitor 12|ISR 311;ISR;Competitor 30|GER 21;GER;Competitor 26|NED 11;NED;Competitor 34|GBR 850;GBR;Competitor 23|BRA 177;BRA;Competitor 3|AUT 431;AUT;Competitor 2|FRA 9;FRA;Competitor 18|FRA 4;FRA;Competitor 17|GBR 855;GBR;Competitor 24|BRA 1187;BRA;Competitor 4|USA 1712;USA;Competitor 43|SWE 344;SWE;Competitor 42|GER 61;GER;Competitor 27|SWE 342;SWE;Competitor 41|CHN 1211;CHN;Competitor 7|USA 1757;USA;Competitor 45|GER 66;GER;Competitor 28|SUI 14;SUI;Competitor 40|JPN 4151;JPN;Competitor 32|JPN 4321;JPN;Competitor 33|CAN 11;CAN;Competitor 5|AUS 7;AUS;Competitor 1|USA 1736;USA;Competitor 44|RUS 700;RUS;Competitor 38|CHN 221;CHN;Competitor 9|GBR 841;GBR;Competitor 21 2|CCG|c34c423c-0295-4fe5-91ca-336681624702|7|0;StartGate;M1;M7|1;Buoy6;M6|2;Buoy5;M5|3;LeeGate;M2;M3|4;Buoy6;M6|5;Buoy5;M5|6;FinishGate;M1;M4 diff --git a/java/com.sap.sailing.domain.swisstimingadapter.test/src/com/sap/sailing/domain/swisstimingadapter/test/ActivelyConnectingStoreAndForwardTest.java b/java/com.sap.sailing.domain.swisstimingadapter.test/src/com/sap/sailing/domain/swisstimingadapter/test/ActivelyConnectingStoreAndForwardTest.java index 94a1f3c5eef..2c1c9752273 100755 --- a/java/com.sap.sailing.domain.swisstimingadapter.test/src/com/sap/sailing/domain/swisstimingadapter/test/ActivelyConnectingStoreAndForwardTest.java +++ b/java/com.sap.sailing.domain.swisstimingadapter.test/src/com/sap/sailing/domain/swisstimingadapter/test/ActivelyConnectingStoreAndForwardTest.java @@ -134,7 +134,7 @@ public class ActivelyConnectingStoreAndForwardTest { } } }); - String rawMessage = "RAC|2|4711;A wonderful test race|4712;Not such a wonderful race"; + String rawMessage = "0|RAC|2|c34c423c-0295-4fe5-91ca-336681624711;A wonderful test race|c34c423c-0295-4fe5-91ca-336681624712;Not such a wonderful race"; transceiver.sendMessage(rawMessage, sendingStream); synchronized (this) { for (int i=0; i<1000 && !receivedSomething[0]; i++) { diff --git a/java/com.sap.sailing.domain.swisstimingadapter.test/src/com/sap/sailing/domain/swisstimingadapter/test/EndToEndListeningStoreAndFowardTest.java b/java/com.sap.sailing.domain.swisstimingadapter.test/src/com/sap/sailing/domain/swisstimingadapter/test/EndToEndListeningStoreAndFowardTest.java index 87b0bbff525..8d823038189 100755 --- a/java/com.sap.sailing.domain.swisstimingadapter.test/src/com/sap/sailing/domain/swisstimingadapter/test/EndToEndListeningStoreAndFowardTest.java +++ b/java/com.sap.sailing.domain.swisstimingadapter.test/src/com/sap/sailing/domain/swisstimingadapter/test/EndToEndListeningStoreAndFowardTest.java @@ -142,7 +142,7 @@ public class EndToEndListeningStoreAndFowardTest { @Test public void testEndToEndScenarioWithInitMessages() throws Exception { - String[] racesToTrack = new String[] { "4711", "4712" }; + String[] racesToTrack = new String[] { "c34c423c-0295-4fe5-91ca-336681624711", "c34c423c-0295-4fe5-91ca-336681624712" }; String scriptName = "/InitMessagesScript.txt"; setUpUsingScript(racesToTrack, scriptName); @@ -154,7 +154,7 @@ public class EndToEndListeningStoreAndFowardTest { raceIDs.add(race.getName()); } Set expectedRaceIDs = new HashSet(); - for (String raceIDToTrack : new String[] { "4711", "4712" }) { + for (String raceIDToTrack : new String[] { "c34c423c-0295-4fe5-91ca-336681624711", "c34c423c-0295-4fe5-91ca-336681624712" }) { expectedRaceIDs.add(raceIDToTrack); } assertEquals(expectedRaceIDs, raceIDs); @@ -162,7 +162,7 @@ public class EndToEndListeningStoreAndFowardTest { @Test public void testLongRaceLog() throws Exception { - String[] racesToTrack = new String[] { "W4702" }; + String[] racesToTrack = new String[] { "c34c423c-0295-4fe5-91ca-336681624702" }; String scriptName1 = "/SailMasterDataInterfaceRACandSTL.txt"; String scriptName2 = "/SailMasterDataInterface-ExampleAsText.txt"; setUpUsingScript(racesToTrack, scriptName1, scriptName2); @@ -171,7 +171,7 @@ public class EndToEndListeningStoreAndFowardTest { @Test public void testLongRaceLogNewVersion() throws Exception { - String[] racesToTrack = new String[] { "W4702" }; + String[] racesToTrack = new String[] { "c34c423c-0295-4fe5-91ca-336681624702" }; String scriptName1 = "/W4702RACandSTLandCCG.txt"; String scriptName2 = "/W4702AsText.txt"; setUpUsingScript(racesToTrack, scriptName1, scriptName2); @@ -230,7 +230,7 @@ public class EndToEndListeningStoreAndFowardTest { @Test public void testLongLogRaceNewConfig() throws Exception { - String[] racesToTrack = new String[] { "W4702" }; + String[] racesToTrack = new String[] { "c34c423c-0295-4fe5-91ca-336681624702" }; String scriptName1 = "/SailMasterDataInterfaceRACandSTL.txt"; String scriptName2 = "/SailMasterDataInterface-ExampleAsText.txt"; String scriptNewCourseConfig = "/SailMasterDataInterfaceNewCourseConfig.txt"; @@ -277,7 +277,7 @@ public class EndToEndListeningStoreAndFowardTest { } } Set expectedRaceIDs = new HashSet(); - for (String raceIDToTrack : new String[] { "W4702" }) { + for (String raceIDToTrack : new String[] { "c34c423c-0295-4fe5-91ca-336681624702" }) { expectedRaceIDs.add(raceIDToTrack); } assertEquals(expectedRaceIDs, raceIDs); @@ -285,7 +285,7 @@ public class EndToEndListeningStoreAndFowardTest { @Test public void testDuplicateCCGMessageAndWaypointUniqueness() throws Exception { - String[] racesToTrack = new String[] { "W4702" }; + String[] racesToTrack = new String[] { "c34c423c-0295-4fe5-91ca-336681624702" }; setUpUsingScript(racesToTrack, "/DuplicateCCG.txt"); Set allTrackedRaces = getAllTrackedRaces(); @@ -301,12 +301,12 @@ public class EndToEndListeningStoreAndFowardTest { @Test public void testTMDMessageBeforeReceivingStartTime() throws Exception { final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); - String[] racesToTrack = new String[] { "SAM005923" }; + String[] racesToTrack = new String[] { "c34c423c-0295-4fe5-91ca-336681625923" }; setUpUsingScript(racesToTrack, "/TMDBeforeStartTimeExample.txt"); Set allTrackedRaces = getAllTrackedRaces(); assertEquals(1, allTrackedRaces.size()); TrackedRace trackedRace = allTrackedRaces.iterator().next(); - assertEquals("SAM005923", trackedRace.getRace().getName()); + assertEquals("c34c423c-0295-4fe5-91ca-336681625923", trackedRace.getRace().getName()); assertEquals(dateFormat.parse("2013-04-04T13:45:00+0200"), trackedRace.getStartOfRace().asDate()); for (Competitor competitor : trackedRace.getRace().getCompetitors()) { if (competitor.getBoat().getSailID().equals("GBR-828")) { @@ -333,12 +333,12 @@ public class EndToEndListeningStoreAndFowardTest { @Test public void testTMDMessageBeforeReceivingStartTimeWithManyTMDs() throws Exception { final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); - String[] racesToTrack = new String[] { "SAM005923" }; + String[] racesToTrack = new String[] { "c34c423c-0295-4fe5-91ca-336681625923" }; setUpUsingScript(racesToTrack, "/TMDBeforeStartTimeExample_ManyTMDs.txt"); Set allTrackedRaces = getAllTrackedRaces(); assertEquals(1, allTrackedRaces.size()); TrackedRace trackedRace = allTrackedRaces.iterator().next(); - assertEquals("SAM005923", trackedRace.getRace().getName()); + assertEquals("c34c423c-0295-4fe5-91ca-336681625923", trackedRace.getRace().getName()); assertEquals(dateFormat.parse("2013-04-04T13:45:00+0200"), trackedRace.getStartOfRace().asDate()); for (Competitor competitor : trackedRace.getRace().getCompetitors()) { NavigableSet markPassings = trackedRace.getMarkPassings(competitor); @@ -352,7 +352,7 @@ public class EndToEndListeningStoreAndFowardTest { @Test public void testRongRaceLogRACZero() throws Exception{ - String[] racesToTrack = new String[] { "W4702" }; + String[] racesToTrack = new String[] { "c34c423c-0295-4fe5-91ca-336681624702" }; String scriptName2 = "/SailMasterDataInterfaceRACZero.txt"; setUpUsingScript(racesToTrack, scriptName2); Set allNewTrackedRaces = getAllTrackedRaces(); @@ -361,7 +361,7 @@ public class EndToEndListeningStoreAndFowardTest { @Test public void testEndToEndWithSwissTimingData() throws Exception { - String[] racesToTrack = new String[] { "W4702" }; + String[] racesToTrack = new String[] { "c34c423c-0295-4fe5-91ca-336681624702" }; String scriptName1 = "/SailMasterDataInterfaceRACandSTL.txt"; String scriptName2 = "/SailMasterDataInterface-ExampleAsText.txt"; setUpUsingScript(racesToTrack, scriptName1, scriptName2); diff --git a/java/com.sap.sailing.domain.swisstimingadapter.test/src/com/sap/sailing/domain/swisstimingadapter/test/OverlappingStoredAndReceivedMessagesTest.java b/java/com.sap.sailing.domain.swisstimingadapter.test/src/com/sap/sailing/domain/swisstimingadapter/test/OverlappingStoredAndReceivedMessagesTest.java index 13db0818e95..86d83885578 100755 --- a/java/com.sap.sailing.domain.swisstimingadapter.test/src/com/sap/sailing/domain/swisstimingadapter/test/OverlappingStoredAndReceivedMessagesTest.java +++ b/java/com.sap.sailing.domain.swisstimingadapter.test/src/com/sap/sailing/domain/swisstimingadapter/test/OverlappingStoredAndReceivedMessagesTest.java @@ -109,7 +109,7 @@ public class OverlappingStoredAndReceivedMessagesTest implements RaceSpecificMes assert STORED < COUNT-UNBUFFERED && STORED-OVERLAP >= 0; final String[] rawMessage = new String[COUNT]; for (int i=0; i