Changeset 8458 in josm for trunk/test/unit
- Timestamp:
- 2015-06-03T12:33:14+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/NameMismatchTest.java
r8239 r8458 2 2 package org.openstreetmap.josm.data.validation.tests; 3 3 4 import static org. hamcrest.CoreMatchers.is;5 import static org.junit.Assert.assert That;4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertSame; 6 6 7 7 import java.util.List; … … 16 16 17 17 @Before 18 public void setUp() throws Exception{18 public void setUp() { 19 19 JOSMFixture.createUnitTestFixture().init(); 20 20 } … … 27 27 28 28 @Test 29 public void test0() throws Exception{29 public void test0() { 30 30 final List<TestError> errors = test("node name:de=Europa"); 31 assert That(errors.size(), is(1));32 assert That(errors.get(0).getMessage(), is("A name is missing, even though name:* exists."));31 assertSame(errors.size(), 1); 32 assertEquals(errors.get(0).getDescription(), "A name is missing, even though name:* exists."); 33 33 } 34 34 35 35 @Test 36 public void test1() throws Exception{36 public void test1() { 37 37 final List<TestError> errors = test("node name=Europe name:de=Europa"); 38 assert That(errors.size(), is(1));39 assert That(errors.get(0).getMessage(), is("Missing name:*=Europe. Add tag with correct language key."));38 assertSame(errors.size(), 1); 39 assertEquals(errors.get(0).getDescription(), "Missing name:*=Europe. Add tag with correct language key."); 40 40 } 41 41 42 42 @Test 43 public void test2() throws Exception{43 public void test2() { 44 44 final List<TestError> errors = test("node name=Europe name:de=Europa name:en=Europe"); 45 assert That(errors.size(), is(0));45 assertSame(errors.size(), 0); 46 46 } 47 47 48 48 @Test 49 public void test3() throws Exception{49 public void test3() { 50 50 List<TestError> errors; 51 51 errors = test("node \"name\"=\"Italia - Italien - Italy\""); 52 assert That(errors.size(), is(0));52 assertSame(errors.size(), 0); 53 53 errors = test("node name=\"Italia - Italien - Italy\" name:it=Italia"); 54 assert That(errors.size(), is(2));54 assertSame(errors.size(), 2); 55 55 errors = test("node name=\"Italia - Italien - Italy\" name:it=Italia name:de=Italien"); 56 assert That(errors.size(), is(1));57 assert That(errors.get(0).getMessage(), is("Missing name:*=Italy. Add tag with correct language key."));56 assertSame(errors.size(), 1); 57 assertEquals(errors.get(0).getDescription(), "Missing name:*=Italy. Add tag with correct language key."); 58 58 errors = test("node name=\"Italia - Italien - Italy\" name:it=Italia name:de=Italien name:en=Italy"); 59 assert That(errors.size(), is(0));59 assertSame(errors.size(), 0); 60 60 } 61 61 }
Note:
See TracChangeset
for help on using the changeset viewer.