DimensionFF extends FunctionBase1 { @Override public NodeValue exec(NodeValue v) { try { GeometryWrapper geometry = GeometryWrapper.extract(v); Integer dimension = geometry.getTopologicalDimension(); return NodeValue.makeNodeInteger(dimension); } catch (DatatypeFormatException ex) { throw new ExprEvalException(ex.getMessage(), ex); } }  @Override NodeValue exec(NodeValue v);  }
@Test public void testExec_0_Dimension() { NodeValue geometryLiteral = NodeValue.makeNode("<http: DimensionFF instance = new DimensionFF(); NodeValue expResult = NodeValue.makeNodeInteger(0); NodeValue result = instance.exec(geometryLiteral); assertEquals(expResult, result); }
@Test public void testExec_1_Dimension() { NodeValue geometryLiteral = NodeValue.makeNode("<http: DimensionFF instance = new DimensionFF(); NodeValue expResult = NodeValue.makeNodeInteger(1); NodeValue result = instance.exec(geometryLiteral); assertEquals(expResult, result); }
@Test public void testExec_2_Dimension() { NodeValue geometryLiteral = NodeValue.makeNode("<http: DimensionFF instance = new DimensionFF(); NodeValue expResult = NodeValue.makeNodeInteger(2); NodeValue result = instance.exec(geometryLiteral); assertEquals(expResult, result); }