ConvertLatLonFF extends FunctionBase2 { @Override public NodeValue exec(NodeValue v1, NodeValue v2) { try { NodeValue result = ConvertLatLon.toNodeValue(v1, v2); return result; } catch (DatatypeFormatException ex) { throw new ExprEvalException(ex.getMessage(), ex); } }  @Override NodeValue exec(NodeValue v1, NodeValue v2);  }
@Test public void testExec() { NodeValue v1 = NodeValue.makeFloat(10.0f); NodeValue v2 = NodeValue.makeFloat(20.0f); ConvertLatLonFF instance = new ConvertLatLonFF(); NodeValue expResult = NodeValue.makeNode("<http: NodeValue result = instance.exec(v1, v2); assertEquals(expResult, result); }
@Test(expected = ExprEvalException.class) public void testExec_pos0_fail() { NodeValue v1 = NodeValue.makeString("e"); NodeValue v2 = NodeValue.makeFloat(20.0f); ConvertLatLonFF instance = new ConvertLatLonFF(); NodeValue expResult = NodeValue.makeNode("<http: NodeValue result = instance.exec(v1, v2); }
@Test(expected = ExprEvalException.class) public void testExec_pos1_fail() { NodeValue v1 = NodeValue.makeFloat(10.0f); NodeValue v2 = NodeValue.makeString("e"); ConvertLatLonFF instance = new ConvertLatLonFF(); NodeValue expResult = NodeValue.makeNode("<http: NodeValue result = instance.exec(v1, v2); }