public CatalogFactory getFactory() { return new CatalogFactoryImpl(this); }
@Test public void testCreateInWorkspace() throws Exception { ResourcePool rp = createNiceMock(ResourcePool.class); Catalog cat = createNiceMock(Catalog.class); expect(cat.getFactory()).andReturn(new CatalogFactoryImpl(null)).anyTimes(); expect(cat.getResourcePool()).andReturn(rp).anyTimes(); WorkspaceInfo ws = createNiceMock(WorkspaceInfo.class); FeatureTypeInfo ft = createNiceMock(FeatureTypeInfo.class); expect(ft.getName()).andReturn("foo").anyTimes(); replay(rp, ft, ws, cat); StyleGenerator gen = new StyleGenerator(cat); gen.setWorkspace(ws); SimpleFeatureType schema = DataUtilities.createType("foo", "geom:Point"); StyleInfo style = gen.createStyle(new SLDHandler(), ft, schema); assertNotNull(style); assertNotNull(style.getWorkspace()); }
expect(cat.getFactory()).andReturn(new CatalogFactoryImpl(null)).anyTimes(); expect(cat.getResourcePool()).andReturn(rp).anyTimes();
expect(cat.getFactory()).andReturn(new CatalogFactoryImpl(null)).anyTimes(); expect(cat.getResourcePool()).andReturn(rp).anyTimes();
expect(catalog.getFactory()).andReturn(new CatalogFactoryImpl(catalog)).anyTimes(); expect(catalog.getResourceLoader()).andReturn(loader).anyTimes();
expect(cat.getFactory()).andReturn(new CatalogFactoryImpl(null)).anyTimes(); expect(cat.getResourcePool()).andReturn(rp).anyTimes();
login("admin", "geoserver", "ROLE_ADMINISTRATOR"); CatalogFactory catFac = new CatalogFactoryImpl(catalog); WorkspaceInfo wi; wi = catFac.createWorkspace();