Ignore:
Timestamp:
2015-06-03T01:27:41+02:00 (10 years ago)
Author:
Don-vip
Message:

unit tests - simplify assertions

Location:
trunk/test/unit/org/openstreetmap/josm/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/DefaultNameFormatterTest.java

    r7937 r8450  
    33
    44import static org.hamcrest.CoreMatchers.is;
     5import static org.junit.Assert.assertSame;
    56import static org.junit.Assert.assertThat;
    6 import static org.junit.Assert.assertTrue;
    77
    88import java.io.FileInputStream;
     
    6767            System.out.println("p3: "+DefaultNameFormatter.getInstance().format(p3)+" - "+p3); // route(lcn Sal  Salier-Radweg(412 members)
    6868
    69             assertTrue(comparator.compare(p1, p2) == -1); // p1 < p2
    70             assertTrue(comparator.compare(p2, p1) ==  1); // p2 > p1
     69            assertSame(comparator.compare(p1, p2), -1); // p1 < p2
     70            assertSame(comparator.compare(p2, p1),  1); // p2 > p1
    7171
    72             assertTrue(comparator.compare(p1, p3) == -1); // p1 < p3
    73             assertTrue(comparator.compare(p3, p1) ==  1); // p3 > p1
    74             assertTrue(comparator.compare(p2, p3) ==  1); // p2 > p3
    75             assertTrue(comparator.compare(p3, p2) == -1); // p3 < p2
     72            assertSame(comparator.compare(p1, p3), -1); // p1 < p3
     73            assertSame(comparator.compare(p3, p1),  1); // p3 > p1
     74            assertSame(comparator.compare(p2, p3),  1); // p2 > p3
     75            assertSame(comparator.compare(p3, p2), -1); // p3 < p2
    7676
    7777            Relation[] relations = new ArrayList<>(ds.getRelations()).toArray(new Relation[0]);
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/nodes/NodeListMergeModelTest.java

    r8391 r8450  
    55import static org.fest.reflect.core.Reflection.method;
    66import static org.junit.Assert.assertEquals;
     7import static org.junit.Assert.assertFalse;
    78import static org.junit.Assert.assertTrue;
    89import static org.junit.Assert.fail;
     
    697698
    698699        model.setFrozen(false);
    699         assertTrue(!model.isFrozen());
     700        assertFalse(model.isFrozen());
    700701    }
    701702
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/PresetClassificationsTest.java

    r7937 r8450  
    22package org.openstreetmap.josm.gui.tagging;
    33
     4import static org.junit.Assert.assertFalse;
    45import static org.junit.Assert.assertTrue;
    56
     
    5455        w.addNode(new Node());
    5556        w.addNode(new Node());
    56         assertTrue("unclosed way should not match building preset", !getMatchingPresetNames("building", w).contains("Building"));
     57        assertFalse("unclosed way should not match building preset", getMatchingPresetNames("building", w).contains("Building"));
    5758        w.addNode(n1);
    5859        assertTrue("closed way should match building preset", getMatchingPresetNames("building", w).contains("Building"));
     
    6465        assertTrue("railway=tram should match 'Railway Route' for relation creation", getMatchingPresetNames("route", tram).contains("Railway Route"));
    6566        assertTrue("railway=tram should match 'Public Transport Route' for relation creation", getMatchingPresetNames("route", tram).contains("Public Transport Route"));
    66         assertTrue("railway=tram should not match 'Bus route'", !getMatchingPresetNames("route", tram).contains("Bus route"));
     67        assertFalse("railway=tram should not match 'Bus route'", getMatchingPresetNames("route", tram).contains("Bus route"));
    6768    }
    6869}
Note: See TracChangeset for help on using the changeset viewer.