private void doTestEquals( Geometry a, Geometry b, boolean equalsGeometry, boolean equalsObject, boolean equalsExact, boolean equalsHash) { assertEquals(equalsGeometry, a.equals(b)); assertEquals(equalsObject, a.equals((Object) b)); assertEquals(equalsExact, a.equalsExact(b)); assertEquals(equalsHash, a.hashCode() == b.hashCode()); }
/** * Returns a boolean value that shows if two geometries are equal or not. * * @param node1 xml element containing gml object(s) * @param node2 xml element containing gml object(s) * @return boolean value * @throws QueryException query exception */ @Deterministic public Bln equals(final ANode node1, final ANode node2) throws QueryException { final Geometry geo1 = checkGeo(node1); final Geometry geo2 = checkGeo(node2); return Bln.get(geo1.equals(geo2)); }
public void testEqualsWithNull() throws Exception { Geometry polygon = reader.read("POLYGON ((0 0, 0 50, 50 50, 50 0, 0 0))"); assertTrue(!polygon.equals(null)); final Object g = null; assertTrue(!polygon.equals(g)); }
public void testEquals1() throws Exception { Geometry polygon1 = reader.read("POLYGON ((0 0, 0 50, 50 50, 50 0, 0 0))"); Geometry polygon2 = reader.read("POLYGON ((50 50, 50 0, 0 0, 0 50, 50 50))"); assertTrue(polygon1.equals(polygon2)); }