Changeset 10378 in josm for trunk/test/unit/org
- Timestamp:
- 2016-06-15T10:30:37+02:00 (8 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 49 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java
r10052 r10378 96 96 void verifyRectangleClockwise(final Way way) { 97 97 for (int i = 1; i < way.getNodesCount() - 1; i++) { 98 assertEquals(-Math.PI / 2, 98 assertEquals(-Math.PI / 2, Geometry.getCornerAngle( 99 99 way.getNode(i - 1).getEastNorth(), way.getNode(i).getEastNorth(), way.getNode(i + 1).getEastNorth()), 1e-6); 100 100 } -
trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJobTest.java
r10222 r10378 79 79 */ 80 80 @Test 81 public void testStatusCodes() throws IOException, InterruptedException 81 public void testStatusCodes() throws IOException, InterruptedException { 82 82 doTestStatusCode(200); 83 83 // can't test for 3xx, as httpstat.us redirects finally to 200 page -
trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java
r10334 r10378 33 33 @SuppressFBWarnings(value = "MS_PKGPROTECT") 34 34 public static final double[] SAMPLE_VALUES = new double[]{ 35 // CHECKSTYLE.OFF: SingleSpaceSeparator 35 36 -180.0, -179.9, -179.6, -179.5, -179.4, -179.1, -179.0, -100.0, -99.9, -10.0, -9.9, -1.0, -0.1, 36 180.0, 179.9, 179.6, 179.5, 179.4, 179.1, 179.0, 100.0, 99.9, 10.0, 9.9, 1.0, 0.1,37 180.0, 179.9, 179.6, 179.5, 179.4, 179.1, 179.0, 100.0, 99.9, 10.0, 9.9, 1.0, 0.1, 37 38 0.12, 0.123, 0.1234, 0.12345, 0.123456, 0.1234567, 38 39 1.12, 1.123, 1.1234, 1.12345, 1.123456, 1.1234567, 39 40 10.12, 10.123, 10.1234, 10.12345, 10.123456, 10.1234567, 40 41 100.12, 100.123, 100.1234, 100.12345, 100.123456, 100.1234567 42 // CHECKSTYLE.ON: SingleSpaceSeparator 41 43 }; 42 44 … … 54 56 assertEquals(LatLon.roundToOsmPrecision(-0.0), 0.0, 0); 55 57 58 // CHECKSTYLE.OFF: SingleSpaceSeparator 56 59 assertEquals(LatLon.roundToOsmPrecision(0.12345678), 0.1234568, 0); 57 60 assertEquals(LatLon.roundToOsmPrecision(0.123456789), 0.1234568, 0); … … 65 68 assertEquals(LatLon.roundToOsmPrecision(100.12345678), 100.1234568, 0); 66 69 assertEquals(LatLon.roundToOsmPrecision(100.123456789), 100.1234568, 0); 70 // CHECKSTYLE.ON: SingleSpaceSeparator 67 71 68 assertEquals(LatLon.roundToOsmPrecision(100.00000001), 69 assertEquals(LatLon.roundToOsmPrecision(100.000000001), 70 assertEquals(LatLon.roundToOsmPrecision(100.0000000001), 71 assertEquals(LatLon.roundToOsmPrecision(100.00000000001), 72 assertEquals(LatLon.roundToOsmPrecision(100.000000000001), 73 assertEquals(LatLon.roundToOsmPrecision(100.0000000000001), 74 assertEquals(LatLon.roundToOsmPrecision(100.00000000000001), 75 assertEquals(LatLon.roundToOsmPrecision(100.000000000000001), 76 assertEquals(LatLon.roundToOsmPrecision(100.0000000000000001), 77 assertEquals(LatLon.roundToOsmPrecision(100.00000000000000001), 78 assertEquals(LatLon.roundToOsmPrecision(100.000000000000000001), 79 assertEquals(LatLon.roundToOsmPrecision(100.0000000000000000001), 80 assertEquals(LatLon.roundToOsmPrecision(100.00000000000000000001), 72 assertEquals(LatLon.roundToOsmPrecision(100.00000001), 100.0000000, 0); 73 assertEquals(LatLon.roundToOsmPrecision(100.000000001), 100.0000000, 0); 74 assertEquals(LatLon.roundToOsmPrecision(100.0000000001), 100.0000000, 0); 75 assertEquals(LatLon.roundToOsmPrecision(100.00000000001), 100.0000000, 0); 76 assertEquals(LatLon.roundToOsmPrecision(100.000000000001), 100.0000000, 0); 77 assertEquals(LatLon.roundToOsmPrecision(100.0000000000001), 100.0000000, 0); 78 assertEquals(LatLon.roundToOsmPrecision(100.00000000000001), 100.0000000, 0); 79 assertEquals(LatLon.roundToOsmPrecision(100.000000000000001), 100.0000000, 0); 80 assertEquals(LatLon.roundToOsmPrecision(100.0000000000000001), 100.0000000, 0); 81 assertEquals(LatLon.roundToOsmPrecision(100.00000000000000001), 100.0000000, 0); 82 assertEquals(LatLon.roundToOsmPrecision(100.000000000000000001), 100.0000000, 0); 83 assertEquals(LatLon.roundToOsmPrecision(100.0000000000000000001), 100.0000000, 0); 84 assertEquals(LatLon.roundToOsmPrecision(100.00000000000000000001), 100.0000000, 0); 81 85 82 assertEquals(LatLon.roundToOsmPrecision(99.999999999999999999999), 83 assertEquals(LatLon.roundToOsmPrecision(99.99999999999999999999), 84 assertEquals(LatLon.roundToOsmPrecision(99.9999999999999999999), 85 assertEquals(LatLon.roundToOsmPrecision(99.999999999999999999), 86 assertEquals(LatLon.roundToOsmPrecision(99.99999999999999999), 87 assertEquals(LatLon.roundToOsmPrecision(99.9999999999999999), 88 assertEquals(LatLon.roundToOsmPrecision(99.999999999999999), 89 assertEquals(LatLon.roundToOsmPrecision(99.99999999999999), 90 assertEquals(LatLon.roundToOsmPrecision(99.9999999999999), 91 assertEquals(LatLon.roundToOsmPrecision(99.999999999999), 92 assertEquals(LatLon.roundToOsmPrecision(99.99999999999), 93 assertEquals(LatLon.roundToOsmPrecision(99.9999999999), 94 assertEquals(LatLon.roundToOsmPrecision(99.999999999), 95 assertEquals(LatLon.roundToOsmPrecision(99.99999999), 96 assertEquals(LatLon.roundToOsmPrecision(99.9999999), 86 assertEquals(LatLon.roundToOsmPrecision(99.999999999999999999999), 100.0000000, 0); 87 assertEquals(LatLon.roundToOsmPrecision(99.99999999999999999999), 100.0000000, 0); 88 assertEquals(LatLon.roundToOsmPrecision(99.9999999999999999999), 100.0000000, 0); 89 assertEquals(LatLon.roundToOsmPrecision(99.999999999999999999), 100.0000000, 0); 90 assertEquals(LatLon.roundToOsmPrecision(99.99999999999999999), 100.0000000, 0); 91 assertEquals(LatLon.roundToOsmPrecision(99.9999999999999999), 100.0000000, 0); 92 assertEquals(LatLon.roundToOsmPrecision(99.999999999999999), 100.0000000, 0); 93 assertEquals(LatLon.roundToOsmPrecision(99.99999999999999), 100.0000000, 0); 94 assertEquals(LatLon.roundToOsmPrecision(99.9999999999999), 100.0000000, 0); 95 assertEquals(LatLon.roundToOsmPrecision(99.999999999999), 100.0000000, 0); 96 assertEquals(LatLon.roundToOsmPrecision(99.99999999999), 100.0000000, 0); 97 assertEquals(LatLon.roundToOsmPrecision(99.9999999999), 100.0000000, 0); 98 assertEquals(LatLon.roundToOsmPrecision(99.999999999), 100.0000000, 0); 99 assertEquals(LatLon.roundToOsmPrecision(99.99999999), 100.0000000, 0); 100 assertEquals(LatLon.roundToOsmPrecision(99.9999999), 99.9999999, 0); 97 101 } 98 102 -
trunk/test/unit/org/openstreetmap/josm/data/imagery/ImageryInfoTest.java
r10221 r10378 36 36 @Test 37 37 public void testGetExtendedUrl() { 38 ImageryInfo testImageryTMS = 38 ImageryInfo testImageryTMS = new ImageryInfo("test imagery", "http://localhost", "tms", null, null); 39 39 testImageryTMS.setDefaultMinZoom(16); 40 40 testImageryTMS.setDefaultMaxZoom(23); -
trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java
r10221 r10378 23 23 public class TemplatedWMSTileSourceTest { 24 24 25 private ImageryInfo testImageryWMS = 26 private ImageryInfo testImageryTMS = 25 private ImageryInfo testImageryWMS = new ImageryInfo("test imagery", "http://localhost", "wms", null, null); 26 private ImageryInfo testImageryTMS = new ImageryInfo("test imagery", "http://localhost", "tms", null, null); 27 27 28 28 /** … … 190 190 private static boolean isWithin(EastNorth point, EastNorth topLeft, EastNorth bottomRight) { 191 191 return Math.min(topLeft.east(), bottomRight.east()) <= point.east() && 192 point.east() <= Math.max(topLeft.east(), bottomRight.east()) 192 point.east() <= Math.max(topLeft.east(), bottomRight.east()) && 193 193 Math.min(topLeft.north(), bottomRight.north()) <= point.north() && 194 194 point.north() <= Math.max(topLeft.north(), bottomRight.north()); -
trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java
r10221 r10378 25 25 public class WMTSTileSourceTest { 26 26 27 private ImageryInfo testImageryTMS = 27 private ImageryInfo testImageryTMS = new ImageryInfo("test imagery", "http://localhost", "tms", null, null); 28 28 private ImageryInfo testImageryPSEUDO_MERCATOR = getImagery(TestUtils.getTestDataRoot() + "wmts/getcapabilities-pseudo-mercator.xml"); 29 29 private ImageryInfo testImageryTOPO_PL = getImagery(TestUtils.getTestDataRoot() + "wmts/getcapabilities-TOPO.xml"); … … 192 192 + "VERSION=1.0.0&LAYER=MAPA TOPOGRAFICZNA&STYLE=default&FORMAT=image/jpeg&tileMatrixSet=EPSG:4326&" 193 193 + "tileMatrix=EPSG:4326:0&tileRow=1&tileCol=1", 194 testSource.getTileUrl(0, 1,1));194 testSource.getTileUrl(0, 1, 1)); 195 195 } 196 196 … … 221 221 assertEquals( 222 222 "http://www.ngi.be/cartoweb/1.0.0/topo/default/3857/7/1/1.png", 223 testSource.getTileUrl(0, 1,1));223 testSource.getTileUrl(0, 1, 1)); 224 224 } 225 225 … … 232 232 verifyTile(new LatLon(45.4105023, -75.7153702), testSource, 303751, 375502, 12); 233 233 verifyTile(new LatLon(45.4601306, -75.7617187), testSource, 1186, 1466, 4); 234 235 234 } 236 235 -
trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetMergerTest.java
r9979 r10378 8 8 import static org.junit.Assert.assertSame; 9 9 import static org.junit.Assert.assertTrue; 10 import static org.junit.Assert.fail; 10 11 11 12 import java.io.StringWriter; … … 53 54 } 54 55 55 private void runConsistencyTests(DataSet ds) throws Exception{56 private void runConsistencyTests(DataSet ds) { 56 57 StringWriter writer = new StringWriter(); 57 DatasetConsistencyTest test = 58 DatasetConsistencyTest test = new DatasetConsistencyTest(ds, writer); 58 59 test.checkReferrers(); 59 60 test.checkCompleteWaysWithIncompleteNodes(); … … 63 64 test.checkZeroNodesWays(); 64 65 String result = writer.toString(); 65 if ( result.length() > 0)66 throw new RuntimeException(result);66 if (!result.isEmpty()) 67 fail(result); 67 68 } 68 69 69 70 @After 70 public void checkDatasets() throws Exception{71 public void checkDatasets() { 71 72 runConsistencyTests(my); 72 73 runConsistencyTests(their); -
trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryRelationTest.java
r9666 r10378 80 80 rel2.addMember(new RelationMemberData(null, OsmPrimitiveType.NODE, 2)); 81 81 82 // CHECKSTYLE.OFF: SingleSpaceSeparator 82 83 assertEquals("relation (1, 0 members)", rel0.getDisplayName(hnf)); 83 84 assertEquals("relation (1, 1 member)", rel1.getDisplayName(hnf)); … … 94 95 assertEquals("relation (\"RelName\", 1 member)", rel1.getDisplayName(hnf)); 95 96 assertEquals("relation (\"RelName\", 2 members)", rel2.getDisplayName(hnf)); 97 // CHECKSTYLE.ON: SingleSpaceSeparator 96 98 } 97 99 } -
trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryWayTest.java
r9203 r10378 122 122 way2.addNode(2); 123 123 124 // CHECKSTYLE.OFF: SingleSpaceSeparator 124 125 assertEquals("1 (0 nodes)", way0.getDisplayName(hnf)); 125 126 assertEquals("1 (1 node)", way1.getDisplayName(hnf)); … … 136 137 assertEquals("WayName (1 node)", way1.getDisplayName(hnf)); 137 138 assertEquals("WayName (2 nodes)", way2.getDisplayName(hnf)); 139 // CHECKSTYLE.ON: SingleSpaceSeparator 138 140 } 139 141 } -
trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitorTest.java
r10202 r10378 169 169 r1.addMember(new RelationMember("node-20", n20)); 170 170 Way w30 = new Way(30, 1); 171 Node n21 171 Node n21 = new Node(21); 172 172 w30.addNode(n21); 173 173 Node n22 = new Node(22); -
trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
r8836 r10378 25 25 26 26 // CHECKSTYLE.OFF: LineLength 27 // CHECKSTYLE.OFF: SingleSpaceSeparator 27 28 28 29 /** … … 30 31 */ 31 32 ProjData[] data = { 32 new ProjData("Zimmerwald", d(7, 27, 54.983506), d(46, 52, 37.540562), 947.149, 602030.680, 191775.030, 897.915), 33 new ProjData("Chrischona", d(7, 40, 6.983077), d(47, 34, 1.385301), 504.935, 617306.300, 268507.300, 456.064), 34 new ProjData("Pfaender", d(9, 47, 3.697723), d(47, 30, 55.172797), 1089.372, 776668.105, 265372.681, 1042.624), 35 new ProjData("La Givrine", d(6, 6, 7.326361), d(46, 27, 14.690021), 1258.274, 497313.292, 145625.438, 1207.434), 36 new ProjData("Monte Generoso", d(9, 1, 16.389053), d(45, 55, 45.438020), 1685.027, 722758.810, 87649.670, 1636.600) }; 37 33 new ProjData("Zimmerwald", d(7, 27, 54.983506), d(46, 52, 37.540562), 947.149, 602030.680, 191775.030, 897.915), 34 new ProjData("Chrischona", d(7, 40, 6.983077), d(47, 34, 1.385301), 504.935, 617306.300, 268507.300, 456.064), 35 new ProjData("Pfaender", d(9, 47, 3.697723), d(47, 30, 55.172797), 1089.372, 776668.105, 265372.681, 1042.624), 36 new ProjData("La Givrine", d(6, 6, 7.326361), d(46, 27, 14.690021), 1258.274, 497313.292, 145625.438, 1207.434), 37 new ProjData("Monte Generoso", d(9, 1, 16.389053), d(45, 55, 45.438020), 1685.027, 722758.810, 87649.670, 1636.600) }; 38 39 // CHECKSTYLE.ON: SingleSpaceSeparator 38 40 // CHECKSTYLE.ON: LineLength 39 41 -
trunk/test/unit/org/openstreetmap/josm/data/validation/routines/EmailValidatorTest.java
r10338 r10378 58 58 */ 59 59 @Test 60 public void testEmail() 60 public void testEmail() { 61 61 assertTrue(validator.isValid("jsmith@apache.org")); 62 62 assertFalse(validator.isValid(null)); … … 67 67 */ 68 68 @Test 69 public void testEmailWithNumericAddress() 69 public void testEmailWithNumericAddress() { 70 70 assertTrue(validator.isValid("someone@[216.109.118.76]")); 71 71 assertTrue(validator.isValid("someone@yahoo.com")); … … 76 76 */ 77 77 @Test 78 public void testEmailExtension() 78 public void testEmailExtension() { 79 79 assertTrue(validator.isValid("jsmith@apache.org")); 80 80 … … 99 99 */ 100 100 @Test 101 public void testEmailWithDash() 101 public void testEmailWithDash() { 102 102 assertTrue(validator.isValid("andy.noble@data-workshop.com")); 103 103 … … 114 114 */ 115 115 @Test 116 public void testEmailWithDotEnd() 116 public void testEmailWithDotEnd() { 117 117 assertFalse(validator.isValid("andy.noble@data-workshop.com.")); 118 118 } … … 123 123 */ 124 124 @Test 125 public void testEmailWithBogusCharacter() 125 public void testEmailWithBogusCharacter() { 126 126 127 127 assertFalse(validator.isValid("andy.noble@\u008fdata-workshop.com")); … … 184 184 */ 185 185 @Test 186 public void testEmailWithCommas() 186 public void testEmailWithCommas() { 187 187 assertFalse(validator.isValid("joeblow@apa,che.org")); 188 188 … … 196 196 */ 197 197 @Test 198 public void testEmailWithSpaces() 198 public void testEmailWithSpaces() { 199 199 assertFalse(validator.isValid("joeblow @apache.org")); // TODO - this should be valid? 200 200 … … 215 215 */ 216 216 @Test 217 public void testEmailWithControlChars() 217 public void testEmailWithControlChars() { 218 218 for (char c = 0; c < 32; c++) { 219 219 assertFalse("Test control char " + ((int) c), validator.isValid("foo" + c + "bar@domain.com")); … … 278 278 */ 279 279 @Test 280 public void testEmailUserName() 280 public void testEmailUserName() { 281 281 282 282 assertTrue(validator.isValid("joe1blow@apache.org")); … … 492 492 @Ignore("This test fails so disable it for 1.1.4 release. The real solution is to fix the email parsing") 493 493 @Test 494 public void testEmailFromPerl() 494 public void testEmailFromPerl() { 495 495 for (int index = 0; index < testEmailFromPerl.length; index++) { 496 496 String item = testEmailFromPerl[index].item; -
trunk/test/unit/org/openstreetmap/josm/data/validation/routines/InetAddressValidatorTest.java
r10338 r10378 47 47 @Test 48 48 public void testInetAddressesFromTheWild() { 49 assertTrue("www.apache.org IP should be valid", validator.isValid("140.211.11.130")); 50 assertTrue("www.l.google.com IP should be valid", validator.isValid("72.14.253.103")); 51 assertTrue("fsf.org IP should be valid", validator.isValid("199.232.41.5")); 52 assertTrue("appscs.ign.com IP should be valid", validator.isValid("216.35.123.87")); 49 // CHECKSTYLE.OFF: SingleSpaceSeparator 50 assertTrue("www.apache.org IP should be valid", validator.isValid("140.211.11.130")); 51 assertTrue("www.l.google.com IP should be valid", validator.isValid("72.14.253.103")); 52 assertTrue("fsf.org IP should be valid", validator.isValid("199.232.41.5")); 53 assertTrue("appscs.ign.com IP should be valid", validator.isValid("216.35.123.87")); 54 // CHECKSTYLE.ON: SingleSpaceSeparator 53 55 } 54 56 … … 67 69 @Test 68 70 public void testInetAddressesByClass() { 69 assertTrue("class A IP should be valid", validator.isValid("24.25.231.12")); 70 assertFalse("illegal class A IP should be invalid", validator.isValid("2.41.32.324")); 71 72 assertTrue("class B IP should be valid", validator.isValid("135.14.44.12")); 73 assertFalse("illegal class B IP should be invalid", validator.isValid("154.123.441.123")); 74 75 assertTrue("class C IP should be valid", validator.isValid("213.25.224.32")); 76 assertFalse("illegal class C IP should be invalid", validator.isValid("201.543.23.11")); 77 78 assertTrue("class D IP should be valid", validator.isValid("229.35.159.6")); 79 assertFalse("illegal class D IP should be invalid", validator.isValid("231.54.11.987")); 80 81 assertTrue("class E IP should be valid", validator.isValid("248.85.24.92")); 82 assertFalse("illegal class E IP should be invalid", validator.isValid("250.21.323.48")); 71 // CHECKSTYLE.OFF: SingleSpaceSeparator 72 assertTrue("class A IP should be valid", validator.isValid("24.25.231.12")); 73 assertFalse("illegal class A IP should be invalid", validator.isValid("2.41.32.324")); 74 75 assertTrue("class B IP should be valid", validator.isValid("135.14.44.12")); 76 assertFalse("illegal class B IP should be invalid", validator.isValid("154.123.441.123")); 77 78 assertTrue("class C IP should be valid", validator.isValid("213.25.224.32")); 79 assertFalse("illegal class C IP should be invalid", validator.isValid("201.543.23.11")); 80 81 assertTrue("class D IP should be valid", validator.isValid("229.35.159.6")); 82 assertFalse("illegal class D IP should be invalid", validator.isValid("231.54.11.987")); 83 84 assertTrue("class E IP should be valid", validator.isValid("248.85.24.92")); 85 assertFalse("illegal class E IP should be invalid", validator.isValid("250.21.323.48")); 86 // CHECKSTYLE.ON: SingleSpaceSeparator 83 87 } 84 88 … … 88 92 @Test 89 93 public void testReservedInetAddresses() { 90 assertTrue("localhost IP should be valid", 91 assertTrue("broadcast IP should be valid", 94 assertTrue("localhost IP should be valid", validator.isValid("127.0.0.1")); 95 assertTrue("broadcast IP should be valid", validator.isValid("255.255.255.255")); 92 96 } 93 97 … … 97 101 @Test 98 102 public void testBrokenInetAddresses() { 103 // CHECKSTYLE.OFF: SingleSpaceSeparator 99 104 assertFalse("IP with characters should be invalid", validator.isValid("124.14.32.abc")); 100 105 assertFalse("IP with leading zeroes should be invalid", validator.isValid("124.14.32.01")); 101 106 assertFalse("IP with three groups should be invalid", validator.isValid("23.64.12")); 102 107 assertFalse("IP with five groups should be invalid", validator.isValid("26.34.23.77.234")); 108 // CHECKSTYLE.ON: SingleSpaceSeparator 103 109 } 104 110 -
trunk/test/unit/org/openstreetmap/josm/data/validation/routines/RegexValidatorTest.java
r10338 r10378 37 37 public class RegexValidatorTest { 38 38 39 private static final String REGEX 39 private static final String REGEX = "^([abc]*)(?:\\-)([DEF]*)(?:\\-)([123]*)$"; 40 40 41 41 private static final String COMPONENT_1 = "([abc]{3})"; 42 42 private static final String COMPONENT_2 = "([DEF]{3})"; 43 43 private static final String COMPONENT_3 = "([123]{3})"; 44 private static final String SEPARATOR_1 45 private static final String SEPARATOR_2 44 private static final String SEPARATOR_1 = "(?:\\-)"; 45 private static final String SEPARATOR_2 = "(?:\\s)"; 46 46 private static final String REGEX_1 = "^" + COMPONENT_1 + SEPARATOR_1 + COMPONENT_2 + SEPARATOR_1 + COMPONENT_3 + "$"; 47 47 private static final String REGEX_2 = "^" + COMPONENT_1 + SEPARATOR_2 + COMPONENT_2 + SEPARATOR_2 + COMPONENT_3 + "$"; 48 48 private static final String REGEX_3 = "^" + COMPONENT_1 + COMPONENT_2 + COMPONENT_3 + "$"; 49 49 private static final String[] MULTIPLE_REGEX = new String[] {REGEX_1, REGEX_2, REGEX_3}; 50 51 // CHECKSTYLE.OFF: SingleSpaceSeparator 50 52 51 53 /** … … 85 87 86 88 // ------------ Set up Sensitive Validators 87 RegexValidator multiple 88 RegexValidator single1 89 RegexValidator single2 90 RegexValidator single3 89 RegexValidator multiple = new RegexValidator(MULTIPLE_REGEX); 90 RegexValidator single1 = new RegexValidator(REGEX_1); 91 RegexValidator single2 = new RegexValidator(REGEX_2); 92 RegexValidator single3 = new RegexValidator(REGEX_3); 91 93 92 94 // ------------ Set up test values … … 128 130 // ------------ Set up In-sensitive Validators 129 131 RegexValidator multiple = new RegexValidator(MULTIPLE_REGEX, false); 130 RegexValidator single1 131 RegexValidator single2 132 RegexValidator single3 132 RegexValidator single1 = new RegexValidator(REGEX_1, false); 133 RegexValidator single2 = new RegexValidator(REGEX_2, false); 134 RegexValidator single3 = new RegexValidator(REGEX_3, false); 133 135 134 136 // ------------ Set up test values … … 172 174 assertNull("Instance match()", validator.match(null)); 173 175 } 176 177 // CHECKSTYLE.ON: SingleSpaceSeparator 174 178 175 179 /** -
trunk/test/unit/org/openstreetmap/josm/data/validation/routines/UrlValidatorTest.java
r10338 r10378 99 99 int statusPerLine = 60; 100 100 int printed = 0; 101 if (printIndex) 101 if (printIndex) { 102 102 statusPerLine = 6; 103 103 } -
trunk/test/unit/org/openstreetmap/josm/gui/DefaultNameFormatterTest.java
r10222 r10378 70 70 System.out.println("p3: "+DefaultNameFormatter.getInstance().format(p3)+" - "+p3); 71 71 72 // CHECKSTYLE.OFF: SingleSpaceSeparator 72 73 assertEquals(comparator.compare(p1, p2), -1); // p1 < p2 73 74 assertEquals(comparator.compare(p2, p1), 1); // p2 > p1 … … 77 78 assertEquals(comparator.compare(p2, p3), 1); // p2 > p3 78 79 assertEquals(comparator.compare(p3, p2), -1); // p3 < p2 80 // CHECKSTYLE.ON: SingleSpaceSeparator 79 81 80 82 Relation[] relations = new ArrayList<>(ds.getRelations()).toArray(new Relation[0]); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerManagerTest.java
r10278 r10378 128 128 */ 129 129 @Before 130 public void setUp() 130 public void setUp() { 131 131 layerManager = new LayerManager(); 132 132 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java
r10050 r10378 37 37 */ 38 38 @Test 39 public void testMarkerLayer() 39 public void testMarkerLayer() { 40 40 assertEquals(Color.magenta, MarkerLayer.getGenericColor()); 41 41 MarkerLayer layer = new MarkerLayer(new GpxData(), "foo", null, null); -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testAdvancedPreference() 28 public void testAdvancedPreference() { 29 29 assertNotNull(new AdvancedPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileActionTest.java
r9845 r10378 24 24 */ 25 25 @Test 26 public void testAction() 26 public void testAction() { 27 27 new ExportProfileAction(Main.pref, "foo", "bar").actionPerformed(null); 28 28 new ExportProfileAction(Main.pref, "expert", "expert").actionPerformed(null); -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ListEditorTest.java
r10047 r10378 30 30 */ 31 31 @Test 32 public void testListSettingTableModel() 32 public void testListSettingTableModel() { 33 33 ListSettingTableModel model = new ListSettingTableModel(null); 34 34 assertNotNull(model.getData()); -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PrefEntryTest.java
r9943 r10378 30 30 */ 31 31 @Test 32 public void testPrefEntry() 32 public void testPrefEntry() { 33 33 String key = "key"; 34 34 StringSetting val = new StringSetting("value"); -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTableTest.java
r10109 r10378 42 42 */ 43 43 @Test 44 public void testPreferencesTable() 44 public void testPreferencesTable() { 45 45 PreferencesTable t = newTable(); 46 46 t.fireDataChanged(); … … 55 55 */ 56 56 @Test 57 public void testAllSettingsTableModel() 57 public void testAllSettingsTableModel() { 58 58 AllSettingsTableModel model = (AllSettingsTableModel) newTable().getModel(); 59 59 assertEquals(1, model.getRowCount()); -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/audio/AudioPreferenceTest.java
r10103 r10378 27 27 */ 28 28 @Test 29 public void testAudioPreference() 29 public void testAudioPreference() { 30 30 assertNotNull(new AudioPreference.Factory().createPreferenceSetting()); 31 31 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/ColorPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testColorPreference() 28 public void testColorPreference() { 29 29 assertNotNull(new ColorPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DisplayPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testDisplayPreference() 28 public void testDisplayPreference() { 29 29 assertNotNull(new DisplayPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DrawingPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testDrawingPreference() 28 public void testDrawingPreference() { 29 29 assertNotNull(new DrawingPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LafPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testLafPreference() 28 public void testLafPreference() { 29 29 assertNotNull(new LafPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LanguagePreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testLanguagePreference() 28 public void testLanguagePreference() { 29 29 assertNotNull(new LanguagePreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testImageryPreference() 28 public void testImageryPreference() { 29 29 assertNotNull(new ImageryPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/BackupPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testBackupPreference() 28 public void testBackupPreference() { 29 29 assertNotNull(new BackupPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testMapPaintPreference() 28 public void testMapPaintPreference() { 29 29 assertNotNull(new MapPaintPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testMapPreference() 28 public void testMapPreference() { 29 29 assertNotNull(new MapPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testTaggingPresetPreference() 28 public void testTaggingPresetPreference() { 29 29 assertNotNull(new TaggingPresetPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java
r9973 r10378 36 36 */ 37 37 @Test 38 public void testPluginPreference() 38 public void testPluginPreference() { 39 39 assertNotNull(new PluginPreference.Factory().createPreferenceSetting()); 40 40 } … … 45 45 */ 46 46 @Test 47 public void testBuildDownloadSummary() throws Exception 47 public void testBuildDownloadSummary() throws Exception { 48 48 final PluginInformation dummy = new PluginInformation( 49 49 new File(TestUtils.getTestDataRoot() + "plugin/dummy_plugin.jar"), "dummy_plugin"); -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreferenceTest.java
r9973 r10378 27 27 */ 28 28 @Test 29 public void testProjectionPreference() 29 public void testProjectionPreference() { 30 30 assertNotNull(new ProjectionPreference.Factory().createPreferenceSetting()); 31 31 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testRemoteControlPreference() 28 public void testRemoteControlPreference() { 29 29 assertNotNull(new RemoteControlPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testAuthenticationPreference() 28 public void testAuthenticationPreference() { 29 29 assertNotNull(new AuthenticationPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/OverpassServerPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testOverpassServerPreference() 28 public void testOverpassServerPreference() { 29 29 assertNotNull(new OverpassServerPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ProxyPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testProxyPreference() 28 public void testProxyPreference() { 29 29 assertNotNull(new ProxyPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testServerAccessPreference() 28 public void testServerAccessPreference() { 29 29 assertNotNull(new ServerAccessPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/shortcut/ShortcutPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testShortcutPreference() 28 public void testShortcutPreference() { 29 29 assertNotNull(new ShortcutPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testValidatorPreference() 28 public void testValidatorPreference() { 29 29 assertNotNull(new ValidatorPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreferenceTest.java
r9973 r10378 26 26 */ 27 27 @Test 28 public void testValidatorTestsPreference() 28 public void testValidatorTestsPreference() { 29 29 assertNotNull(new ValidatorTestsPreference.Factory().createPreferenceSetting()); 30 30 } -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java
r10222 r10378 58 58 final Collection<TaggingPreset> presets = TaggingPresetReader.readAll(TestUtils.getTestDataRoot() + "preset_chunk.xml", true); 59 59 assertThat(presets, hasSize(1)); 60 final TaggingPreset abc = 60 final TaggingPreset abc = presets.iterator().next(); 61 61 final List<String> keys = Utils.transform(abc.data, new Utils.Function<TaggingPresetItem, String>() { 62 62 @Override -
trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookOsxTest.java
r10339 r10378 36 36 */ 37 37 @Test 38 public void testStartupHook() 38 public void testStartupHook() { 39 39 hook.startupHook(); 40 40 } -
trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookWindowsTest.java
r10339 r10378 43 43 */ 44 44 @Test 45 public void testStartupHook() 45 public void testStartupHook() { 46 46 hook.startupHook(); 47 47 } -
trunk/test/unit/org/openstreetmap/josm/tools/TextTagParserTest.java
r8857 r10378 30 30 public void testUnescape() { 31 31 String s, s1; 32 s = "\"2 3 4\""; s1 = "2 3 4"; 32 s = "\"2 3 4\""; 33 s1 = "2 3 4"; 33 34 Assert.assertEquals(s1, TextTagParser.unescape(s)); 34 35 35 s = "\"2 \\\"3\\\" 4\""; s1 = "2 \"3\" 4"; 36 s = "\"2 \\\"3\\\" 4\""; 37 s1 = "2 \"3\" 4"; 36 38 Assert.assertEquals(s1, TextTagParser.unescape(s)); 37 39 38 s = "\"2 3 ===4===\""; s1 = "2 3 ===4==="; 40 s = "\"2 3 ===4===\""; 41 s1 = "2 3 ===4==="; 39 42 Assert.assertEquals(s1, TextTagParser.unescape(s)); 40 43 41 s = "\"2 3 \\\\\\\\===4===\""; s1 = "2 3 \\\\===4==="; 44 s = "\"2 3 \\\\\\\\===4===\""; 45 s1 = "2 3 \\\\===4==="; 42 46 Assert.assertEquals(s1, TextTagParser.unescape(s)); 43 47 } -
trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
r9274 r10378 24 24 @Test 25 25 public void testStrip() { 26 // CHECKSTYLE.OFF: SingleSpaceSeparator 26 27 final String someWhite = 27 28 "\u00A0"+ // SPACE_SEPARATOR … … 42 43 "\uFEFF"+ // ZERO WIDTH NO-BREAK SPACE 43 44 "\u3000"; // IDEOGRAPHIC SPACE 45 // CHECKSTYLE.ON: SingleSpaceSeparator 44 46 Assert.assertNull(Utils.strip(null)); 45 47 Assert.assertEquals("", Utils.strip(""));
Note:
See TracChangeset
for help on using the changeset viewer.