8
8
9
9
public class JtsApplicationTests {
10
10
@ Test
11
- public void givenPolygon2D_whenContainPoint_thenContainmentIsTrue () throws Exception {
11
+ public void givenPolygon2D_whenContainPoint_thenContainmentIsTrueUnitTest () throws Exception {
12
12
Geometry point = GeometryFactoryUtil .readWKT ("POINT (10 20)" );
13
13
Geometry polygon = GeometryFactoryUtil .readWKT ("POLYGON ((0 0, 0 40, 40 40, 40 0, 0 0))" );
14
14
Assert .assertTrue (JTSOperationUtils .isContainment (point , polygon ));
15
15
}
16
16
17
17
@ Test
18
- public void givenRectangle1_whenIntersectWithRectangle2_thenIntersectionIsTrue () throws Exception {
18
+ public void givenRectangle1_whenIntersectWithRectangle2_thenIntersectionIsTrueUnitTest () throws Exception {
19
19
Geometry rectangle1 = GeometryFactoryUtil .readWKT ("POLYGON ((10 10, 10 30, 30 30, 30 10, 10 10))" );
20
20
Geometry rectangle2 = GeometryFactoryUtil .readWKT ("POLYGON ((20 20, 20 40, 40 40, 40 20, 20 20))" );
21
21
Assert .assertTrue (JTSOperationUtils .checkIntersect (rectangle1 , rectangle2 ));
22
22
}
23
23
24
24
@ Test
25
- public void givenPoint_whenAddedBuffer_thenPointIsInsideTheBuffer () throws Exception {
25
+ public void givenPoint_whenAddedBuffer_thenPointIsInsideTheBufferUnitTest () throws Exception {
26
26
Geometry point = GeometryFactoryUtil .readWKT ("POINT (10 10)" );
27
27
Geometry bufferArea = JTSOperationUtils .getBuffer (point , 5 );
28
28
Assert .assertTrue (JTSOperationUtils .isContainment (point , bufferArea ));
29
29
}
30
30
31
31
@ Test
32
- public void givenTwoPoints_whenGetDistanceBetween_thenGetTheDistance () throws Exception {
32
+ public void givenTwoPoints_whenGetDistanceBetween_thenGetTheDistanceUnitTest () throws Exception {
33
33
Geometry point1 = GeometryFactoryUtil .readWKT ("POINT (10 10)" );
34
34
Geometry point2 = GeometryFactoryUtil .readWKT ("POINT (13 14)" );
35
35
double distance = JTSOperationUtils .getDistance (point1 , point2 );
@@ -39,7 +39,7 @@ public void givenTwoPoints_whenGetDistanceBetween_thenGetTheDistance() throws Ex
39
39
}
40
40
41
41
@ Test
42
- public void givenTwoGeometries_whenGetUnionOfBoth_thenGetTheUnion () throws Exception {
42
+ public void givenTwoGeometries_whenGetUnionOfBoth_thenGetTheUnionUnitTest () throws Exception {
43
43
Geometry geometry1 = GeometryFactoryUtil .readWKT ("POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))" );
44
44
Geometry geometry2 = GeometryFactoryUtil .readWKT ("POLYGON ((10 0, 10 10, 20 10, 20 0, 10 0))" );
45
45
@@ -49,7 +49,7 @@ public void givenTwoGeometries_whenGetUnionOfBoth_thenGetTheUnion() throws Excep
49
49
}
50
50
51
51
@ Test
52
- public void givenBaseRectangle_whenAnotherRectangleOverlapping_GetTheDifferenceRectangle () throws Exception {
52
+ public void givenBaseRectangle_whenAnotherRectangleOverlapping_GetTheDifferenceRectangleUnitTest () throws Exception {
53
53
Geometry base = GeometryFactoryUtil .readWKT ("POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))" );
54
54
Geometry cut = GeometryFactoryUtil .readWKT ("POLYGON ((5 0, 5 10, 10 10, 10 0, 5 0))" );
55
55
@@ -59,7 +59,7 @@ public void givenBaseRectangle_whenAnotherRectangleOverlapping_GetTheDifferenceR
59
59
}
60
60
61
61
@ Test
62
- public void givenInvalidGeometryValue_whenValidated_thenGiveFixedResult () throws Exception {
62
+ public void givenInvalidGeometryValue_whenValidated_thenGiveFixedResultUnitTest () throws Exception {
63
63
Geometry invalidGeo = GeometryFactoryUtil .readWKT ("POLYGON ((0 0, 5 5, 5 0, 0 5, 0 0))" );
64
64
Geometry result = JTSOperationUtils .validateAndRepair (invalidGeo );
65
65
0 commit comments