Merge "Default should be an object on TOSCA properties"
authorPamela Dragosh <pdragosh@research.att.com>
Fri, 16 Oct 2020 13:32:46 +0000 (13:32 +0000)
committerGerrit Code Review <gerrit@onap.org>
Fri, 16 Oct 2020 13:32:46 +0000 (13:32 +0000)
71 files changed:
models-base/pom.xml
models-dao/pom.xml
models-decisions/pom.xml
models-errors/pom.xml
models-examples/pom.xml
models-examples/src/main/resources/policytypes/onap.policies.native.Drools.yaml
models-interactions/model-actors/actor.aai/pom.xml
models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetPnfOperation.java
models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiGetTenantOperation.java
models-interactions/model-actors/actor.aai/src/main/java/org/onap/policy/controlloop/actor/aai/AaiUtil.java
models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/BasicAaiOperation.java
models-interactions/model-actors/actor.appc/pom.xml
models-interactions/model-actors/actor.appclcm/pom.xml
models-interactions/model-actors/actor.cds/pom.xml
models-interactions/model-actors/actor.cds/src/test/resources/org/onap/policy/simulators/cds/my_artifact-subscribe.json [new file with mode: 0644]
models-interactions/model-actors/actor.guard/pom.xml
models-interactions/model-actors/actor.sdnc/pom.xml
models-interactions/model-actors/actor.sdnr/pom.xml
models-interactions/model-actors/actor.so/pom.xml
models-interactions/model-actors/actor.test/pom.xml
models-interactions/model-actors/actor.vfc/pom.xml
models-interactions/model-actors/actorServiceProvider/pom.xml
models-interactions/model-actors/pom.xml
models-interactions/model-impl/aai/pom.xml
models-interactions/model-impl/appc/pom.xml
models-interactions/model-impl/appclcm/pom.xml
models-interactions/model-impl/cds/pom.xml
models-interactions/model-impl/events/pom.xml
models-interactions/model-impl/guard/pom.xml
models-interactions/model-impl/pom.xml
models-interactions/model-impl/rest/pom.xml
models-interactions/model-impl/sdnc/pom.xml
models-interactions/model-impl/sdnr/pom.xml
models-interactions/model-impl/so/pom.xml
models-interactions/model-impl/vfc/pom.xml
models-interactions/model-simulators/pom.xml
models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/CdsSimulator.java
models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/CdsSimulatorTest.java
models-interactions/pom.xml
models-pap/pom.xml
models-pdp/pom.xml
models-provider/pom.xml
models-sim/models-sim-dmaap/pom.xml
models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/parameters/DmaapSimParameterGroup.java
models-sim/packages/models-simulator-docker/pom.xml
models-sim/packages/models-simulator-tarball/pom.xml
models-sim/packages/models-simulator-tarball/src/main/assembly.xml
models-sim/packages/models-simulator-tarball/src/main/resources/etc/logback.xml [new file with mode: 0644]
models-sim/packages/pom.xml
models-sim/policy-models-sim-pdp/pom.xml
models-sim/policy-models-simulators/pom.xml
models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/Main.java
models-sim/policy-models-simulators/src/main/java/org/onap/policy/models/simulators/SimulatorParameters.java
models-sim/policy-models-simulators/src/test/java/org/onap/policy/models/simulators/MainTest.java
models-sim/policy-models-simulators/src/test/java/org/onap/policy/models/simulators/SimulatorParametersTest.java
models-sim/policy-models-simulators/src/test/resources/emptyRestServer.json [new file with mode: 0644]
models-sim/policy-models-simulators/src/test/resources/invalidDmaapName.json [new file with mode: 0644]
models-sim/policy-models-simulators/src/test/resources/invalidDmaapProvider.json [new file with mode: 0644]
models-sim/policy-models-simulators/src/test/resources/invalidGrpcServer.json [new file with mode: 0644]
models-sim/policy-models-simulators/src/test/resources/invalidSimParameters.json [deleted file]
models-sim/policy-models-simulators/src/test/resources/invalidTopicSweep.json [new file with mode: 0644]
models-sim/policy-models-simulators/src/test/resources/minParameters.json [new file with mode: 0644]
models-sim/policy-models-simulators/src/test/resources/simParameters.json
models-sim/pom.xml
models-tosca/pom.xml
pom.xml
releases/2.3.2.yaml [new file with mode: 0644]
releases/2.3.3.yaml [new file with mode: 0644]
releases/2.3.4.yaml [new file with mode: 0644]
version.properties

index 5cd00b3..d9cd648 100644 (file)
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-base</artifactId>
index 8d1b723..a3567ec 100644 (file)
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-dao</artifactId>
index f9d609a..8592f07 100644 (file)
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-decisions</artifactId>
index 3fa4baa..8420540 100644 (file)
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-errors</artifactId>
index f9a5fa7..ccfba39 100644 (file)
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-examples</artifactId>
index 382999f..95c87e1 100644 (file)
@@ -111,7 +111,7 @@ data_types:
     onap.datatypes.drools.controller.relation:
         derived_from: tosca.datatypes.Root
         properties:
-            controllerName:
+            name:
                 type: string
                 required: true
                 description: the name of drools controller policy
