Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1084660006 | ||
|
|
07bd7ac1c3 | ||
|
|
ef6cddc909 | ||
|
|
21fdc7fed5 | ||
|
|
e34ac27d07 | ||
|
|
4c7a803f74 | ||
|
|
4ea4e9e523 |
2
pom.xml
2
pom.xml
@ -14,7 +14,7 @@
|
||||
DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN * THE SOFTWARE. -->
|
||||
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -60,35 +60,37 @@ public class GSLayerEncoder extends PropertyXMLEncoder {
|
||||
else
|
||||
set("enabled","false");
|
||||
}
|
||||
|
||||
private final static String DESCRIPTION = "description";
|
||||
/**
|
||||
* Add the 'description' node with a text value from 'description'
|
||||
*
|
||||
*/
|
||||
protected void addDescription(final String description) {
|
||||
add(DESCRIPTION, description);
|
||||
}
|
||||
/**
|
||||
* Set or modify the 'description' node with a text value from 'description'
|
||||
*/
|
||||
public void setDescription(final String description) {
|
||||
set(DESCRIPTION, description);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @param name the name of the layer
|
||||
// */
|
||||
// protected void addName(final String name){
|
||||
// add("name",name);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @return name the name of the layer or null
|
||||
// */
|
||||
// public String getName() {
|
||||
// final Element nameNode = get("name");
|
||||
// if (nameNode != null)
|
||||
// return nameNode.getText();
|
||||
// else
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @param name the name of the layer
|
||||
// * @throws IllegalArgumentException
|
||||
// */
|
||||
// public void setName(final String name) throws IllegalArgumentException {
|
||||
// if (name==null || name.isEmpty())
|
||||
// throw new IllegalArgumentException("Unable to set an empty or null parameter");
|
||||
// set("name",name);
|
||||
// }
|
||||
|
||||
// queryable
|
||||
private final static String QUERYABLE = "queryable";
|
||||
/**
|
||||
* Add the 'queryable' node with a text value from 'queryable' (true as default)
|
||||
*/
|
||||
protected void addQueryable(final String queryable) {
|
||||
add(QUERYABLE, queryable!=null?queryable.toString():"true");
|
||||
}
|
||||
/**
|
||||
* Set or modify the 'queryable' node with a text value from 'queryable' (true as default)
|
||||
*/
|
||||
public void setQueryable(final Boolean queryable) {
|
||||
set(QUERYABLE, queryable!=null?queryable.toString():"true");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link GSLayerEncoder#setWmsPath(String)}
|
||||
*
|
||||
|
||||
@ -194,6 +194,38 @@ public abstract class GSResourceEncoder
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
private final static String DESCRIPTION = "description";
|
||||
|
||||
/**
|
||||
* Add the 'description' node with a text value from 'description'
|
||||
*
|
||||
*/
|
||||
protected void addDescription(final String description) {
|
||||
add(DESCRIPTION, description);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set or modify the 'description' node with a text value from 'description'
|
||||
*/
|
||||
public void setDescription(final String description) {
|
||||
set(DESCRIPTION, description);
|
||||
}
|
||||
|
||||
private final static String ABSTRACT = "abstract";
|
||||
/**
|
||||
* Add the 'abstract' node with a text value from 'abstract'
|
||||
*
|
||||
*/
|
||||
protected void addAbstract(final String _abstract) {
|
||||
add(ABSTRACT, _abstract);
|
||||
}
|
||||
/**
|
||||
* Set or modify the 'abstract' node with a text value from 'abstract'
|
||||
*/
|
||||
public void setAbstract(final String _abstract) {
|
||||
set(ABSTRACT, _abstract);
|
||||
}
|
||||
|
||||
private final static String TITLE = "title";
|
||||
|
||||
|
||||
@ -229,7 +229,7 @@ public abstract class GeoserverRESTTest extends Assert {
|
||||
List<String> workspaces = reader.getWorkspaceNames();
|
||||
for (String workspace : workspaces) {
|
||||
LOGGER.warn("Deleting Workspace " + workspace );
|
||||
boolean removed = publisher.removeWorkspace(workspace,false);
|
||||
boolean removed = publisher.removeWorkspace(workspace,true);
|
||||
assertTrue("Workspace not removed " + workspace, removed );
|
||||
|
||||
}
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
package it.geosolutions.geoserver.rest.publisher;
|
||||
|
||||
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.encoder.GSResourceEncoder.ProjectionPolicy;
|
||||
|
||||
@ -33,6 +34,8 @@ import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -49,18 +52,19 @@ public class GeoserverRESTGeoTiffTest extends GeoserverRESTTest {
|
||||
|
||||
private final static Logger LOGGER = LoggerFactory.getLogger(GeoserverRESTGeoTiffTest.class);
|
||||
|
||||
String storeName = "testRESTStoreGeotiff";
|
||||
String layerName = "resttestdem";
|
||||
|
||||
@Test
|
||||
public void testExternalGeotiff() throws FileNotFoundException, IOException {
|
||||
if (!enabled()) return;
|
||||
deleteAll();
|
||||
|
||||
String storeName = "testRESTStoreGeotiff";
|
||||
String layerName = "resttestdem";
|
||||
File geotiff = new ClassPathResource("testdata/resttestdem.tif").getFile();
|
||||
|
||||
assertTrue(reader.getWorkspaces().isEmpty());
|
||||
assertTrue(publisher.createWorkspace(DEFAULT_WS));
|
||||
|
||||
File geotiff = new ClassPathResource("testdata/resttestdem.tif").getFile();
|
||||
|
||||
// known state?
|
||||
assertFalse("Cleanup failed", existsLayer(layerName));
|
||||
@ -87,14 +91,11 @@ public class GeoserverRESTGeoTiffTest extends GeoserverRESTTest {
|
||||
if (!enabled()) return;
|
||||
deleteAll();
|
||||
|
||||
String storeName = "testRESTStoreGeotiff";
|
||||
String layerName = "resttestdem";
|
||||
|
||||
File geotiff = new ClassPathResource("testdata/resttestdem.tif").getFile();
|
||||
|
||||
assertTrue(reader.getWorkspaces().isEmpty());
|
||||
assertTrue(publisher.createWorkspace(DEFAULT_WS));
|
||||
|
||||
File geotiff = new ClassPathResource("testdata/resttestdem.tif").getFile();
|
||||
|
||||
// known state?
|
||||
assertFalse("Cleanup failed", existsLayer(layerName));
|
||||
|
||||
@ -115,4 +116,23 @@ public class GeoserverRESTGeoTiffTest extends GeoserverRESTTest {
|
||||
//delete
|
||||
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 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);
|
||||
}
|
||||
|
||||
|
||||
// public void testDeleteUnexistingFT() throws FileNotFoundException, IOException {
|
||||
// String wsName = "this_ws_does_not_exist";
|
||||
// String storeName = "this_store_does_not_exist";
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
|
||||
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.GeoserverRESTTest;
|
||||
import it.geosolutions.geoserver.rest.decoder.RESTLayer;
|
||||
@ -39,6 +40,7 @@ import java.io.IOException;
|
||||
import org.apache.commons.httpclient.NameValuePair;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -62,13 +64,34 @@ public class GeoserverRESTShapeTest extends GeoserverRESTTest {
|
||||
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
|
||||
public void testPublishDeleteShapeZip() throws FileNotFoundException, IOException {
|
||||
if (!enabled()) {
|
||||
return;
|
||||
}
|
||||
// Assume.assumeTrue(enabled);
|
||||
|
||||
assertTrue(publisher.createWorkspace(DEFAULT_WS));
|
||||
|
||||
String storeName = "resttestshp";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user