Changeset 8458 in josm for trunk/test/unit


Ignore:
Timestamp:
2015-06-03T12:33:14+02:00 (9 years ago)
Author:
Don-vip
Message:

see #11484 - update unit test

File:
1 edited

Legend:

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

    r8239 r8458  
    22package org.openstreetmap.josm.data.validation.tests;
    33
    4 import static org.hamcrest.CoreMatchers.is;
    5 import static org.junit.Assert.assertThat;
     4import static org.junit.Assert.assertEquals;
     5import static org.junit.Assert.assertSame;
    66
    77import java.util.List;
     
    1616
    1717    @Before
    18     public void setUp() throws Exception {
     18    public void setUp() {
    1919        JOSMFixture.createUnitTestFixture().init();
    2020    }
     
    2727
    2828    @Test
    29     public void test0() throws Exception {
     29    public void test0() {
    3030        final List<TestError> errors = test("node name:de=Europa");
    31         assertThat(errors.size(), is(1));
    32         assertThat(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.");
    3333    }
    3434
    3535    @Test
    36     public void test1() throws Exception {
     36    public void test1() {
    3737        final List<TestError> errors = test("node name=Europe name:de=Europa");
    38         assertThat(errors.size(), is(1));
    39         assertThat(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.");
    4040    }
    4141
    4242    @Test
    43     public void test2() throws Exception {
     43    public void test2() {
    4444        final List<TestError> errors = test("node name=Europe name:de=Europa name:en=Europe");
    45         assertThat(errors.size(), is(0));
     45        assertSame(errors.size(), 0);
    4646    }
    4747
    4848    @Test
    49     public void test3() throws Exception {
     49    public void test3() {
    5050        List<TestError> errors;
    5151        errors = test("node \"name\"=\"Italia - Italien - Italy\"");
    52         assertThat(errors.size(), is(0));
     52        assertSame(errors.size(), 0);
    5353        errors = test("node name=\"Italia - Italien - Italy\" name:it=Italia");
    54         assertThat(errors.size(), is(2));
     54        assertSame(errors.size(), 2);
    5555        errors = test("node name=\"Italia - Italien - Italy\" name:it=Italia name:de=Italien");
    56         assertThat(errors.size(), is(1));
    57         assertThat(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.");
    5858        errors = test("node name=\"Italia - Italien - Italy\" name:it=Italia name:de=Italien name:en=Italy");
    59         assertThat(errors.size(), is(0));
     59        assertSame(errors.size(), 0);
    6060    }
    6161}
Note: See TracChangeset for help on using the changeset viewer.