IsValidFF extends FunctionBase1 { @Override public NodeValue exec(NodeValue v) { try { GeometryWrapper geometry = GeometryWrapper.extract(v); Boolean isValid = geometry.isValid(); return NodeValue.makeNodeBoolean(isValid); } catch (DatatypeFormatException ex) { throw new ExprEvalException(ex.getMessage(), ex); } }  @Override NodeValue exec(NodeValue v);  }
@Test public void testExec_true() { NodeValue geometryLiteral = NodeValue.makeNode("<http: IsValidFF instance = new IsValidFF(); NodeValue expResult = NodeValue.makeNodeBoolean(true); NodeValue result = instance.exec(geometryLiteral); assertEquals(expResult, result); }
@Test public void testExec_false() { NodeValue geometryLiteral = NodeValue.makeNode("<http: IsValidFF instance = new IsValidFF(); NodeValue expResult = NodeValue.makeNodeBoolean(false); NodeValue result = instance.exec(geometryLiteral); assertEquals(expResult, result); }