summaryrefslogtreecommitdiffstats
path: root/examples/examples-onap-vcpe
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@ericsson.com>2018-09-13 15:25:32 +0100
committerliamfallon <liam.fallon@ericsson.com>2018-09-13 15:26:47 +0100
commit4cfa2e2d98f6877d54da304ef17f096284430908 (patch)
treec9452d2bf6bb96fae9c1e8e2d8ce8f8d01e69d22 /examples/examples-onap-vcpe
parent0e23f7634e1e1fb31454c516974613335fcea1a4 (diff)
Sonar/Checkstyle in service/plugins
Sonar and Checkstyle changes in plugins and services, and knock on changes Issue-ID: POLICY-1034 Change-Id: Iff7df74e54fce2c661dcc2fae75ae93d4cacfe5b Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'examples/examples-onap-vcpe')
-rw-r--r--examples/examples-onap-vcpe/pom.xml2
-rw-r--r--examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AaiAndGuardSim.java (renamed from examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSim.java)25
-rw-r--r--examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AaiAndGuardSimEndpoint.java (renamed from examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSimEndpoint.java)50
3 files changed, 70 insertions, 7 deletions
diff --git a/examples/examples-onap-vcpe/pom.xml b/examples/examples-onap-vcpe/pom.xml
index 3080416b2..b0562b9f9 100644
--- a/examples/examples-onap-vcpe/pom.xml
+++ b/examples/examples-onap-vcpe/pom.xml
@@ -83,7 +83,7 @@
<goal>java</goal>
</goals>
<configuration>
- <mainClass>org.onap.policy.apex.auth.clieditor.ApexCLIEditorMain</mainClass>
+ <mainClass>org.onap.policy.apex.auth.clieditor.ApexCommandLineEditorMain</mainClass>
<classpathScope>compile</classpathScope>
<arguments>
<argument>--command-file=${project.basedir}/src/main/resources/policy/${policymodel.name}.apex</argument>
diff --git a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSim.java b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AaiAndGuardSim.java
index f6ae332a8..369e6172c 100644
--- a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSim.java
+++ b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AaiAndGuardSim.java
@@ -27,12 +27,18 @@ import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
import org.glassfish.jersey.server.ResourceConfig;
import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
-public class AAIAndGuardSim {
+/**
+ * The Class AaiAndGuardSim.
+ */
+public class AaiAndGuardSim {
private static final String BASE_URI = "http://localhost:54321/AAIAndGuardSim";
private HttpServer server;
- public AAIAndGuardSim() {
- final ResourceConfig rc = new ResourceConfig(AAIAndGuardSimEndpoint.class);
+ /**
+ * Instantiates a new aai and guard sim.
+ */
+ public AaiAndGuardSim() {
+ final ResourceConfig rc = new ResourceConfig(AaiAndGuardSimEndpoint.class);
server = GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);
while (!server.isStarted()) {
@@ -40,12 +46,23 @@ public class AAIAndGuardSim {
}
}
+ /**
+ * Tear down.
+ *
+ * @throws Exception the exception
+ */
public void tearDown() throws Exception {
server.shutdown();
}
+ /**
+ * The main method.
+ *
+ * @param args the arguments
+ * @throws Exception the exception
+ */
public static void main(final String[] args) throws Exception {
- final AAIAndGuardSim sim = new AAIAndGuardSim();
+ final AaiAndGuardSim sim = new AaiAndGuardSim();
while (true) {
try {
diff --git a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSimEndpoint.java b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AaiAndGuardSimEndpoint.java
index 6c7f7db19..e36ef4d11 100644
--- a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSimEndpoint.java
+++ b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AaiAndGuardSimEndpoint.java
@@ -34,15 +34,22 @@ import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.core.Response;
-
+/**
+ * The Class AaiAndGuardSimEndpoint.
+ */
@Path("/sim")
-public class AAIAndGuardSimEndpoint {
+public class AaiAndGuardSimEndpoint {
private static int postMessagesReceived = 0;
private static int putMessagesReceived = 0;
private static int statMessagesReceived = 0;
private static int getMessagesReceived = 0;
+ /**
+ * Service get stats.
+ *
+ * @return the response
+ */
@Path("/pdp/api/Stats")
@GET
public Response serviceGetStats() {
@@ -51,6 +58,12 @@ public class AAIAndGuardSimEndpoint {
+ ",\"POST\": " + postMessagesReceived + ",\"PUT\": " + putMessagesReceived + "}").build();
}
+ /**
+ * Service guard post request.
+ *
+ * @param jsonString the json string
+ * @return the response
+ */
@Path("/pdp/api/getDecision")
@POST
public Response serviceGuardPostRequest(final String jsonString) {
@@ -65,6 +78,11 @@ public class AAIAndGuardSimEndpoint {
}
}
+ /**
+ * Service get event.
+ *
+ * @return the response
+ */
@Path("/event/GetEvent")
@GET
public Response serviceGetEvent() {
@@ -83,18 +101,34 @@ public class AAIAndGuardSimEndpoint {
return Response.status(200).entity(eventString).build();
}
+ /**
+ * Service get empty event.
+ *
+ * @return the response
+ */
@Path("/event/GetEmptyEvent")
@GET
public Response serviceGetEmptyEvent() {
return Response.status(200).build();
}
+ /**
+ * Service get event bad response.
+ *
+ * @return the response
+ */
@Path("/event/GetEventBadResponse")
@GET
public Response serviceGetEventBadResponse() {
return Response.status(400).build();
}
+ /**
+ * Service post request.
+ *
+ * @param jsonString the json string
+ * @return the response
+ */
@Path("/event/PostEvent")
@POST
public Response servicePostRequest(final String jsonString) {
@@ -112,12 +146,24 @@ public class AAIAndGuardSimEndpoint {
+ ",\"POST\": , " + postMessagesReceived + ",\"PUT\": " + putMessagesReceived + "}").build();
}
+ /**
+ * Service post request bad response.
+ *
+ * @param jsonString the json string
+ * @return the response
+ */
@Path("/event/PostEventBadResponse")
@POST
public Response servicePostRequestBadResponse(final String jsonString) {
return Response.status(400).build();
}
+ /**
+ * Service put request.
+ *
+ * @param jsonString the json string
+ * @return the response
+ */
@Path("/event/PutEvent")
@PUT
public Response servicePutRequest(final String jsonString) {