https://github.com/52north/sos-test-suite

Common Test Suite for the 52N SOS

https://github.com/52north/sos-test-suite

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.6%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Common Test Suite for the 52N SOS

Basic Info
  • Host: GitHub
  • Owner: 52North
  • License: epl-1.0
  • Language: Java
  • Default Branch: master
  • Size: 259 KB
Statistics
  • Stars: 4
  • Watchers: 11
  • Forks: 6
  • Open Issues: 8
  • Releases: 2
Archived
Created over 12 years ago · Last pushed over 2 years ago
Metadata Files
Readme License

README.md

SOS-Test-Suite Build Status

How to use the test suite

Include the following artifacts in your pom.xml:

xml <dependency> <groupId>org.n52.sensorweb.sos</groupId> <artifactId>test-suite-common</artifactId> <version>1.0.0-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> <groupId>org.n52.sensorweb.sos</groupId> <artifactId>test-suite-sos-20</artifactId> <version>1.0.0-SNAPSHOT</version> <scope>test</scope> </dependency>

The tests can be faciliated by implementing the class ComplianceSuite. The method #getTests() defines the tests that sould be run with the RequestExecutor provided by the method #getExecutor().

The RequestExecutor provides methods to build and issue request to a service instance. The instance can be external deployed, embedded with Jetty or even a HTTPServlet instance that is feeded with mocked requests and responses.

Additional dependencies and requirements should be included by using JUnit rules. The following example uses a H2 database as a ExternalResource (which also bootstraps the service) and issues requests using the provided MockHttpExecutor. The tested service uses different endpoints for bindings which are defined in the implemented methods of MockHttpExecutor.

```java import org.junit.Rule; import org.junit.runner.RunWith; import org.n52.sos.service.SosService; import org.n52.sos.service.it.; import org.n52.sos.service.it.v2.kvp.;

@RunWith(ComplianceSuiteRunner.class) public class KvpSuiteTest implements ComplianceSuite { private final H2Database datasource = new H2Database(); private final RequestExecutor executor = new RequestExecutorImpl();

@Rule public H2Database getDatasource() { return this.datasource; }
@Override public RequestExecutor getExecutor() { return this.executor; }

@Override
public Class<?>[] getTests() {
    return new Class<?>[] {
        DeleteObservationTest.class,
        DeleteSensorTest.class,
        DescribeSensorTest.class,
        GetCapabilitiesTest.class,
        GetDataAvailabilityTest.class,
        GetFeatureOfInterestTest.class,
        GetObservationByIdTest.class,
        GetObservationTest.class,
        GetResultTemplateTest.class,
        GetResultTest.class
    };
}

private class RequestExecutorImpl extends MockHttpExecutor {
    RequestExecutorImpl() { super(SosService.class); }
    @Override public Client kvp() { return get("/kvp"); }
    @Override public Client pox() { return post("/pox"); }
    @Override public Client soap() { return post("/soap"); }
}

} ```

How to provide tests

Tests are instances of AbstractComplianceSuiteTest. The class provides methods to obtain an RequestExecutor/Client to issue requests:

```java import static org.hamcrest.Matchers.; import static org.junit.Assert.assertThat; import static org.n52.sos.service.it.v2.ExceptionMatchers.; import org.junit.Test; import org.n52.sos.service.it.*; import org.w3c.dom.Node;

public class GetObservationTest extends AbstractComplianceSuiteTest {

@Test public void missingServiceParameter() {
    Node node = getExecutor().kvp()
            .query("request", "GetObservation")
            .query("version", "2.0.0")
            .response().asNode();
    assertThat(node, is(missingServiceParameterValueException()));
}

} ```

Owner

  • Name: 52°North Spatial Information Research GmbH
  • Login: 52North
  • Kind: organization
  • Email: info@52north.org
  • Location: Münster

