Added testcase trying to reproduce #11. Changed method to ProjectionPolicy.FORCE_DECLARED.
This commit is contained in:
parent
6db046a626
commit
1fdc00ce4f
@ -1199,7 +1199,9 @@ public class GeoServerRESTPublisher {
|
|||||||
String layerName, File zipFile, String nativeCrs,
|
String layerName, File zipFile, String nativeCrs,
|
||||||
String defaultStyle) throws FileNotFoundException, IllegalArgumentException {
|
String defaultStyle) throws FileNotFoundException, IllegalArgumentException {
|
||||||
|
|
||||||
return publishShp(workspace, storename, (NameValuePair[])null, layerName, UploadMethod.FILE, zipFile.toURI(), nativeCrs, ProjectionPolicy.NONE,defaultStyle);
|
return publishShp(workspace, storename, (NameValuePair[]) null,
|
||||||
|
layerName, UploadMethod.FILE, zipFile.toURI(), nativeCrs,
|
||||||
|
ProjectionPolicy.FORCE_DECLARED, defaultStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -235,6 +235,38 @@ public class GeoserverRESTShapeTest extends GeoserverRESTTest {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test case to solve error described in:
|
||||||
|
* https://github.com/geosolutions-it/geoserver-manager/issues/11
|
||||||
|
*
|
||||||
|
* @throws IllegalArgumentException
|
||||||
|
* @throws FileNotFoundException
|
||||||
|
*/
|
||||||
|
public void testPublishShpUsingDeclaredNativeCRS() throws Exception {
|
||||||
|
if (!enabled())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// layer publication params
|
||||||
|
String workspace = DEFAULT_WS;
|
||||||
|
String storename = "resttestshp";
|
||||||
|
String layerName = "cities";
|
||||||
|
File zipFile = new ClassPathResource("testdata/testshp_no_prj.zip")
|
||||||
|
.getFile();
|
||||||
|
String nativeCrs = "EPSG:4230";
|
||||||
|
String defaultStyle = null;
|
||||||
|
|
||||||
|
// Cleanup
|
||||||
|
deleteAllWorkspacesRecursively();
|
||||||
|
assertTrue(publisher.createWorkspace(workspace));
|
||||||
|
|
||||||
|
// Publish layer
|
||||||
|
assertTrue(publisher.publishShp(workspace, storename, layerName,
|
||||||
|
zipFile, nativeCrs, defaultStyle));
|
||||||
|
|
||||||
|
// Read CRS. Should be using the one indicated at publication time.
|
||||||
|
assertNotNull(reader.getLayer(layerName));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 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";
|
||||||
|
|||||||
BIN
src/test/resources/testdata/testshp_no_prj.zip
vendored
Normal file
BIN
src/test/resources/testdata/testshp_no_prj.zip
vendored
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user