aboutsummaryrefslogtreecommitdiffstats
path: root/policy-management/src/test/java/org
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2020-02-11 07:59:26 -0600
committerjhh <jorge.hernandez-herrero@att.com>2020-02-11 07:59:26 -0600
commit572adf3400a4fd552a5f780d20db417233eee4c1 (patch)
tree14349be3c783512f8a93baee8219f1bc88de64e6 /policy-management/src/test/java/org
parentea6425417a0abfcf9ca9c8271fafdcb7b8047903 (diff)
Move model base classes outside feature-lifecycle
So, it can be used in drools-application without a feature dependency. Issue-ID: POLICY-2360 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I1cf75bdd8739c35ea9b590896b177a519363e3d5
Diffstat (limited to 'policy-management/src/test/java/org')
-rw-r--r--policy-management/src/test/java/org/onap/policy/drools/domain/models/DroolsPolicyTest.java52
1 files changed, 52 insertions, 0 deletions
diff --git a/policy-management/src/test/java/org/onap/policy/drools/domain/models/DroolsPolicyTest.java b/policy-management/src/test/java/org/onap/policy/drools/domain/models/DroolsPolicyTest.java
new file mode 100644
index 00000000..22edbb44
--- /dev/null
+++ b/policy-management/src/test/java/org/onap/policy/drools/domain/models/DroolsPolicyTest.java
@@ -0,0 +1,52 @@
+/*
+ * ============LICENSE_START=======================================================
+ * 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.
+ * 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=========================================================
+ */
+
+package org.onap.policy.drools.domain.models;
+
+import com.openpojo.reflection.impl.PojoClassFactory;
+import com.openpojo.validation.Validator;
+import com.openpojo.validation.ValidatorBuilder;
+import com.openpojo.validation.test.impl.GetterTester;
+import com.openpojo.validation.test.impl.SetterTester;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.SuperBuilder;
+import org.junit.Test;
+
+public class DroolsPolicyTest {
+
+ @Data
+ @SuperBuilder
+ @NoArgsConstructor
+ public static class DerivedDomainPolicy extends DroolsPolicy implements Serializable {
+ private static final long serialVersionUID = -1027974819756498893L;
+ }
+
+ @Test
+ public void testPackage() {
+ /* validate model pojos */
+ Validator validator = ValidatorBuilder.create()
+ .with(new SetterTester(), new GetterTester()).build();
+
+ validator.validate(PojoClassFactory.getPojoClass(DerivedDomainPolicy.class));
+ }
+
+} \ No newline at end of file
ackground-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.8.2" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
  <bpmn2:process id="ChangeModelServiceInstanceBB" name="ChangeModelServiceInstanceBB" isExecutable="true">
    <bpmn2:startEvent id="ChangeModelServiceInstance_Start">
      <bpmn2:outgoing>SequenceFlow_18i4a05</bpmn2:outgoing>
    </bpmn2:startEvent>
    <bpmn2:endEvent id="ChangeModelServiceInstance_End">
      <bpmn2:incoming>SequenceFlow_0g502yj</bpmn2:incoming>
    </bpmn2:endEvent>
    <bpmn2:sequenceFlow id="SequenceFlow_18i4a05" sourceRef="ChangeModelServiceInstance_Start" targetRef="SDNCChangeModelServiceInstance" />
    <bpmn2:sequenceFlow id="SequenceFlow_0g502yj" sourceRef="AAIUpdateModelServiceInstance" targetRef="ChangeModelServiceInstance_End" />
    <bpmn2:serviceTask id="SDNCChangeModelServiceInstance" name="&#10;SDNC &#10;Change&#10;(svc instance)&#10;" camunda:expression="${SDNCChangeAssignTasks.changeModelServiceInstance(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
      <bpmn2:incoming>SequenceFlow_18i4a05</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_1q3rjt4</bpmn2:outgoing>
    </bpmn2:serviceTask>
    <bpmn2:serviceTask id="AAIUpdateModelServiceInstance" name="&#10;AAI &#10;Update&#10;(svc Instance)&#10;" camunda:expression="${AAIUpdateTasks.updateServiceInstance(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
      <bpmn2:incoming>SequenceFlow_0ycnbyf</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_0g502yj</bpmn2:outgoing>
    </bpmn2:serviceTask>
    <bpmn2:callActivity id="CallActivity_sdncHandlerReq" name="SDNC ChangeModel (svc instance)" calledElement="SDNCHandler">
      <bpmn2:extensionElements>
        <camunda:in source="SDNCRequest" target="SDNCRequest" />
        <camunda:out source="SDNCResponse" target="SDNCResponse" />
        <camunda:out source="WorkflowException" target="WorkflowException" />
        <camunda:in source="mso-request-id" target="mso-request-id" />
      </bpmn2:extensionElements>
      <bpmn2:incoming>SequenceFlow_1q3rjt4</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_0ycnbyf</bpmn2:outgoing>
    </bpmn2:callActivity>
    <bpmn2:sequenceFlow id="SequenceFlow_1q3rjt4" sourceRef="SDNCChangeModelServiceInstance" targetRef="CallActivity_sdncHandlerReq" />
    <bpmn2:sequenceFlow id="SequenceFlow_0ycnbyf" sourceRef="CallActivity_sdncHandlerReq" targetRef="AAIUpdateModelServiceInstance" />
  </bpmn2:process>
  <bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
  <bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" />
  <bpmn2:error id="Error_1vf4z8q" name="gDelegateError" errorCode="7000" />
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ChangeModelServiceInstanceBB">
      <bpmndi:BPMNShape id="StartEvent_0kbx0xk_di" bpmnElement="ChangeModelServiceInstance_Start">
        <dc:Bounds x="74.89184952978059" y="88.42789968652036" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="81" y="128" width="24" height="12" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="EndEvent_0zsc8pz_di" bpmnElement="ChangeModelServiceInstance_End">
        <dc:Bounds x="631.6078576723498" y="88" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="641" y="128" width="19" height="12" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="SequenceFlow_18i4a05_di" bpmnElement="SequenceFlow_18i4a05">
        <di:waypoint xsi:type="dc:Point" x="111" y="106" />
        <di:waypoint xsi:type="dc:Point" x="158" y="106" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="89.5" y="85" width="90" height="12" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="SequenceFlow_0g502yj_di" bpmnElement="SequenceFlow_0g502yj">
        <di:waypoint xsi:type="dc:Point" x="589" y="106" />
        <di:waypoint xsi:type="dc:Point" x="632" y="106" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="565.5" y="85" width="90" height="12" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="ServiceTask_03km5f0_di" bpmnElement="SDNCChangeModelServiceInstance">
        <dc:Bounds x="158" y="66" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="ServiceTask_10b2mxq_di" bpmnElement="AAIUpdateModelServiceInstance">
        <dc:Bounds x="489" y="66" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="CallActivity_1heowq0_di" bpmnElement="CallActivity_sdncHandlerReq">
        <dc:Bounds x="315" y="66" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="SequenceFlow_1q3rjt4_di" bpmnElement="SequenceFlow_1q3rjt4">
        <di:waypoint xsi:type="dc:Point" x="258" y="106" />
        <di:waypoint xsi:type="dc:Point" x="315" y="106" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="286.5" y="85" width="0" height="12" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="SequenceFlow_0ycnbyf_di" bpmnElement="SequenceFlow_0ycnbyf">
        <di:waypoint xsi:type="dc:Point" x="415" y="106" />
        <di:waypoint xsi:type="dc:Point" x="489" y="106" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="452" y="85" width="0" height="12" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn2:definitions>