Changeset 8509 in josm for trunk/test


Ignore:
Timestamp:
2015-06-20T14:36:00+02:00 (9 years ago)
Author:
Don-vip
Message:

fix many checkstyle violations

Location:
trunk/test
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergerTest.java

    r7937 r8509  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.conflict.pair.tags;
    3 
    4 import org.junit.Ignore;
    53
    64import java.awt.BorderLayout;
    75
    86import javax.swing.JFrame;
     7
     8import org.junit.Ignore;
    99
    1010@Ignore
     
    2727        tagMerger.getModel().addItem(new TagMergeItem("key", "myvalue", null));
    2828        tagMerger.getModel().addItem(new TagMergeItem("key", null, "theirvalue"));
    29         tagMerger.getModel().addItem(new TagMergeItem("a very long key asdfasdf asdfasdf", "a very long value asdfasdf", "a very long value asdfasdf"));
     29        tagMerger.getModel().addItem(new TagMergeItem("a very long key asdfasdf asdfasdf", "a very long value asdfasdf",
     30                "a very long value asdfasdf"));
    3031        for (int i=0; i< 50; i++) {
    3132          tagMerger.getModel().addItem(new TagMergeItem("key", "myvalue", "theirvalue"));
  • trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java

    r7937 r8509  
    114114     *
    115115     * @param ds the data set
    116      * @throws OsmTransferException
     116     * @throws OsmTransferException if something goes wrong
    117117     */
    118118    public static void createDataSetOnServer(DataSet ds) throws OsmTransferException {
     
    125125        OsmServerWriter writer = new OsmServerWriter();
    126126        Changeset cs = new Changeset();
    127         writer.uploadOsm(new UploadStrategySpecification().setStrategy(UploadStrategy.SINGLE_REQUEST_STRATEGY), primitives,cs,NullProgressMonitor.INSTANCE);
     127        writer.uploadOsm(new UploadStrategySpecification().setStrategy(UploadStrategy.SINGLE_REQUEST_STRATEGY),
     128                primitives, cs, NullProgressMonitor.INSTANCE);
    128129        OsmApi.getOsmApi().closeChangeset(cs, NullProgressMonitor.INSTANCE);
    129130    }
     
    135136
    136137        // don't use atomic upload, the test API server can't cope with large diff uploads
    137         //
    138138        Main.pref.put("osm-server.atomic-upload", false);
    139139
    140         File dataSetCacheOutputFile = new File(System.getProperty("java.io.tmpdir"), MultiFetchServerObjectReaderTest.class.getName() + ".dataset");
     140        File dataSetCacheOutputFile = new File(System.getProperty("java.io.tmpdir"),
     141                MultiFetchServerObjectReaderTest.class.getName() + ".dataset");
    141142
    142143        String p = System.getProperties().getProperty("useCachedDataset");
     
    146147        }
    147148
    148         logger.info(MessageFormat.format("property ''{0}'' not set to true, creating test dataset on the server. property is ''{1}''", "useCachedDataset", p));
     149        logger.info(MessageFormat.format(
     150                "property ''{0}'' not set to true, creating test dataset on the server. property is ''{1}''", "useCachedDataset", p));
    149151
    150152        // build and upload the test data set
    151         //
    152153        logger.info("creating test data set ....");
    153154        testDataSet = buildTestDataSet();
  • trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java

    r7937 r8509  
    129129     *
    130130     * @param ds the data set
    131      * @throws OsmTransferException
     131     * @throws OsmTransferException if something goes wrong
    132132     */
    133133    static public void createDataSetOnServer(APIDataSet ds) throws OsmTransferException, CyclicUploadDependencyException {
     
    164164        }
    165165
    166         logger.info(MessageFormat.format("property ''{0}'' not set to true, creating test dataset on the server. property is ''{1}''", "useCachedDataset", p));
     166        logger.info(MessageFormat.format(
     167                "property ''{0}'' not set to true, creating test dataset on the server. property is ''{1}''", "useCachedDataset", p));
    167168
    168169        // build and upload the test data set
  • trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java

    r7937 r8509  
    7373            File f = new File(josmHome);
    7474            if (! f.exists() || ! f.canRead()) {
    75                 fail(MessageFormat.format("property ''{0}'' points to ''{1}'' which is either not existing ({2}) or not readable ({3}). Current directory is ''{4}''.",
     75                fail(MessageFormat.format(
     76                        "property ''{0}'' points to ''{1}'' which is either not existing ({2}) or not readable ({3}). Current directory is ''{4}''.",
    7677                        "josm.home", josmHome, f.exists(), f.canRead(), Paths.get("").toAbsolutePath()));
    7778            }
  • trunk/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java

    r8194 r8509  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.actions;
     3
     4import static org.hamcrest.CoreMatchers.is;
     5import static org.junit.Assert.assertThat;
     6
     7import java.util.Arrays;
     8import java.util.Collections;
    29
    310import org.junit.BeforeClass;
     
    613import org.openstreetmap.josm.data.osm.Relation;
    714import org.openstreetmap.josm.data.osm.Way;
    8 
    9 import java.util.Arrays;
    10 import java.util.Collections;
    11 
    12 import static org.hamcrest.CoreMatchers.is;
    13 import static org.junit.Assert.*;
    1415
    1516public class CopyActionTest {
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java

    r8450 r8509  
    2020import org.openstreetmap.josm.JOSMFixture;
    2121import org.openstreetmap.josm.Main;
    22 import org.openstreetmap.josm.corrector.UserCancelException;
    2322import org.openstreetmap.josm.data.Preferences;
    2423import org.openstreetmap.josm.data.coor.EastNorth;
     
    131130    /**
    132131     * Setup test.
    133      * @throws UserCancelException
    134132     */
    135133    @BeforeClass
    136     public static void setUp() throws UserCancelException {
     134    public static void setUp() {
    137135        JOSMFixture.createUnitTestFixture().init(true);
    138136    }
  • trunk/test/unit/org/openstreetmap/josm/actions/search/SearchCompilerTest.java

    r8250 r8509  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.actions.search;
    23
  • trunk/test/unit/org/openstreetmap/josm/data/BoundsTest.java

    r8450 r8509  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.data;
    23
  • trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java

    r8450 r8509  
    173173                    foundAtLeastOne = true;
    174174                    if (!osm.get(key).equals(filterCode(osm))) {
    175                         failedPrimitives.append(String.format("Object %s. Expected [%s] but was [%s]%n", osm.toString(), osm.get(key), filterCode(osm)));
     175                        failedPrimitives.append(String.format(
     176                                "Object %s. Expected [%s] but was [%s]%n", osm.toString(), osm.get(key), filterCode(osm)));
    176177                    }
    177178                }
  • trunk/test/unit/org/openstreetmap/josm/data/osm/OsmUtilsTest.java

    r8257 r8509  
    33
    44import static org.hamcrest.CoreMatchers.is;
    5 import static org.junit.Assert.*;
     5import static org.junit.Assert.assertThat;
     6import static org.junit.Assert.assertTrue;
    67
    78import org.junit.BeforeClass;
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java

    r7151 r8509  
    3030    /**
    3131     * create a list of epsg codes and bounds to be used by the perl script
    32      * @param args
     32     * @param args program main arguments
    3333     */
    3434    public static void main(String[] args) {
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java

    r8457 r8509  
    100100                EastNorth en = proj.latlon2eastNorth(new LatLon(lat, lon));
    101101                LatLon ll2 = proj.eastNorth2latlon(en);
    102                 out.write(String.format("%s%n  ll  %s %s%n  en  %s %s%n  ll2 %s %s%n", proj.toCode(), lat, lon, en.east(), en.north(), ll2.lat(), ll2.lon()));
     102                out.write(String.format(
     103                        "%s%n  ll  %s %s%n  en  %s %s%n  ll2 %s %s%n", proj.toCode(), lat, lon, en.east(), en.north(), ll2.lat(), ll2.lon()));
    103104            }
    104105        }
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java

    r8331 r8509  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.data.validation.tests;
    23
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java

    r7937 r8509  
    5353        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00,04:00-sunrise; Fr-Sa sunset-sunrise"), isEmpty());
    5454        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00, 04:00-sunrise; Fr-Sa sunset-sunrise"), hasSize(1));
    55         assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00, 04:00-sunrise; Fr-Sa sunset-sunrise").get(0).getSeverity(), is(Severity.OTHER));
    56         assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00, 04:00-sunrise; Fr-Sa sunset-sunrise").get(0).getPrettifiedValue(), is("Su-Th sunset-24:00,04:00-sunrise; Fr-Sa sunset-sunrise"));
     55        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00, 04:00-sunrise; Fr-Sa sunset-sunrise")
     56                .get(0).getSeverity(), is(Severity.OTHER));
     57        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00, 04:00-sunrise; Fr-Sa sunset-sunrise")
     58                .get(0).getPrettifiedValue(), is("Su-Th sunset-24:00,04:00-sunrise; Fr-Sa sunset-sunrise"));
    5759    }
    5860
     
    6769        assertThat(errors.get(0).getMessage(), is(key + " - Mo-Tue <--- (Please use the abbreviation \"Tu\" for \"tue\".)"));
    6870        assertThat(errors.get(0).getSeverity(), is(Severity.WARNING));
    69         assertThat(errors.get(1).getMessage(), is(key + " - Mo-Tue <--- (This rule is not very explicit because there is no time selector being used."+
     71        assertThat(errors.get(1).getMessage(), is(key +
     72                " - Mo-Tue <--- (This rule is not very explicit because there is no time selector being used."+
    7073                " Please add a time selector to this rule or use a comment to make it more explicit.)"));
    7174        assertThat(errors.get(1).getSeverity(), is(Severity.WARNING));
     
    108111        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "5.00 p.m-11.00 p.m"), hasSize(1));
    109112        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "5.00 p.m-11.00 p.m").get(0).getMessage(),
    110                 is(key + " - 5.00 p <--- (hyphen (-) or open end (+) in time range expected. For working with points in time, the mode for opening_hours.js has to be altered. Maybe wrong tag?)"));
     113                is(key + " - 5.00 p <--- (hyphen (-) or open end (+) in time range expected. "
     114                       + "For working with points in time, the mode for opening_hours.js has to be altered. Maybe wrong tag?)"));
    111115    }
    112116
     
    139143        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo,Tu 04-17").get(0).getSeverity(), is(Severity.WARNING));
    140144        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo,Tu 04-17").get(0).getMessage(),
    141                 is(key + " - Mo,Tu 04-17 <--- (Time range without minutes specified. Not very explicit! Please use this syntax instead \"04:00-17:00\".)"));
     145                is(key + " - Mo,Tu 04-17 <--- (Time range without minutes specified. "
     146                       + "Not very explicit! Please use this syntax instead \"04:00-17:00\".)"));
    142147        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo,Tu 04-17").get(0).getPrettifiedValue(), is("Mo,Tu 04:00-17:00"));
    143148    }
     
    154159        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Sa 09:00-18:00", OpeningHourTest.CheckMode.BOTH), isEmpty());
    155160        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su 09:30; We 19:30", OpeningHourTest.CheckMode.BOTH), isEmpty());
    156         assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00", OpeningHourTest.CheckMode.BOTH), isEmpty());
    157         assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00", OpeningHourTest.CheckMode.BOTH), hasSize(1));
    158         assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00", OpeningHourTest.CheckMode.BOTH).get(0).getPrettifiedValue(), is("Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00"));
    159         assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00", OpeningHourTest.CheckMode.BOTH).get(0).getPrettifiedValue(), is("Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00"));
     161        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00",
     162                OpeningHourTest.CheckMode.BOTH), isEmpty());
     163        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00",
     164                OpeningHourTest.CheckMode.BOTH), hasSize(1));
     165        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00",
     166                OpeningHourTest.CheckMode.BOTH).get(0).getPrettifiedValue(), is("Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00"));
     167        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00",
     168                OpeningHourTest.CheckMode.BOTH).get(0).getPrettifiedValue(), is("Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00"));
    160169    }
    161170
     
    170179        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "fixme", OpeningHourTest.CheckMode.BOTH), not(isEmpty()));
    171180        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "daily", OpeningHourTest.CheckMode.BOTH), not(isEmpty()));
    172         assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30,17:45,19:00; Sa 15:00; Su 11:00", OpeningHourTest.CheckMode.BOTH), isEmpty());
    173         assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00", OpeningHourTest.CheckMode.BOTH), hasSize(1));
    174         assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00", OpeningHourTest.CheckMode.BOTH).get(0).getSeverity(), is(Severity.OTHER));
    175         assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00", OpeningHourTest.CheckMode.BOTH).get(0).getPrettifiedValue(), is("Mo-Fr 13:30,17:45,19:00; Sa 15:00; Su 11:00"));
     181        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30,17:45,19:00; Sa 15:00; Su 11:00",
     182                OpeningHourTest.CheckMode.BOTH), isEmpty());
     183        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00",
     184                OpeningHourTest.CheckMode.BOTH), hasSize(1));
     185        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00",
     186                OpeningHourTest.CheckMode.BOTH).get(0).getSeverity(), is(Severity.OTHER));
     187        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00",
     188                OpeningHourTest.CheckMode.BOTH).get(0).getPrettifiedValue(), is("Mo-Fr 13:30,17:45,19:00; Sa 15:00; Su 11:00"));
    176189    }
    177190
  • trunk/test/unit/org/openstreetmap/josm/gui/DefaultNameFormatterTest.java

    r8450 r8509  
    4444    /**
    4545     * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/9632">#9632</a>.
    46      * @throws IllegalDataException
    47      * @throws IOException
    48      * @throws SAXException
     46     * @throws IllegalDataException if an error was found while parsing the data from the source
     47     * @throws IOException if any I/O error occurs
     48     * @throws SAXException if any XML error occurs
    4949     */
    5050    @Test
     
    6363            Relation p3 = (Relation) ds.getPrimitiveById(167042, OsmPrimitiveType.RELATION);
    6464
    65             System.out.println("p1: "+DefaultNameFormatter.getInstance().format(p1)+" - "+p1); // route_master ("Bus 453", 6 members)
    66             System.out.println("p2: "+DefaultNameFormatter.getInstance().format(p2)+" - "+p2); // TMC ("A 6 Kaiserslautern - Mannheim [negative]", 123 members)
    67             System.out.println("p3: "+DefaultNameFormatter.getInstance().format(p3)+" - "+p3); // route(lcn Sal  Salier-Radweg(412 members)
     65            // route_master ("Bus 453", 6 members)
     66            System.out.println("p1: "+DefaultNameFormatter.getInstance().format(p1)+" - "+p1);
     67            // TMC ("A 6 Kaiserslautern - Mannheim [negative]", 123 members)
     68            System.out.println("p2: "+DefaultNameFormatter.getInstance().format(p2)+" - "+p2);
     69            // route(lcn Sal  Salier-Radweg(412 members)
     70            System.out.println("p3: "+DefaultNameFormatter.getInstance().format(p3)+" - "+p3);
    6871
    6972            assertSame(comparator.compare(p1, p2), -1); // p1 < p2
     
    9194        assertThat(getFormattedRelationName("type=multipolygon building=yes"), is("multipolygon (\"building\", 0 members)"));
    9295        assertThat(getFormattedRelationName("type=multipolygon building=yes ref=123"), is("multipolygon (\"123\", 0 members)"));
    93         assertThat(getFormattedRelationName("type=multipolygon building=yes addr:housenumber=123"), is("multipolygon (\"building\", 0 members)"));
    94         assertThat(getFormattedRelationName("type=multipolygon building=residential addr:housenumber=123"), is("multipolygon (\"residential\", 0 members)"));
     96        assertThat(getFormattedRelationName("type=multipolygon building=yes addr:housenumber=123"),
     97                is("multipolygon (\"building\", 0 members)"));
     98        assertThat(getFormattedRelationName("type=multipolygon building=residential addr:housenumber=123"),
     99                is("multipolygon (\"residential\", 0 members)"));
    95100    }
    96101
     
    102107        assertThat(getFormattedWayName("building=yes"), is("building (0 nodes)"));
    103108        assertThat(getFormattedWayName("building=yes addr:housenumber=123"), is("House number 123 (0 nodes)"));
    104         assertThat(getFormattedWayName("building=yes addr:housenumber=123 addr:street=FooStreet"), is("House number 123 at FooStreet (0 nodes)"));
     109        assertThat(getFormattedWayName("building=yes addr:housenumber=123 addr:street=FooStreet"),
     110                is("House number 123 at FooStreet (0 nodes)"));
    105111        assertThat(getFormattedWayName("building=yes addr:housenumber=123 addr:housename=FooName"), is("House FooName (0 nodes)"));
    106112    }
  • trunk/test/unit/org/openstreetmap/josm/gui/SystemOfMeasurementTest.java

    r7937 r8509  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.gui;
    23
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagMergeItemTest.java

    r7937 r8509  
    8080    }
    8181
    82     @Test()
     82    @Test
    8383    public void test_decide_1() {
    8484        TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");
     
    9191    }
    9292
    93     @Test()
     93    @Test
    9494    public void test_applyToMyPrimitive() {
    9595        TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");
     
    107107    }
    108108
    109     @Test()
     109    @Test
    110110    public void test_applyToMyPrimitive_2() {
    111111        TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");
     
    122122    }
    123123
    124     @Test()
     124    @Test
    125125    public void test_applyToMyPrimitive_3() {
    126126        TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");
     
    138138    }
    139139
    140     @Test()
     140    @Test
    141141    public void test_applyToMyPrimitive_4() {
    142142        TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/LatLonDialogTest.java

    r7937 r8509  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.gui.dialogs;
     3
     4import static org.hamcrest.CoreMatchers.is;
     5import static org.junit.Assert.assertThat;
    26
    37import org.junit.Test;
    48import org.openstreetmap.josm.data.coor.LatLon;
    5 
    6 import static org.hamcrest.CoreMatchers.is;
    7 import static org.junit.Assert.assertThat;
    89
    910public class LatLonDialogTest {
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/ToolbarPreferencesTest.java

    r8423 r8509  
    4040
    4141        }
    42 
    4342    }
    4443
     
    6766        checkAction(parser.loadAction("action(uknownParam=aa)"));
    6867
    69         Assert.assertEquals("action(param1=value1,param2=value2)", parser.saveAction(parser.loadAction("action(param1=value1,param2=value2)")));
    70         Assert.assertEquals("action(param1=value1,param2=)", parser.saveAction(parser.loadAction("action(param1=value1)")));
    71         Assert.assertEquals("action(param1=value1,param2=2\\(\\=\\,\\\\)", parser.saveAction(parser.loadAction("action(param1=value1,param2=2\\(\\=\\,\\\\)")));
     68        Assert.assertEquals("action(param1=value1,param2=value2)",
     69                parser.saveAction(parser.loadAction("action(param1=value1,param2=value2)")));
     70        Assert.assertEquals("action(param1=value1,param2=)",
     71                parser.saveAction(parser.loadAction("action(param1=value1)")));
     72        Assert.assertEquals("action(param1=value1,param2=2\\(\\=\\,\\\\)",
     73                parser.saveAction(parser.loadAction("action(param1=value1,param2=2\\(\\=\\,\\\\)")));
    7274    }
    73 
    7475}
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/PresetClassificationsTest.java

    r8450 r8509  
    6363    public void testRelationsForTram() {
    6464        final OsmPrimitive tram = OsmUtils.createPrimitive("way railway=tram");
    65         assertTrue("railway=tram should match 'Railway Route' for relation creation", getMatchingPresetNames("route", tram).contains("Railway Route"));
    66         assertTrue("railway=tram should match 'Public Transport Route' for relation creation", getMatchingPresetNames("route", tram).contains("Public Transport Route"));
     65        assertTrue("railway=tram should match 'Railway Route' for relation creation", getMatchingPresetNames("route", tram)
     66                .contains("Railway Route"));
     67        assertTrue("railway=tram should match 'Public Transport Route' for relation creation", getMatchingPresetNames("route", tram)
     68                .contains("Public Transport Route"));
    6769        assertFalse("railway=tram should not match 'Bus route'", getMatchingPresetNames("route", tram).contains("Bus route"));
    6870    }
  • trunk/test/unit/org/openstreetmap/josm/gui/util/RotationAngleTest.java

    r8262 r8509  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.gui.util;
    23
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java

    r8193 r8509  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.io.remotecontrol.handler;
     3
     4import static org.junit.Assert.assertThat;
    25
    36import org.hamcrest.CoreMatchers;
    47import org.junit.Test;
    5 
    6 import static org.junit.Assert.*;
    78
    89public class ImportHandlerTest {
     
    1415        req.setUrl("http://localhost:8111/import?url=http://localhost:8888/relations?relations=19711&mode=recursive");
    1516        assertThat(req.args.get("url"), CoreMatchers.is("http://localhost:8888/relations?relations=19711&mode=recursive"));
    16 
    1717    }
    18 
    1918}
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandlerTest.java

    r8193 r8509  
     1// License: GPL. For details, see LICENSE file.
    12package org.openstreetmap.josm.io.remotecontrol.handler;
    23
    3 import org.junit.Test;
    4 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
     4import static org.hamcrest.CoreMatchers.is;
     5import static org.junit.Assert.assertThat;
    56
    67import java.util.Collections;
     
    89import java.util.Map;
    910
    10 import static org.hamcrest.CoreMatchers.is;
    11 import static org.junit.Assert.*;
     11import org.junit.Test;
     12import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
    1213
    1314public class RequestHandlerTest {
     
    7071    @Test
    7172    public void testRequestParameter4() {
    72         assertThat(getRequestParameter("http://example.com/:@-._~!$&'()*+,=;:@-._~!$&'()*+,=:@-._~!$&'()*+,==?/?:@-._~!$'()*+,;=/?:@-._~!$'()*+,;==#/?:@-._~!$&'()*+,;="),
     73        assertThat(getRequestParameter(
     74                "http://example.com/:@-._~!$&'()*+,=;:@-._~!$&'()*+,=:@-._~!$&'()*+,==?/?:@-._~!$'()*+,;=/?:@-._~!$'()*+,;==#/?:@-._~!$&'()*+,;="),
    7375                is(Collections.singletonMap("/?:@-._~!$'()* ,;", "/?:@-._~!$'()* ,;==")));
    7476    }
     
    8284                is(expected));
    8385    }
    84 
    8586}
  • trunk/test/unit/org/openstreetmap/josm/tools/BugReportExceptionHandlerTest.java

    r8356 r8509  
    3333    /**
    3434     * Test method for {@link org.openstreetmap.josm.tools.BugReportExceptionHandler#getBugReportUrl(java.lang.String)}.
    35      * @throws IOException
     35     * @throws IOException if any I/O error occurs
    3636     */
    3737    @Test
  • trunk/test/unit/org/openstreetmap/josm/tools/ExifReaderTest.java

    r7959 r8509  
    2323
    2424    private File orientationSampleFile, directionSampleFile;
    25    
     25
    2626    /**
    2727     * Setup test
    28      * @throws Exception
    2928     */
    3029    @Before
    31     public void setUp() throws Exception {
     30    public void setUp() {
    3231        directionSampleFile = new File("data_nodist/exif-example_direction.jpg");
    3332        orientationSampleFile = new File("data_nodist/exif-example_orientation=6.jpg");
    3433    }
    3534
    36     /** 
     35    /**
    3736     * Test time extraction
    38      * @throws ParseException
     37     * @throws ParseException if {@link ExifReader#readTime} fails to parse date/time of sample file
    3938     */
    4039    @Test
     
    5251        assertEquals(Integer.valueOf(6), orientation);
    5352    }
    54    
     53
    5554    /**
    5655     * Test coordinates extraction
  • trunk/test/unit/org/openstreetmap/josm/tools/OsmUrlToBoundsTest.java

    r6920 r8509  
    1515    private static final ParseTestItem[] parseTestData = {
    1616        new ParseTestItem("https://www.openstreetmap.org", null),
    17         new ParseTestItem("https://www.openstreetmap.org/?bbox=-0.489,51.28,0.236,51.686", new Bounds(51.28, -0.489, 51.686, 0.236)),
    18         new ParseTestItem("https://www.openstreetmap.org/?minlon=-0.489&minlat=51.28&maxlon=0.236&maxlat=51.686", new Bounds(51.28, -0.489, 51.686, 0.236)),
    19         new ParseTestItem("https://www.openstreetmap.org/?maxlat=51.686&maxlon=0.236&minlat=51.28&minlon=-0.489", new Bounds(51.28, -0.489, 51.686, 0.236)),
    20         new ParseTestItem("https://www.openstreetmap.org/?zoom=17&lat=51.71873&lon=8.76164", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)),
    21         new ParseTestItem("https://www.openstreetmap.org/?lon=8.76164&lat=51.71873&zoom=17&foo", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)),
    22         new ParseTestItem("https://www.openstreetmap.org/?mlon=8.76164&mlat=51.71873", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 18)),
    23         new ParseTestItem("http://osm.org/go/euulwp", OsmUrlToBounds.positionToBounds(51.48262023925781, -0.29937744140625, 8)),
    24         new ParseTestItem("https://www.openstreetmap.org/#map=17/51.71873/8.76164", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)),
    25         new ParseTestItem("https://www.openstreetmap.org/#map=17/51.71873/8.76164&layers=CN", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)),
    26         new ParseTestItem("https%3A%2F%2Fwww.openstreetmap.org%2F%23map%3D16%2F51.71873%2F8.76164", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 16)),
    27         new ParseTestItem("https%3A%2F%2Fwww.openstreetmap.org%2F%23map%3D16%2F51.71873%2F8.76164%26layers%3DCN", OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 16)),
    28         new ParseTestItem("https://www.openstreetmap.org/?note=26325#map=18/40.86215/-75.75020", OsmUrlToBounds.positionToBounds(40.86215, -75.75020, 18)),
    29         new ParseTestItem("https://www.openstreetmap.org/?note=26325#map=18/40.86215/-75.75020&layers=N", OsmUrlToBounds.positionToBounds(40.86215, -75.75020, 18)),
    30         new ParseTestItem("https://www.openstreetmap.org/?mlat=51.5&mlon=-0.01#map=10/51.4831/-0.1270", OsmUrlToBounds.positionToBounds(51.4831, -0.1270, 10)),
    31         new ParseTestItem("https://www.openstreetmap.org/?mlat=51.5&mlon=-0.01#map=10/51.4831/-0.3509&layers=T", OsmUrlToBounds.positionToBounds(51.4831, -0.3509, 10)),
     17        new ParseTestItem("https://www.openstreetmap.org/?bbox=-0.489,51.28,0.236,51.686",
     18                new Bounds(51.28, -0.489, 51.686, 0.236)),
     19        new ParseTestItem("https://www.openstreetmap.org/?minlon=-0.489&minlat=51.28&maxlon=0.236&maxlat=51.686",
     20                new Bounds(51.28, -0.489, 51.686, 0.236)),
     21        new ParseTestItem("https://www.openstreetmap.org/?maxlat=51.686&maxlon=0.236&minlat=51.28&minlon=-0.489",
     22                new Bounds(51.28, -0.489, 51.686, 0.236)),
     23        new ParseTestItem("https://www.openstreetmap.org/?zoom=17&lat=51.71873&lon=8.76164",
     24                OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)),
     25        new ParseTestItem("https://www.openstreetmap.org/?lon=8.76164&lat=51.71873&zoom=17&foo",
     26                OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)),
     27        new ParseTestItem("https://www.openstreetmap.org/?mlon=8.76164&mlat=51.71873",
     28                OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 18)),
     29        new ParseTestItem("http://osm.org/go/euulwp",
     30                OsmUrlToBounds.positionToBounds(51.48262023925781, -0.29937744140625, 8)),
     31        new ParseTestItem("https://www.openstreetmap.org/#map=17/51.71873/8.76164",
     32                OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)),
     33        new ParseTestItem("https://www.openstreetmap.org/#map=17/51.71873/8.76164&layers=CN",
     34                OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 17)),
     35        new ParseTestItem("https%3A%2F%2Fwww.openstreetmap.org%2F%23map%3D16%2F51.71873%2F8.76164",
     36                OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 16)),
     37        new ParseTestItem("https%3A%2F%2Fwww.openstreetmap.org%2F%23map%3D16%2F51.71873%2F8.76164%26layers%3DCN",
     38                OsmUrlToBounds.positionToBounds(51.71873, 8.76164, 16)),
     39        new ParseTestItem("https://www.openstreetmap.org/?note=26325#map=18/40.86215/-75.75020",
     40                OsmUrlToBounds.positionToBounds(40.86215, -75.75020, 18)),
     41        new ParseTestItem("https://www.openstreetmap.org/?note=26325#map=18/40.86215/-75.75020&layers=N",
     42                OsmUrlToBounds.positionToBounds(40.86215, -75.75020, 18)),
     43        new ParseTestItem("https://www.openstreetmap.org/?mlat=51.5&mlon=-0.01#map=10/51.4831/-0.1270",
     44                OsmUrlToBounds.positionToBounds(51.4831, -0.1270, 10)),
     45        new ParseTestItem("https://www.openstreetmap.org/?mlat=51.5&mlon=-0.01#map=10/51.4831/-0.3509&layers=T",
     46                OsmUrlToBounds.positionToBounds(51.4831, -0.3509, 10)),
    3247        new ParseTestItem("https://www.openstreetmap.org/#map", null),
    3348        new ParseTestItem("https://www.openstreetmap.org/#map=foo", null),
  • trunk/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java

    r8322 r8509  
    33
    44import static org.hamcrest.CoreMatchers.is;
    5 import static org.junit.Assert.*;
     5import static org.junit.Assert.assertThat;
    66
    77import org.junit.Test;
  • trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateEngineTest.java

    r7937 r8509  
    3636    public void testVariable() throws ParseError {
    3737        TemplateParser parser = new TemplateParser("abc{var}\\{ef\\$\\{g");
    38         ReflectionAssert.assertReflectionEquals(CompoundTemplateEntry.fromArray(new StaticText("abc"), new Variable("var"), new StaticText("{ef${g")), parser.parse());
     38        ReflectionAssert.assertReflectionEquals(CompoundTemplateEntry.fromArray(new StaticText("abc"),
     39                new Variable("var"), new StaticText("{ef${g")), parser.parse());
    3940    }
    4041
Note: See TracChangeset for help on using the changeset viewer.