Search in sources :

Example 1 with GPGeoserverFeatureTypes

use of org.geosdi.geoplatform.connector.geoserver.model.featuretypes.configured.GPGeoserverFeatureTypes in project geo-platform by geosdi.

the class GeoserverConnectorFeatureTypesTest method a_loadWorkspaceDatastoresRequestTest.

// 
@Test
public void a_loadWorkspaceDatastoresRequestTest() throws Exception {
    GPGeoserverFeatureTypeWrapper gpGeoserverFeatureTypeWrapper = this.geoserverConnectorStore.loadWorkspaceFeatureTypesRequest().withFeatureTypeCategory(GPGeoserverFeatureTypeCategory.configured).withWorkspace("topp").getResponse();
    logger.info("############{}\n", ((GPGeoserverFeatureTypes) gpGeoserverFeatureTypeWrapper.toFeatureType()).getFeatureTypes().size());
    SortedSet<String> layerNames = new TreeSet<String>();
    RESTFeatureTypeList featureTypes = this.restReader.getFeatureTypes("topp");
    for (NameLinkElem ft : featureTypes) {
        layerNames.add(ft.getName());
    }
    logger.info("############{}\n", layerNames);
}
Also used : RESTFeatureTypeList(it.geosolutions.geoserver.rest.decoder.RESTFeatureTypeList) TreeSet(java.util.TreeSet) NameLinkElem(it.geosolutions.geoserver.rest.decoder.utils.NameLinkElem) GPGeoserverFeatureTypes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.configured.GPGeoserverFeatureTypes) GPGeoserverFeatureTypeWrapper(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.wrapper.GPGeoserverFeatureTypeWrapper) Test(org.junit.Test) GeoserverConnectorTest(org.geosdi.geoplatform.geoserver.GeoserverConnectorTest)

Example 2 with GPGeoserverFeatureTypes

use of org.geosdi.geoplatform.connector.geoserver.model.featuretypes.configured.GPGeoserverFeatureTypes in project geo-platform by geosdi.

the class GPGeoserverFeatureTypesJacksonTest method a_unmarshallGeoserverFeatureTypesConfiguredFromStringTest.

@Test
public void a_unmarshallGeoserverFeatureTypesConfiguredFromStringTest() throws Exception {
    GPGeoserverFeatureTypes featureTypes = jacksonSupport.getDefaultMapper().readValue(new StringReader("{\"featureTypes\": {\n" + "    \"featureType\": [\n" + "      {\n" + "        \"name\": \"PrimitiveGeoFeature\",\n" + "        \"href\": \"http://localhost:8080/geoserver/restng/workspaces/sf/datastores/sf/featuretypes/PrimitiveGeoFeature.json\"\n" + "      },\n" + "      {\n" + "        \"name\": \"archsites\",\n" + "        \"href\": \"http://localhost:8080/geoserver/restng/workspaces/sf/datastores/sf/featuretypes/archsites.json\"\n" + "      }\n" + "    ]\n" + "  }\n" + "}"), GPGeoserverFeatureTypes.class);
    logger.info("######################GEOSERVER_FEATURE_TYPES_CONFIGURED_FROM_STRING : {}\n", featureTypes);
}
Also used : StringReader(java.io.StringReader) GPGeoserverFeatureTypes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.configured.GPGeoserverFeatureTypes) Test(org.junit.Test)

Aggregations

GPGeoserverFeatureTypes (org.geosdi.geoplatform.connector.geoserver.model.featuretypes.configured.GPGeoserverFeatureTypes)2 Test (org.junit.Test)2 RESTFeatureTypeList (it.geosolutions.geoserver.rest.decoder.RESTFeatureTypeList)1 NameLinkElem (it.geosolutions.geoserver.rest.decoder.utils.NameLinkElem)1 StringReader (java.io.StringReader)1 TreeSet (java.util.TreeSet)1 GPGeoserverFeatureTypeWrapper (org.geosdi.geoplatform.connector.geoserver.model.featuretypes.wrapper.GPGeoserverFeatureTypeWrapper)1 GeoserverConnectorTest (org.geosdi.geoplatform.geoserver.GeoserverConnectorTest)1