Skip to content

Commit

Permalink
Fix typo errors (#125) (#127)
Browse files Browse the repository at this point in the history
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
  • Loading branch information
opensearch-trigger-bot[bot] authored Aug 17, 2022
1 parent cf4a7e4 commit d9f9833
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ private XYShapeQueryBuilder createQueryBuilderFromQueryShape() {
Geometry geometry = ShapeObjectBuilder.randomGeometryWithXYCoordinates();
XYShapeQueryBuilder builder = new XYShapeQueryBuilder(XY_SHAPE_FIELD_NAME, geometry);
builder.ignoreUnmapped(randomBoolean());
return setRelationBasedonType(geometry.type(), builder);
return setRelationBasedOnType(geometry.type(), builder);
}

private XYShapeQueryBuilder createQueryBuilderFromIndexedShape() {
Expand All @@ -262,10 +262,10 @@ private XYShapeQueryBuilder createQueryBuilderFromIndexedShape() {
builder.indexedShapeRouting(indexedShapeRouting);
}
builder.ignoreUnmapped(randomBoolean());
return setRelationBasedonType(indexedShapeToReturn.type(), builder);
return setRelationBasedOnType(indexedShapeToReturn.type(), builder);
}

private XYShapeQueryBuilder setRelationBasedonType(ShapeType shapeType, XYShapeQueryBuilder builder) {
private XYShapeQueryBuilder setRelationBasedOnType(ShapeType shapeType, XYShapeQueryBuilder builder) {
if (shapeType == ShapeType.LINESTRING || shapeType == ShapeType.MULTILINESTRING) {
return builder.relation(randomFrom(ShapeRelation.DISJOINT, ShapeRelation.INTERSECTS, ShapeRelation.CONTAINS));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void testQueryingCircle() {
Circle circle = randomCircle(randomBoolean());
final List<XYGeometry> geometries = queryVisitor.visit(circle);
assertNotNull("failed to convert to XYCircle", geometries);
assertEquals("Unexpected number of geomteries found", SIZE, geometries.size());
assertEquals("Unexpected number of geometries found", SIZE, geometries.size());
assertTrue("invalid object found", geometries.get(FIRST_GEOMETRY) instanceof XYCircle);
}

Expand All @@ -80,7 +80,7 @@ public void testQueryingLine() {
Line geometry = randomLine(verticesLimit, randomBoolean());
final List<XYGeometry> geometries = queryVisitor.visit(geometry);
assertNotNull("Query geometries cannot be null", geometries);
assertEquals("Unexpected number of geomteries found", SIZE, geometries.size());
assertEquals("Unexpected number of geometries found", SIZE, geometries.size());
assertTrue("invalid object found ", geometries.get(FIRST_GEOMETRY) instanceof XYLine);
}

Expand All @@ -90,7 +90,7 @@ public void testQueryingMultiLine() {
MultiLine multiLine = randomMultiLine(verticesLimit, linesLimit, randomBoolean());
final List<XYGeometry> geometries = queryVisitor.visit(multiLine);
assertNotNull("Query geometries cannot be null", geometries);
assertEquals("Unexpected number of geomteries found", geometries.size(), multiLine.size());
assertEquals("Unexpected number of geometries found", geometries.size(), multiLine.size());
for (XYGeometry geometry : geometries) {
assertTrue("invalid object found", geometry instanceof XYLine);
}
Expand All @@ -100,7 +100,7 @@ public void testQueryingPoint() {
Point geometry = randomPoint(randomBoolean());
final List<XYGeometry> geometries = queryVisitor.visit(geometry);
assertNotNull("Query geometries cannot be null", geometries);
assertEquals("Unexpected number of geomteries found", SIZE, geometries.size());
assertEquals("Unexpected number of geometries found", SIZE, geometries.size());
assertTrue("invalid object found", geometries.get(FIRST_GEOMETRY) instanceof XYPoint);

}
Expand All @@ -110,7 +110,7 @@ public void testQueryingMultiPoint() {
MultiPoint multiPoint = randomMultiPoint(pointLimit, randomBoolean());
final List<XYGeometry> geometries = queryVisitor.visit(multiPoint);
assertNotNull("Query geometries cannot be null", geometries);
assertEquals("Unexpected number of geomteries found", geometries.size(), multiPoint.size());
assertEquals("Unexpected number of geometries found", geometries.size(), multiPoint.size());
for (XYGeometry geometry : geometries) {
assertTrue("invalid object found", geometry instanceof XYPoint);
}
Expand All @@ -120,15 +120,15 @@ public void testQueryingPolygon() throws IOException, ParseException {
Polygon geometry = randomPolygon();
final List<XYGeometry> geometries = queryVisitor.visit(geometry);
assertNotNull("Query geometries cannot be null", geometries);
assertEquals("Unexpected number of geomteries found", SIZE, geometries.size());
assertEquals("Unexpected number of geometries found", SIZE, geometries.size());
assertTrue("invalid object found", geometries.get(FIRST_GEOMETRY) instanceof XYPolygon);
}

public void testQueryingMultiPolygon() throws IOException, ParseException {
MultiPolygon multiPolygon = randomMultiPolygon();
final List<XYGeometry> geometries = queryVisitor.visit(multiPolygon);
assertNotNull("Query geometries cannot be null", geometries);
assertEquals("Unexpected number of geomteries found", geometries.size(), multiPolygon.size());
assertEquals("Unexpected number of geometries found", geometries.size(), multiPolygon.size());
for (XYGeometry geometry : geometries) {
assertTrue("invalid object found", geometry instanceof XYPolygon);
}
Expand All @@ -145,7 +145,7 @@ public void testQueryingRectangle() {
Rectangle geometry = randomRectangle();
final List<XYGeometry> geometries = queryVisitor.visit(geometry);
assertNotNull("Query geometries cannot be null", geometries);
assertEquals("Unexpected number of geomteries found", SIZE, geometries.size());
assertEquals("Unexpected number of geometries found", SIZE, geometries.size());
assertTrue("invalid object found", geometries.get(FIRST_GEOMETRY) instanceof XYRectangle);
}
}

0 comments on commit d9f9833

Please sign in to comment.