Changeset 8459 in josm for trunk/test/unit/org
- Timestamp:
- 2015-06-03T13:24:59+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/NameMismatchTest.java
r8458 r8459 13 13 import org.openstreetmap.josm.data.validation.TestError; 14 14 15 /** 16 * JUnit Test of "Name mismatch" validation test. 17 */ 15 18 public class NameMismatchTest { 16 19 20 /** 21 * Setup test. 22 */ 17 23 @Before 18 24 public void setUp() { … … 26 32 } 27 33 34 /** 35 * Test "A name is missing, even though name:* exists." 36 */ 28 37 @Test 29 38 public void test0() { 30 39 final List<TestError> errors = test("node name:de=Europa"); 31 assertSame( errors.size(), 1);32 assertEquals( errors.get(0).getDescription(), "A name is missing, even though name:* exists.");40 assertSame(1, errors.size()); 41 assertEquals("A name is missing, even though name:* exists.", errors.get(0).getMessage()); 33 42 } 34 43 44 /** 45 * Test "Missing name:*={0}. Add tag with correct language key." 46 */ 35 47 @Test 36 48 public void test1() { 37 49 final List<TestError> errors = test("node name=Europe name:de=Europa"); 38 assertSame( errors.size(), 1);39 assertEquals( errors.get(0).getDescription(), "Missing name:*=Europe. Add tag with correct language key.");50 assertSame(1, errors.size()); 51 assertEquals("Missing name:*=Europe. Add tag with correct language key.", errors.get(0).getDescription()); 40 52 } 41 53 54 /** 55 * Test no error 56 */ 42 57 @Test 43 58 public void test2() { 44 59 final List<TestError> errors = test("node name=Europe name:de=Europa name:en=Europe"); 45 assertSame( errors.size(), 0);60 assertSame(0, errors.size()); 46 61 } 47 62 63 /** 64 * Various other tests 65 */ 48 66 @Test 49 67 public void test3() { 50 68 List<TestError> errors; 51 69 errors = test("node \"name\"=\"Italia - Italien - Italy\""); 52 assertSame( errors.size(), 0);70 assertSame(0, errors.size()); 53 71 errors = test("node name=\"Italia - Italien - Italy\" name:it=Italia"); 54 assertSame( errors.size(), 2);72 assertSame(2, errors.size()); 55 73 errors = test("node name=\"Italia - Italien - Italy\" name:it=Italia name:de=Italien"); 56 assertSame( errors.size(), 1);57 assertEquals( errors.get(0).getDescription(), "Missing name:*=Italy. Add tag with correct language key.");74 assertSame(1, errors.size()); 75 assertEquals("Missing name:*=Italy. Add tag with correct language key.", errors.get(0).getDescription()); 58 76 errors = test("node name=\"Italia - Italien - Italy\" name:it=Italia name:de=Italien name:en=Italy"); 59 assertSame( errors.size(), 0);77 assertSame(0, errors.size()); 60 78 } 61 79 }
Note:
See TracChangeset
for help on using the changeset viewer.