public void reset() { // drop all the catalog store/feature types/raster caches catalog.getResourcePool().dispose(); // reset the referencing subsystem CRS.reset("all"); // look for pluggable handlers for (GeoServerLifecycleHandler handler : GeoServerExtensions.extensions(GeoServerLifecycleHandler.class)) { try { handler.onReset(); } catch (Throwable t) { LOGGER.log( Level.SEVERE, "A GeoServer lifecycle handler threw an exception during reset", t); } } } }
@Override protected void setUpTestData(SystemTestData testData) throws Exception { new File(testData.getDataDirectoryRoot(), "user_projections").mkdir(); testData.copyTo( OverrideCRSTest.class.getResourceAsStream("test_override_epsg.properties"), "user_projections/epsg_overrides.properties"); CRS.reset("all"); testData.setUpSecurity(); }
CRS.reset("all"); LOGGER.info("Shut down GT referencing threads ");
@Override protected void onSetUp(SystemTestData testData) throws Exception { OLD_TMP_VALUE = System.getProperty(JAVA_IO_TMPDIR); System.setProperty(JAVA_IO_TMPDIR, new File("./target").getCanonicalPath()); super.onSetUp(testData); GeoServerResourceLoader loader1 = getResourceLoader(); GeoServerResourceLoader loader2 = GeoServerExtensions.bean(GeoServerResourceLoader.class); // setup the grid file, the definitions and the tx overrides new File(testData.getDataDirectoryRoot(), "user_projections").mkdir(); testData.copyTo( OvverideTransformationsTest.class.getResourceAsStream("test_epsg.properties"), "user_projections/epsg.properties"); testData.copyTo( OvverideTransformationsTest.class.getResourceAsStream( "test_epsg_operations.properties"), "user_projections/epsg_operations.properties"); testData.copyTo( OvverideTransformationsTest.class.getResourceAsStream("stgeorge.las"), "user_projections/stgeorge.las"); testData.copyTo( OvverideTransformationsTest.class.getResourceAsStream("stgeorge.los"), "user_projections/stgeorge.los"); CRS.reset("all"); }
System.setProperty("org.geotools.referencing.forceXY", "true"); Hints.putSystemDefault(Hints.FORCE_AXIS_ORDER_HONORING, "http"); CRS.reset("all");
@BeforeClass public static void setupClass() { System.clearProperty("org.geotools.referencing.forceXY"); CRS.reset("all"); }
@BeforeClass public static void setup() { // System.setProperty("org.geotools.test.interactive", "true"); System.setProperty(GeoTools.FORCE_LONGITUDE_FIRST_AXIS_ORDER, "false"); CRS.reset("all"); }
@AfterClass public static void clearClass() { System.clearProperty("org.geotools.referencing.forceXY"); CRS.reset("all"); }
@BeforeClass public static void setupClass() { System.clearProperty("org.geotools.referencing.forceXY"); CRS.reset("all"); }
@BeforeClass public static void cleanupCRS() { System.setProperty(GeoTools.FORCE_LONGITUDE_FIRST_AXIS_ORDER, "true"); CRS.reset("all"); }
@AfterClass public static void close() { System.clearProperty(GeoTools.FORCE_LONGITUDE_FIRST_AXIS_ORDER); CRS.reset("all"); }
protected void tearDownInternal() throws Exception { System.clearProperty("org.geotools.referencing.forceXY"); Hints.removeSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER); CRS.reset("all"); }
@BeforeClass public static void setupClass() { System.clearProperty("org.geotools.referencing.forceXY"); CRS.reset("all"); }
@BeforeClass public static void init() { // make sure CRS ordering is correct CRS.reset("all"); System.setProperty(GeoTools.FORCE_LONGITUDE_FIRST_AXIS_ORDER, "true"); }
@BeforeClass public static void setupClass() { System.setProperty("org.geotools.referencing.forceXY", "true"); CRS.reset("all"); }
@BeforeClass public static void prepareCRS() { CRS.reset("all"); }
@BeforeClass public static void setupCRS() throws FactoryException { CRS.reset("all"); Hints.putSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE); // the following is only to make the test work in Eclipse, where the test // classpath is tainted by the test classpath of dependent modules (whilst in Maven it's // not) Set<CRSAuthorityFactory> factories = ReferencingFactoryFinder.getCRSAuthorityFactories(null); for (CRSAuthorityFactory factory : factories) { if (factory.getClass().getSimpleName().equals("EPSGCRSAuthorityFactory")) { ReferencingFactoryFinder.removeAuthorityFactory(factory); } } assertEquals( AxisOrder.NORTH_EAST, CRS.getAxisOrder(CRS.decode("urn:ogc:def:crs:EPSG::4326"))); }
public void testSRSAxisOrder() throws Exception { try { CoordinateReferenceSystem crs = CRS.decode("EPSG:4326"); assertEquals("EPSG:4326", CRS.toSRS(crs)); Hints.putSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE); CRS.reset("ALL"); assertEquals("urn:ogc:def:crs:EPSG::4326", CRS.toSRS(crs)); } finally { Hints.removeSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER); } }
/** Adds the extra factory to the set of authority factories. */ @Before public void setUp() { assertNull(extra); CRS.reset("all"); extra = new FactoryEPSGExtra(); ReferencingFactoryFinder.addAuthorityFactory(extra); ReferencingFactoryFinder.scanForPlugins(); }
CRS.reset("all"); System.setProperty("org.geotools.referencing.forceXY", "true"); CRS.reset("all"); Hints.putSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE); assertEquals(AxisOrder.EAST_NORTH, CRS.getAxisOrder(CRS.decode("EPSG:4326", false))); CRS.reset("all"); assertEquals(AxisOrder.NORTH_EAST, CRS.getAxisOrder(CRS.decode("EPSG:4326", false))); assertEquals(AxisOrder.EAST_NORTH, CRS.getAxisOrder(CRS.decode("EPSG:4326", true))); CRS.reset("all"); System.setProperty("org.geotools.referencing.forceXY", "true"); assertEquals(AxisOrder.EAST_NORTH, CRS.getAxisOrder(CRS.decode("EPSG:4326", false)));