fixed ParseTracTracJSONServiceOutputTest.testWeymouthURIsOnline by being more tolerant with HIDDEN races

Change-Id: Ie82b496cc56a87767f4f047e0e0af9631b64a731
This commit is contained in:
Axel Uhl committed 2016-02-15 21:49:56 +01:00
1 parent a6ccef32ca
commit e3f8f87c7d
2 files changed
+16 -13

No files matched your search

@@ -99,12 +99,15 @@ public class ParseTracTracJSONServiceOutputTest {
// replay races may have an empty / null live URI
assertTrue(race.getLiveURI() == null || new URI("tcp://" + TracTracConnectionConstants.HOST_NAME + ":4400").equals(race.getLiveURI()));
// and they point to stored data in the form of a binary ".mtb" file
String expectedSuffix = ".mtb";
final String expectedSuffix = ".mtb";
assertTrue(race.getStoredURI().toString().endsWith(expectedSuffix) ||
new URI("tcp://" + TracTracConnectionConstants.HOST_NAME + ":4401").equals(race.getStoredURI()));
} else {
assertEquals(new URI("tcp://" + TracTracConnectionConstants.HOST_NAME + ":4400"), race.getLiveURI());
assertEquals(new URI("tcp://" + TracTracConnectionConstants.HOST_NAME + ":4401"), race.getStoredURI());
if (!"HIDDEN".equals(race.getRaceStatus())) {
// hidden races may have a null live URI and perhaps have already been converted to an .mtb, so only assert if not a HIDDEN race
assertEquals(new URI("tcp://" + TracTracConnectionConstants.HOST_NAME + ":4400"), race.getLiveURI());
assertEquals(new URI("tcp://" + TracTracConnectionConstants.HOST_NAME + ":4401"), race.getStoredURI());
}
}
}
}