Skip to content

Commit 4f83c62

Browse files
committed
feat(*): add GIGS tests
1 parent 03fe1a8 commit 4f83c62

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1213
-1
lines changed

build.gradle.kts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dependencies {
4646
testFixturesImplementation("org.python:jython-slim:2.7.4")
4747

4848
// For GIGS tests
49-
//implementation("org.iogp:gigs:1.0-SNAPSHOT")
49+
testImplementation("org.iogp:gigs:1.0-SNAPSHOT")
5050

5151
// For Swagger UI
5252
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0")
@@ -73,6 +73,22 @@ tasks.withType<BootBuildImage> {
7373
docker { bindHostToBuilder = true }
7474
}
7575

76+
// Unit tests exclude GIGS tests
77+
tasks.named<Test>("test") {
78+
useJUnitPlatform {
79+
excludeTags("gigs")
80+
}
81+
}
82+
83+
// GIGS tests
84+
tasks.register<Test>("gigs") {
85+
description = "Runs GIGS tests."
86+
group = "verification"
87+
useJUnitPlatform() {
88+
includeTags("gigs")
89+
}
90+
}
91+
7692
fun Project.getTaggedImageName() : String {
7793
val imageVersion = version.let { if (it == "unspecified" || it.toString().endsWith(".x")) "latest" else it }
7894
val imageName = requireNotNull(properties["spring-boot.build-image.imageName"]).toString()
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* GIGS - Geospatial Integrity of Geoscience Software
3+
* https://gigs.iogp.org/
4+
*
5+
* Copyright (C) 2022-2023 International Association of Oil and Gas Producers.
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a
8+
* copy of this software and associated documentation files (the "Software"),
9+
* to deal in the Software without restriction, including without limitation
10+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
11+
* and/or sell copies of the Software, and to permit persons to whom the
12+
* Software is furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included
15+
* in all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23+
* DEALINGS IN THE SOFTWARE.
24+
*/
25+
package com.geomatys.crsservice.gigs;
26+
27+
import com.geomatys.crsservice.client.LocalCoordinateOperationFactory;
28+
import org.apache.sis.referencing.factory.GeodeticObjectFactory;
29+
import org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory;
30+
import org.iogp.gigs.Factories;
31+
import org.iogp.gigs.internal.geoapi.PseudoEpsgFactory;
32+
import org.iogp.gigs.internal.geoapi.Units;
33+
import org.iogp.gigs.internal.geoapi.ValidatorContainer;
34+
35+
import java.net.URISyntaxException;
36+
37+
38+
/**
39+
* A container for various factory implementations.
40+
* This is used as a replacement for long list of arguments in constructors when a test may require
41+
* many factories for different kinds of objects (datum, coordinate system, operations, <i>etc</i>).
42+
*
43+
* <p>Implementations can create a {@code Factories} subclass and initialize all fields in their constructor.</p>
44+
*
45+
* @author Martin Desruisseaux (Geomatys)
46+
* @version 1.0
47+
* @since 1.0
48+
*/
49+
public class CRSFactories extends Factories {
50+
51+
public CRSFactories() throws URISyntaxException {
52+
copFactory = new LocalCoordinateOperationFactory();
53+
mtFactory = new DefaultMathTransformFactory();
54+
final GeodeticObjectFactory geoObjectFactory = new GeodeticObjectFactory();
55+
datumFactory = geoObjectFactory;
56+
csFactory = geoObjectFactory;
57+
crsFactory = geoObjectFactory;
58+
datumAuthorityFactory = new PseudoEpsgFactory(Units.getInstance(), datumFactory, csFactory, crsFactory, null, null, ValidatorContainer.DEFAULT);
59+
}
60+
61+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.geomatys.crsservice.gigs.not.supported.s5100;
2+
3+
import com.geomatys.crsservice.gigs.CRSFactories;
4+
import org.iogp.gigs.Test5104;
5+
import org.junit.jupiter.api.Disabled;
6+
import org.junit.jupiter.api.Tag;
7+
import org.opengis.referencing.operation.CoordinateOperationFactory;
8+
import org.opengis.util.FactoryException;
9+
10+
import java.net.URISyntaxException;
11+
12+
@Tag("gigs")
13+
@Disabled
14+
public class GIGSTest5104 extends Test5104 {
15+
16+
/**
17+
* Creates a new test using the given factories.
18+
* The factories needed by this class are {@link CoordinateOperationFactory}.
19+
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
20+
*
21+
* <h4>Authority factory usage</h4>
22+
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
23+
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
24+
*
25+
*/
26+
public GIGSTest5104() throws FactoryException, URISyntaxException {
27+
super(new CRSFactories());
28+
}
29+
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.geomatys.crsservice.gigs.not.supported.s5100;
2+
3+
import com.geomatys.crsservice.gigs.CRSFactories;
4+
import org.iogp.gigs.Test51051;
5+
import org.junit.jupiter.api.Disabled;
6+
import org.junit.jupiter.api.Tag;
7+
import org.opengis.referencing.operation.CoordinateOperationFactory;
8+
import org.opengis.util.FactoryException;
9+
10+
import java.net.URISyntaxException;
11+
12+
@Tag("gigs")
13+
@Disabled
14+
public class GIGSTest51051 extends Test51051 {
15+
16+
/**
17+
* Creates a new test using the given factories.
18+
* The factories needed by this class are {@link CoordinateOperationFactory}.
19+
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
20+
*
21+
* <h4>Authority factory usage</h4>
22+
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
23+
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
24+
*
25+
*/
26+
public GIGSTest51051() throws FactoryException, URISyntaxException {
27+
super(new CRSFactories());
28+
}
29+
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.geomatys.crsservice.gigs.not.supported.s5100;
2+
3+
import com.geomatys.crsservice.gigs.CRSFactories;
4+
import org.iogp.gigs.Test51052;
5+
import org.junit.jupiter.api.Disabled;
6+
import org.junit.jupiter.api.Tag;
7+
import org.opengis.referencing.operation.CoordinateOperationFactory;
8+
import org.opengis.util.FactoryException;
9+
10+
import java.net.URISyntaxException;
11+
12+
@Tag("gigs")
13+
@Disabled
14+
public class GIGSTest51052 extends Test51052 {
15+
16+
/**
17+
* Creates a new test using the given factories.
18+
* The factories needed by this class are {@link CoordinateOperationFactory}.
19+
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
20+
*
21+
* <h4>Authority factory usage</h4>
22+
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
23+
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
24+
*
25+
*/
26+
public GIGSTest51052() throws FactoryException, URISyntaxException {
27+
super(new CRSFactories());
28+
}
29+
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.geomatys.crsservice.gigs.not.supported.s5100;
2+
3+
import com.geomatys.crsservice.gigs.CRSFactories;
4+
import org.iogp.gigs.Test5106;
5+
import org.junit.jupiter.api.Disabled;
6+
import org.junit.jupiter.api.Tag;
7+
import org.opengis.referencing.operation.CoordinateOperationFactory;
8+
import org.opengis.util.FactoryException;
9+
10+
import java.net.URISyntaxException;
11+
12+
@Tag("gigs")
13+
@Disabled
14+
public class GIGSTest5106 extends Test5106 {
15+
16+
/**
17+
* Creates a new test using the given factories.
18+
* The factories needed by this class are {@link CoordinateOperationFactory}.
19+
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
20+
*
21+
* <h4>Authority factory usage</h4>
22+
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
23+
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
24+
*
25+
*/
26+
public GIGSTest5106() throws FactoryException, URISyntaxException {
27+
super(new CRSFactories());
28+
}
29+
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.geomatys.crsservice.gigs.not.supported.s5100;
2+
3+
import com.geomatys.crsservice.gigs.CRSFactories;
4+
import org.iogp.gigs.Test5107;
5+
import org.junit.jupiter.api.Disabled;
6+
import org.junit.jupiter.api.Tag;
7+
import org.opengis.referencing.operation.CoordinateOperationFactory;
8+
import org.opengis.util.FactoryException;
9+
10+
import java.net.URISyntaxException;
11+
12+
@Tag("gigs")
13+
@Disabled
14+
public class GIGSTest5107 extends Test5107 {
15+
16+
/**
17+
* Creates a new test using the given factories.
18+
* The factories needed by this class are {@link CoordinateOperationFactory}.
19+
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
20+
*
21+
* <h4>Authority factory usage</h4>
22+
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
23+
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
24+
*
25+
*/
26+
public GIGSTest5107() throws FactoryException, URISyntaxException {
27+
super(new CRSFactories());
28+
}
29+
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.geomatys.crsservice.gigs.not.supported.s5100;
2+
3+
import com.geomatys.crsservice.gigs.CRSFactories;
4+
import org.iogp.gigs.Test5108;
5+
import org.junit.jupiter.api.Disabled;
6+
import org.junit.jupiter.api.Tag;
7+
import org.opengis.referencing.operation.CoordinateOperationFactory;
8+
import org.opengis.util.FactoryException;
9+
10+
import java.net.URISyntaxException;
11+
12+
@Tag("gigs")
13+
@Disabled
14+
public class GIGSTest5108 extends Test5108 {
15+
16+
/**
17+
* Creates a new test using the given factories.
18+
* The factories needed by this class are {@link CoordinateOperationFactory}.
19+
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
20+
*
21+
* <h4>Authority factory usage</h4>
22+
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
23+
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
24+
*
25+
*/
26+
public GIGSTest5108() throws FactoryException, URISyntaxException {
27+
super(new CRSFactories());
28+
}
29+
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.geomatys.crsservice.gigs.not.supported.s5100;
2+
3+
import com.geomatys.crsservice.gigs.CRSFactories;
4+
import org.iogp.gigs.Test5109;
5+
import org.junit.jupiter.api.Disabled;
6+
import org.junit.jupiter.api.Tag;
7+
import org.opengis.referencing.operation.CoordinateOperationFactory;
8+
import org.opengis.util.FactoryException;
9+
10+
import java.net.URISyntaxException;
11+
12+
@Tag("gigs")
13+
@Disabled
14+
public class GIGSTest5109 extends Test5109 {
15+
16+
/**
17+
* Creates a new test using the given factories.
18+
* The factories needed by this class are {@link CoordinateOperationFactory}.
19+
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
20+
*
21+
* <h4>Authority factory usage</h4>
22+
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
23+
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
24+
*
25+
*/
26+
public GIGSTest5109() throws FactoryException, URISyntaxException {
27+
super(new CRSFactories());
28+
}
29+
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.geomatys.crsservice.gigs.not.supported.s5100;
2+
3+
import com.geomatys.crsservice.gigs.CRSFactories;
4+
import org.iogp.gigs.Test5110;
5+
import org.junit.jupiter.api.Disabled;
6+
import org.junit.jupiter.api.Tag;
7+
import org.opengis.referencing.operation.CoordinateOperationFactory;
8+
import org.opengis.util.FactoryException;
9+
10+
import java.net.URISyntaxException;
11+
12+
@Tag("gigs")
13+
@Disabled
14+
public class GIGSTest5110 extends Test5110 {
15+
16+
/**
17+
* Creates a new test using the given factories.
18+
* The factories needed by this class are {@link CoordinateOperationFactory}.
19+
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
20+
*
21+
* <h4>Authority factory usage</h4>
22+
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
23+
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
24+
*
25+
*/
26+
public GIGSTest5110() throws FactoryException, URISyntaxException {
27+
super(new CRSFactories());
28+
}
29+
30+
}

0 commit comments

Comments
 (0)