Ignore:
Timestamp:
2017-02-25T01:26:42+01:00 (8 years ago)
Author:
donvip
Message:

see #josm11761 - add non-regression unit test, disabled for now

Location:
applications/editors/josm/plugins/opendata/test
Files:
6 added
8 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/NonRegFunctionalTests.java

    r30575 r33156  
    2424
    2525public abstract class NonRegFunctionalTests {
    26    
     26
    2727    /**
    2828     * Non-regression generic test.
     
    3838            assertTrue("Node without coordinate found for "+context, latlon != null);
    3939            assertTrue("Node with invalid coordinate ("+latlon+") found for "+context, latlon.isValid());
     40            assertFalse("Node with outside world coordinate ("+latlon+") found for "+context, latlon.isOutSideWorld());
    4041        }
    4142        // and no empty ways
     
    4849        }
    4950    }
    50    
     51
    5152    /**
    5253     * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/10214">#10214</a>
     
    6566        assertTrue(found);
    6667    }
    67    
     68
    6869    /**
    6970     * Lists all datasets files matching given extension.
     
    7778        return result;
    7879    }
    79    
     80
    8081    static void addTree(Path directory, Collection<Path> all, String ext) throws IOException {
    8182        try (DirectoryStream<Path> ds = Files.newDirectoryStream(directory)) {
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/archive/ZipReaderTest.java

    r32901 r33156  
    2424     */
    2525    @Rule
    26     public JOSMTestRules rules = new JOSMTestRules().preferences().noTimeout();
     26    public JOSMTestRules rules = new JOSMTestRules().preferences().projection().noTimeout();
    2727
    2828    /**
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GmlReaderTest.java

    r33051 r33156  
    2828     */
    2929    @Rule
    30     public JOSMTestRules rules = new JOSMTestRules().preferences().timeout(60000);
     30    public JOSMTestRules rules = new JOSMTestRules().preferences().projection().timeout(60000);
    3131
    3232    /**
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/geographic/KmlReaderTest.java

    r32355 r33156  
    2626     */
    2727    @Rule
    28     public JOSMTestRules rules = new JOSMTestRules().preferences();
     28    public JOSMTestRules rules = new JOSMTestRules().preferences().projection();
    2929
    3030    /**
     
    4343        assertFalse(KmlReader.COLOR_PATTERN.matcher("yellow").matches());
    4444    }
    45    
     45
    4646    /**
    4747     * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/12694">#12694</a>
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/geographic/MifReaderTest.java

    r32545 r33156  
    2525     */
    2626    @Rule
    27     public JOSMTestRules rules = new JOSMTestRules().preferences();
     27    public JOSMTestRules rules = new JOSMTestRules().preferences().projection();
    2828
    2929    private static AbstractDataSetHandler newHandler(final String epsgCode) {
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/geographic/ShpReaderTest.java

    r32545 r33156  
    22package org.openstreetmap.josm.plugins.opendata.core.io.geographic;
    33
     4import static org.junit.Assert.assertFalse;
    45import static org.junit.Assert.assertNotNull;
     6import static org.junit.Assert.assertTrue;
    57
    68import java.io.File;
     
    1214import javax.xml.stream.XMLStreamException;
    1315
     16import org.junit.Ignore;
    1417import org.junit.Rule;
    1518import org.junit.Test;
    1619import org.openstreetmap.josm.TestUtils;
     20import org.openstreetmap.josm.data.coor.LatLon;
    1721import org.openstreetmap.josm.data.osm.Node;
    1822import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests;
     
    2832     */
    2933    @Rule
    30     public JOSMTestRules rules = new JOSMTestRules().preferences().timeout(60000);
     34    public JOSMTestRules rules = new JOSMTestRules().preferences().projection().timeout(60000);
    3135
    3236    /**
     
    4044            for (Node n : ShpReader.parseDataSet(is, file, null, null).getNodes()) {
    4145                assertNotNull(n.toString(), n.getCoor());
     46            }
     47        }
     48    }
     49
     50    /**
     51     * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/11761">#11761</a>
     52     * @throws IOException if an error occurs during reading
     53     */
     54    @Test
     55    @Ignore("work in progress")
     56    public void testTicket11761() throws IOException, XMLStreamException, FactoryConfigurationError {
     57        File file = new File(TestUtils.getRegressionDataFile(11761, "HAR.shp"));
     58        try (InputStream is = new FileInputStream(file)) {
     59            for (Node n : ShpReader.parseDataSet(is, file, null, null).getNodes()) {
     60                assertNotNull(n.toString(), n.getCoor());
     61                assertFalse(n.toString(), LatLon.ZERO.equals(n.getCoor()));
     62                assertFalse(n.toString(), n.getCoor().isOutSideWorld());
     63                assertTrue(n.toString(), n.getCoor().isValid());
    4264            }
    4365        }
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/tabular/CsvReaderTest.java

    r32898 r33156  
    2828     */
    2929    @Rule
    30     public JOSMTestRules rules = new JOSMTestRules().preferences();
     30    public JOSMTestRules rules = new JOSMTestRules().preferences().projection();
    3131
    3232    private static AbstractDataSetHandler newHandler(final String epsgCode) {
  • applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/tabular/OdsReaderTest.java

    r33049 r33156  
    2323     */
    2424    @Rule
    25     public JOSMTestRules rules = new JOSMTestRules().preferences();
     25    public JOSMTestRules rules = new JOSMTestRules().preferences().projection();
    2626
    2727    /**
Note: See TracChangeset for help on using the changeset viewer.