Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #122 #129

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
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
316 changes: 78 additions & 238 deletions pom.xml

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions src/assembly/aio.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
<useProjectArtifact>true</useProjectArtifact>
<unpack>true</unpack>
<scope>runtime</scope>
<excludes>
<exclude>com.sun.jersey:jersey-server</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>
18 changes: 4 additions & 14 deletions src/assembly/deps.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,14 @@
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<includes>
<include>com.sun.jersey:jersey-client</include>
<include>org.opengis.cite:schema-utils</include>
</includes>
<outputDirectory>/</outputDirectory>
<unpack>false</unpack>
<scope>runtime</scope>
<useTransitiveDependencies>false</useTransitiveDependencies>
</dependencySet>
<dependencySet>
<excludes>
<exclude>org.opengis.cite.teamengine:teamengine-spi</exclude>
<exclude>com.sun.jersey:jersey-client</exclude>
<exclude>org.opengis.cite:schema-utils</exclude>
<exclude>*:jersey-client</exclude>
<exclude>*:jersey-server</exclude>
<exclude>*:jersey-hk2</exclude>
<exclude>jakarta.ws.rs:jakarta.ws.rs-api</exclude>
<exclude>com.beust:jcommander</exclude>
<exclude>com.sun.jersey:jersey-core</exclude>
<exclude>javax.ws.rs:jsr311-api</exclude>
<exclude>org.testng:testng</exclude>
</excludes>
<outputDirectory>/</outputDirectory>
Expand Down
7 changes: 6 additions & 1 deletion src/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM tomcat:7.0-jre8
FROM tomcat:10.1-jre17

RUN apt update && apt install -y unzip

# add TEAM engine webapp
ADD maven/dependency/teamengine-web-*.war /root/
Expand All @@ -14,12 +16,15 @@ RUN cd /root/ && unzip -q teamengine-console-*-base.zip -d /root/te_base

# set TE_BASE
ENV JAVA_OPTS="-Xms1024m -Xmx2048m -DTE_BASE=/root/te_base"
ENV JPDA_ADDRESS="*:8000"

# add ETS
ADD maven/ets-ogcapi-edr10-*-ctl.zip /root/
RUN cd /root/ && unzip -q ets-ogcapi-edr10-*-ctl.zip -d /root/te_base/scripts
ADD maven/ets-ogcapi-edr10-*-deps.zip /root/
RUN cd /root/ && unzip -q -o ets-ogcapi-edr10-*-deps.zip -d /usr/local/tomcat/webapps/teamengine/WEB-INF/lib

RUN rm -R /root/te_base/scripts/note

# run tomcat
CMD ["catalina.sh", "jpda", "run"]
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package org.opengis.cite.ogcapiedr10;

import com.beust.jcommander.Parameter;

import java.io.File;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;

import com.beust.jcommander.Parameter;

/**
* Declares supported command line arguments that are parsed using the
* JCommander library. All arguments are optional. The default values are as
* follows:
* Declares supported command line arguments that are parsed using the JCommander library.
* All arguments are optional. The default values are as follows:
* <ul>
* <li>XML properties file: ${user.home}/test-run-props.xml</li>
* <li>outputDir: ${user.home}</li>
Expand All @@ -27,35 +26,38 @@
*/
public class CommandLineArguments {

@Parameter(description = "Properties file")
private List<String> xmlProps;

@Parameter(names = {"-o", "--outputDir"}, description = "Output directory")
private String outputDir;

@Parameter(names = {"-d", "--deleteSubjectOnFinish"}, description = "Delete file containing representation of test subject when finished")
private boolean deleteSubjectOnFinish = false;

public CommandLineArguments() {
this.xmlProps = new ArrayList<>();
}

public File getPropertiesFile() {
File fileRef;
if (xmlProps.isEmpty()) {
fileRef = new File(System.getProperty("user.home"), "test-run-props.xml");
} else {
String propsFile = xmlProps.get(0);
fileRef = (propsFile.startsWith("file:")) ? new File(URI.create(propsFile)) : new File(propsFile);
}
return fileRef;
}

public String getOutputDir() {
return (null != outputDir) ? outputDir : System.getProperty("user.home");
}

public boolean doDeleteSubjectOnFinish() {
return deleteSubjectOnFinish;
}
@Parameter(description = "Properties file")
private List<String> xmlProps;

@Parameter(names = { "-o", "--outputDir" }, description = "Output directory")
private String outputDir;

@Parameter(names = { "-d", "--deleteSubjectOnFinish" },
description = "Delete file containing representation of test subject when finished")
private boolean deleteSubjectOnFinish = false;

public CommandLineArguments() {
this.xmlProps = new ArrayList<>();
}

public File getPropertiesFile() {
File fileRef;
if (xmlProps.isEmpty()) {
fileRef = new File(System.getProperty("user.home"), "test-run-props.xml");
}
else {
String propsFile = xmlProps.get(0);
fileRef = (propsFile.startsWith("file:")) ? new File(URI.create(propsFile)) : new File(propsFile);
}
return fileRef;
}

public String getOutputDir() {
return (null != outputDir) ? outputDir : System.getProperty("user.home");
}

public boolean doDeleteSubjectOnFinish() {
return deleteSubjectOnFinish;
}

}
50 changes: 24 additions & 26 deletions src/main/java/org/opengis/cite/ogcapiedr10/CommonDataFixture.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
package org.opengis.cite.ogcapiedr10;

