Add APPC-related Activities for WFD 66/82166/3
authorElena Kuleshov <evn@att.com>
Wed, 13 Mar 2019 17:26:54 +0000 (13:26 -0400)
committerElena Kuleshov <evn@att.com>
Thu, 14 Mar 2019 03:57:39 +0000 (23:57 -0400)
Add APP-C related Activities for WFD with JUnits; corrected JUnits

Change-Id: I1a7142f692945843e7942b43b6fe68e23ea21e96
Issue-ID: SO-1518
Signed-off-by: Kuleshov, Elena <evn@att.com>
19 files changed:
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFLockActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSnapShotActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStartActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStopActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnlockActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeBackupActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java

diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFLockActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFLockActivity.bpmn
new file mode 100644 (file)
index 0000000..1aaa920
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFLockActivity" name="VNFLockActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFLockActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFLockActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFLockActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskLock" targetRef="VNFLockActivity_End" />
+    <bpmn:serviceTask id="TaskLock" name="VNF Lock" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionLock&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskLock" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFLockActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFLockActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFLockActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskLock">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSnapShotActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSnapShotActivity.bpmn
new file mode 100644 (file)
index 0000000..8115f69
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFSnapShotActivity" name="VNFSnapShotActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFSnapShotActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFSnapShotActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFSnapShotActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskSnapShot" targetRef="VNFSnapShotActivity_End" />
+    <bpmn:serviceTask id="TaskSnapShot" name="VNF SnapShot" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionSnapshot&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskSnapShot" />
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFSnapShotActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFSnapShotActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFSnapShotActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskSnapShot">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStartActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStartActivity.bpmn
new file mode 100644 (file)
index 0000000..f0490a9
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFStartActivity" name="VNFStartActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFStartActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFStartActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFStartActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskStart" targetRef="VNFStartActivity_End" />
+    <bpmn:serviceTask id="TaskStart" name="VNF Start" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionStart&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskStart" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFStartActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFStartActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFStartActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskStart">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStopActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFStopActivity.bpmn
new file mode 100644 (file)
index 0000000..0e02295
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFStopActivity" name="VNFStopActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFStopActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFStopActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFStopActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskStop" targetRef="VNFStopActivity_End" />
+    <bpmn:serviceTask id="TaskStop" name="VNF Stop" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionStop&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskStop" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFStopActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFStopActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFStopActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskStop">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnlockActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnlockActivity.bpmn
new file mode 100644 (file)
index 0000000..6d1b68c
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFUnlockActivity" name="VNFUnlockActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFUnlockActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFUnlockActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFUnlockActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskUnlock" targetRef="VNFUnlockActivity_End" />
+    <bpmn:serviceTask id="TaskUnlock" name="VNF Unlock" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionUnlock&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskUnlock" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFUnlockActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFUnlockActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFUnlockActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskUnlock">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeBackupActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeBackupActivity.bpmn
new file mode 100644 (file)
index 0000000..dfcf997
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFUpgradeBackupActivity" name="VNFUpgradeBackupActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFUpgradeBackupActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFUpgradeBackupActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFUpgradeBackupActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskUpgradeBackup" targetRef="VNFUpgradeBackupActivity_End" />
+    <bpmn:serviceTask id="TaskUpgradeBackup" name="VNF UpgradeBackup" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionUpgradeBackup&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskUpgradeBackup" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFUpgradeBackupActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFUpgradeBackupActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFUpgradeBackupActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskUpgradeBackup">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
index 9c745fd..8e76f8f 100644 (file)
@@ -25,7 +25,6 @@ import static org.mockito.Mockito.doThrow;
 
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
 import org.onap.so.bpmn.BaseBPMNTest;
@@ -44,8 +43,8 @@ public class VNFHealthCheckActivityTest extends BaseBPMNTest{
        }
        
        @Test
-       @Ignore
        public void rainyDayVNFHealthCheckActivity_Test() throws Exception {
+               variables.put("actionHealthCheck", Action.HealthCheck);
                doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
                                .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
                ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFHealthCheckActivity", variables);
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFLockActivityTest.java
new file mode 100644 (file)
index 0000000..f36a72f
--- /dev/null
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 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.
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFLockActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFLockActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFLockActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFLockActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskLock",                                                                
+                               "VNFLockActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test   
+       public void rainyDayVNFLockActivity_Test() throws Exception {
+               variables.put("actionLock", Action.Lock);
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFLockActivity", variables);
+               assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFLockActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskLock").hasNotPassed(                                                                  
+                               "VNFLockActivity_End");         
+       }
+       
+}
index e8d603e..2d9b952 100644 (file)
@@ -25,7 +25,6 @@ import static org.mockito.Mockito.doThrow;
 
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
 import org.onap.so.bpmn.BaseBPMNTest;
@@ -44,8 +43,8 @@ public class VNFQuiesceTrafficActivityTest extends BaseBPMNTest{
        }
        
        @Test
