Search in sources :

Example 1 with GeoserverLoadLayerRequest

use of org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadLayerRequest in project geo-platform by geosdi.

the class GPGeoserverConnectorStoreV22XTest method n_layerRasterGeoserverConnectorTest.

@Test
public void n_layerRasterGeoserverConnectorTest() throws Exception {
    GeoserverLoadLayerRequest layerRequest = geoserverConnectorStoreV2_20_x.loadLayerRequest();
    layerRequest.withName("Arc_Sample");
    logger.info("############RASTER_LAYER_GEOSERVER_CONNECTOR_RESPONSE : \n{}\n", layerRequest.getResponseAsString());
}
Also used : GeoserverLoadLayerRequest(org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadLayerRequest) Test(org.junit.Test)

Example 2 with GeoserverLoadLayerRequest

use of org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadLayerRequest in project geo-platform by geosdi.

the class GeoserverConnectorLayersTest method b_getLayer.

@Test
public void b_getLayer() throws Exception {
    RESTLayer restLayer = this.restReader.getLayer("poi");
    GeoserverLoadLayerRequest geoserverLoadLayerRequest = this.geoserverConnectorStore.loadLayerRequest().withName("poi");
    GeoserverLayer geoserverLayer = geoserverLoadLayerRequest.getResponse();
    logger.info("##########################RESOURCE_URL_REST_READER {}\n", restLayer.getResourceUrl());
    logger.info("##########################RESOURCE_URL_GEOSERVER_CONNECTOR {}\n", geoserverLayer.getLayerResource().getHref());
    logger.info("#######################GEOSERVER_LAYER: {}\n", geoserverLayer);
    List<String> styleNames = geoserverLoadLayerRequest.getResponse().getLayerStyle().getStyles().stream().map(s -> s.getName()).collect(Collectors.toList());
    assertTrue("###################STYLES_LENGTH", styleNames.size() == restLayer.getStyles().getNames().size());
    if (restLayer.getStyles() != null) {
        for (String styleName : restLayer.getStyles().getNames()) {
            logger.info("#######################STYLE_NAME: {}\n", styleName);
            assertTrue("###################STYLE NAME:", styleNames.contains(styleName));
        }
    }
}
Also used : GeoserverLayerType(org.geosdi.geoplatform.connector.geoserver.model.layers.GeoserverLayerType) GPGeoserverFeatureTypeCategory(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.category.GPGeoserverFeatureTypeCategory) LoggerFactory(org.slf4j.LoggerFactory) GPGeoserverCoverageInfo(org.geosdi.geoplatform.connector.geoserver.model.workspace.coverages.GPGeoserverCoverageInfo) IGPGeoserverStyle(org.geosdi.geoplatform.connector.geoserver.model.styles.IGPGeoserverStyle) RESTFeatureType(it.geosolutions.geoserver.rest.decoder.RESTFeatureType) Lists(com.google.common.collect.Lists) IGPGeoserverFeatureTypeInfo(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.IGPGeoserverFeatureTypeInfo) GPGeoserverFeatureTypeInfo(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.GPGeoserverFeatureTypeInfo) GPGeoserverLatLonBoundingBox(org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverLatLonBoundingBox) Arrays.asList(java.util.Arrays.asList) GeoserverLoadWorkspaceLayerRequest(org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadWorkspaceLayerRequest) GeoserverConnectorTest(org.geosdi.geoplatform.geoserver.GeoserverConnectorTest) RESTCoverage(it.geosolutions.geoserver.rest.decoder.RESTCoverage) GeoserverLoadLayerRequest(org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadLayerRequest) FALSE(java.lang.Boolean.FALSE) GeoserverLayerStyle(org.geosdi.geoplatform.connector.geoserver.model.layers.GeoserverLayerStyle) Logger(org.slf4j.Logger) GPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttributes) GPGeoserverNativeBoundingBox(org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverNativeBoundingBox) GPFeatureTypeAttribute(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttribute) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) GPGeoserverFeatureTypes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.configured.GPGeoserverFeatureTypes) GeoserverLoadFeatureTypeWithUrlRequest(org.geosdi.geoplatform.connector.geoserver.request.featuretypes.GeoserverLoadFeatureTypeWithUrlRequest) RESTLayer(it.geosolutions.geoserver.rest.decoder.RESTLayer) Collectors(java.util.stream.Collectors) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) Ignore(org.junit.Ignore) StreamSupport.stream(java.util.stream.StreamSupport.stream) GeoserverCreateFeatureTypeRequest(org.geosdi.geoplatform.connector.geoserver.request.featuretypes.GeoserverCreateFeatureTypeRequest) GPGeoserverStyle(org.geosdi.geoplatform.connector.geoserver.model.styles.GPGeoserverStyle) IGPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes) GeoserverLayer(org.geosdi.geoplatform.connector.geoserver.model.layers.GeoserverLayer) IGPFeatureTypeAttribute(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttribute) Assert(org.junit.Assert) TRUE(java.lang.Boolean.TRUE) GeoserverLayer(org.geosdi.geoplatform.connector.geoserver.model.layers.GeoserverLayer) GeoserverLoadLayerRequest(org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadLayerRequest) RESTLayer(it.geosolutions.geoserver.rest.decoder.RESTLayer) GeoserverConnectorTest(org.geosdi.geoplatform.geoserver.GeoserverConnectorTest) Test(org.junit.Test)

