Selective reload improvement fix to close issue 43
This commit is contained in:
parent
e34ac27d07
commit
21fdc7fed5
File diff suppressed because it is too large
Load Diff
@ -229,7 +229,7 @@ public abstract class GeoserverRESTTest extends Assert {
|
|||||||
List<String> workspaces = reader.getWorkspaceNames();
|
List<String> workspaces = reader.getWorkspaceNames();
|
||||||
for (String workspace : workspaces) {
|
for (String workspace : workspaces) {
|
||||||
LOGGER.warn("Deleting Workspace " + workspace );
|
LOGGER.warn("Deleting Workspace " + workspace );
|
||||||
boolean removed = publisher.removeWorkspace(workspace,false);
|
boolean removed = publisher.removeWorkspace(workspace,true);
|
||||||
assertTrue("Workspace not removed " + workspace, removed );
|
assertTrue("Workspace not removed " + workspace, removed );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,6 +26,7 @@
|
|||||||
package it.geosolutions.geoserver.rest.publisher;
|
package it.geosolutions.geoserver.rest.publisher;
|
||||||
|
|
||||||
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
||||||
|
import it.geosolutions.geoserver.rest.GeoServerRESTPublisher.StoreType;
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTCoverageStore;
|
import it.geosolutions.geoserver.rest.decoder.RESTCoverageStore;
|
||||||
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy;
|
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy;
|
||||||
|
|
||||||
@ -33,6 +34,8 @@ import java.io.File;
|
|||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -49,18 +52,19 @@ public class GeoserverRESTGeoTiffTest extends GeoserverRESTTest {
|
|||||||
|
|
||||||
private final static Logger LOGGER = LoggerFactory.getLogger(GeoserverRESTGeoTiffTest.class);
|
private final static Logger LOGGER = LoggerFactory.getLogger(GeoserverRESTGeoTiffTest.class);
|
||||||
|
|
||||||
|
String storeName = "testRESTStoreGeotiff";
|
||||||
|
String layerName = "resttestdem";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExternalGeotiff() throws FileNotFoundException, IOException {
|
public void testExternalGeotiff() throws FileNotFoundException, IOException {
|
||||||
if (!enabled()) return;
|
if (!enabled()) return;
|
||||||
deleteAll();
|
deleteAll();
|
||||||
|
|
||||||
String storeName = "testRESTStoreGeotiff";
|
File geotiff = new ClassPathResource("testdata/resttestdem.tif").getFile();
|
||||||
String layerName = "resttestdem";
|
|
||||||
|
|
||||||
assertTrue(reader.getWorkspaces().isEmpty());
|
assertTrue(reader.getWorkspaces().isEmpty());
|
||||||
assertTrue(publisher.createWorkspace(DEFAULT_WS));
|
assertTrue(publisher.createWorkspace(DEFAULT_WS));
|
||||||
|
|
||||||
File geotiff = new ClassPathResource("testdata/resttestdem.tif").getFile();
|
|
||||||
|
|
||||||
// known state?
|
// known state?
|
||||||
assertFalse("Cleanup failed", existsLayer(layerName));
|
assertFalse("Cleanup failed", existsLayer(layerName));
|
||||||
@ -87,14 +91,11 @@ public class GeoserverRESTGeoTiffTest extends GeoserverRESTTest {
|
|||||||
if (!enabled()) return;
|
if (!enabled()) return;
|
||||||
deleteAll();
|
deleteAll();
|
||||||
|
|
||||||
String storeName = "testRESTStoreGeotiff";
|
File geotiff = new ClassPathResource("testdata/resttestdem.tif").getFile();
|
||||||
String layerName = "resttestdem";
|
|
||||||
|
|
||||||
assertTrue(reader.getWorkspaces().isEmpty());
|
assertTrue(reader.getWorkspaces().isEmpty());
|
||||||
assertTrue(publisher.createWorkspace(DEFAULT_WS));
|
assertTrue(publisher.createWorkspace(DEFAULT_WS));
|
||||||
|
|
||||||
File geotiff = new ClassPathResource("testdata/resttestdem.tif").getFile();
|
|
||||||
|
|
||||||
// known state?
|
// known state?
|
||||||
assertFalse("Cleanup failed", existsLayer(layerName));
|
assertFalse("Cleanup failed", existsLayer(layerName));
|
||||||
|
|
||||||
@ -115,4 +116,23 @@ public class GeoserverRESTGeoTiffTest extends GeoserverRESTTest {
|
|||||||
//delete
|
//delete
|
||||||
assertTrue("Unpublish() failed", publisher.removeCoverageStore(DEFAULT_WS, storeName,true));
|
assertTrue("Unpublish() failed", publisher.removeCoverageStore(DEFAULT_WS, storeName,true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testReloadCoverageStore() throws FileNotFoundException, IOException {
|
||||||
|
if (!enabled()) return;
|
||||||
|
deleteAll();
|
||||||
|
|
||||||
|
File geotiff = new ClassPathResource("testdata/resttestdem.tif").getFile();
|
||||||
|
|
||||||
|
assertTrue(publisher.createWorkspace(DEFAULT_WS));
|
||||||
|
|
||||||
|
// test insert
|
||||||
|
boolean pub = publisher.publishGeoTIFF(DEFAULT_WS, storeName, geotiff);
|
||||||
|
|
||||||
|
assertNotNull("publish() failed", pub);
|
||||||
|
|
||||||
|
// test reload
|
||||||
|
assertTrue(publisher.reloadStore(DEFAULT_WS, storeName, StoreType.COVERAGESTORES));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -105,11 +105,10 @@ public class GeoserverRESTPublisherTest extends GeoserverRESTTest {
|
|||||||
String wsName = "this_ws_does_not_exist";
|
String wsName = "this_ws_does_not_exist";
|
||||||
String storeName = "this_store_does_not_exist";
|
String storeName = "this_store_does_not_exist";
|
||||||
|
|
||||||
boolean ok = publisher.removeDatastore(wsName, storeName);
|
boolean ok = publisher.removeDatastore(wsName, storeName,true);
|
||||||
assertFalse("removed not existing datastore", ok);
|
assertFalse("removed not existing datastore", ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// public void testDeleteUnexistingFT() throws FileNotFoundException, IOException {
|
// public void testDeleteUnexistingFT() throws FileNotFoundException, IOException {
|
||||||
// String wsName = "this_ws_does_not_exist";
|
// String wsName = "this_ws_does_not_exist";
|
||||||
// String storeName = "this_store_does_not_exist";
|
// String storeName = "this_store_does_not_exist";
|
||||||
|
|||||||
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
package it.geosolutions.geoserver.rest.publisher;
|
package it.geosolutions.geoserver.rest.publisher;
|
||||||
|
|
||||||
|
import it.geosolutions.geoserver.rest.GeoServerRESTPublisher.StoreType;
|
||||||
import it.geosolutions.geoserver.rest.GeoServerRESTPublisher.UploadMethod;
|
import it.geosolutions.geoserver.rest.GeoServerRESTPublisher.UploadMethod;
|
||||||
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTLayer;
|
import it.geosolutions.geoserver.rest.decoder.RESTLayer;
|
||||||
@ -39,6 +40,7 @@ import java.io.IOException;
|
|||||||
import org.apache.commons.httpclient.NameValuePair;
|
import org.apache.commons.httpclient.NameValuePair;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -62,13 +64,34 @@ public class GeoserverRESTShapeTest extends GeoserverRESTTest {
|
|||||||
deleteAllWorkspaces();
|
deleteAllWorkspaces();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testReloadDataStore() throws FileNotFoundException, IOException {
|
||||||
|
if (!enabled())
|
||||||
|
return;
|
||||||
|
|
||||||
|
assertTrue(publisher.createWorkspace(DEFAULT_WS));
|
||||||
|
|
||||||
|
String storeName = "resttestshp";
|
||||||
|
String layerName = "cities";
|
||||||
|
|
||||||
|
File zipFile = new ClassPathResource("testdata/resttestshp.zip").getFile();
|
||||||
|
|
||||||
|
|
||||||
|
// test insert
|
||||||
|
boolean published = publisher.publishShp(DEFAULT_WS, storeName, layerName, zipFile);
|
||||||
|
assertTrue("publish() failed", published);
|
||||||
|
|
||||||
|
// test reload
|
||||||
|
assertTrue(publisher.reloadStore(DEFAULT_WS, storeName, StoreType.DATASTORES));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPublishDeleteShapeZip() throws FileNotFoundException, IOException {
|
public void testPublishDeleteShapeZip() throws FileNotFoundException, IOException {
|
||||||
if (!enabled()) {
|
if (!enabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Assume.assumeTrue(enabled);
|
|
||||||
assertTrue(publisher.createWorkspace(DEFAULT_WS));
|
assertTrue(publisher.createWorkspace(DEFAULT_WS));
|
||||||
|
|
||||||
String storeName = "resttestshp";
|
String storeName = "resttestshp";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user