Changeset 8459 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2015-06-03T13:24:59+02:00 (10 years ago)
Author:
Don-vip
Message:

javadoc / Unit test fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/NameMismatchTest.java

    r8458 r8459  
    1313import org.openstreetmap.josm.data.validation.TestError;
    1414
     15/**
     16 * JUnit Test of "Name mismatch" validation test.
     17 */
    1518public class NameMismatchTest {
    1619
     20    /**
     21     * Setup test.
     22     */
    1723    @Before
    1824    public void setUp() {
     
    2632    }
    2733
     34    /**
     35     * Test "A name is missing, even though name:* exists."
     36     */
    2837    @Test
    2938    public void test0() {
    3039        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());
    3342    }
    3443
     44    /**
     45     * Test "Missing name:*={0}. Add tag with correct language key."
     46     */
    3547    @Test
    3648    public void test1() {
    3749        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());
    4052    }
    4153
     54    /**
     55     * Test no error
     56     */
    4257    @Test
    4358    public void test2() {
    4459        final List<TestError> errors = test("node name=Europe name:de=Europa name:en=Europe");
    45         assertSame(errors.size(), 0);
     60        assertSame(0, errors.size());
    4661    }
    4762
     63    /**
     64     * Various other tests
     65     */
    4866    @Test
    4967    public void test3() {
    5068        List<TestError> errors;
    5169        errors = test("node \"name\"=\"Italia - Italien - Italy\"");
    52         assertSame(errors.size(), 0);
     70        assertSame(0, errors.size());
    5371        errors = test("node name=\"Italia - Italien - Italy\" name:it=Italia");
    54         assertSame(errors.size(), 2);
     72        assertSame(2, errors.size());
    5573        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());
    5876        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());
    6078    }
    6179}
Note: See TracChangeset for help on using the changeset viewer.