Ignore:
Timestamp:
2010-10-08T23:54:18+02:00 (14 years ago)
Author:
guggis
Message:

cosmetics (documentation etc.)
fixing unit tests

Location:
applications/editors/josm/plugins/turnrestrictions/test
Files:
11 added
5 edited
2 moved

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModelTest.groovy

    r20586 r23510  
    11package org.openstreetmap.josm.plugins.turnrestrictions.editor;
    2 import org.openstreetmap.josm.fixtures.JOSMFixture;
     2
     3import groovy.util.GroovyTestCase;
     4
    35import org.openstreetmap.josm.gui.MainApplication;
    46import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     
    79import org.openstreetmap.josm.data.coor.*;
    810
     11import org.openstreetmap.josm.plugins.turnrestrictions.fixtures.JOSMFixture;
     12
    913import static org.junit.Assert.*;
    1014import org.junit.*;
    1115import javax.swing.JFrame;
    1216
     17import junit.framework.TestCase;
     18import junit.framework.TestResult;
     19
    1320/**
    1421 * Unit test for {@see JosmSelctionListModel}
    1522 */
    16 class JosmSelectionListModelTest {
     23class JosmSelectionListModelTest extends GroovyTestCase {
    1724        final shouldFail = new GroovyTestCase().&shouldFail
     25       
     26        @Before
     27        public void setUp() {
     28                JOSMFixture.createUnitTestFixture().init()
     29        }
    1830       
    1931        @Test
     
    6274                model.setJOSMSelection(objects)
    6375                model.setSelected(objects[0..1])
    64                 assert model.getSelected().asList() == objects[0..1]
     76                assert model.getSelected().asList() as Set == objects[0..1] as Set
    6577               
    6678                // set new selection which includes one object which is currently
     
    90102                // select two elements
    91103                selectionModel.setSelectionInterval(1,2)
    92                 assert model.getSelected().asList() == [model.getElementAt(1),model.getElementAt(2)];
     104                assert model.getSelected().asList() as Set == [model.getElementAt(1),model.getElementAt(2)] as Set;
    93105        }
    94106       
  • applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModelUnitTest.groovy

    r20606 r23510  
    11package org.openstreetmap.josm.plugins.turnrestrictions.editor;
     2import groovy.util.GroovyTestCase;
    23
    34import static org.junit.Assert.*;
     
    1213import org.openstreetmap.josm.data.osm.DataSet
    1314import org.openstreetmap.josm.data.coor.*
     15import org.openstreetmap.josm.fixtures.JOSMFixture;
    1416import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1517
     18import org.openstreetmap.josm.plugins.turnrestrictions.fixtures.JOSMFixture;
     19
    1620/**
    17  * This is a unit test for {@see TurnRestrictionEditorModel}
     21 * This is a unit test for {@link TurnRestrictionEditorModel}
    1822 *
    1923 */
    20 class TurnRestrictionEditorModelUnitTest {
     24class TurnRestrictionEditorModelUnitTest extends GroovyTestCase{
    2125
    2226        final shouldFail = new GroovyTestCase().&shouldFail
     
    9296        @Before
    9397        public void setUp() {
     98                JOSMFixture.createUnitTestFixture().init()
     99                       
    94100                ds = new DataSet()
    95101                layer = new OsmDataLayer(ds, "test", null)             
  • applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditorUnitTest.groovy

    r20606 r23510  
    11package org.openstreetmap.josm.plugins.turnrestrictions.editor;
     2
     3import groovy.util.GroovyTestCase;
     4
    25import org.openstreetmap.josm.data.osm.DataSet;
    36import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     7
     8import org.openstreetmap.josm.plugins.turnrestrictions.fixtures.JOSMFixture;
    49
    510import static org.junit.Assert.*;
    611import org.junit.*;
    712/**
    8  * Unit test for the {@see TurnRestrictionLegEditor}
     13 * Unit test for the {@link TurnRestrictionLegEditor}
    914 *
    1015 */
    11 class TurnRestrictionLegEditorUnitTest {
     16class TurnRestrictionLegEditorUnitTest extends GroovyTestCase {
    1217        final shouldFail = new GroovyTestCase().&shouldFail
    1318       
     
    2328        @Before
    2429        public void setUp() {
     30                JOSMFixture.createUnitTestFixture().init()
     31               
    2532                ds = new DataSet()
    2633                layer = new OsmDataLayer(ds, "test", null)             
  • applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeRendererTest.groovy

    r20606 r23510  
    33import static org.junit.Assert.*;
    44import org.junit.*;
     5
     6import groovy.util.GroovyTestCase;
     7
    58import java.awt.Component
     9import org.openstreetmap.josm.plugins.turnrestrictions.fixtures.JOSMFixture;
    610
    7 class TurnRestrictionTypeRendererTest {
     11class TurnRestrictionTypeRendererTest extends GroovyTestCase{
    812
     13        @Before
     14        public void setUp() {
     15                JOSMFixture.createUnitTestFixture().init()                     
     16        }
     17       
    918        @Test
    1019        public void test_Constructor() {
  • applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeTest.groovy

    r20606 r23510  
    11package org.openstreetmap.josm.plugins.turnrestrictions.editor;
     2import groovy.util.GroovyTestCase;
    23
    34import static org.junit.Assert.*;
    45import org.junit.*
    5 class TurnRestrictionTypeTest {
     6class TurnRestrictionTypeTest extends GroovyTestCase{
    67       
    78        @Test
     
    1718                assert type == null
    1819        }
    19 
    2020}
Note: See TracChangeset for help on using the changeset viewer.