mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-22 13:45:42 +00:00
fixed FREG parser to cope with multi-line TD strings
This commit is contained in:
+1014
File diff suppressed because it is too large
Load Diff
+19
@@ -18,6 +18,7 @@ import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.domain.common.impl.Util;
|
||||
import com.sap.sailing.freg.resultimport.CompetitorRow;
|
||||
import com.sap.sailing.freg.resultimport.RegattaResults;
|
||||
import com.sap.sailing.freg.resultimport.impl.FregHtmlParser;
|
||||
|
||||
public class SimpleHtmlParsingTest {
|
||||
@@ -28,6 +29,24 @@ public class SimpleHtmlParsingTest {
|
||||
assertNotNull(readLine);
|
||||
br.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultiLineTD() throws IOException {
|
||||
final InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream("Coupe-internationale-de-france.htm");
|
||||
FregHtmlParser parser = new FregHtmlParser();
|
||||
final RegattaResults regattaResults = parser.getRegattaResults(resourceAsStream);
|
||||
List<CompetitorRow> result = regattaResults.getCompetitorResults();
|
||||
assertFalse(result.isEmpty());
|
||||
assertEquals(57, result.size());
|
||||
assertTrue(regattaResults.getMetadata().contains("PRE- WORLD \n 2012 - COUPE INTERNATIONALE DE FRANCE 505"));
|
||||
for (CompetitorRow row : result) {
|
||||
if (Util.contains(row.getNames(), "MARTIN Aline")) {
|
||||
assertEquals("FRA 8716", row.getSailID());
|
||||
assertEquals(111, row.getScoreAfterDiscarding(), 0.000000001);
|
||||
assertEquals(230.00, row.getTotalPointsBeforeDiscarding(), 0.000000001);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyAndDashedScores() throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user