Example 3 with GeoserverLoadLayerRequest

use of org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadLayerRequest in project geo-platform by geosdi.

the class GeoserverConnectorLayersTest method c_getLayerWithWorkspace.

@Test
public void c_getLayerWithWorkspace() throws Exception {
    RESTLayer restLayer = this.restReader.getLayer("tiger", "poi");
    GeoserverLoadWorkspaceLayerRequest geoserverLoadLayerRequest = this.geoserverConnectorStore.loadWorkspaceLayerRequest().withLayerName("poi").withWorkspaceName("tiger");
    GeoserverLayer geoserverLayer = geoserverLoadLayerRequest.getResponse();
    logger.info("##########################STYLES_REST_READER {}\n", restLayer.getStyles().getNames());
    logger.info("#######################GEOSERVER_LAYER: {}\n", geoserverLayer);
    List<String> styleNames = geoserverLoadLayerRequest.getResponse().getLayerStyle().getStyles().stream().map(s -> s.getName()).collect(Collectors.toList());
    logger.info("#######################GEOSERVER_STYLE_NAMES: {}\n", styleNames);
    assertTrue("###################STYLES_LENGTH", styleNames.size() == restLayer.getStyles().getNames().size());
    if (restLayer.getStyles() != null) {
        for (String styleName : restLayer.getStyles().getNames()) {
            logger.info("#######################STYLE_NAME: {}\n", styleName);
            assertTrue("###################STYLE NAME:", styleNames.contains(styleName));
        }
    }
}
Also used : GeoserverLayerType(org.geosdi.geoplatform.connector.geoserver.model.layers.GeoserverLayerType) GPGeoserverFeatureTypeCategory(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.category.GPGeoserverFeatureTypeCategory) LoggerFactory(org.slf4j.LoggerFactory) GPGeoserverCoverageInfo(org.geosdi.geoplatform.connector.geoserver.model.workspace.coverages.GPGeoserverCoverageInfo) IGPGeoserverStyle(org.geosdi.geoplatform.connector.geoserver.model.styles.IGPGeoserverStyle) RESTFeatureType(it.geosolutions.geoserver.rest.decoder.RESTFeatureType) Lists(com.google.common.collect.Lists) IGPGeoserverFeatureTypeInfo(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.IGPGeoserverFeatureTypeInfo) GPGeoserverFeatureTypeInfo(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.GPGeoserverFeatureTypeInfo) GPGeoserverLatLonBoundingBox(org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverLatLonBoundingBox) Arrays.asList(java.util.Arrays.asList) GeoserverLoadWorkspaceLayerRequest(org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadWorkspaceLayerRequest) GeoserverConnectorTest(org.geosdi.geoplatform.geoserver.GeoserverConnectorTest) RESTCoverage(it.geosolutions.geoserver.rest.decoder.RESTCoverage) GeoserverLoadLayerRequest(org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadLayerRequest) FALSE(java.lang.Boolean.FALSE) GeoserverLayerStyle(org.geosdi.geoplatform.connector.geoserver.model.layers.GeoserverLayerStyle) Logger(org.slf4j.Logger) GPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttributes) GPGeoserverNativeBoundingBox(org.geosdi.geoplatform.connector.geoserver.model.bbox.GPGeoserverNativeBoundingBox) GPFeatureTypeAttribute(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.GPFeatureTypeAttribute) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) GPGeoserverFeatureTypes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.configured.GPGeoserverFeatureTypes) GeoserverLoadFeatureTypeWithUrlRequest(org.geosdi.geoplatform.connector.geoserver.request.featuretypes.GeoserverLoadFeatureTypeWithUrlRequest) RESTLayer(it.geosolutions.geoserver.rest.decoder.RESTLayer) Collectors(java.util.stream.Collectors) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) Ignore(org.junit.Ignore) StreamSupport.stream(java.util.stream.StreamSupport.stream) GeoserverCreateFeatureTypeRequest(org.geosdi.geoplatform.connector.geoserver.request.featuretypes.GeoserverCreateFeatureTypeRequest) GPGeoserverStyle(org.geosdi.geoplatform.connector.geoserver.model.styles.GPGeoserverStyle) IGPFeatureTypeAttributes(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttributes) GeoserverLayer(org.geosdi.geoplatform.connector.geoserver.model.layers.GeoserverLayer) IGPFeatureTypeAttribute(org.geosdi.geoplatform.connector.geoserver.model.featuretypes.attribute.IGPFeatureTypeAttribute) Assert(org.junit.Assert) TRUE(java.lang.Boolean.TRUE) GeoserverLoadWorkspaceLayerRequest(org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadWorkspaceLayerRequest) GeoserverLayer(org.geosdi.geoplatform.connector.geoserver.model.layers.GeoserverLayer) RESTLayer(it.geosolutions.geoserver.rest.decoder.RESTLayer) GeoserverConnectorTest(org.geosdi.geoplatform.geoserver.GeoserverConnectorTest) Test(org.junit.Test)

