use of org.geotoolkit.ogc.xml.v100.PropertyIsNullType in project geotoolkit by Geomatys.
the class OGC100Test method testFilterComparisonPropertyIsNull.
@Test
public void testFilterComparisonPropertyIsNull() throws JAXBException {
final Unmarshaller UNMARSHALLER = POOL.acquireUnmarshaller();
final Marshaller MARSHALLER = POOL.acquireMarshaller();
// Read test
Object obj = UNMARSHALLER.unmarshal(FILE_FIL_COMP_ISNULL);
assertNotNull(obj);
JAXBElement<? extends FilterType> jaxfilter = (JAXBElement<? extends FilterType>) obj;
assertNotNull(jaxfilter);
Filter filter = TRANSFORMER_GT.visitFilter(jaxfilter.getValue());
assertNotNull(filter);
NullOperator prop = (NullOperator) filter;
ValueReference center = (ValueReference) prop.getExpressions().get(0);
assertEquals(center.getXPath(), valueStr);
// write test
FilterType ft = TRANSFORMER_OGC.apply(filter);
assertNotNull(ft.getComparisonOps());
ComparisonOpsType cot = ft.getComparisonOps().getValue();
PropertyIsNullType pibt = (PropertyIsNullType) cot;
PropertyNameType pnt = (PropertyNameType) pibt.getPropertyName();
assertEquals(pnt.getContent(), valueStr);
MARSHALLER.marshal(ft.getComparisonOps(), TEST_FILE_FIL_COMP_ISNULL);
POOL.recycle(MARSHALLER);
POOL.recycle(UNMARSHALLER);
}
Aggregations