Advancing spatial information infrastructures to foster open science

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 1
  • Total pull requests: 51
  • Average time to close issues: N/A
  • Average time to close pull requests: 16 days
  • Total issue authors: 1
  • Total pull request authors: 6
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.67
  • Merged pull requests: 22
  • Bot issues: 0
  • Bot pull requests: 36
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (34)
  • CarstenHollmann (9)
  • srstsavage (2)
  • autermann (2)
  • JLLeitschuh (1)
  • PasunuriSrinidhi (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (34) java (32) github_actions (2)

Dependencies

common/pom.xml maven
  • com.github.spotbugs:spotbugs-annotations
  • javax.servlet:javax.servlet-api
  • org.apache.xmlbeans:xmlbeans
  • org.hamcrest:hamcrest
  • org.n52.sensorweb:52n-xml-soap-v12
  • org.springframework:spring-test
  • xml-apis:xml-apis
  • stax:stax-api test
pom.xml maven
  • javax.servlet:javax.servlet-api 4.0.1 provided
  • ch.qos.logback:logback-classic 1.2.11
  • com.github.spotbugs:spotbugs-annotations 4.7.0
  • joda-time:joda-time 2.10.14
  • junit:junit 4.13.2
  • org.apache.xmlbeans:xmlbeans 3.1.0
  • org.hamcrest:hamcrest 2.2
  • org.hamcrest:hamcrest-library 2.2
  • org.n52.arctic-sea:iceland 9.5.3
  • org.n52.arctic-sea:shetland 9.5.3
  • org.n52.sensorweb-server.sos:test-suite-common 2.0.0-SNAPSHOT
  • org.n52.sensorweb-server.sos:test-suite-sos-100 2.0.0-SNAPSHOT
  • org.n52.sensorweb-server.sos:test-suite-sos-20 2.0.0-SNAPSHOT
  • org.n52.sensorweb:52n-xml-gml-v321 2.7.0
  • org.n52.sensorweb:52n-xml-om-v20 2.7.0
  • org.n52.sensorweb:52n-xml-ows-v110 2.7.0
  • org.n52.sensorweb:52n-xml-sensorML-v101 2.7.0
  • org.n52.sensorweb:52n-xml-soap-v12 2.7.0
  • org.n52.sensorweb:52n-xml-sos-v20 2.7.0
  • org.n52.sensorweb:52n-xml-sosdo-v10 2.7.0
  • org.n52.sensorweb:52n-xml-sosdo-v20 2.7.0
  • org.n52.sensorweb:52n-xml-sweCommon-v20 2.7.0
  • org.n52.sensorweb:52n-xml-swes-v20 2.7.0
  • org.slf4j:jcl-over-slf4j 1.7.36
  • org.slf4j:jul-to-slf4j 1.7.36
  • org.slf4j:log4j-over-slf4j 1.7.36
  • org.slf4j:slf4j-api 1.7.36
  • org.springframework:spring-core 5.3.20
  • org.springframework:spring-test 5.3.20
  • stax:stax-api 1.0.1
  • xml-apis:xml-apis 1.4.01
sos-20/pom.xml maven
  • ${project.groupId}:test-suite-common
  • javax.servlet:javax.servlet-api
  • joda-time:joda-time
  • org.apache.xmlbeans:xmlbeans
  • org.hamcrest:hamcrest
  • org.n52.arctic-sea:shetland
  • org.n52.sensorweb:52n-xml-gml-v321
  • org.n52.sensorweb:52n-xml-om-v20
  • org.n52.sensorweb:52n-xml-ows-v110
  • org.n52.sensorweb:52n-xml-sensorML-v101
  • org.n52.sensorweb:52n-xml-sos-v20
  • org.n52.sensorweb:52n-xml-sosdo-v10
  • org.n52.sensorweb:52n-xml-sweCommon-v20
  • org.n52.sensorweb:52n-xml-swes-v20
  • org.springframework:spring-test
  • stax:stax-api
  • xml-apis:xml-apis
.github/workflows/codeql-analysis.yml actions
  • actions/checkout v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite
.github/workflows/daily.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-java v3 composite
.github/workflows/pull.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-java v3 composite
.github/workflows/push.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-java v3 composite
sos-100/pom.xml maven