Example 4 with GeoserverLoadLayerRequest

use of org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadLayerRequest in project geo-platform by geosdi.

the class GPGeoserverConnectorStoreV220XTest method n_layerRasterGeoserverConnectorTest.

@Test
public void n_layerRasterGeoserverConnectorTest() throws Exception {
    GeoserverLoadLayerRequest layerRequest = geoserverConnectorStoreV2_20_x.loadLayerRequest();
    layerRequest.withName("Arc_Sample");
    logger.info("############RASTER_LAYER_GEOSERVER_CONNECTOR_RESPONSE : \n{}\n", layerRequest.getResponseAsString());
}
Also used : GeoserverLoadLayerRequest(org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadLayerRequest) Test(org.junit.Test)

Example 5 with GeoserverLoadLayerRequest

use of org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadLayerRequest in project geo-platform by geosdi.

the class GPGeoserverConnectorStoreTest method m_layerVectorGeoserverConnectorTest.

@Test
public void m_layerVectorGeoserverConnectorTest() throws Exception {
    GeoserverLoadLayerRequest layerRequest = geoserverConnectorStoreV2_21_x.loadLayerRequest();
    layerRequest.withName("giant_polygon");
    logger.info("##############VECTOR_LAYER_GEOSERVER_CONNECTOR_RESPONSE : \n{}\n", layerRequest.getResponseAsString());
}
Also used : GeoserverLoadLayerRequest(org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadLayerRequest) Test(org.junit.Test)

Aggregations

GeoserverLoadLayerRequest (org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadLayerRequest)13 Test (org.junit.Test)11 GeoserverLayer (org.geosdi.geoplatform.connector.geoserver.model.layers.GeoserverLayer)4 Lists (com.google.common.collect.Lists)3 FALSE (java.lang.Boolean.FALSE)3 TRUE (java.lang.Boolean.TRUE)3 List (java.util.List)3 Collectors.toList (java.util.stream.Collectors.toList)3 GPGeoserverFeatureTypeInfo (org.geosdi.geoplatform.connector.geoserver.model.featuretypes.GPGeoserverFeatureTypeInfo)3 GeoserverLayerStyle (org.geosdi.geoplatform.connector.geoserver.model.layers.GeoserverLayerStyle)3 GeoserverLayerType (org.geosdi.geoplatform.connector.geoserver.model.layers.GeoserverLayerType)3 GPGeoserverStyle (org.geosdi.geoplatform.connector.geoserver.model.styles.GPGeoserverStyle)3 IGPGeoserverStyle (org.geosdi.geoplatform.connector.geoserver.model.styles.IGPGeoserverStyle)3 GPGeoserverCoverageInfo (org.geosdi.geoplatform.connector.geoserver.model.workspace.coverages.GPGeoserverCoverageInfo)3 GeoserverLoadFeatureTypeWithUrlRequest (org.geosdi.geoplatform.connector.geoserver.request.featuretypes.GeoserverLoadFeatureTypeWithUrlRequest)3 GeoserverLayersRequest (org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLayersRequest)3 GeoserverLoadWorkspaceLayerRequest (org.geosdi.geoplatform.connector.geoserver.request.layers.GeoserverLoadWorkspaceLayerRequest)3 GeoserverLayerTask (org.geosdi.geoplatform.connector.store.task.GeoserverLayerTask)3 Logger (org.slf4j.Logger)3 LoggerFactory (org.slf4j.LoggerFactory)3