static Element and(Document document, Node parent) { return and(document, parent, false); }
public void testAndEncode() throws Exception { Document dom = encode(FilterMockData.and(), OGC.And); assertEquals( 1, dom.getElementsByTagNameNS(OGC.NAMESPACE, OGC.PropertyIsEqualTo.getLocalPart()) .getLength()); assertEquals( 1, dom.getElementsByTagNameNS(OGC.NAMESPACE, OGC.PropertyIsNotEqualTo.getLocalPart()) .getLength()); }
public void testEncodeLogical() throws Exception { Document doc = encode(FilterMockData.and(), OGC.Filter); assertEquals("ogc:Filter", doc.getDocumentElement().getNodeName()); assertEquals(1, doc.getElementsByTagNameNS(OGC.NAMESPACE, "And").getLength()); doc = encode(FilterMockData.not(), OGC.Filter); assertEquals("ogc:Filter", doc.getDocumentElement().getNodeName()); assertEquals(1, doc.getElementsByTagNameNS(OGC.NAMESPACE, "Not").getLength()); } }
public void testAndParse() throws Exception { FilterMockData.and(document, document); And and = (And) parse(); assertEquals(2, and.getChildren().size()); }
public void testParseLogical() throws Exception { Element filterElement = FilterMockData.element(document, document, OGC.Filter); FilterMockData.and(document, filterElement); Filter filter = (Filter) parse(); assertTrue(filter instanceof And); }
public void testAndWithLikeParse() throws Exception { Element e = FilterMockData.and(document, document, true); FilterMockData.propertyIsLike(document, e); FilterMockData.propertyIsLike(document, e); And and = (And) parse(); assertEquals(2, and.getChildren().size()); assertTrue(and.getChildren().get(0) instanceof PropertyIsLike); assertTrue(and.getChildren().get(1) instanceof PropertyIsLike); }
public void testAndWithBetweenParse() throws Exception { Element e = FilterMockData.and(document, document, true); FilterMockData.propertyIsBetween(document, e); FilterMockData.propertyIsBetween(document, e); And and = (And) parse(); assertEquals(2, and.getChildren().size()); assertTrue(and.getChildren().get(0) instanceof PropertyIsBetween); assertTrue(and.getChildren().get(1) instanceof PropertyIsBetween); }
public void testAndWithNullParse() throws Exception { Element e = FilterMockData.and(document, document, true); FilterMockData.propertyisNull(document, e); FilterMockData.propertyisNull(document, e); And and = (And) parse(); assertEquals(2, and.getChildren().size()); assertTrue(and.getChildren().get(0) instanceof PropertyIsNull); assertTrue(and.getChildren().get(1) instanceof PropertyIsNull); }