Changeset 9967 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2016-03-12T11:35:43+01:00 (9 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/data/validation/routines
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTest.java
r9853 r9967 25 25 import java.lang.reflect.Field; 26 26 import java.lang.reflect.Modifier; 27 import java.net.IDN;28 27 import java.util.Locale; 29 28 … … 282 281 assertEquals(s[1], DomainValidator.unicodeToASCII(s[0])); 283 282 } 284 }285 286 /**287 * Check if IDN.toASCII is broken or not288 */289 @Test290 public void testIsIDNtoASCIIBroken() {291 System.out.println(">>DomainValidatorTest.testIsIDNtoASCIIBroken()");292 final String input = ".";293 final boolean ok = input.equals(IDN.toASCII(input));294 System.out.println("IDN.toASCII is " + (ok ? "OK" : "BROKEN"));295 String[] props = {296 "java.version", // Java Runtime Environment version297 "java.vendor", // Java Runtime Environment vendor298 "java.vm.specification.version", // Java Virtual Machine specification version299 "java.vm.specification.vendor", // Java Virtual Machine specification vendor300 "java.vm.specification.name", // Java Virtual Machine specification name301 "java.vm.version", // Java Virtual Machine implementation version302 "java.vm.vendor", // Java Virtual Machine implementation vendor303 "java.vm.name", // Java Virtual Machine implementation name304 "java.specification.version", // Java Runtime Environment specification version305 "java.specification.vendor", // Java Runtime Environment specification vendor306 "java.specification.name", // Java Runtime Environment specification name307 "java.class.version", // Java class format version number308 };309 for (String t : props) {310 System.out.println(t + "=" + System.getProperty(t));311 }312 System.out.println("<<DomainValidatorTest.testIsIDNtoASCIIBroken()");313 283 } 314 284 -
trunk/test/unit/org/openstreetmap/josm/data/validation/routines/RegexValidatorTest.java
r9853 r9967 18 18 19 19 import static org.junit.Assert.assertEquals; 20 import static org.junit.Assert.assertFalse; 20 21 import static org.junit.Assert.assertNull; 22 import static org.junit.Assert.assertTrue; 21 23 import static org.junit.Assert.fail; 22 24 … … 56 58 57 59 // isValid() 58 assert Equals("Sensitive isValid() valid", true,sensitive.isValid("ac-DE-1"));59 assert Equals("Sensitive isValid() invalid", false,sensitive.isValid("AB-de-1"));60 assert Equals("Insensitive isValid() valid", true,insensitive.isValid("AB-de-1"));61 assert Equals("Insensitive isValid() invalid", false,insensitive.isValid("ABd-de-1"));60 assertTrue("Sensitive isValid() valid", sensitive.isValid("ac-DE-1")); 61 assertFalse("Sensitive isValid() invalid", sensitive.isValid("AB-de-1")); 62 assertTrue("Insensitive isValid() valid", insensitive.isValid("AB-de-1")); 63 assertFalse("Insensitive isValid() invalid", insensitive.isValid("ABd-de-1")); 62 64 63 65 // validate() 64 assertEquals("Sensitive validate() valid", 65 assert Equals("Sensitive validate() invalid", null,sensitive.validate("AB-de-1"));66 assertEquals("Insensitive validate() valid", 67 assert Equals("Insensitive validate() invalid", null,insensitive.validate("ABd-de-1"));66 assertEquals("Sensitive validate() valid", "acDE1", sensitive.validate("ac-DE-1")); 67 assertNull("Sensitive validate() invalid", sensitive.validate("AB-de-1")); 68 assertEquals("Insensitive validate() valid", "ABde1", insensitive.validate("AB-de-1")); 69 assertNull("Insensitive validate() invalid", insensitive.validate("ABd-de-1")); 68 70 69 71 // match() … … 94 96 95 97 // isValid() 96 assert Equals("Sensitive isValid() Multiple", true,multiple.isValid(value));97 assert Equals("Sensitive isValid() 1st", false,single1.isValid(value));98 assert Equals("Sensitive isValid() 2nd", true,single2.isValid(value));99 assert Equals("Sensitive isValid() 3rd", false,single3.isValid(value));98 assertTrue("Sensitive isValid() Multiple", multiple.isValid(value)); 99 assertFalse("Sensitive isValid() 1st", single1.isValid(value)); 100 assertTrue("Sensitive isValid() 2nd", single2.isValid(value)); 101 assertFalse("Sensitive isValid() 3rd", single3.isValid(value)); 100 102 101 103 // validate() 102 104 assertEquals("Sensitive validate() Multiple", expect, multiple.validate(value)); 103 assertNull("Sensitive validate() 1st", single1.validate(value));105 assertNull("Sensitive validate() 1st", single1.validate(value)); 104 106 assertEquals("Sensitive validate() 2nd", expect, single2.validate(value)); 105 assertNull("Sensitive validate() 3rd", single3.validate(value));107 assertNull("Sensitive validate() 3rd", single3.validate(value)); 106 108 107 109 // match() … … 113 115 // All invalid 114 116 value = "AAC*FDE*321"; 115 assert Equals("isValid() Invalid", false, multiple.isValid(value));117 assertFalse("isValid() Invalid", multiple.isValid(value)); 116 118 assertNull("validate() Invalid", multiple.validate(value)); 117 119 assertNull("match() Multiple", multiple.match(value)); … … 136 138 137 139 // isValid() 138 assert Equals("isValid() Multiple", true,multiple.isValid(value));139 assert Equals("isValid() 1st", false,single1.isValid(value));140 assert Equals("isValid() 2nd", true,single2.isValid(value));141 assert Equals("isValid() 3rd", false,single3.isValid(value));140 assertTrue("isValid() Multiple", multiple.isValid(value)); 141 assertFalse("isValid() 1st", single1.isValid(value)); 142 assertTrue("isValid() 2nd", single2.isValid(value)); 143 assertFalse("isValid() 3rd", single3.isValid(value)); 142 144 143 145 // validate() 144 146 assertEquals("validate() Multiple", expect, multiple.validate(value)); 145 assertNull("validate() 1st", single1.validate(value));147 assertNull("validate() 1st", single1.validate(value)); 146 148 assertEquals("validate() 2nd", expect, single2.validate(value)); 147 assertNull("validate() 3rd", single3.validate(value));149 assertNull("validate() 3rd", single3.validate(value)); 148 150 149 151 // match() … … 155 157 // All invalid 156 158 value = "AAC*FDE*321"; 157 assert Equals("isValid() Invalid", false, multiple.isValid(value));159 assertFalse("isValid() Invalid", multiple.isValid(value)); 158 160 assertNull("validate() Invalid", multiple.validate(value)); 159 161 assertNull("match() Multiple", multiple.match(value)); … … 165 167 @Test 166 168 public void testNullValue() { 167 168 169 RegexValidator validator = new RegexValidator(REGEX); 169 assert Equals("Instance isValid()", false, validator.isValid(null));170 assertFalse("Instance isValid()", validator.isValid(null)); 170 171 assertNull("Instance validate()", validator.validate(null)); 171 172 assertNull("Instance match()", validator.match(null)); -
trunk/test/unit/org/openstreetmap/josm/data/validation/routines/UrlValidatorTest.java
r9853 r9967 399 399 } 400 400 return carryMsg.toString(); 401 }402 403 /**404 * Test validate URL405 */406 @Test407 public void testValidateUrl() {408 assertTrue(true);409 401 } 410 402
Note:
See TracChangeset
for help on using the changeset viewer.