Search in sources :

Example 11 with UnaryLogicOpType

use of net.opengis.filter.v_2_0_0.UnaryLogicOpType in project ddf by codice.

the class TestWfsFilterDelegate method testLogicalNotOfComparison.

@Test
public void testLogicalNotOfComparison() throws Exception {
    String mockProperty = "myPropertyName";
    String mockType = "myType";
    WfsFilterDelegate delegate = mockFeatureMetacardCreateDelegate(mockProperty, mockType);
    FilterType filterToBeNoted = delegate.propertyIsLike(Metacard.ANY_TEXT, LITERAL, true);
    //Perform Test
    FilterType filter = delegate.not(filterToBeNoted);
    //Verify
    assertThat(filter.getLogicOps().getName().toString(), is(LOGICAL_NOT_NAME));
    UnaryLogicOpType logicOpType = (UnaryLogicOpType) filter.getLogicOps().getValue();
    PropertyIsLikeType compOpsType1 = (PropertyIsLikeType) logicOpType.getComparisonOps().getValue();
    String valRef1 = fetchPropertyIsLikeExpression(compOpsType1, VALUE_REFERENCE);
    assertThat(valRef1, is(mockProperty));
    String literal1 = fetchPropertyIsLikeExpression(compOpsType1, LITERAL);
    assertThat(literal1, is(LITERAL));
}
Also used : UnaryLogicOpType(net.opengis.filter.v_2_0_0.UnaryLogicOpType) FilterType(net.opengis.filter.v_2_0_0.FilterType) PropertyIsLikeType(net.opengis.filter.v_2_0_0.PropertyIsLikeType) Test(org.junit.Test)

Example 12 with UnaryLogicOpType

use of net.opengis.filter.v_2_0_0.UnaryLogicOpType in project ddf by codice.

the class TestWfsFilterDelegate method testDisjointAsNotIntersects.

@Test
public void testDisjointAsNotIntersects() throws SAXException, IOException, JAXBException {
    WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.Intersects.toString());
    FilterType filter = delegate.disjoint(Metacard.ANY_GEO, POLYGON);
    assertTrue(filter.getLogicOps().getValue() instanceof UnaryLogicOpType);
    UnaryLogicOpType type = (UnaryLogicOpType) filter.getLogicOps().getValue();
    assertTrue(type.getSpatialOps().getValue() instanceof BinarySpatialOpType);
    assertXMLEqual(MockWfsServer.getNotIntersectsXmlFilter(), getXmlFromMarshaller(filter));
}
Also used : UnaryLogicOpType(net.opengis.filter.v_2_0_0.UnaryLogicOpType) FilterType(net.opengis.filter.v_2_0_0.FilterType) BinarySpatialOpType(net.opengis.filter.v_2_0_0.BinarySpatialOpType) Test(org.junit.Test)

Aggregations

FilterType (net.opengis.filter.v_2_0_0.FilterType)9 UnaryLogicOpType (net.opengis.filter.v_2_0_0.UnaryLogicOpType)9 Test (org.junit.Test)9 DistanceBufferType (net.opengis.filter.v_2_0_0.DistanceBufferType)3 FilterType (net.opengis.filter.v_1_1_0.FilterType)2 UnaryLogicOpType (net.opengis.filter.v_1_1_0.UnaryLogicOpType)2 BinarySpatialOpType (net.opengis.filter.v_2_0_0.BinarySpatialOpType)2 PropertyIsLikeType (net.opengis.filter.v_2_0_0.PropertyIsLikeType)2 ArrayList (java.util.ArrayList)1 BBOXType (net.opengis.filter.v_2_0_0.BBOXType)1 BinaryLogicOpType (net.opengis.filter.v_2_0_0.BinaryLogicOpType)1 FilterType (ogc.schema.opengis.filter.v_1_0_0.FilterType)1 UnaryLogicOpType (ogc.schema.opengis.filter.v_1_0_0.UnaryLogicOpType)1