Skip to content

Commit

Permalink
Enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
bpross-52n committed Oct 29, 2021
1 parent b3a36da commit bafa882
Show file tree
Hide file tree
Showing 19 changed files with 656 additions and 106 deletions.
4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This executable test suite is for the OGC API - Processes draft standard.

Visit the http://opengeospatial.github.io/ets-ogcapi-processes10/[project documentation website]
Visit the http://opengeospatial.github.io/ets-ogcapi-processes10/[project documentation website TBD]
for more information, including the API documentation.

== How to build the test suite
Expand All @@ -22,7 +22,7 @@ If you would like to get involved, you can:

* https://github.com/opengeospatial/ets-ogcapi-processes10/issues[Report an issue] such as a defect or
an enhancement request
* Help to resolve an https://github.com/opengeospatial/ets-ogcapi-features10/issues?q=is%3Aopen[open issue]
* Help to resolve an https://github.com/opengeospatial/ets-ogcapi-processes10/issues?q=is%3Aopen[open issue]
* Fix a bug: Fork the repository, apply the fix, and create a pull request
* Add new tests: Fork the repository, implement and verify the tests on a new topic branch,
and create a pull request (don't forget to periodically rebase long-lived branches so
Expand Down
2 changes: 1 addition & 1 deletion jenkinsfiles/build/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pipeline {
stage('Preparation') {
steps{
deleteDir()
sh 'git clone [email protected]:opengeospatial/ets-ogcapi-tiles10.git .'
sh 'git clone [email protected]:opengeospatial/ets-ogcapi-processes10.git .'
}
}
stage('Build') {
Expand Down
2 changes: 1 addition & 1 deletion jenkinsfiles/release/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pipeline {
stage('Preparation') {
steps{
deleteDir()
sh 'git clone [email protected]:opengeospatial/ets-ogcapi-tiles10.git .'
sh 'git clone [email protected]:opengeospatial/ets-ogcapi-processes10.git .'
}
}
stage('Release') {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<properties>
<ets-code>ogcapi-processes-1.0</ets-code>
<spec-version>0.1</spec-version>
<docker.teamengine.version>5.4</docker.teamengine.version>
<docker.teamengine.version>5.5-SNAPSHOT</docker.teamengine.version>
</properties>

<dependencies>
Expand Down
47 changes: 35 additions & 12 deletions src/main/java/org/opengis/cite/ogcapiprocesses10/CommonFixture.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.openapi4j.core.validation.ValidationResults.ValidationItem;
import org.openapi4j.parser.model.v3.OpenApi3;
import org.openapi4j.parser.model.v3.Server;
import org.opengis.cite.ogcapiprocesses10.CommonFixture.Output;
import org.opengis.cite.ogcapiprocesses10.util.ClientUtils;
import org.testng.ITestContext;
import org.testng.annotations.BeforeClass;
Expand Down Expand Up @@ -47,6 +46,12 @@ public class CommonFixture {
protected URI rootUri;

protected final String CONTENT_TYPE = "Content-Type";

protected final String CONTENT_MEDIA_TYPE_PROPERTY_KEY = "contentMediaType";

protected final String CONTENT_SCHEMA_PROPERTY_KEY = "contentSchema";

protected final String CONTENT_ENCODING_PROPERTY_KEY = "contentEncoding";

/**
* Initializes the common test fixture with a client component for interacting with HTTP endpoints.
Expand All @@ -60,6 +65,7 @@ public void initCommonFixture( ITestContext testContext ) {
rootUri = (URI) testContext.getSuite().getAttribute( SuiteAttribute.IUT.getName() );
try {
specURI = new URI("https://raw.githubusercontent.com/opengeospatial/ogcapi-processes/master/openapi.yaml");
// specURI = new URI("file:///d:/tmp2/geoprocessing-WPS-all-in-one-1.0-draft.7-SNAPSHOT-oas3-swagger.yaml");
} catch (URISyntaxException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -116,16 +122,12 @@ private void initLogging() {
responseLoggingFilter = new ResponseLoggingFilter( responsePrintStream );
}

protected String printResults(ValidationResults validationResults) {

List<ValidationItem> validationItems = validationResults.items();

StringBuilder printedResultsStringBuilder = new StringBuilder();

protected String printResults(ValidationResults validationResults) {
List<ValidationItem> validationItems = validationResults.items();
StringBuilder printedResultsStringBuilder = new StringBuilder();
for (ValidationItem validationItem : validationItems) {
printedResultsStringBuilder.append(validationItem + "\n");
}

}
return printedResultsStringBuilder.toString();
}

Expand Down Expand Up @@ -162,8 +164,7 @@ protected Input createInput(JsonNode schemaNode, String id) {
if(format.equals("byte")) {
type.setBinary(true);
}
}

}
}
input.addType(type);
}else {
Expand Down Expand Up @@ -198,7 +199,18 @@ protected Input createInput(JsonNode schemaNode, String id) {
type.setBinary(true);
}
}

JsonNode contentMediaTypeNode = oneOfChildNode.get(CONTENT_MEDIA_TYPE_PROPERTY_KEY);
if(contentMediaTypeNode != null && !contentMediaTypeNode.isMissingNode()) {
type.setContentMediaType(contentMediaTypeNode.asText());
}
JsonNode contentEncodingNode = oneOfChildNode.get(CONTENT_ENCODING_PROPERTY_KEY);
if(contentEncodingNode != null && !contentEncodingNode.isMissingNode()) {
type.setContentEncoding(contentEncodingNode.asText());
}
JsonNode contentSchemaNode = oneOfChildNode.get(CONTENT_SCHEMA_PROPERTY_KEY);
if(contentSchemaNode != null && !contentSchemaNode.isMissingNode()) {
type.setContentSchema(contentSchemaNode.asText());
}
}
input.addType(type);
}
Expand All @@ -219,11 +231,13 @@ public class Type {
private String typeDefinition;
private String contentEncoding;
private String contentMediaType;
private String contentSchema;
private boolean isBinary;

public Type(String typeDefinition) {
this.typeDefinition = typeDefinition;
}

public boolean isBinary() {
return isBinary;
}
Expand All @@ -248,6 +262,15 @@ public void setContentMediaType(String contentMediaType) {
this.contentMediaType = contentMediaType;
}

public void setContentSchema(String schema) {
this.contentSchema = schema;

}

public String getContentSchema() {
return contentSchema;
}

public String getTypeDefinition() {
return typeDefinition;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class ErrorMessage {

private static final String BASE_NAME =
"org.opengis.cite.ogcapifeatures10.MessageBundle";
"org.opengis.cite.ogcapiprocesses10.MessageBundle";
private static ResourceBundle msgResources =
ResourceBundle.getBundle(BASE_NAME);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void storeRequirementClassesInTestContext( ITestContext testContext ) {
}

/**
* Partly addresses Requirement 1 : /req/tiles/core/conformance-success
* Partly addresses Requirement 1 : /req/processes/core/conformance-success
*
* @param testPoint
* the test point to test, never <code>null</code>
Expand All @@ -79,7 +79,7 @@ public void validateConformanceOperationAndResponse( TestPoint testPoint ) {
}

/**
* Requirement 1 : /req/tiles/core/conformance-success
* Requirement 1 : /req/processes/core/conformance-success
*
* Abstract Test ?: /ats/core/conformance-success
*/
Expand All @@ -89,7 +89,7 @@ private void validateConformanceOperationResponse( String testPointUri, Response
JsonPath jsonPath = response.jsonPath();
this.requirementClasses = parseAndValidateRequirementClasses( jsonPath );
assertTrue( this.requirementClasses.contains( CORE ),
"Requirement class \"http://www.opengis.net/spec/ogcapi-tiles-1/1.0/conf/core\" is not available from path "
"Requirement class \"http://www.opengis.net/spec/ogcapi-processes-1/1.0/conf/core\" is not available from path "
+ testPointUri );
}

Expand All @@ -106,7 +106,6 @@ List<RequirementClass> parseAndValidateRequirementClasses( JsonPath jsonPath ) {

List<RequirementClass> requirementClasses = new ArrayList<>();
for ( Object conformTo : conformsTo ) {
System.out.println("conformsTo "+conformsTo);
if ( conformTo instanceof String ) {
String conformanceClass = (String) conformTo;
RequirementClass requirementClass = RequirementClass.byConformanceClass( conformanceClass );
Expand Down
Loading

0 comments on commit bafa882

Please sign in to comment.