Ejemplo n.º 1
0
 @Override
 protected void onSetUp(SystemTestData testData) throws Exception {
   GeoServer geoServer = getGeoServer();
   geoServer.addListener(
       new ServicePersister(
           (List) Arrays.asList(new ServiceLoader(getResourceLoader())), geoServer));
 }
Ejemplo n.º 2
0
 @Before
 public void removeFooService() {
   GeoServer geoServer = getGeoServer();
   WorkspaceInfo ws = getCatalog().getDefaultWorkspace();
   ServiceInfo s = geoServer.getServiceByName(ws, "foo", ServiceInfo.class);
   if (s != null) {
     geoServer.remove(s);
   }
 }
Ejemplo n.º 3
0
  @Test
  public void testRemoveWorkspaceLocalService() throws Exception {
    testAddWorkspaceLocalService();

    File dataDirRoot = getTestData().getDataDirectoryRoot();
    WorkspaceInfo ws = getCatalog().getDefaultWorkspace();

    File f = new File(dataDirRoot, "workspaces" + "/" + ws.getName() + "/service.xml");
    assertTrue(f.exists());

    ServiceInfo s = geoServer.getServiceByName(ws, "foo", ServiceInfo.class);
    geoServer.remove(s);
    assertFalse(f.exists());
  }
Ejemplo n.º 4
0
  @Test
  public void testAddWorkspaceLocalService() throws Exception {
    File dataDirRoot = getTestData().getDataDirectoryRoot();
    WorkspaceInfo ws = getCatalog().getDefaultWorkspace();

    ServiceInfo s = geoServer.getFactory().createService();
    s.setName("foo");
    s.setWorkspace(ws);

    File f = new File(dataDirRoot, "workspaces" + "/" + ws.getName() + "/service.xml");
    assertFalse(f.exists());

    geoServer.add(s);
    assertTrue(f.exists());
  }