#102 master - fix tests
This commit is contained in:
parent
80b1767cd1
commit
6689211b5d
@ -95,7 +95,10 @@ public class GSFeatureEncoderTest extends GeoserverRESTTest {
|
|||||||
if (!GSVersionDecoder.VERSION.getVersion(VERSION).equals(
|
if (!GSVersionDecoder.VERSION.getVersion(VERSION).equals(
|
||||||
GSVersionDecoder.VERSION.UNRECOGNIZED)) {
|
GSVersionDecoder.VERSION.UNRECOGNIZED)) {
|
||||||
layerEncoder = new GSLayerEncoder();
|
layerEncoder = new GSLayerEncoder();
|
||||||
layerEncoder = new GSLayerEncoder();
|
} else if (GSVersionDecoder.VERSION.getVersion(VERSION).equals(
|
||||||
|
GSVersionDecoder.VERSION.UNRECOGNIZED)) {
|
||||||
|
layerEncoder = new GSLayerEncoder21();
|
||||||
|
}
|
||||||
layerEncoder.setEnabled(true);
|
layerEncoder.setEnabled(true);
|
||||||
layerEncoder.setQueryable(true);
|
layerEncoder.setQueryable(true);
|
||||||
layerEncoder.setAdvertised(true);
|
layerEncoder.setAdvertised(true);
|
||||||
@ -139,73 +142,10 @@ public class GSFeatureEncoderTest extends GeoserverRESTTest {
|
|||||||
|
|
||||||
assertTrue(publisher.publishDBLayer(DEFAULT_WS, storeName, fte,
|
assertTrue(publisher.publishDBLayer(DEFAULT_WS, storeName, fte,
|
||||||
layerEncoder));
|
layerEncoder));
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testIntegration1() throws IOException {
|
|
||||||
|
|
||||||
if (!enabled())
|
|
||||||
return;
|
|
||||||
deleteAll();
|
|
||||||
|
|
||||||
GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(RESTURL, RESTUSER, RESTPW);
|
|
||||||
|
|
||||||
String storeName = "resttestshp";
|
|
||||||
String layerName = "cities";
|
|
||||||
|
|
||||||
GSFeatureTypeEncoder fte = new GSFeatureTypeEncoder();
|
|
||||||
fte.setNativeName(layerName);
|
|
||||||
fte.setName(layerName + "_NEW2");
|
|
||||||
fte.setTitle("title");
|
|
||||||
fte.setNativeCRS("EPSG:4326");
|
|
||||||
fte.setDescription("desc");
|
|
||||||
fte.setEnabled(true);
|
|
||||||
|
|
||||||
//metadataLink
|
|
||||||
GSMetadataLinkInfoEncoder metadatalink = new GSMetadataLinkInfoEncoder(
|
|
||||||
"text/xml", "ISO19115:2003",
|
|
||||||
"http://www.organization.org/metadata1");
|
|
||||||
fte.addMetadataLinkInfo(metadatalink);
|
|
||||||
|
|
||||||
//use of GSLayerEncoder for GS 2.1 & before
|
|
||||||
GSLayerEncoder21 layerEncoder = null;
|
|
||||||
if (GSVersionDecoder.VERSION.getVersion(VERSION).equals(
|
|
||||||
GSVersionDecoder.VERSION.UNRECOGNIZED)) {
|
|
||||||
layerEncoder = new GSLayerEncoder21();
|
|
||||||
layerEncoder.setEnabled(true);
|
|
||||||
layerEncoder.setQueryable(true);
|
|
||||||
layerEncoder.setAdvertised(true);
|
|
||||||
|
|
||||||
layerEncoder.setDefaultStyle("point");
|
|
||||||
layerEncoder.addStyle("point2");
|
|
||||||
layerEncoder.addStyle("point3");
|
|
||||||
|
|
||||||
// authorityURL
|
|
||||||
GSAuthorityURLInfoEncoder authorityURL = new GSAuthorityURLInfoEncoder(
|
|
||||||
"authority1", "http://www.authority1.org");
|
|
||||||
GSAuthorityURLInfoEncoder authorityURL2 = new GSAuthorityURLInfoEncoder(
|
|
||||||
"authority2", "http://www.authority2.org");
|
|
||||||
layerEncoder.addAuthorityURL(authorityURL);
|
|
||||||
layerEncoder.addAuthorityURL(authorityURL2);
|
|
||||||
|
|
||||||
// identifier
|
|
||||||
GSIdentifierInfoEncoder identifier = new GSIdentifierInfoEncoder(
|
|
||||||
"authority1", "identifier1");
|
|
||||||
GSIdentifierInfoEncoder identifier2 = new GSIdentifierInfoEncoder(
|
|
||||||
"authority2", "identifier2");
|
|
||||||
layerEncoder.addIdentifier(identifier);
|
|
||||||
layerEncoder.addIdentifier(identifier2);
|
|
||||||
|
|
||||||
publisher.createWorkspace(DEFAULT_WS);
|
|
||||||
assertTrue(publisher.publishDBLayer(DEFAULT_WS, storeName, fte,
|
|
||||||
layerEncoder));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFeatureTypeEncoder() {
|
public void testFeatureTypeEncoder() {
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user