Compare commits

...

7 Commits

Author SHA1 Message Date
ccancellieri
1084660006 prepare for the next release iteration 2012-09-28 18:47:12 +02:00
ccancellieri
07bd7ac1c3 1.4.4 release 2012-09-28 18:40:43 +02:00
ccancellieri
ef6cddc909 Adding support to resourceEncoder for Description, Abstract and layerEncoder queriable 2012-09-27 13:42:38 +02:00
ccancellieri
21fdc7fed5 Selective reload improvement fix to close issue 43 2012-09-27 13:42:26 +02:00
Simone Giannecchini
e34ac27d07 [maven-release-plugin] prepare for next development iteration 2012-08-20 13:53:52 +02:00
Simone Giannecchini
4c7a803f74 [maven-release-plugin] prepare release v1.4.3 2012-08-20 13:53:40 +02:00
Simone Giannecchini
4ea4e9e523 fake push on 1.4.x 2012-08-10 18:11:42 +02:00
8 changed files with 1810 additions and 2093 deletions

View File

@ -61,33 +61,35 @@ public class GSLayerEncoder extends PropertyXMLEncoder {
set("enabled","false");
}
// /**
// * @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);
// }
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);
}
// 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)}

View File

@ -195,6 +195,38 @@ public abstract class GSResourceEncoder
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";
/**

View File

@ -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 );
}

View File

@ -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));
}
}

View File

@ -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";

View File

@ -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;
@ -63,12 +65,33 @@ public class GeoserverRESTShapeTest extends GeoserverRESTTest {
}
}
@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";