import com.reprezen.kaizen.oasparser.model3.OpenApi3;
import org.opengis.cite.ogcapiedr10.conformance.RequirementClass;
import org.testng.ITestContext;
import org.testng.SkipException;
import org.testng.annotations.BeforeClass;
import static org.opengis.cite.ogcapiedr10.SuiteAttribute.NO_OF_COLLECTIONS;
import static org.opengis.cite.ogcapiedr10.SuiteAttribute.REQUIREMENTCLASSES;

import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import static org.opengis.cite.ogcapiedr10.SuiteAttribute.NO_OF_COLLECTIONS;
import static org.opengis.cite.ogcapiedr10.SuiteAttribute.REQUIREMENTCLASSES;
import org.opengis.cite.ogcapiedr10.conformance.RequirementClass;
import org.testng.ITestContext;
import org.testng.SkipException;
import org.testng.annotations.BeforeClass;

import com.reprezen.kaizen.oasparser.model3.OpenApi3;

/**
* @author <a href="mailto:[email protected]">Lyn Goltz </a>
Expand All @@ -22,29 +23,26 @@ public class CommonDataFixture extends CommonFixture {
private static final int DEFAULT_NUMBER_OF_COLLECTIONS = 3;

private OpenApi3 apiModel = null;

public URI modelUri = null;

private List<RequirementClass> requirementClasses;

protected int noOfCollections = DEFAULT_NUMBER_OF_COLLECTIONS;



public OpenApi3 getModel()
{
if(this.apiModel==null) {

public OpenApi3 getModel() {
if (this.apiModel == null) {
String msg = "apiModel is null in CommonDataFixture";
System.out.println(msg);
throw new NullPointerException(msg);
}
return this.apiModel;
}
}

@BeforeClass
public void requirementClasses(ITestContext testContext) {
this.requirementClasses = (List<RequirementClass>) testContext.getSuite()
.getAttribute(REQUIREMENTCLASSES.getName());
.getAttribute(REQUIREMENTCLASSES.getName());
}

@BeforeClass
Expand All @@ -54,33 +52,32 @@ public void noOfCollections(ITestContext testContext) {
this.noOfCollections = (Integer) noOfCollections;
}
}

private URI appendFormatToURI(URI input)
{

private URI appendFormatToURI(URI input) {
URI modelUri = null;
try {

if (input.toString().contains("?")) {
modelUri = new URI(input.toString() + "f=application/json");
} else {
}
else {
modelUri = new URI(input.toString() + "?f=application/json");
}
} catch (Exception e) {
}
catch (Exception e) {
e.printStackTrace();
}

return modelUri;
}

@BeforeClass
public void retrieveApiModel(ITestContext testContext) {

modelUri = (URI) testContext.getSuite().getAttribute(SuiteAttribute.API_DEFINITION.getName());

this.apiModel = (OpenApi3) testContext.getSuite().getAttribute( SuiteAttribute.API_MODEL.getName() );
}


this.apiModel = (OpenApi3) testContext.getSuite().getAttribute(SuiteAttribute.API_MODEL.getName());
}

protected List<String> createListOfMediaTypesToSupportForOtherResources(Map<String, Object> linkToSelf) {
if (this.requirementClasses == null)
Expand Down Expand Up @@ -111,4 +108,5 @@ protected List<String> createListOfMediaTypesToSupportForFeatureCollectionsAndFe
mediaTypesToSupport.remove(linkToSelf.get("type"));
return mediaTypesToSupport;
}

}
Loading