Changeset 10133 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2016-04-10T13:37:15+02:00 (9 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTest.java
r9967 r10133 20 20 import static org.junit.Assert.assertFalse; 21 21 import static org.junit.Assert.assertNotNull; 22 import static org.junit.Assert.assertNull; 22 23 import static org.junit.Assert.assertTrue; 23 24 import static org.junit.Assert.fail; … … 478 479 return sorted && strictlySorted && lowerCase; 479 480 } 481 482 /** 483 * Unit test of {@link DomainValidator#getValidatorName}. 484 */ 485 @Test 486 public void testValidatorName() { 487 assertNull(DomainValidator.getInstance().getValidatorName()); 488 } 480 489 } -
trunk/test/unit/org/openstreetmap/josm/data/validation/routines/EmailValidatorTest.java
r9853 r10133 574 574 assertTrue(validator.isValid("abc@school.school")); 575 575 } 576 577 /** 578 * Unit test of {@link EmailValidator#getValidatorName}. 579 */ 580 @Test 581 public void testValidatorName() { 582 assertEquals("Email validator", EmailValidator.getInstance().getValidatorName()); 583 } 576 584 } -
trunk/test/unit/org/openstreetmap/josm/data/validation/routines/InetAddressValidatorTest.java
r9853 r10133 19 19 20 20 import static org.junit.Assert.assertFalse; 21 import static org.junit.Assert.assertNull; 21 22 import static org.junit.Assert.assertTrue; 22 23 … … 615 616 // CHECKSTYLE.ON: MethodLengthCheck 616 617 // CHECKSTYLE.ON: LineLength 618 619 /** 620 * Unit test of {@link InetAddressValidator#getValidatorName}. 621 */ 622 @Test 623 public void testValidatorName() { 624 assertNull(new InetAddressValidator().getValidatorName()); 625 } 617 626 } -
trunk/test/unit/org/openstreetmap/josm/data/validation/routines/RegexValidatorTest.java
r9967 r10133 257 257 258 258 /** 259 * Unit test of {@link RegexValidator#getValidatorName}. 260 */ 261 @Test 262 public void testValidatorName() { 263 assertNull(new RegexValidator(".*").getValidatorName()); 264 } 265 266 /** 259 267 * Compare two arrays 260 268 * @param label Label for the test -
trunk/test/unit/org/openstreetmap/josm/data/validation/routines/UrlValidatorTest.java
r9967 r10133 546 546 } 547 547 548 /** 549 * Unit test of {@link UrlValidator#getValidatorName}. 550 */ 551 @Test 552 public void testValidatorName() { 553 assertEquals("URL validator", UrlValidator.getInstance().getValidatorName()); 554 } 555 548 556 //-------------------- Test data for creating a composite URL 549 557 /** -
trunk/test/unit/org/openstreetmap/josm/gui/correction/RoleCorrectionTableTest.java
r10130 r10133 39 39 RelationMember member = new RelationMember("foo", new Node()); 40 40 r.addMember(member); 41 RoleCorrectionTable t = new RoleCorrectionTable(Arrays.asList(new RoleCorrection(r, 0, member, "bar"))); 41 RoleCorrection rc = new RoleCorrection(r, 0, member, "bar"); 42 RoleCorrectionTable t = new RoleCorrectionTable(Arrays.asList(rc)); 42 43 assertNotNull(t.getCellRenderer(0, 0)); 43 44 assertNotNull(t.getCellRenderer(0, 1)); … … 63 64 assertEquals(Boolean.TRUE, model.getValueAt(0, 3)); 64 65 assertNull(model.getValueAt(0, 4)); 66 model.setValueAt("", 0, 0); 67 assertEquals("relation (0, 1 member)", model.getValueAt(0, 0)); 68 model.setValueAt("", 0, 3); 69 assertEquals(Boolean.TRUE, model.getValueAt(0, 3)); 70 model.setValueAt(Boolean.FALSE, 0, 3); 71 assertEquals(Boolean.FALSE, model.getValueAt(0, 3)); 72 RoleCorrection[] array = new RoleCorrection[15]; 73 Arrays.fill(array, rc); 74 t = new RoleCorrectionTable(Arrays.asList(array)); 75 assertEquals(array.length, t.getCorrectionTableModel().getCorrections().size()); 65 76 } 66 77 } -
trunk/test/unit/org/openstreetmap/josm/gui/correction/TagCorrectionTableTest.java
r10130 r10133 33 33 @Test 34 34 public void testTagCorrectionTable() { 35 TagCorrectionTable t = new TagCorrectionTable(Arrays.asList(new TagCorrection("foo", "bar", "foo", "baz"))); 35 TagCorrection tc1 = new TagCorrection("foo", "bar", "foo", "baz"); 36 TagCorrection tc2 = new TagCorrection("bar", "foo", "baz", "foo"); 37 TagCorrectionTable t = new TagCorrectionTable(Arrays.asList(tc1, tc2)); 36 38 assertNotNull(t.getCellRenderer(0, 0)); 37 39 assertNotNull(t.getCellRenderer(0, 1)); 38 40 assertNotNull(t.getCellRenderer(0, 2)); 39 41 assertNotNull(t.getCellRenderer(0, 3)); 42 assertNotNull(t.getCellRenderer(0, 4)); 43 assertNotNull(t.getCellRenderer(1, 0)); 44 assertNotNull(t.getCellRenderer(1, 1)); 45 assertNotNull(t.getCellRenderer(1, 2)); 46 assertNotNull(t.getCellRenderer(1, 3)); 47 assertNotNull(t.getCellRenderer(1, 4)); 40 48 TagCorrectionTableModel model = t.getCorrectionTableModel(); 41 assertEquals( 1, model.getCorrections().size());42 assertEquals( 1, model.getRowCount());49 assertEquals(2, model.getCorrections().size()); 50 assertEquals(2, model.getRowCount()); 43 51 assertEquals(4, model.getApplyColumn()); 44 52 assertTrue(model.getApply(0)); … … 52 60 assertNull(model.getColumnName(5)); 53 61 assertFalse(model.isCellEditable(0, 0)); 62 assertFalse(model.isCellEditable(1, 0)); 54 63 assertTrue(model.isCellEditable(0, 4)); 64 assertTrue(model.isCellEditable(1, 4)); 55 65 assertEquals("foo", model.getValueAt(0, 0)); 56 66 assertEquals("bar", model.getValueAt(0, 1)); … … 59 69 assertEquals(Boolean.TRUE, model.getValueAt(0, 4)); 60 70 assertNull(model.getValueAt(0, 5)); 71 assertEquals("bar", model.getValueAt(1, 0)); 72 assertEquals("foo", model.getValueAt(1, 1)); 73 assertEquals("baz", model.getValueAt(1, 2)); 74 assertEquals("foo", model.getValueAt(1, 3)); 75 assertEquals(Boolean.TRUE, model.getValueAt(1, 4)); 76 assertNull(model.getValueAt(1, 5)); 77 model.setValueAt("", 0, 0); 78 assertEquals("foo", model.getValueAt(0, 0)); 79 model.setValueAt("", 0, 4); 80 assertEquals(Boolean.TRUE, model.getValueAt(0, 4)); 81 model.setValueAt(Boolean.FALSE, 0, 4); 82 assertEquals(Boolean.FALSE, model.getValueAt(0, 4)); 83 TagCorrection[] array = new TagCorrection[15]; 84 Arrays.fill(array, tc1); 85 t = new TagCorrectionTable(Arrays.asList(array)); 86 assertEquals(array.length, t.getCorrectionTableModel().getCorrections().size()); 61 87 } 62 88 } -
trunk/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java
r10108 r10133 187 187 } 188 188 } 189 190 /** 191 * Unit test to reach 100% code coverage. 192 */ 193 @Test 194 public void testCoverage() { 195 assertNotNull(new DateUtils()); 196 } 189 197 }
Note:
See TracChangeset
for help on using the changeset viewer.