@Test public void testLoadInitialMap() throws Exception { InputStream geocognitionStream = GeocognitionElement.class.getResourceAsStream(GeocognitionTest.STARTUP_GEOCOGNITION_XML); gc.read(geocognitionStream); assertNotNull(gc.getGeocognitionElement(GeocognitionView.FIRST_MAP)); }
@Before public void setUp() throws Exception { Services.registerService(ErrorManager.class, "", new DefaultErrorManager()); TestWorkspace workspace = new TestWorkspace(); workspace.setWorkspaceFolder("target"); Services.registerService(Workspace.class, "", workspace); Services.registerService( ApplicationInfo.class, "Gets information about the application: " + "name, version, etc.", new OrbisGISApplicationInfo()); OrbisgisUIServices.installServices(); gc = new DefaultGeocognition(); gc.addElementFactory(new GeocognitionSymbolFactory()); gc.addElementFactory(new GeocognitionLegendFactory()); gc.addElementFactory(new GeocognitionMapContextFactory()); }
@Ignore @Test public void testLoadAndCheckInitialGeocognition() throws Exception { InputStream geocognitionStream = GeocognitionElement.class.getResourceAsStream(GeocognitionTest.STARTUP_GEOCOGNITION_XML); gc.read(geocognitionStream); GeocognitionElement[] elems = gc.getElements( new GeocognitionFilter() { @Override public boolean accept(GeocognitionElement element) { return true; } }); for (GeocognitionElement elem : elems) { assertNotNull(elem.getObject()); } }