Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,25 @@ To compile the project without launching the service:
./gradlew build
----

=== GIGS tests

To run GIGS conformance tests, run:

[source,shell]
----
./gradlew gigs
----

The task produces a test report in link:build/reports/tests/gigs/index.html[].

[NOTE]
====
The service is not fully compliant with GIGS tests for now,
so the test task is allowed to produce errors without failing the build.
GIGS testing is only informative for now.
====


== Documentation

Project technical documentation is available link:./src/docs/asciidoc/index.adoc[here].
Expand Down
23 changes: 22 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dependencies {
testFixturesImplementation("org.python:jython-slim:2.7.4")

// For GIGS tests
//implementation("org.iogp:gigs:1.0-SNAPSHOT")
testImplementation("org.iogp:gigs:1.0-GEOMATYS-ALPHA-1")

// For Swagger UI
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0")
Expand All @@ -73,6 +73,27 @@ tasks.withType<BootBuildImage> {
docker { bindHostToBuilder = true }
}

// Unit tests exclude GIGS tests
tasks.named<Test>("test") {
useJUnitPlatform {
excludeTags("gigs")
}
}

// GIGS tests
tasks.register<Test>("gigs") {
// Allow GIGS test task to fail. GIGS
// Conformance tests give an insight about the conversion engine state,
// but we do not want it to block build.
// Strict conformance requirement will be added later, when the project will reach sufficient maturity.
ignoreFailures = true
description = "Runs GIGS tests."
group = "verification"
useJUnitPlatform() {
includeTags("gigs")
}
}

fun Project.getTaggedImageName() : String {
val imageVersion = version.let { if (it == "unspecified" || it.toString().endsWith(".x")) "latest" else it }
val imageName = requireNotNull(properties["spring-boot.build-image.imageName"]).toString()
Expand Down
61 changes: 61 additions & 0 deletions src/test/java/com/geomatys/crsservice/gigs/CRSFactories.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* GIGS - Geospatial Integrity of Geoscience Software
* https://gigs.iogp.org/
*
* Copyright (C) 2022-2023 International Association of Oil and Gas Producers.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
package com.geomatys.crsservice.gigs;

import com.geomatys.crsservice.client.LocalCoordinateOperationFactory;
import org.apache.sis.referencing.factory.GeodeticObjectFactory;
import org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory;
import org.iogp.gigs.Factories;
import org.iogp.gigs.internal.geoapi.PseudoEpsgFactory;
import org.iogp.gigs.internal.geoapi.Units;
import org.iogp.gigs.internal.geoapi.ValidatorContainer;

import java.net.URISyntaxException;


/**
* A container for various factory implementations.
* This is used as a replacement for long list of arguments in constructors when a test may require
* many factories for different kinds of objects (datum, coordinate system, operations, <i>etc</i>).
*
* <p>Implementations can create a {@code Factories} subclass and initialize all fields in their constructor.</p>
*
* @author Martin Desruisseaux (Geomatys)
* @version 1.0
* @since 1.0
*/
public class CRSFactories extends Factories {

public CRSFactories() throws URISyntaxException {
copFactory = new LocalCoordinateOperationFactory();
mtFactory = new DefaultMathTransformFactory();
final GeodeticObjectFactory geoObjectFactory = new GeodeticObjectFactory();
datumFactory = geoObjectFactory;
csFactory = geoObjectFactory;
crsFactory = geoObjectFactory;
datumAuthorityFactory = new PseudoEpsgFactory(Units.getInstance(), datumFactory, csFactory, crsFactory, null, null, ValidatorContainer.DEFAULT);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.geomatys.crsservice.gigs.not.supported.s5100;

import com.geomatys.crsservice.gigs.CRSFactories;
import org.iogp.gigs.Test5104;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Tag;
import org.opengis.referencing.operation.CoordinateOperationFactory;
import org.opengis.util.FactoryException;

import java.net.URISyntaxException;

@Tag("gigs")
@Disabled
public class GIGSTest5104 extends Test5104 {

/**
* Creates a new test using the given factories.
* The factories needed by this class are {@link CoordinateOperationFactory}.
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
*
* <h4>Authority factory usage</h4>
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
*
*/
public GIGSTest5104() throws FactoryException, URISyntaxException {
super(new CRSFactories());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.geomatys.crsservice.gigs.not.supported.s5100;

import com.geomatys.crsservice.gigs.CRSFactories;
import org.iogp.gigs.Test51051;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Tag;
import org.opengis.referencing.operation.CoordinateOperationFactory;
import org.opengis.util.FactoryException;

import java.net.URISyntaxException;

@Tag("gigs")
@Disabled
public class GIGSTest51051 extends Test51051 {

/**
* Creates a new test using the given factories.
* The factories needed by this class are {@link CoordinateOperationFactory}.
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
*
* <h4>Authority factory usage</h4>
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
*
*/
public GIGSTest51051() throws FactoryException, URISyntaxException {
super(new CRSFactories());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.geomatys.crsservice.gigs.not.supported.s5100;

import com.geomatys.crsservice.gigs.CRSFactories;
import org.iogp.gigs.Test51052;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Tag;
import org.opengis.referencing.operation.CoordinateOperationFactory;
import org.opengis.util.FactoryException;

import java.net.URISyntaxException;

@Tag("gigs")
@Disabled
public class GIGSTest51052 extends Test51052 {

/**
* Creates a new test using the given factories.
* The factories needed by this class are {@link CoordinateOperationFactory}.
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
*
* <h4>Authority factory usage</h4>
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
*
*/
public GIGSTest51052() throws FactoryException, URISyntaxException {
super(new CRSFactories());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.geomatys.crsservice.gigs.not.supported.s5100;

import com.geomatys.crsservice.gigs.CRSFactories;
import org.iogp.gigs.Test5106;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Tag;
import org.opengis.referencing.operation.CoordinateOperationFactory;
import org.opengis.util.FactoryException;

import java.net.URISyntaxException;

@Tag("gigs")
@Disabled
public class GIGSTest5106 extends Test5106 {

/**
* Creates a new test using the given factories.
* The factories needed by this class are {@link CoordinateOperationFactory}.
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
*
* <h4>Authority factory usage</h4>
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
*
*/
public GIGSTest5106() throws FactoryException, URISyntaxException {
super(new CRSFactories());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.geomatys.crsservice.gigs.not.supported.s5100;

import com.geomatys.crsservice.gigs.CRSFactories;
import org.iogp.gigs.Test5107;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Tag;
import org.opengis.referencing.operation.CoordinateOperationFactory;
import org.opengis.util.FactoryException;

import java.net.URISyntaxException;

@Tag("gigs")
@Disabled
public class GIGSTest5107 extends Test5107 {

/**
* Creates a new test using the given factories.
* The factories needed by this class are {@link CoordinateOperationFactory}.
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
*
* <h4>Authority factory usage</h4>
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
*
*/
public GIGSTest5107() throws FactoryException, URISyntaxException {
super(new CRSFactories());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.geomatys.crsservice.gigs.not.supported.s5100;

import com.geomatys.crsservice.gigs.CRSFactories;
import org.iogp.gigs.Test5108;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Tag;
import org.opengis.referencing.operation.CoordinateOperationFactory;
import org.opengis.util.FactoryException;

import java.net.URISyntaxException;

@Tag("gigs")
@Disabled
public class GIGSTest5108 extends Test5108 {

/**
* Creates a new test using the given factories.
* The factories needed by this class are {@link CoordinateOperationFactory}.
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
*
* <h4>Authority factory usage</h4>
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
*
*/
public GIGSTest5108() throws FactoryException, URISyntaxException {
super(new CRSFactories());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.geomatys.crsservice.gigs.not.supported.s5100;

import com.geomatys.crsservice.gigs.CRSFactories;
import org.iogp.gigs.Test5109;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Tag;
import org.opengis.referencing.operation.CoordinateOperationFactory;
import org.opengis.util.FactoryException;

import java.net.URISyntaxException;

@Tag("gigs")
@Disabled
public class GIGSTest5109 extends Test5109 {

/**
* Creates a new test using the given factories.
* The factories needed by this class are {@link CoordinateOperationFactory}.
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
*
* <h4>Authority factory usage</h4>
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
*
*/
public GIGSTest5109() throws FactoryException, URISyntaxException {
super(new CRSFactories());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.geomatys.crsservice.gigs.not.supported.s5100;

import com.geomatys.crsservice.gigs.CRSFactories;
import org.iogp.gigs.Test5110;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Tag;
import org.opengis.referencing.operation.CoordinateOperationFactory;
import org.opengis.util.FactoryException;

import java.net.URISyntaxException;

@Tag("gigs")
@Disabled
public class GIGSTest5110 extends Test5110 {

/**
* Creates a new test using the given factories.
* The factories needed by this class are {@link CoordinateOperationFactory}.
* If a requested factory is {@code null}, then the tests which depend on it will be skipped.
*
* <h4>Authority factory usage</h4>
* The authority factory is used only for some test cases where the components are fetched by EPSG codes
* instead of being built by user. Those test cases are identified by the "definition source" line in Javadoc.
*
*/
public GIGSTest5110() throws FactoryException, URISyntaxException {
super(new CRSFactories());
}

}
Loading