use of org.geotoolkit.gml.xml.v311.FeatureCollectionType in project geo-platform by geosdi.
the class WFSTransactionUpdateTest method sfRoads.
@Test
public void sfRoads() throws Exception {
WFSTransactionRequest<TransactionResponseType> request = super.serverConnector.createTransactionRequest();
request.setOperation(TransactionOperation.UPDATE);
request.setTypeName(sfRoads);
request.setFID("roads.23");
GeometryAttributeDTO geometry = new GeometryAttributeDTO();
geometry.setName("the_geom");
geometry.setSrid(new Integer(4326));
geometry.setValue("MULTILINESTRING((-103.89135254479997 44.62794736744623,-103.89096632362241 44.627735453174864,-103.89062170872486 44.62730973343466,-103.89002953848615 44.625163198149565,-103.89024101107378 44.62483551115963,-103.89114993132819 44.62388221415969,-103.89139774483179 44.623670144891136))");
request.setAttributes(Arrays.asList(geometry));
logger.info("HERE THE REQUEST SF_ROADS ########################## \n{}\n", request.showRequestAsString());
WFSGetFeatureRequest<FeatureCollectionType> requestGet = super.serverConnector.createGetFeatureRequest();
requestGet.setResultType(ResultTypeType.RESULTS.value());
requestGet.setTypeName(sfRoads);
requestGet.setFeatureIDs(Arrays.asList("roads.23"));
logger.info("HERE THE REQUEST GET_FEATURE SF_ROADS ########################## \n{}\n", requestGet.showRequestAsString());
logger.info("RESPONSE GET FEATURE SF_ROADS @@@@@@@@@@@@@@@@@@@@@@@@@@@@@ \n{}\n", requestGet.formatResponseAsString(2));
}
use of org.geotoolkit.gml.xml.v311.FeatureCollectionType in project geo-platform by geosdi.
the class GPWFSGetFeatureLayerTempoTest method e_searchLikeLayerTempoTest.
@Test
public void e_searchLikeLayerTempoTest() throws Exception {
WFSGetFeatureRequest<FeatureCollectionType> request = serverConnector.createGetFeatureRequest();
request.setResultType(RESULTS.value());
request.setTypeName(new QName("admin:tempo"));
QueryDTO queryDTO = new QueryDTO();
queryDTO.setMatchOperator("ALL");
AttributeDTO attributeDTO = new AttributeDTO();
attributeDTO.setName("string");
attributeDTO.setType("string");
QueryRestrictionDTO queryRestrictionDTO = new QueryRestrictionDTO(attributeDTO, OperatorType.LIKE, "testo");
queryDTO.setQueryRestrictionList(Arrays.asList(queryRestrictionDTO));
request.setQueryDTO(queryDTO);
logger.info("######################\n{}\n", request.showRequestAsString());
FeatureCollectionType response = request.getResponse();
assertTrue(response.getNumberOfFeatures().intValue() == 7);
}
use of org.geotoolkit.gml.xml.v311.FeatureCollectionType in project geo-platform by geosdi.
the class WFSGetFeatureTest method m_statesSecureNotContainsRestrictionTest.
@Test
public void m_statesSecureNotContainsRestrictionTest() throws Exception {
WFSGetFeatureRequest<FeatureCollectionType> request = secureServerConnector.createGetFeatureRequest();
request.setTypeName(statesName);
request.setResultType(HITS.value());
request.setQueryDTO(GPJAXBContextBuilder.newInstance().unmarshal(new StringReader("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<QueryDTO>\n" + " <matchOperator>NONE</matchOperator>\n" + " <queryRestrictionList>\n" + " <queryRestriction>\n" + " <attribute>\n" + " <maxOccurs>1</maxOccurs>\n" + " <minOccurs>0</minOccurs>\n" + " <name>SUB_REGION</name>\n" + " <nillable>true</nillable>\n" + " <type>string</type>\n" + " <value></value>\n" + " </attribute>\n" + " <operator>CONTAINS</operator>\n" + " <restriction>Mtn</restriction>\n" + " </queryRestriction>\n" + " </queryRestrictionList>\n" + "</QueryDTO>"), QueryDTO.class));
logger.info("#############################REQUEST_AS_STRING : \n{}\n", request.showRequestAsString());
FeatureCollectionType response = request.getResponse();
logger.info("#####################################statesSecureNotContainsRestrictionTest#Features {}\n", response.getNumberOfFeatures().intValue());
}
use of org.geotoolkit.gml.xml.v311.FeatureCollectionType in project geo-platform by geosdi.
the class WFSGetFeatureTest method q_statesSecureNotGreatherThanRestrictionTest.
@Test
public void q_statesSecureNotGreatherThanRestrictionTest() throws Exception {
WFSGetFeatureRequest<FeatureCollectionType> request = secureServerConnector.createGetFeatureRequest();
request.setTypeName(statesName);
request.setResultType(HITS.value());
request.setQueryDTO(GPJAXBContextBuilder.newInstance().unmarshal(new StringReader("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + "<QueryDTO>\n" + " <matchOperator>NONE</matchOperator>\n" + " <queryRestrictionList>\n" + " <queryRestriction>\n" + " <attribute>\n" + " <maxOccurs>1</maxOccurs>\n" + " <minOccurs>0</minOccurs>\n" + " <name>WORKERS</name>\n" + " <nillable>true</nillable>\n" + " <type>double</type>\n" + " <value></value>\n" + " </attribute>\n" + " <operator>GREATER</operator>\n" + " <restriction>6000000</restriction>\n" + " </queryRestriction>\n" + " </queryRestrictionList>\n" + "</QueryDTO>"), QueryDTO.class));
logger.info("#############################REQUEST_AS_STRING : \n{}\n", request.showRequestAsString());
FeatureCollectionType response = request.getResponse();
logger.info("########################################statesSecureNotGreatherThanRestrictionTest#Features : {}\n", response.getNumberOfFeatures().intValue());
}
use of org.geotoolkit.gml.xml.v311.FeatureCollectionType in project geo-platform by geosdi.
the class WFSGetFeatureTest method d_secureStatesHitsQueryRestrictions.
@Test
public void d_secureStatesHitsQueryRestrictions() throws Exception {
WFSGetFeatureRequest<FeatureCollectionType> request = secureServerConnector.createGetFeatureRequest();
request.setResultType(HITS.value());
request.setTypeName(statesName);
request.setQueryDTO(queryDTOAnd);
logger.info("######################\n{}\n", request.showRequestAsString());
FeatureCollectionType response = request.getResponse();
logger.info("###############################secureStatesHitsQueryRestrictions#Features {}\n", response.getNumberOfFeatures().intValue());
}
Aggregations