ConvertLatLon { public static final Node toNode(Node latNode, Node lonNode) { NodeValue result = toNodeValue(NodeValue.makeNode(latNode), NodeValue.makeNode(lonNode)); return result.asNode(); }  static final Literal toLiteral(double lat, double lon); static final String toWKT(double lat, double lon); static final NodeValue toNodeValue(NodeValue latNodeValue, NodeValue lonNodeValue); static double extractDouble(NodeValue nodeValue); static final Node toNode(Node latNode, Node lonNode); static final GeometryWrapper toGeometryWrapper(Node latNode, Node lonNode); static final void checkBounds(double latitude, double longitude);  }
@Test public void testConvertToNode_Node_Node() { Node n1 = NodeValue.makeFloat(10.0f).asNode(); Node n2 = NodeValue.makeFloat(20.0f).asNode(); Node expResult = NodeFactory.createLiteral("<http: Node result = ConvertLatLon.toNode(n1, n2); assertEquals(expResult, result); }
@Test public void testConvertToNode_NodeString_NodeString() { Node n1 = NodeValue.makeString("10.0").asNode(); Node n2 = NodeValue.makeString("20").asNode(); Node expResult = NodeFactory.createLiteral("<http: Node result = ConvertLatLon.toNode(n1, n2); assertEquals(expResult, result); }
@Test(expected = DatatypeFormatException.class) public void testConvertToNode_NodeString_NodeString_Malformed() { Node n1 = NodeValue.makeString("val").asNode(); Node n2 = NodeValue.makeString("20.0").asNode(); Node expResult = NodeFactory.createLiteral("<http: Node result = ConvertLatLon.toNode(n1, n2); assertEquals(expResult, result); }