Ignore:
Timestamp:
2014-08-15T14:26:05+02:00 (10 years ago)
Author:
donvip
Message:

[josm_opendata] fix #josm9592 - handling of MIF file in cyrillic + CoordSys NonEarth clause

File:
1 edited

Legend:

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

    r30573 r30583  
    1111import org.openstreetmap.josm.JOSMFixture;
    1212import org.openstreetmap.josm.TestUtils;
     13import org.openstreetmap.josm.data.osm.DataSet;
     14import org.openstreetmap.josm.data.projection.Projections;
     15import org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler;
    1316import org.openstreetmap.josm.plugins.opendata.core.io.NonRegFunctionalTests;
    1417
     
    2629    }
    2730   
     31    private static AbstractDataSetHandler newHandler(final String epsgCode) {
     32        AbstractDataSetHandler handler = new AbstractDataSetHandler() {
     33            @Override
     34            public boolean acceptsFilename(String filename) {
     35                return true;
     36            }
     37            @Override
     38            public void updateDataSet(DataSet ds) {
     39            }
     40        };
     41        DefaultMifHandler mifHandler = new DefaultMifHandler();
     42        mifHandler.setCoordSysNonEarthProjection(Projections.getProjectionByCode(epsgCode));
     43        handler.setMifHandler(mifHandler);
     44        return handler;
     45    }
     46   
    2847    /**
    2948     * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/9592">#9592</a>
     
    3453        File file = new File(TestUtils.getRegressionDataFile(9592, "bg.mif"));
    3554        try (InputStream is = new FileInputStream(file)) {
    36             NonRegFunctionalTests.testGeneric("#9592", MifReader.parseDataSet(is, file, null, null));
     55            NonRegFunctionalTests.testGeneric("#9592", MifReader.parseDataSet(is, file, newHandler("EPSG:32635"), null));
    3756        }
    3857    }
Note: See TracChangeset for help on using the changeset viewer.