CoordinateDimensionFF extends FunctionBase1 { @Override public NodeValue exec(NodeValue v) { try { GeometryWrapper geometry = GeometryWrapper.extract(v); Integer dimension = geometry.getCoordinateDimension(); return NodeValue.makeNodeInteger(dimension); } catch (DatatypeFormatException ex) { throw new ExprEvalException(ex.getMessage(), ex); } }  @Override NodeValue exec(NodeValue v);  }
@Test public void testExec_2_Dimension() { NodeValue geometryLiteral = NodeValue.makeNode("<http: CoordinateDimensionFF instance = new CoordinateDimensionFF(); NodeValue expResult = NodeValue.makeNodeInteger(2); NodeValue result = instance.exec(geometryLiteral); assertEquals(expResult, result); }
@Test public void testExec_3Z_Dimension() { NodeValue geometryLiteral = NodeValue.makeNode("<http: CoordinateDimensionFF instance = new CoordinateDimensionFF(); NodeValue expResult = NodeValue.makeNodeInteger(3); NodeValue result = instance.exec(geometryLiteral); assertEquals(expResult, result); }
@Test public void testExec_3M_Dimension() { NodeValue geometryLiteral = NodeValue.makeNode("<http: CoordinateDimensionFF instance = new CoordinateDimensionFF(); NodeValue expResult = NodeValue.makeNodeInteger(3); NodeValue result = instance.exec(geometryLiteral); assertEquals(expResult, result); }
@Test public void testExec_4_Dimension() { NodeValue geometryLiteral = NodeValue.makeNode("<http: CoordinateDimensionFF instance = new CoordinateDimensionFF(); NodeValue expResult = NodeValue.makeNodeInteger(4); NodeValue result = instance.exec(geometryLiteral); assertEquals(expResult, result); }