publisher improvements to fix issue #4
This commit is contained in:
parent
f9b640cdab
commit
9493343f1b
@ -132,10 +132,10 @@ public class GeoServerRESTPublisher {
|
||||
*/
|
||||
public boolean publishStyle(String sldBody) {
|
||||
try {
|
||||
return publishStyle(sldBody,null);
|
||||
} catch (IllegalArgumentException e){
|
||||
if (LOGGER.isEnabledFor(Level.ERROR)){
|
||||
LOGGER.error(e.getLocalizedMessage(),e);
|
||||
return publishStyle(sldBody, null);
|
||||
} catch (IllegalArgumentException e) {
|
||||
if (LOGGER.isEnabledFor(Level.ERROR)) {
|
||||
LOGGER.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -162,13 +162,15 @@ public class GeoServerRESTPublisher {
|
||||
* @throws IllegalArgumentException
|
||||
* if the style body is null or empty
|
||||
*/
|
||||
public boolean publishStyle(final String sldBody, final String name) throws IllegalArgumentException {
|
||||
if (sldBody==null || sldBody.isEmpty()){
|
||||
throw new IllegalArgumentException("The style body may not be null or empty");
|
||||
public boolean publishStyle(final String sldBody, final String name)
|
||||
throws IllegalArgumentException {
|
||||
if (sldBody == null || sldBody.isEmpty()) {
|
||||
throw new IllegalArgumentException(
|
||||
"The style body may not be null or empty");
|
||||
}
|
||||
StringBuilder sUrl = new StringBuilder(restURL);
|
||||
sUrl.append("/rest/styles");
|
||||
if (name!=null && !name.isEmpty()){
|
||||
if (name != null && !name.isEmpty()) {
|
||||
sUrl.append("?name=").append(name);
|
||||
}
|
||||
final String result = HTTPUtils.post(sUrl.toString(), sldBody,
|
||||
@ -209,6 +211,81 @@ public class GeoServerRESTPublisher {
|
||||
return result != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update SLD called as 'name'.
|
||||
* <P>
|
||||
* This is the equivalent call with cUrl:
|
||||
*
|
||||
* <PRE>
|
||||
* {@code curl -u admin:geoserver -XPUT \
|
||||
* -H 'Content-type: application/vnd.ogc.sld+xml' \
|
||||
* -d @$FULLSLD \
|
||||
* http://$GSIP:$GSPORT/$SERVLET/rest/styles/$NAME}
|
||||
* </PRE>
|
||||
*
|
||||
* @param sldBody
|
||||
* the SLD document as an XML String.
|
||||
* @param name
|
||||
* the Style name to modify.
|
||||
*
|
||||
* @return <TT>true</TT> if the operation completed successfully.
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* if the style body or name are null or empty
|
||||
*
|
||||
*/
|
||||
public boolean updateStyle(final String sldBody, final String name)
|
||||
throws IllegalArgumentException {
|
||||
if (sldBody == null || sldBody.isEmpty()) {
|
||||
throw new IllegalArgumentException(
|
||||
"The style body may not be null or empty");
|
||||
} else if (name == null || name.isEmpty()) {
|
||||
throw new IllegalArgumentException(
|
||||
"The style name may not be null or empty");
|
||||
}
|
||||
|
||||
final StringBuilder sUrl = new StringBuilder(restURL);
|
||||
sUrl.append("/rest/styles/").append(encode(name));
|
||||
|
||||
final String result = HTTPUtils.put(sUrl.toString(), sldBody,
|
||||
"application/vnd.ogc.sld+xml", gsuser, gspass);
|
||||
return result != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an SLD called 'name'.
|
||||
*
|
||||
* @param sldFile
|
||||
* the File containing the SLD document.
|
||||
* @param name
|
||||
* the Style name.
|
||||
*
|
||||
* @return <TT>true</TT> if the operation completed successfully.
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* if the sldFile file or name are null or name is empty
|
||||
*
|
||||
*/
|
||||
public boolean updateStyle(final File sldFile, final String name)
|
||||
throws IllegalArgumentException {
|
||||
|
||||
if (sldFile == null) {
|
||||
throw new IllegalArgumentException(
|
||||
"Unable to updateStyle using a null parameter file");
|
||||
} else if (name == null || name.isEmpty()) {
|
||||
throw new IllegalArgumentException(
|
||||
"The style name may not be null or empty");
|
||||
}
|
||||
|
||||
final StringBuilder sUrl = new StringBuilder(restURL);
|
||||
sUrl.append("/rest/styles/").append(encode(name));
|
||||
|
||||
final String result = HTTPUtils.put(sUrl.toString(), sldFile,
|
||||
"application/vnd.ogc.sld+xml", gsuser, gspass);
|
||||
return result != null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a Style.<br>
|
||||
*
|
||||
@ -232,7 +309,7 @@ public class GeoServerRESTPublisher {
|
||||
|
||||
final StringBuffer sUrl = new StringBuffer(restURL);
|
||||
|
||||
// check style name
|
||||
// check style name
|
||||
// TODO may we whant to throw an exception instead of
|
||||
// change style name?
|
||||
styleName = styleName.replaceAll(":", "_");
|
||||
@ -259,9 +336,9 @@ public class GeoServerRESTPublisher {
|
||||
public boolean removeStyle(String styleName) {
|
||||
try {
|
||||
return removeStyle(styleName, true);
|
||||
} catch (IllegalArgumentException e){
|
||||
if (LOGGER.isEnabledFor(Level.ERROR)){
|
||||
LOGGER.error(e.getLocalizedMessage(),e);
|
||||
} catch (IllegalArgumentException e) {
|
||||
if (LOGGER.isEnabledFor(Level.ERROR)) {
|
||||
LOGGER.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -466,7 +543,7 @@ public class GeoServerRESTPublisher {
|
||||
* @param layername
|
||||
* @param srs
|
||||
* @param defaultStyle
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
public boolean publishDBLayer(String workspace, String storename,
|
||||
String layername, String srs, String defaultStyle) {
|
||||
@ -649,7 +726,8 @@ public class GeoServerRESTPublisher {
|
||||
|
||||
if (configure != null) {
|
||||
sbUrl.append("?configure=").append(configure);
|
||||
if (params != (NameValuePair[])null && !configure.equals(ParameterConfigure.NONE)) {
|
||||
if (params != (NameValuePair[]) null
|
||||
&& !configure.equals(ParameterConfigure.NONE)) {
|
||||
final String paramString = appendParameters(params);
|
||||
if (!paramString.isEmpty()) {
|
||||
sbUrl.append("&").append(paramString);
|
||||
@ -1747,35 +1825,35 @@ public class GeoServerRESTPublisher {
|
||||
final int paramsSize = params.length;
|
||||
if (paramsSize > 0) {
|
||||
int i = 0;
|
||||
NameValuePair param=params[i];
|
||||
while (param!=null && i++<paramsSize){
|
||||
final String name=param.getName();
|
||||
final String value=param.getValue();
|
||||
NameValuePair param = params[i];
|
||||
while (param != null && i++ < paramsSize) {
|
||||
final String name = param.getName();
|
||||
final String value = param.getValue();
|
||||
// success
|
||||
if (name!=null && !name.isEmpty() && value!=null && !value.isEmpty()){
|
||||
sbUrl.append(name).append("=")
|
||||
.append(value);
|
||||
if (name != null && !name.isEmpty() && value != null
|
||||
&& !value.isEmpty()) {
|
||||
sbUrl.append(name).append("=").append(value);
|
||||
// end cycle
|
||||
param=null;
|
||||
param = null;
|
||||
} else {
|
||||
// next value
|
||||
param=params[i];
|
||||
param = params[i];
|
||||
}
|
||||
}
|
||||
for (; i < paramsSize; i++) {
|
||||
param=params[i];
|
||||
if (param!=null){
|
||||
final String name=param.getName();
|
||||
final String value=param.getValue();
|
||||
sbUrl.append(name).append("=")
|
||||
.append(value);
|
||||
if (name!=null && !name.isEmpty() && value!=null && !value.isEmpty()){
|
||||
param = params[i];
|
||||
if (param != null) {
|
||||
final String name = param.getName();
|
||||
final String value = param.getValue();
|
||||
sbUrl.append(name).append("=").append(value);
|
||||
if (name != null && !name.isEmpty() && value != null
|
||||
&& !value.isEmpty()) {
|
||||
sbUrl.append("&").append(name).append("=")
|
||||
.append(value);
|
||||
.append(value);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,182 +42,219 @@ import org.jdom.Namespace;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
|
||||
/**
|
||||
* Testcase for publishing layers on geoserver.
|
||||
* We need a running GeoServer to properly run the tests.
|
||||
* If such geoserver instance cannot be contacted, tests will be skipped.
|
||||
*
|
||||
* Testcase for publishing layers on geoserver. We need a running GeoServer to
|
||||
* properly run the tests. If such geoserver instance cannot be contacted, tests
|
||||
* will be skipped.
|
||||
*
|
||||
* @author etj
|
||||
* @author Carlo Cancellieri - carlo.cancellieri@geo-solutions.it
|
||||
*/
|
||||
public class GeoserverRESTStyleTest extends GeoserverRESTTest {
|
||||
|
||||
private final static Logger LOGGER = Logger.getLogger(GeoserverRESTStyleTest.class);
|
||||
private final static Logger LOGGER = Logger
|
||||
.getLogger(GeoserverRESTStyleTest.class);
|
||||
|
||||
public GeoserverRESTStyleTest(String testName) {
|
||||
super(testName);
|
||||
}
|
||||
public GeoserverRESTStyleTest(String testName) {
|
||||
super(testName);
|
||||
}
|
||||
|
||||
public void testStyles() throws IOException {
|
||||
if (!enabled()) return;
|
||||
deleteAll();
|
||||
public void testStyles() throws IOException {
|
||||
if (!enabled())
|
||||
return;
|
||||
deleteAll();
|
||||
|
||||
assertEquals(0, reader.getStyles().size());
|
||||
assertEquals(0, reader.getStyles().size());
|
||||
|
||||
final String styleName = "restteststyle";
|
||||
File sldFile = new ClassPathResource("testdata/restteststyle.sld").getFile();
|
||||
final String styleName = "restteststyle";
|
||||
File sldFile = new ClassPathResource("testdata/restteststyle.sld")
|
||||
.getFile();
|
||||
|
||||
// insert style
|
||||
assertTrue(publisher.publishStyle(sldFile));
|
||||
assertTrue(reader.existsStyle(styleName));
|
||||
// insert style
|
||||
assertTrue(publisher.publishStyle(sldFile));
|
||||
assertTrue(reader.existsStyle(styleName));
|
||||
|
||||
assertFalse(publisher.publishStyle(sldFile));
|
||||
assertTrue(reader.existsStyle(styleName));
|
||||
assertFalse(publisher.publishStyle(sldFile));
|
||||
assertTrue(reader.existsStyle(styleName));
|
||||
|
||||
String sld = reader.getSLD(styleName);
|
||||
assertNotNull(sld);
|
||||
String sld = reader.getSLD(styleName);
|
||||
assertNotNull(sld);
|
||||
|
||||
Element styleEl = JDOMBuilder.buildElement(sld);
|
||||
assertNotNull(styleEl);
|
||||
Element styleEl = JDOMBuilder.buildElement(sld);
|
||||
assertNotNull(styleEl);
|
||||
|
||||
Namespace SLDNS = Namespace.getNamespace("sld", "http://www.opengis.net/sld");
|
||||
Namespace SLDNS = Namespace.getNamespace("sld",
|
||||
"http://www.opengis.net/sld");
|
||||
|
||||
try{
|
||||
try {
|
||||
|
||||
assertEquals(styleName, styleEl.getChild("NamedLayer", SLDNS).getChild("Name",SLDNS).getText());
|
||||
assertEquals("STYLE FOR TESTING PURPOSES", styleEl.getChild("NamedLayer", SLDNS).getChild("UserStyle", SLDNS).getChild("Title", SLDNS).getText());
|
||||
} catch(NullPointerException npe) {
|
||||
fail("Error in SLD");
|
||||
}
|
||||
assertEquals(styleName, styleEl.getChild("NamedLayer", SLDNS)
|
||||
.getChild("Name", SLDNS).getText());
|
||||
assertEquals(
|
||||
"STYLE FOR TESTING PURPOSES",
|
||||
styleEl.getChild("NamedLayer", SLDNS)
|
||||
.getChild("UserStyle", SLDNS)
|
||||
.getChild("Title", SLDNS).getText());
|
||||
} catch (NullPointerException npe) {
|
||||
fail("Error in SLD");
|
||||
}
|
||||
|
||||
// assertEquals(1475, sld.length());
|
||||
// assertEquals(1475, sld.length());
|
||||
|
||||
assertEquals(1, reader.getStyles().size());
|
||||
}
|
||||
assertEquals(1, reader.getStyles().size());
|
||||
}
|
||||
|
||||
protected void cleanupTestStyle(final String styleName) {
|
||||
// dry run delete to work in a known state
|
||||
if (reader.existsStyle(styleName)) {
|
||||
LOGGER.info("Clearing stale test style " + styleName);
|
||||
boolean ok = publisher.removeStyle(styleName);
|
||||
if (!ok) {
|
||||
fail("Could not unpublish style " + styleName);
|
||||
}
|
||||
}
|
||||
assertFalse("Cleanup failed", reader.existsStyle(styleName));
|
||||
}
|
||||
protected void cleanupTestStyle(final String styleName) {
|
||||
// dry run delete to work in a known state
|
||||
if (reader.existsStyle(styleName)) {
|
||||
LOGGER.info("Clearing stale test style " + styleName);
|
||||
boolean ok = publisher.removeStyle(styleName);
|
||||
if (!ok) {
|
||||
fail("Could not unpublish style " + styleName);
|
||||
}
|
||||
}
|
||||
assertFalse("Cleanup failed", reader.existsStyle(styleName));
|
||||
}
|
||||
|
||||
public void testPublishDeleteStyleFile() throws FileNotFoundException, IOException {
|
||||
if (!enabled()) {
|
||||
return;
|
||||
}
|
||||
// Assume.assumeTrue(enabled);
|
||||
final String styleName = "restteststyle";
|
||||
public void testPublishDeleteStyleFile() throws FileNotFoundException,
|
||||
IOException {
|
||||
if (!enabled()) {
|
||||
return;
|
||||
}
|
||||
// Assume.assumeTrue(enabled);
|
||||
final String styleName = "restteststyle";
|
||||
|
||||
File sldFile = new ClassPathResource("testdata/restteststyle.sld").getFile();
|
||||
File sldFile = new ClassPathResource("testdata/restteststyle.sld")
|
||||
.getFile();
|
||||
|
||||
// known state?
|
||||
cleanupTestStyle(styleName);
|
||||
// known state?
|
||||
cleanupTestStyle(styleName);
|
||||
|
||||
// test insert
|
||||
boolean published = publisher.publishStyle(sldFile); // Will take the name from sld contents
|
||||
assertTrue("publish() failed", published);
|
||||
assertTrue(reader.existsStyle(styleName));
|
||||
// test insert
|
||||
boolean published = publisher.publishStyle(sldFile); // Will take the
|
||||
// name from sld
|
||||
// contents
|
||||
assertTrue("publish() failed", published);
|
||||
assertTrue(reader.existsStyle(styleName));
|
||||
|
||||
//test delete
|
||||
boolean ok = publisher.removeStyle(styleName);
|
||||
assertTrue("Unpublish() failed", ok);
|
||||
assertFalse(reader.existsStyle(styleName));
|
||||
}
|
||||
sldFile = new ClassPathResource("testdata/restteststyle2.sld").getFile();
|
||||
published = publisher.updateStyle(sldFile, styleName); // update
|
||||
assertTrue("update() failed", published);
|
||||
|
||||
public void testPublishDeleteStyleString() throws FileNotFoundException, IOException {
|
||||
if (!enabled()) {
|
||||
return;
|
||||
}
|
||||
// Assume.assumeTrue(enabled);
|
||||
String styleName = "restteststyle";
|
||||
// test delete
|
||||
boolean ok = publisher.removeStyle(styleName);
|
||||
assertTrue("Unpublish() failed", ok);
|
||||
assertFalse(reader.existsStyle(styleName));
|
||||
}
|
||||
|
||||
File sldFile = new ClassPathResource("testdata/restteststyle.sld").getFile();
|
||||
public void testPublishDeleteStyleString() throws FileNotFoundException,
|
||||
IOException {
|
||||
if (!enabled()) {
|
||||
return;
|
||||
}
|
||||
// Assume.assumeTrue(enabled);
|
||||
String styleName = "restteststyle";
|
||||
|
||||
// known state?
|
||||
cleanupTestStyle(styleName);
|
||||
File sldFile = new ClassPathResource("testdata/restteststyle.sld")
|
||||
.getFile();
|
||||
|
||||
// test insert
|
||||
String sldContent = IOUtils.toString(new FileInputStream(sldFile));
|
||||
// known state?
|
||||
cleanupTestStyle(styleName);
|
||||
|
||||
boolean published = publisher.publishStyle(sldContent); // Will take the name from sld contents
|
||||
assertTrue("publish() failed", published);
|
||||
assertTrue(reader.existsStyle(styleName));
|
||||
//test delete
|
||||
boolean ok = publisher.removeStyle(styleName);
|
||||
assertTrue("Unpublish() failed", ok);
|
||||
assertFalse(reader.existsStyle(styleName));
|
||||
|
||||
styleName = "restteststyle_with_name";
|
||||
// test insert with name
|
||||
published = publisher.publishStyle(sldContent,styleName); // Will set the name
|
||||
assertTrue("publish() failed", published);
|
||||
assertTrue(reader.existsStyle(styleName));
|
||||
//test delete
|
||||
ok = publisher.removeStyle(styleName);
|
||||
assertTrue("Unpublish() failed", ok);
|
||||
assertFalse(reader.existsStyle(styleName));
|
||||
|
||||
}
|
||||
// test insert
|
||||
String sldContent = IOUtils.toString(new FileInputStream(sldFile));
|
||||
|
||||
public void testUpdateDefaultStyle() throws FileNotFoundException, IOException {
|
||||
if (!enabled()) {
|
||||
return;
|
||||
}
|
||||
deleteAll();
|
||||
boolean published = publisher.publishStyle(sldContent); // Will take the
|
||||
// name from sld
|
||||
// contents
|
||||
assertTrue("publish() failed", published);
|
||||
assertTrue(reader.existsStyle(styleName));
|
||||
// test delete
|
||||
boolean ok = publisher.removeStyle(styleName);
|
||||
assertTrue("Unpublish() failed", ok);
|
||||
assertFalse(reader.existsStyle(styleName));
|
||||
|
||||
String storeName = "resttestshp";
|
||||
String layerName = "cities";
|
||||
styleName = "restteststyle_with_name";
|
||||
// test insert with name
|
||||
published = publisher.publishStyle(sldContent, styleName); // Will set
|
||||
// the name
|
||||
assertTrue("publish() failed", published);
|
||||
assertTrue(reader.existsStyle(styleName));
|
||||
String newSldContent = sldContent.replace(
|
||||
"<sld:Title>STYLE FOR TESTING PURPOSES</sld:Title>",
|
||||
"<sld:Title>MODIFIED STYLE FOR TESTING</sld:Title>");
|
||||
published = publisher.updateStyle(newSldContent, styleName); // update
|
||||
assertTrue("publish() failed", published);
|
||||
|
||||
final String styleName = "restteststyle";
|
||||
{
|
||||
File sldFile = new ClassPathResource("testdata/restteststyle.sld").getFile();
|
||||
cleanupTestStyle(styleName);
|
||||
boolean sldpublished = publisher.publishStyle(sldFile); // Will take the name from sld contents
|
||||
assertTrue("style publish() failed", sldpublished);
|
||||
assertTrue(reader.existsStyle(styleName));
|
||||
}
|
||||
// test delete
|
||||
ok = publisher.removeStyle(styleName);
|
||||
assertTrue("Unpublish() failed", ok);
|
||||
assertFalse(reader.existsStyle(styleName));
|
||||
|
||||
final String styleName2 = "restteststyle2";
|
||||
{
|
||||
File sldFile = new ClassPathResource("testdata/restteststyle2.sld").getFile();
|
||||
cleanupTestStyle(styleName2);
|
||||
boolean sldpublished = publisher.publishStyle(sldFile,styleName2);
|
||||
assertTrue("style publish() failed", sldpublished);
|
||||
assertTrue(reader.existsStyle(styleName2));
|
||||
}
|
||||
}
|
||||
|
||||
File zipFile = new ClassPathResource("testdata/resttestshp.zip").getFile();
|
||||
public void testUpdateDefaultStyle() throws FileNotFoundException,
|
||||
IOException {
|
||||
if (!enabled()) {
|
||||
return;
|
||||
}
|
||||
deleteAll();
|
||||
|
||||
assertTrue(publisher.createWorkspace(DEFAULT_WS));
|
||||
|
||||
// test insert
|
||||
boolean published = publisher.publishShp(DEFAULT_WS, storeName, layerName, zipFile, "EPSG:4326", styleName);
|
||||
assertTrue("publish() failed", published);
|
||||
assertTrue(existsLayer(layerName));
|
||||
String storeName = "resttestshp";
|
||||
String layerName = "cities";
|
||||
|
||||
{
|
||||
RESTLayer layer = reader.getLayer(layerName);
|
||||
LOGGER.info("Layer style is " + layer.getDefaultStyle());
|
||||
assertEquals(styleName, layer.getDefaultStyle());
|
||||
}
|
||||
final String styleName = "restteststyle";
|
||||
{
|
||||
File sldFile = new ClassPathResource("testdata/restteststyle.sld")
|
||||
.getFile();
|
||||
cleanupTestStyle(styleName);
|
||||
boolean sldpublished = publisher.publishStyle(sldFile); // Will take
|
||||
// the name
|
||||
// from sld
|
||||
// contents
|
||||
assertTrue("style publish() failed", sldpublished);
|
||||
assertTrue(reader.existsStyle(styleName));
|
||||
}
|
||||
|
||||
GSLayerEncoder le = new GSLayerEncoder();
|
||||
le.setDefaultStyle(styleName2);
|
||||
publisher.configureLayer(DEFAULT_WS, layerName, le);
|
||||
final String styleName2 = "restteststyle2";
|
||||
{
|
||||
File sldFile = new ClassPathResource("testdata/restteststyle2.sld")
|
||||
.getFile();
|
||||
cleanupTestStyle(styleName2);
|
||||
boolean sldpublished = publisher.publishStyle(sldFile, styleName2);
|
||||
assertTrue("style publish() failed", sldpublished);
|
||||
assertTrue(reader.existsStyle(styleName2));
|
||||
}
|
||||
|
||||
{
|
||||
RESTLayer layer = reader.getLayer(layerName);
|
||||
LOGGER.info("Layer style is " + layer.getDefaultStyle());
|
||||
assertEquals(styleName2, layer.getDefaultStyle());
|
||||
}
|
||||
File zipFile = new ClassPathResource("testdata/resttestshp.zip")
|
||||
.getFile();
|
||||
|
||||
// remove layer and datastore
|
||||
boolean dsRemoved = publisher.removeDatastore(DEFAULT_WS, storeName, true);
|
||||
assertTrue("removeDatastore() failed", dsRemoved);
|
||||
}
|
||||
assertTrue(publisher.createWorkspace(DEFAULT_WS));
|
||||
|
||||
// test insert
|
||||
boolean published = publisher.publishShp(DEFAULT_WS, storeName,
|
||||
layerName, zipFile, "EPSG:4326", styleName);
|
||||
assertTrue("publish() failed", published);
|
||||
assertTrue(existsLayer(layerName));
|
||||
|
||||
{
|
||||
RESTLayer layer = reader.getLayer(layerName);
|
||||
LOGGER.info("Layer style is " + layer.getDefaultStyle());
|
||||
assertEquals(styleName, layer.getDefaultStyle());
|
||||
}
|
||||
|
||||
GSLayerEncoder le = new GSLayerEncoder();
|
||||
le.setDefaultStyle(styleName2);
|
||||
publisher.configureLayer(DEFAULT_WS, layerName, le);
|
||||
|
||||
{
|
||||
RESTLayer layer = reader.getLayer(layerName);
|
||||
LOGGER.info("Layer style is " + layer.getDefaultStyle());
|
||||
assertEquals(styleName2, layer.getDefaultStyle());
|
||||
}
|
||||
|
||||
// remove layer and datastore
|
||||
boolean dsRemoved = publisher.removeDatastore(DEFAULT_WS, storeName,
|
||||
true);
|
||||
assertTrue("removeDatastore() failed", dsRemoved);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user