@@ -23,16 +23,18 @@ private class TestData {
23
23
private final double referenceLatitude ;
24
24
private final double referenceLongitude ;
25
25
private final String shortCode ;
26
+ private final String testType ;
26
27
27
28
public TestData (String line ) {
28
29
String [] parts = line .split ("," );
29
- if (parts .length != 4 ) {
30
+ if (parts .length != 5 ) {
30
31
throw new IllegalArgumentException ("Wrong format of testing data." );
31
32
}
32
33
this .code = parts [0 ];
33
34
this .referenceLatitude = Double .valueOf (parts [1 ]);
34
35
this .referenceLongitude = Double .valueOf (parts [2 ]);
35
36
this .shortCode = parts [3 ];
37
+ this .testType = parts [4 ];
36
38
}
37
39
}
38
40
@@ -55,6 +57,9 @@ public void setUp() throws Exception {
55
57
@ Test
56
58
public void testShortening () {
57
59
for (TestData testData : testDataList ) {
60
+ if (testData .testType != "B" && testData .testType != "S" ) {
61
+ continue ;
62
+ }
58
63
OpenLocationCode olc = new OpenLocationCode (testData .code );
59
64
OpenLocationCode shortened =
60
65
olc .shorten (testData .referenceLatitude , testData .referenceLongitude );
@@ -68,6 +73,9 @@ public void testShortening() {
68
73
@ Test
69
74
public void testRecovering () {
70
75
for (TestData testData : testDataList ) {
76
+ if (testData .testType != "B" && testData .testType != "R" ) {
77
+ continue ;
78
+ }
71
79
OpenLocationCode olc = new OpenLocationCode (testData .shortCode );
72
80
OpenLocationCode recovered =
73
81
olc .recover (testData .referenceLatitude , testData .referenceLongitude );
0 commit comments