index 4b2dc45..521d7bc 100644 (file)
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.aai</artifactId>
index d89d835..a4b3065 100644 (file)
@@ -26,7 +26,6 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 import javax.ws.rs.client.Invocation.Builder;
 import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.MediaType;
 import org.onap.policy.aai.AaiConstants;
 import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
 import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
@@ -70,8 +69,6 @@ public class AaiGetPnfOperation extends AaiGetOperation {
     protected CompletableFuture<OperationOutcome> startOperationAsync(int attempt, OperationOutcome outcome) {
         Map<String, Object> headers = makeHeaders();
 
-        headers.put("Accept", MediaType.APPLICATION_JSON);
-
         StringBuilder str = new StringBuilder(getClient().getBaseUrl());
 
         String path = getPath() + URI_SEP + URLEncoder.encode(getTargetEntity(), StandardCharsets.UTF_8);
index fe11798..add9c64 100644 (file)
@@ -24,7 +24,6 @@ import java.util.Map;
 import java.util.concurrent.CompletableFuture;
 import javax.ws.rs.client.Invocation.Builder;
 import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.MediaType;
 import org.onap.policy.aai.AaiConstants;
 import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
 import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
@@ -65,9 +64,7 @@ public class AaiGetTenantOperation extends AaiGetOperation {
 
     @Override
     protected CompletableFuture<OperationOutcome> startOperationAsync(int attempt, OperationOutcome outcome) {
-        Map<String, Object> headers = makeHeaders();
-
-        headers.put("Accept", MediaType.APPLICATION_JSON);
+        final Map<String, Object> headers = makeHeaders();
 
         StringBuilder str = new StringBuilder(getClient().getBaseUrl());
 
index 14edc3a..c44e9d8 100644 (file)
@@ -22,6 +22,7 @@ package org.onap.policy.controlloop.actor.aai;
 
 import java.util.HashMap;
 import java.util.Map;
+import javax.ws.rs.core.MediaType;
 import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
 
 /**
@@ -44,6 +45,7 @@ public class AaiUtil {
 
         headers.put("X-FromAppId", "POLICY");
         headers.put("X-TransactionId", params.getRequestId().toString());
+        headers.put("Accept", MediaType.APPLICATION_JSON);
 
         return headers;
     }
index 1f481ae..9479d06 100644 (file)
@@ -70,5 +70,6 @@ public abstract class BasicAaiOperation extends BasicHttpOperation {
     protected void verifyHeaders(Map<String, Object> headers) {
         assertEquals("POLICY", headers.get("X-FromAppId").toString());
         assertEquals(params.getRequestId().toString(), headers.get("X-TransactionId"));
+        assertEquals("application/json", headers.get("Accept").toString());
     }
 }
index 765f764..74b208e 100644 (file)
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.appc</artifactId>
index e4c48cf..1450fb6 100644 (file)
@@ -24,7 +24,7 @@
   <parent>
    <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
     <artifactId>model-actors</artifactId>
-    <version>2.3.2-SNAPSHOT</version>
+    <version>2.3.5-SNAPSHOT</version>
   </parent>
 
   <artifactId>actor.appclcm</artifactId>
index a01c32b..a467807 100644 (file)
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
     <artifactId>actor.cds</artifactId>
     <dependencies>
diff --git a/models-interactions/model-actors/actor.cds/src/test/resources/org/onap/policy/simulators/cds/my_artifact-subscribe.json b/models-interactions/model-actors/actor.cds/src/test/resources/org/onap/policy/simulators/cds/my_artifact-subscribe.json
new file mode 100644 (file)
index 0000000..307ee93
--- /dev/null
@@ -0,0 +1,27 @@
+{
+  "commonHeader": {
+    "timestamp": "2020-03-20T14:00:25.217Z",
+    "requestId": "123456-1000",
+    "subRequestId": "sub-123456-1000",
+    "flag": {
+    },
+    "originatorId": "sdnc"
+  },
+  "actionIdentifiers": {
+    "blueprintName": "my_artifact",
+    "blueprintVersion": "1.0.0",
+    "actionName": "subscribe",
+    "mode": "sync"
+  },
+  "status": {
+    "code": 200,
+    "message": "success",
+    "eventType": "EVENT_COMPONENT_EXECUTED",
+    "timestamp": "2020-07-02T14:56:25.608Z"
+  },
+  "payload": {
+    "subscription-response": {
+        "status": "success"
+    }
+  }
+}
\ No newline at end of file
index cf2b2ff..9c82ecc 100644 (file)
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.guard</artifactId>
index 37df2b7..9fa0102 100644 (file)
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.sdnc</artifactId>
index 813e113..9e0613e 100644 (file)
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.sdnr</artifactId>
index 78599f2..96a9510 100644 (file)
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.so</artifactId>
index 4c3b7d9..4c83822 100644 (file)
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.test</artifactId>
index d03ff5c..54a8fb8 100644 (file)
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>actor.vfc</artifactId>
index 3c2ad0a..b2570f3 100644 (file)
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
         <artifactId>model-actors</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>actorServiceProvider</artifactId>
index 4e30c59..0d0679c 100644 (file)
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.onap.policy.models</groupId>
     <artifactId>policy-models-interactions</artifactId>
-    <version>2.3.2-SNAPSHOT</version>
+    <version>2.3.5-SNAPSHOT</version>
   </parent>
 
   <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
index 6a823be..c33dc54 100644 (file)
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
         <artifactId>model-impl</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>aai</artifactId>
index 51f131b..09c066c 100644 (file)
@@ -26,7 +26,7 @@
   <parent>
     <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
     <artifactId>model-impl</artifactId>
-    <version>2.3.2-SNAPSHOT</version>
+    <version>2.3.5-SNAPSHOT</version>
   </parent>
 
   <artifactId>appc</artifactId>
index 6d438b9..60b9aee 100644 (file)
@@ -26,7 +26,7 @@
   <parent>
     <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
     <artifactId>model-impl</artifactId>
-    <version>2.3.2-SNAPSHOT</version>
+    <version>2.3.5-SNAPSHOT</version>
   </parent>
 
   <artifactId>appclcm</artifactId>
index 347bad6..73ca43c 100644 (file)
@@ -25,7 +25,7 @@
   <parent>
     <artifactId>model-impl</artifactId>
     <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
-    <version>2.3.2-SNAPSHOT</version>
+    <version>2.3.5-SNAPSHOT</version>
   </parent>
 
   <artifactId>cds</artifactId>
index 89bfd84..e543d03 100644 (file)
@@ -26,7 +26,7 @@
   <parent>
     <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
     <artifactId>model-impl</artifactId>
-    <version>2.3.2-SNAPSHOT</version>
+    <version>2.3.5-SNAPSHOT</version>
   </parent>
 
   <artifactId>events</artifactId>
index 19e1c67..6626c59 100644 (file)
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
     <artifactId>model-impl</artifactId>
-    <version>2.3.2-SNAPSHOT</version>
+    <version>2.3.5-SNAPSHOT</version>
   </parent>
 
   <artifactId>guard</artifactId>
index 8ea0b77..dd068ee 100644 (file)
@@ -27,7 +27,7 @@
   <parent>
       <groupId>org.onap.policy.models</groupId>
       <artifactId>policy-models-interactions</artifactId>
-      <version>2.3.2-SNAPSHOT</version>
+      <version>2.3.5-SNAPSHOT</version>
   </parent>
 
   <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
index 72a081e..2c0d5ab 100644 (file)
@@ -26,7 +26,7 @@
   <parent>
     <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
     <artifactId>model-impl</artifactId>
-    <version>2.3.2-SNAPSHOT</version>
+    <version>2.3.5-SNAPSHOT</version>
   </parent>
 
   <artifactId>rest</artifactId>
index 54b2b38..997d25f 100644 (file)
@@ -24,7 +24,7 @@
   <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
         <artifactId>model-impl</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
   </parent>
 
   <artifactId>sdnc</artifactId>
index 3114725..c2e4a02 100644 (file)
@@ -27,7 +27,7 @@
   <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
         <artifactId>model-impl</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
    </parent>
 
   <artifactId>sdnr</artifactId>
index 9a9a8ab..a6f8bc3 100644 (file)
@@ -26,7 +26,7 @@
   <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
         <artifactId>model-impl</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
   </parent>
 
   <artifactId>so</artifactId>
index 014a646..f9137d3 100644 (file)
@@ -24,7 +24,7 @@
   <parent>
         <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
         <artifactId>model-impl</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
   <artifactId>vfc</artifactId>
index e496fc0..2a1fe2d 100644 (file)
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models-interactions</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <groupId>org.onap.policy.models.policy-models-interactions</groupId>
index 3418780..222bd7f 100644 (file)
@@ -29,18 +29,26 @@ import io.grpc.netty.NettyServerBuilder;
 import io.grpc.stub.StreamObserver;
 import java.io.IOException;
 import java.net.InetSocketAddress;
+import java.time.Instant;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import lombok.Getter;
 import org.apache.commons.lang3.StringUtils;
 import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers;
+import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType;
+import org.onap.ccsdk.cds.controllerblueprints.common.api.Status;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput.Builder;
 import org.onap.policy.common.utils.resources.ResourceUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class CdsSimulator implements Runnable {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(CdsSimulator.class);
 
-public class CdsSimulator {
     @Getter
     private final int port;
 
@@ -77,16 +85,15 @@ public class CdsSimulator {
 
             @Override
             public StreamObserver<ExecutionServiceInput> process(
-                            final StreamObserver<ExecutionServiceOutput> responseObserver) {
+                final StreamObserver<ExecutionServiceOutput> responseObserver) {
 
                 return new StreamObserver<ExecutionServiceInput>() {
 
                     @Override
                     public void onNext(final ExecutionServiceInput executionServiceInput) {
+                        LOGGER.info("Received request input to CDS: {}", executionServiceInput);
                         try {
-                            String responseString = getResponseString(executionServiceInput, countOfSuccesfulEvents);
-                            Builder builder = ExecutionServiceOutput.newBuilder();
-                            JsonFormat.parser().ignoringUnknownFields().merge(responseString, builder);
+                            Builder builder = getResponse(executionServiceInput, countOfSuccesfulEvents);
                             TimeUnit.MILLISECONDS.sleep(requestedResponseDelayMs);
                             responseObserver.onNext(builder.build());
                         } catch (InvalidProtocolBufferException e) {
@@ -111,13 +118,25 @@ public class CdsSimulator {
         };
 
         server = NettyServerBuilder.forAddress(new InetSocketAddress(host, port)).addService(testCdsBlueprintServerImpl)
-                        .build();
+            .build();
     }
 
+    /**
+     * Start the server.
+     *
+     * @throws IOException IO exception.
+     */
     public void start() throws IOException {
         server.start();
+        // The grpc server uses daemon threads by default. Hence the application will exit as soon the main thread
+        // completes. So, wrap the server in a non-daemon thread and call awaitTermination to keep the thread alive
+        // until the server is terminated.
+        new Thread(this).start();
     }
 
+    /**
+     * Stop the server.
+     */
     public void stop() {
         server.shutdown();
     }
@@ -127,9 +146,11 @@ public class CdsSimulator {
      *
      * @param executionServiceInput service input
      * @param countOfSuccesfulEvents number of successive successful events
-     * @return  responseString
+     * @return builder for ExecutionServiceOutput response
+     * @throws InvalidProtocolBufferException when response string cannot be converted
      */
-    public String getResponseString(ExecutionServiceInput executionServiceInput, int countOfSuccesfulEvents) {
+    public Builder getResponse(ExecutionServiceInput executionServiceInput, int countOfSuccesfulEvents)
+        throws InvalidProtocolBufferException {
         String resourceName = "DefaultResponseEvent";
         if (!StringUtils.isBlank(executionServiceInput.getActionIdentifiers().getActionName())) {
             ActionIdentifiers actionIdentifiers = executionServiceInput.getActionIdentifiers();
@@ -141,11 +162,33 @@ public class CdsSimulator {
         } else {
             resourceName = resourceName + ".json";
         }
+        LOGGER.info("Fetching response from {}", resourceName);
         String responseString = ResourceUtils.getResourceAsString(resourceLocation + resourceName);
-        if (responseString == null) {
-            responseString = ResourceUtils.getResourceAsString(resourceLocation
-                + "DefaultResponseEvent.json");
+        Builder builder = ExecutionServiceOutput.newBuilder();
+        if (null == responseString) {
+            LOGGER.info("Expected response file {} not found in {}", resourceName, resourceLocation);
+            ActionIdentifiers actionIdentifiers = executionServiceInput.getActionIdentifiers();
+            builder.setCommonHeader(executionServiceInput.getCommonHeader());
+            builder.setActionIdentifiers(actionIdentifiers);
+            builder.setPayload(executionServiceInput.getPayload());
+            builder.setStatus(Status.newBuilder().setCode(500).setMessage("failure")
+                .setErrorMessage("failed to get  get cba file name(" + actionIdentifiers.getBlueprintName()
+                    + "), version(" + actionIdentifiers.getBlueprintVersion() + ") from db : file check failed.")
+                .setEventType(EventType.EVENT_COMPONENT_FAILURE).setTimestamp(Instant.now().toString()));
+        } else {
+            LOGGER.debug("Returning response from CDS Simulator: {}", responseString);
+            JsonFormat.parser().ignoringUnknownFields().merge(responseString, builder);
+        }
+        return builder;
+    }
+
+    @Override
+    public void run() {
+        try {
+            server.awaitTermination();
+        } catch (InterruptedException e) {
+            LOGGER.info("gRPC server is terminated");
+            Thread.currentThread().interrupt();
         }
-        return responseString;
     }
 }
index efc4036..d9fb52b 100644 (file)
@@ -52,7 +52,7 @@ public class Util {
 
     private static final String CANNOT_PROCESS_PARAMETERS = "cannot parse parameters ";
     private static final String CANNOT_CONNECT = "cannot connect to port ";
-    private static final String LOCALHOST = "localhost";
+    public static final String LOCALHOST = "localhost";
 
     private Util() {
         // Prevent instantiation of this class
index fea03e3..07ec0dc 100644 (file)
@@ -24,6 +24,7 @@ package org.onap.policy.simulators;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import com.google.protobuf.util.JsonFormat;
 import io.grpc.ManagedChannel;
 import io.grpc.internal.DnsNameResolverProvider;
 import io.grpc.internal.PickFirstLoadBalancerProvider;
@@ -42,9 +43,11 @@ import org.junit.Test;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceStub;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput.Builder;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
+import org.onap.policy.common.utils.network.NetworkUtil;
 import org.onap.policy.common.utils.resources.ResourceUtils;
 
 public class CdsSimulatorTest {
@@ -52,9 +55,15 @@ public class CdsSimulatorTest {
 
     private CdsSimulator sim;
 
+    /**
+     * Starts the simulator, allocating a unique port for each test so we don't have to
+     * wait for the prior server to shut down.
+     */
     @Before
     public void setUp() throws Exception {
-        sim = Util.buildCdsSim();
+        int port = NetworkUtil.allocPort();
+        sim = new CdsSimulator(Util.LOCALHOST, port);
+        sim.start();
     }
 
     @After
@@ -65,8 +74,10 @@ public class CdsSimulatorTest {
     @Test
     public void test() throws Exception {
         String reqstr = IOUtils.toString(getClass().getResource("cds/cds.request.json"), StandardCharsets.UTF_8);
-        ExecutionServiceInput request = coder.decode(reqstr, ExecutionServiceInput.class);
-        ManagedChannel channel = NettyChannelBuilder.forAddress("localhost", sim.getPort())
+        Builder builder = ExecutionServiceInput.newBuilder();
+        JsonFormat.parser().ignoringUnknownFields().merge(reqstr, builder);
+        ExecutionServiceInput request = builder.build();
+        ManagedChannel channel = NettyChannelBuilder.forAddress(Util.LOCALHOST, sim.getPort())
             .nameResolverFactory(new DnsNameResolverProvider())
             .loadBalancerFactory(new PickFirstLoadBalancerProvider()).usePlaintext().build();
 
@@ -117,13 +128,16 @@ public class CdsSimulatorTest {
     }
 
     @Test
-    public void testGetResponseString() throws IOException, CoderException, ParseException {
-        CdsSimulator cdsSimulator = new CdsSimulator("localhost", sim.getPort());
+    public void testGetResponse() throws IOException, CoderException, ParseException {
+        CdsSimulator cdsSimulator = new CdsSimulator(Util.LOCALHOST, sim.getPort());
         String reqstr = ResourceUtils.getResourceAsString(
             "org/onap/policy/simulators/cds/cds.request.json");
         String responseqstr = ResourceUtils.getResourceAsString(
             "org/onap/policy/simulators/cds/pm_control-create-subscription.json");
         ExecutionServiceInput request = coder.decode(reqstr, ExecutionServiceInput.class);
-        assertEquals(responseqstr, cdsSimulator.getResponseString(request, 0));
+        org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput.Builder esoBuilder =
+            ExecutionServiceOutput.newBuilder();
+        JsonFormat.parser().ignoringUnknownFields().merge(responseqstr, esoBuilder);
+        assertEquals(esoBuilder.toString(), cdsSimulator.getResponse(request, 0).toString());
     }
 }
index d0e7f44..e0f5ab5 100644 (file)
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.onap.policy.models</groupId>
     <artifactId>policy-models</artifactId>
-    <version>2.3.2-SNAPSHOT</version>
+    <version>2.3.5-SNAPSHOT</version>
   </parent>
   <artifactId>policy-models-interactions</artifactId>
   <packaging>pom</packaging>
index c782753..8abed9a 100644 (file)
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-pap</artifactId>
index fdb5022..8190476 100644 (file)
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-pdp</artifactId>
index 362552c..2cb4091 100644 (file)
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-provider</artifactId>
index bb71eef..487cec7 100644 (file)
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.onap.policy.models.sim</groupId>
         <artifactId>policy-models-sim</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-sim-dmaap</artifactId>
index 11da575..9719ae9 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
- *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index c6f4717..b9c181f 100644 (file)
@@ -1,6 +1,7 @@
 <!--
   ============LICENSE_START=======================================================
    Copyright (C) 2020 Bell Canada.
+   Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -23,8 +24,8 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.onap.policy.models.sim</groupId>
-        <artifactId>policy-models-sim</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <artifactId>models-sim-packages</artifactId>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>models-simulator-docker</artifactId>
@@ -43,6 +44,8 @@
         <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
         <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
+        <!-- There is no code in this sub-module, only holds interfaces. So skip sonar. -->
+        <sonar.skip>true</sonar.skip>
     </properties>
 
     <build>
         <dependency>
             <groupId>org.onap.policy.models.sim</groupId>
             <artifactId>models-simulator-tarball</artifactId>
-            <version>2.3.2-SNAPSHOT</version>
+           <version>${project.version}</version>
             <classifier>tarball</classifier>
             <type>tar.gz</type>
         </dependency>
index 9fb1fb5..c8c2088 100644 (file)
@@ -3,6 +3,7 @@
   ONAP
   ================================================================================
    Copyright (C) 2020 Bell Canada.
+   Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -26,8 +27,8 @@
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.onap.policy.models.sim</groupId>
-    <artifactId>policy-models-sim</artifactId>
-    <version>2.3.2-SNAPSHOT</version>
+    <artifactId>models-sim-packages</artifactId>
+    <version>2.3.5-SNAPSHOT</version>
   </parent>
 
   <artifactId>models-simulator-tarball</artifactId>
   <name>${project.artifactId}</name>
   <description>A module that runs all "simulators", including DMaaP.</description>
 
+  <properties>
+      <!-- There is no code in this sub-module, only holds interfaces. So skip sonar. -->
+      <sonar.skip>true</sonar.skip>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>org.onap.policy.models.sim</groupId>
       <artifactId>policy-models-simulators</artifactId>
-      <version>2.3.2-SNAPSHOT</version>
+      <version>${project.version}</version>
     </dependency>
   </dependencies>
 
index 9a2fd65..47395e1 100644 (file)
             <outputDirectory>etc${file.separator}ssl</outputDirectory>
             <lineEnding>keep</lineEnding>
         </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/resources/etc
+            </directory>
+            <includes>
+                <include>*.xml</include>
+            </includes>
+            <outputDirectory>etc</outputDirectory>
+            <lineEnding>unix</lineEnding>
+        </fileSet>
     </fileSets>
 </assembly>
diff --git a/models-sim/packages/models-simulator-tarball/src/main/resources/etc/logback.xml b/models-sim/packages/models-simulator-tarball/src/main/resources/etc/logback.xml
new file mode 100644 (file)
index 0000000..131b0fe
--- /dev/null
@@ -0,0 +1,42 @@
+<!--
+  ============LICENSE_START=======================================================
+   Copyright (C) 2020 AT&T Intellectual Property.
+  ================================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  SPDX-License-Identifier: Apache-2.0
+  ============LICENSE_END=========================================================
+-->
+
+<configuration scan="true" scanPeriod="30 seconds" debug="false">
+
+    <!--
+        This is only used for testing and only a snapshot docker image is generated,
+        thus it is not necessary for the messages to following the ONAP standard.
+        Therefore, keeping it short so it's easier to wade through the output.
+
+        Also sending all output to stdout instead of to a log file; it can be viewed
+        via "docker logs" or captured by kubernetes.
+     -->
+
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <Pattern>%d %level  %msg%n</Pattern>
+        </encoder>
+    </appender>
+
+    <root level="INFO">
+        <appender-ref ref="STDOUT" />
+    </root>
+
+</configuration>
index 1492255..ceabde6 100644 (file)
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.onap.policy.models.sim</groupId>
         <artifactId>policy-models-sim</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>models-sim-packages</artifactId>
index 18d6160..22425df 100644 (file)
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.onap.policy.models.sim</groupId>
     <artifactId>policy-models-sim</artifactId>
-    <version>2.3.2-SNAPSHOT</version>
+    <version>2.3.5-SNAPSHOT</version>
   </parent>
   <artifactId>policy-models-sim-pdp</artifactId>
   <name>policy-models-sim-pdp</name>
index 9cd19e4..c129783 100644 (file)
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.policy.models.sim</groupId>
         <artifactId>policy-models-sim</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-simulators</artifactId>
index a0fafbc..f82423c 100644 (file)
@@ -83,18 +83,22 @@ public class Main extends ServiceManagerContainer {
         }
 
         DmaapSimParameterGroup dmaapProv = params.getDmaapProvider();
-        String dmaapName = dmaapProv.getName();
-        String provName = dmaapName.replace("simulator", "provider");
+        String dmaapName = (dmaapProv != null ? dmaapProv.getName() : null);
 
         // dmaap provider
-        AtomicReference<DmaapSimProvider> provRef = new AtomicReference<>();
-        addAction(provName, () -> provRef.set(buildDmaapProvider(dmaapProv)), () -> provRef.get().shutdown());
+        if (dmaapProv != null) {
+            String provName = dmaapName.replace("simulator", "provider");
+            AtomicReference<DmaapSimProvider> provRef = new AtomicReference<>();
+            addAction(provName, () -> provRef.set(buildDmaapProvider(dmaapProv)), () -> provRef.get().shutdown());
+        }
 
         CdsServerParameters cdsServer = params.getGrpcServer();
 
         // Cds Simulator
-        AtomicReference<CdsSimulator> cdsSim = new AtomicReference<>();
-        addAction(cdsServer.getName(), () -> cdsSim.set(buildCdsSimulator(cdsServer)), () -> cdsSim.get().stop());
+        if (cdsServer != null) {
+            AtomicReference<CdsSimulator> cdsSim = new AtomicReference<>();
+            addAction(cdsServer.getName(), () -> cdsSim.set(buildCdsSimulator(cdsServer)), () -> cdsSim.get().stop());
+        }
 
         // REST server simulators
         // @formatter:off
@@ -276,7 +280,7 @@ public class Main extends ServiceManagerContainer {
         props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_SWAGGER_SUFFIX, "false");
         props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX, "true");
 
-        if (dmaapName.equals(params.getName())) {
+        if (dmaapName != null && dmaapName.equals(params.getName())) {
             props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_SERIALIZATION_PROVIDER,
                             String.join(",", CambriaMessageBodyHandler.class.getName(),
                                             GsonMessageBodyHandler.class.getName(),
index 788829f..4b60d5e 100644 (file)
@@ -27,14 +27,14 @@ import lombok.Getter;
 import org.onap.policy.common.endpoints.parameters.TopicParameters;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.common.parameters.BeanValidator;
-import org.onap.policy.common.parameters.annotations.NotNull;
+import org.onap.policy.common.parameters.ObjectValidationResult;
+import org.onap.policy.common.parameters.ValidationStatus;
 import org.onap.policy.models.sim.dmaap.parameters.DmaapSimParameterGroup;
 
 /**
  * Simulator parameters.
  */
 @Getter
-@NotNull
 public class SimulatorParameters {
 
     /**
@@ -77,6 +77,24 @@ public class SimulatorParameters {
     public BeanValidationResult validate(String containerName) {
         BeanValidationResult result = new BeanValidator().validateTop(containerName, this);
 
+        if (dmaapProvider != null) {
+            // do not want full validation of the provider, so validate the relevant
+            // fields ourselves
+            BeanValidationResult subResult = new BeanValidationResult("dmaapProvider", dmaapProvider);
+            subResult.validateNotNull("name", dmaapProvider.getName());
+            if (dmaapProvider.getTopicSweepSec() < 1) {
+                ObjectValidationResult fieldResult =
+                                new ObjectValidationResult("topicSweepSec", dmaapProvider.getTopicSweepSec(),
+                                                ValidationStatus.INVALID, "is below the minimum value: 1");
+                subResult.addResult(fieldResult);
+            }
+            result.addResult(subResult);
+        }
+
+        if (grpcServer != null) {
+            result.addResult(grpcServer.validate());
+        }
+
         result.validateList("restServers", restServers, params -> params.validate("restServers"));
         result.validateList("topicServers", topicServers, params -> params.validate("topicServers"));
 
index e9e8cbd..f5598e2 100644 (file)
@@ -109,7 +109,7 @@ public class MainTest {
 
     @Test
     public void testConstructor() throws Exception {
-        assertThatIllegalArgumentException().isThrownBy(() -> new Main("invalidSimParameters.json"))
+        assertThatIllegalArgumentException().isThrownBy(() -> new Main("invalidDmaapProvider.json"))
                         .withMessage("invalid simulator parameters");
     }
 
@@ -125,7 +125,7 @@ public class MainTest {
         Main.main(new String[] {PARAMETER_FILE});
 
         // don't need to wait long, because buildXxx() does the wait for us
-        for (int port = 6666; port <= 6670; ++port) {
+        for (int port : new int[] {6666, 6667, 6668, 6669, 6670, 6680}) {
             assertTrue("simulator on port " + port, NetworkUtil.isTcpPortOpen(HOST, port, 1, 100));
         }
 
@@ -133,6 +133,13 @@ public class MainTest {
         checkAai();
     }
 
+    @Test
+    public void testMainMinimalParameters() {
+        Main.main(new String[] {"minParameters.json"});
+        assertNotNull(Main.getInstance());
+        assertTrue(Main.getInstance().isAlive());
+    }
+
     private void checkAai() throws HttpClientConfigException {
         BusTopicParams params = BusTopicParams.builder().clientName("client").hostname(HOST).port(6666).useHttps(true)
                         .allowSelfSignedCerts(true).basePath("aai").build();
index 5294ca4..8094ca4 100644 (file)
@@ -20,6 +20,7 @@
 
 package org.onap.policy.models.simulators;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -34,14 +35,51 @@ public class SimulatorParametersTest {
 
     @Test
     public void testValidate() throws CoderException {
-        // some fields missing
-        BeanValidationResult result = new SimulatorParameters().validate("InvalidParams");
-        assertFalse(result.isValid());
-        assertNotNull(result.getResult());
-
-        // everything populated
         SimulatorParameters params = new StandardCoder().decode(new File("src/test/resources/simParameters.json"),
                         SimulatorParameters.class);
         assertNull(params.validate("ValidParams").getResult());
     }
+
+    @Test
+    public void testValidateEmptyRestServer() throws CoderException {
+        SimulatorParameters params = new StandardCoder()
+                        .decode(new File("src/test/resources/emptyRestServer.json"), SimulatorParameters.class);
+        assertNull(params.validate("ValidParams").getResult());
+    }
+
+    @Test
+    public void testValidateInvalidDmaapProvider() throws CoderException {
+        SimulatorParameters params = new StandardCoder()
+                        .decode(new File("src/test/resources/invalidDmaapProvider.json"), SimulatorParameters.class);
+        BeanValidationResult result = params.validate("InvalidDmaapParams");
+        assertFalse(result.isValid());
+        assertNotNull(result.getResult());
+    }
+
+    @Test
+    public void testValidateInvalidDmaapName() throws CoderException {
+        SimulatorParameters params = new StandardCoder().decode(
+                        new File("src/test/resources/invalidDmaapName.json"), SimulatorParameters.class);
+        BeanValidationResult result = params.validate("InvalidDmaapParams");
+        assertFalse(result.isValid());
+        assertThat(result.getResult()).contains("item \"name\" value \"null\"");
+    }
+
+    @Test
+    public void testValidateInvalidTopicSweep() throws CoderException {
+        SimulatorParameters params = new StandardCoder().decode(
+                        new File("src/test/resources/invalidTopicSweep.json"), SimulatorParameters.class);
+        BeanValidationResult result = params.validate("InvalidDmaapParams");
+        assertFalse(result.isValid());
+        assertThat(result.getResult()).contains("topicSweepSec");
+    }
+
+    @Test
+    public void testValidateInvalidGrpcServer() throws CoderException {
+        SimulatorParameters params = new StandardCoder()
+                        .decode(new File("src/test/resources/invalidGrpcServer.json"), SimulatorParameters.class);
+        BeanValidationResult result = params.validate("InvalidGrpcParams");
+        assertFalse(result.isValid());
+        assertNotNull(result.getResult());
+    }
 }
diff --git a/models-sim/policy-models-simulators/src/test/resources/emptyRestServer.json b/models-sim/policy-models-simulators/src/test/resources/emptyRestServer.json
new file mode 100644 (file)
index 0000000..4a86253
--- /dev/null
@@ -0,0 +1,11 @@
+{
+    "dmaapProvider": {
+        "name": "DMaaP simulator",
+        "topicSweepSec": 300,
+        "restServerParameters": {}
+    },
+    "restServers": [],
+    "topicSinks": [],
+    "topicSources": [],
+    "topicServers": []
+}
diff --git a/models-sim/policy-models-simulators/src/test/resources/invalidDmaapName.json b/models-sim/policy-models-simulators/src/test/resources/invalidDmaapName.json
new file mode 100644 (file)
index 0000000..889c4c8
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "dmaapProvider": {
+        "name": null,
+        "topicSweepSec":300
+    },
+    "restServers": [],
+    "topicSinks": [],
+    "topicSources": [],
+    "topicServers": []
+}
diff --git a/models-sim/policy-models-simulators/src/test/resources/invalidDmaapProvider.json b/models-sim/policy-models-simulators/src/test/resources/invalidDmaapProvider.json
new file mode 100644 (file)
index 0000000..ff67901
--- /dev/null
@@ -0,0 +1,7 @@
+{
+    "dmaapProvider": {},
+    "restServers": [],
+    "topicSinks": [],
+    "topicSources": [],
+    "topicServers": []
+}
diff --git a/models-sim/policy-models-simulators/src/test/resources/invalidGrpcServer.json b/models-sim/policy-models-simulators/src/test/resources/invalidGrpcServer.json
new file mode 100644 (file)
index 0000000..86e4253
--- /dev/null
@@ -0,0 +1,7 @@
+{
+    "grpcServer": {},
+    "restServers": [],
+    "topicSinks": [],
+    "topicSources": [],
+    "topicServers": []
+}
diff --git a/models-sim/policy-models-simulators/src/test/resources/invalidSimParameters.json b/models-sim/policy-models-simulators/src/test/resources/invalidSimParameters.json
deleted file mode 100644 (file)
index 2c63c08..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-{
-}
diff --git a/models-sim/policy-models-simulators/src/test/resources/invalidTopicSweep.json b/models-sim/policy-models-simulators/src/test/resources/invalidTopicSweep.json
new file mode 100644 (file)
index 0000000..11a37d5
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "dmaapProvider": {
+        "name": "DMaaP simulator",
+        "topicSweepSec":0
+    },
+    "restServers": [],
+    "topicSinks": [],
+    "topicSources": [],
+    "topicServers": []
+}
diff --git a/models-sim/policy-models-simulators/src/test/resources/minParameters.json b/models-sim/policy-models-simulators/src/test/resources/minParameters.json
new file mode 100644 (file)
index 0000000..c7ea498
--- /dev/null
@@ -0,0 +1,14 @@
+{
+    "restServers": [
+        {
+            "name": "A&AI simulator",
+            "providerClass": "org.onap.policy.simulators.AaiSimulatorJaxRs",
+            "host": "localhost",
+            "port": 6766,
+            "https": true
+        }
+    ],
+    "topicSinks": [],
+    "topicSources": [],
+    "topicServers": []
+}
index 1d1c0aa..df8de6f 100644 (file)
@@ -1,10 +1,7 @@
 {
     "dmaapProvider": {
         "name": "DMaaP simulator",
-        "topicSweepSec": 300,
-        "restServerParameters": {
-
-        }
+        "topicSweepSec": 300
     },
     "restServers": [
         {
index ce9cfae..40eb2a1 100644 (file)
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.onap.policy.models</groupId>
     <artifactId>policy-models</artifactId>
-    <version>2.3.2-SNAPSHOT</version>
+    <version>2.3.5-SNAPSHOT</version>
   </parent>
 
   <groupId>org.onap.policy.models.sim</groupId>
index 9c79ee0..5369120 100644 (file)
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.onap.policy.models</groupId>
         <artifactId>policy-models</artifactId>
-        <version>2.3.2-SNAPSHOT</version>
+        <version>2.3.5-SNAPSHOT</version>
     </parent>
 
     <artifactId>policy-models-tosca</artifactId>
diff --git a/pom.xml b/pom.xml
index 5b518f1..b7e9a91 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
 
     <groupId>org.onap.policy.models</groupId>
     <artifactId>policy-models</artifactId>
-    <version>2.3.2-SNAPSHOT</version>
+    <version>2.3.5-SNAPSHOT</version>
 
     <packaging>pom</packaging>
     <name>policy-models</name>
diff --git a/releases/2.3.2.yaml b/releases/2.3.2.yaml
new file mode 100644 (file)
index 0000000..775ce71
--- /dev/null
@@ -0,0 +1,4 @@
+distribution_type: 'maven'
+version: '2.3.2'
+project: 'policy-models'
+log_dir: 'policy-models-maven-stage-master/493/'
diff --git a/releases/2.3.3.yaml b/releases/2.3.3.yaml
new file mode 100644 (file)
index 0000000..bf62bba
--- /dev/null
@@ -0,0 +1,4 @@
+distribution_type: 'maven'
+version: '2.3.3'
+project: 'policy-models'
+log_dir: 'policy-models-maven-stage-master/495/'
diff --git a/releases/2.3.4.yaml b/releases/2.3.4.yaml
new file mode 100644 (file)
index 0000000..164a967
--- /dev/null
@@ -0,0 +1,4 @@
+distribution_type: 'maven'
+version: '2.3.4'
+project: 'policy-models'
+log_dir: 'policy-models-maven-stage-master/496/'
index 16dbea1..c0e0aca 100644 (file)
@@ -4,7 +4,7 @@
 
 major=2
 minor=3
-patch=2
+patch=5
 
 base_version=${major}.${minor}.${patch}