-       @Ignore
        public void rainyDayVNFQuiesceTrafficActivity_Test() throws Exception {
+               variables.put("actionQuiesceTraffic", Action.QuiesceTraffic);
                doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
                                .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
                ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFQuiesceTrafficActivity", variables);
index 75ff1eb..d541cdf 100644 (file)
@@ -25,7 +25,6 @@ import static org.mockito.Mockito.doThrow;
 
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
 import org.onap.so.bpmn.BaseBPMNTest;
@@ -44,8 +43,8 @@ public class VNFResumeTrafficActivityTest extends BaseBPMNTest{
        }
        
        @Test
-       @Ignore
        public void rainyDayVNFResumeTrafficActivity_Test() throws Exception {
+               variables.put("actionResumeTraffic", Action.ResumeTraffic);
                doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
                                .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
                ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFResumeTrafficActivity", variables);
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSnapShotActivityTest.java
new file mode 100644 (file)
index 0000000..f6bfd04
--- /dev/null
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 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.
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFSnapShotActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFSnapShotActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSnapShotActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFSnapShotActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskSnapShot",                                                            
+                               "VNFSnapShotActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test   
+       public void rainyDayVNFSnapShotActivity_Test() throws Exception {
+               variables.put("actionSnapshot", Action.Snapshot);
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSnapShotActivity", variables);
+               assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFSnapShotActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskSnapShot").hasNotPassed(                                                              
+                               "VNFSnapShotActivity_End");             
+       }
+       
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStartActivityTest.java
new file mode 100644 (file)
index 0000000..6e4be69
--- /dev/null
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 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.
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFStartActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFStartActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStartActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFStartActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskStart",                                                               
+                               "VNFStartActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test   
+       public void rainyDayVNFStartActivity_Test() throws Exception {
+               variables.put("actionStart", Action.Start);
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStartActivity", variables);
+               assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFStartActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskStart").hasNotPassed(                                                                 
+                               "VNFStartActivity_End");                
+       }
+       
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFStopActivityTest.java
new file mode 100644 (file)
index 0000000..3bc5940
--- /dev/null
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 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.
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFStopActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFStopActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStopActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFStopActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskStop",                                                                
+                               "VNFStopActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test   
+       public void rainyDayVNFStopActivity_Test() throws Exception {
+               variables.put("actionStop", Action.Stop);
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFStopActivity", variables);
+               assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFStopActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskStop").hasNotPassed(                                                                  
+                               "VNFStopActivity_End");         
+       }
+       
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnlockActivityTest.java
new file mode 100644 (file)
index 0000000..d0db70b
--- /dev/null
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 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.
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFUnlockActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFUnlockActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnlockActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFUnlockActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskUnlock",                                                              
+                               "VNFUnlockActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test   
+       public void rainyDayVNFUnlockActivity_Test() throws Exception {
+               variables.put("actionUnlock", Action.Unlock);
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnlockActivity", variables);
+               assertThat(pi).isNotNull().isStarted().hasPassedInOrder("VNFUnlockActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskUnlock").hasNotPassed(                                                                
+                               "VNFUnlockActivity_End");               
+       }
+       
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeBackupActivityTest.java
new file mode 100644 (file)
index 0000000..c68196c
--- /dev/null
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 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.
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFUpgradeBackupActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFUpgradeBackupActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeBackupActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeBackupActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskUpgradeBackup",                                                               
+                               "VNFUpgradeBackupActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test
+       public void rainyDayVNFUpgradeBackupActivity_Test() throws Exception {
+               variables.put("actionUpgradeBackup", Action.UpgradeBackup);
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeBackupActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeBackupActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskUpgradeBackup").hasNotPassed(                                                                 
+                               "VNFUpgradeBackupActivity_End");                
+               assertThat(pi).isEnded();
+       }
+       
+}
index b3976ad..5fa9307 100644 (file)
@@ -25,7 +25,6 @@ import static org.mockito.Mockito.doThrow;
 
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
 import org.onap.so.bpmn.BaseBPMNTest;
@@ -43,8 +42,9 @@ public class VNFUpgradePostCheckActivityTest extends BaseBPMNTest{
        }
        
        @Test
-       @Ignore
        public void rainyDayVNFUpgradePostCheckActivity_Test() throws Exception {
+               variables.put("actionUpgradePostCheck", Action.UpgradePostCheck);
+               
                doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
                                .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
                ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePostCheckActivity", variables);
index 15f314b..40f5df8 100644 (file)
@@ -25,7 +25,6 @@ import static org.mockito.Mockito.doThrow;
 
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
 import org.onap.so.bpmn.BaseBPMNTest;
@@ -44,8 +43,8 @@ public class VNFUpgradePreCheckActivityTest extends BaseBPMNTest{
        }
        
        @Test
-       @Ignore
        public void rainyDayVNFUpgradePreCheckActivity_Test() throws Exception {
+               variables.put("actionUpgradePreCheck", Action.UpgradePreCheck);
                doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
                                .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
                ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePreCheckActivity", variables);
index 11f88d2..91e6bf4 100644 (file)
@@ -25,7 +25,6 @@ import static org.mockito.Mockito.doThrow;
 
 import org.camunda.bpm.engine.delegate.BpmnError;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.onap.so.bpmn.common.BuildingBlockExecution;
 import org.onap.so.bpmn.BaseBPMNTest;
@@ -44,8 +43,8 @@ public class VNFUpgradeSoftwareActivityTest extends BaseBPMNTest{
        }
        
        @Test
-       @Ignore
        public void rainyDayVNFUpgradeSoftwareActivity_Test() throws Exception {
+               variables.put("actionUpgradeSoftware", Action.UpgradeSoftware);
                doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
                                .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
                ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeSoftwareActivity", variables);
index e0516ce..85cbb75 100644 (file)
@@ -68,6 +68,7 @@ public class AppcRunTasks {
                execution.setVariable("actionResumeTraffic", Action.ResumeTraffic);             
                execution.setVariable("actionStop", Action.Stop);
                execution.setVariable("actionStart", Action.Start);
+               execution.setVariable("actionHealthCheck", Action.HealthCheck);
                execution.setVariable("rollbackVnfStop", false);
                execution.setVariable("rollbackVnfLock", false);
                execution.setVariable("rollbackQuiesceTraffic", false);