Changeset 15497 in josm for trunk/test/unit


Ignore:
Timestamp:
2019-11-02T16:28:02+01:00 (5 years ago)
Author:
Don-vip
Message:

see #16796 - fix most of checkstyle/pmd/findbugs violations

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java

    r15496 r15497  
    480480        EqualsVerifier.forClass(GpxData.class).usingGetClass()
    481481            .suppress(Warning.NONFINAL_FIELDS)
    482             .withIgnoredFields("creator", "fromServer", "storageFile", "initializing", "updating", "suppressedInvalidate", "listeners", "tracks", "routes", "waypoints", "proxy", "segSpans", "modified")
     482            .withIgnoredFields("creator", "fromServer", "storageFile", "initializing", "updating",
     483                    "suppressedInvalidate", "listeners", "tracks", "routes", "waypoints", "proxy", "segSpans", "modified")
    483484            .withPrefabValues(WayPoint.class, new WayPoint(LatLon.NORTH_POLE), new WayPoint(LatLon.SOUTH_POLE))
    484485            .withPrefabValues(ListenerList.class, ListenerList.create(), ListenerList.create())
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java

    r15496 r15497  
    4545                "<html>Select all tracks that you want to be displayed. " +
    4646                        "You can drag select a range of tracks or use CTRL+Click to select specific ones. " +
    47                         "The map is updated live in the background. Open the URLs by double clicking them, edit name and description by double clicking the cell.</html>",
     47                        "The map is updated live in the background. "+
     48                        "Open the URLs by double clicking them, edit name and description by double clicking the cell.</html>",
    4849                        "Show all"
    4950                );
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerActionTest.java

    r15496 r15497  
    141141
    142142        List<String> ways = osm.getWays().stream()
    143                 .map(w -> Integer.toString(w.getNodes().size()) + ":" + w.getKeys().entrySet().stream().sorted((e1, e2) -> e1.getKey().compareTo(e2.getKey())).collect(Collectors.toList()).toString())
     143                .map(w -> Integer.toString(w.getNodes().size()) + ":" + w.getKeys().entrySet().stream()
     144                        .sorted((e1, e2) -> e1.getKey().compareTo(e2.getKey())).collect(Collectors.toList()).toString())
    144145                .sorted()
    145146                .collect(Collectors.toList());
    146147
    147148        List<String> waysExpected = osmExpected.getWays().stream()
    148                 .map(w -> Integer.toString(w.getNodes().size()) + ":" + w.getKeys().entrySet().stream().sorted((e1, e2) -> e1.getKey().compareTo(e2.getKey())).collect(Collectors.toList()).toString())
     149                .map(w -> Integer.toString(w.getNodes().size()) + ":" + w.getKeys().entrySet().stream()
     150                        .sorted((e1, e2) -> e1.getKey().compareTo(e2.getKey())).collect(Collectors.toList()).toString())
    149151                .sorted()
    150152                .collect(Collectors.toList());
     
    152154        assertEquals("Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!", waysExpected, ways);
    153155
    154         assertEquals("Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!", osmExpected.allPrimitives().size(), osm.allPrimitives().size());
     156        assertEquals("Conversion " + originalGpx + " -> " + expectedOsm + " didn't match!", osmExpected.allPrimitives().size(),
     157                osm.allPrimitives().size());
    155158    }
    156159
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelperTest.java

    r15496 r15497  
    7272    @Test
    7373    public void testVelocity() throws IOException, SAXException {
    74         final List<String> colors = calculateColors("data_nodist/2094047.gpx", ImmutableMap.of("colormode", Integer.toString(ColorMode.VELOCITY.toIndex())), 10);
     74        final List<String> colors = calculateColors("data_nodist/2094047.gpx",
     75                ImmutableMap.of("colormode", Integer.toString(ColorMode.VELOCITY.toIndex())), 10);
    7576        assertEquals("[#000000, #FFAD00, #FFA800, #FFA800, #FF9E00, #FF9400, #FF7000, #FF7000, #FF8000, #FF9400]", colors.toString());
    7677    }
     
    99100    @Test
    100101    public void testDirection() throws IOException, SAXException {
    101         final List<String> colors = calculateColors("data_nodist/2094047.gpx", ImmutableMap.of("colormode", Integer.toString(ColorMode.DIRECTION.toIndex())), 10);
     102        final List<String> colors = calculateColors("data_nodist/2094047.gpx",
     103                ImmutableMap.of("colormode", Integer.toString(ColorMode.DIRECTION.toIndex())), 10);
    102104        assertEquals("[#000000, #EAEC25, #EDEA26, #EDE525, #ECD322, #EBB81D, #E85A0D, #E73708, #E84D0B, #EA8A15]", colors.toString());
    103105    }
     
    111113    @Test
    112114    public void testTime() throws IOException, SAXException {
    113         final List<String> colors = calculateColors("data_nodist/2094047.gpx", ImmutableMap.of("colormode", Integer.toString(ColorMode.TIME.toIndex())), 10);
     115        final List<String> colors = calculateColors("data_nodist/2094047.gpx",
     116                ImmutableMap.of("colormode", Integer.toString(ColorMode.TIME.toIndex())), 10);
    114117        assertEquals("[#000000, #FF0000, #FF0000, #FF0500, #FF0500, #FF0A00, #FF0A00, #FF1F00, #FF2E00, #FF3300]", colors.toString());
    115118    }
  • trunk/test/unit/org/openstreetmap/josm/io/GpxWriterTest.java

    r15496 r15497  
    103103    public void testExtensions() throws IOException {
    104104        GpxData data = new GpxData();
    105         data.getNamespaces().add(new XMLNamespace("test", "http://example.com/testURI")); //only namespace, no location printed
    106         data.getNamespaces().add(new XMLNamespace("knownprefix", "http://example.com/URI", "http://example.com/location.xsd")); //printed
    107         data.getNamespaces().add(new XMLNamespace("notpresent", "http://example.com/notpresent", "http://example.com/notpresent.xsd")); //NOT printed
     105        // only namespace, no location printed
     106        data.getNamespaces().add(new XMLNamespace("test", "http://example.com/testURI"));
     107        // printed
     108        data.getNamespaces().add(new XMLNamespace("knownprefix", "http://example.com/URI", "http://example.com/location.xsd"));
     109        // NOT printed
     110        data.getNamespaces().add(new XMLNamespace("notpresent", "http://example.com/notpresent", "http://example.com/notpresent.xsd"));
    108111
    109112        GpxExtensionCollection exts = data.getExtensions();
     
    128131        GpxWriter writer = new GpxWriter(baos);
    129132
     133        // CHECKSTYLE.OFF: LineLength
     134
    130135        writer.write(data);
    131136        assertEquals("<?xml version='1.0' encoding='UTF-8'?>\n" +
     
    275280                "</gpx>", baos.toString());
    276281
     282        // CHECKSTYLE.ON: LineLength
     283
    277284        writer.close();
    278285    }
Note: See TracChangeset for help on using the changeset viewer.