aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-08-08 03:14:52 -0700
committerSébastien Determe <sd378r@intl.att.com>2017-08-08 12:36:19 +0000
commit249699f8fb908359213697055b66637c9baeda99 (patch)
tree0041a981ee940c8aaf32ecaf77916c36b8f25988 /src/test
parente63aa2efcd5dff2af82b39368d5989763c9cdd6f (diff)
Rework of the unit tests (mainly IT)
Rework of the unit tests (mainly IT) + new example files and test resource config Change-Id: I4970b3710c7decdc8a3265a86115097d4394ad80 Issue-Id: CLAMP-1 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/clamp/clds/AbstractIT.java28
-rw-r--r--src/test/java/org/onap/clamp/clds/it/AsdcIT.java56
-rw-r--r--src/test/java/org/onap/clamp/clds/it/DcaeIT.java2
-rw-r--r--src/test/java/org/onap/clamp/clds/it/PolicyClientIT.java208
-rw-r--r--src/test/java/org/onap/clamp/clds/it/PropJsonBuilderIT.java226
-rw-r--r--src/test/java/org/onap/clamp/clds/model/prop/CustomModelElement.java47
-rw-r--r--src/test/java/org/onap/clamp/clds/model/prop/CustomModelElementTest.java67
-rw-r--r--src/test/java/org/onap/clamp/clds/model/prop/ModelPropertiesTest.java69
-rw-r--r--src/test/resources/clds/clds-reference.properties41
-rw-r--r--src/test/resources/example/modelBpmnProp.json42
-rw-r--r--src/test/resources/example/modelBpmnPropForPolicy.json26
-rw-r--r--src/test/resources/example/modelProp.json1114
-rw-r--r--src/test/resources/example/modelPropForPolicy.json404
-rw-r--r--src/test/resources/example/templatePropForTca.json10
-rw-r--r--src/test/resources/expected/stringmatch.json1
-rw-r--r--src/test/resources/expected/tca.json93
16 files changed, 1746 insertions, 688 deletions
diff --git a/src/test/java/org/onap/clamp/clds/AbstractIT.java b/src/test/java/org/onap/clamp/clds/AbstractIT.java
index 873c852a..b705e38d 100644
--- a/src/test/java/org/onap/clamp/clds/AbstractIT.java
+++ b/src/test/java/org/onap/clamp/clds/AbstractIT.java
@@ -1,3 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * 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============================================
+ * ===================================================================
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
package org.onap.clamp.clds;
import org.junit.BeforeClass;
@@ -6,14 +29,11 @@ import org.onap.clamp.clds.model.refprop.RefProp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ActiveProfiles;
-/**
- * Created by j on 6/16/17.
- */
@ActiveProfiles("clamp-default")
public abstract class AbstractIT {
@Autowired
- protected RefProp refProp;
+ protected RefProp refProp;
@Autowired
protected PolicyClient policyClient;
diff --git a/src/test/java/org/onap/clamp/clds/it/AsdcIT.java b/src/test/java/org/onap/clamp/clds/it/AsdcIT.java
deleted file mode 100644
index d616b7e2..00000000
--- a/src/test/java/org/onap/clamp/clds/it/AsdcIT.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP CLAMP
- * ================================================================================
- * 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============================================
- * ===================================================================
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.onap.clamp.clds.it;
-
-import org.onap.clamp.clds.AbstractIT;
-import org.onap.clamp.clds.client.req.SdcReq;
-import org.onap.clamp.clds.model.CldsEvent;
-import org.onap.clamp.clds.model.prop.ModelProperties;
-import org.onap.clamp.clds.transform.TransformUtil;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-/**
- * Test DCAE API in org.onap.clamp.ClampDesigner.client package - replicate DCAE Delegates in test.
- */
-@RunWith(SpringRunner.class)
-@SpringBootTest
-public class AsdcIT extends AbstractIT {
-
- @Test
- public void testBlueprint() throws Exception {
- String modelProp = TransformUtil.getResourceAsString("example/modelProp.json");
- String modelBpmnProp = TransformUtil.getResourceAsString("example/modelBpmnProp.json");
- String modelName = "example-model06";
- String controlName = "ClosedLoop-FRWL-SIG04-1582f840-test-test-1234-005056a9d756";
- String docText = TransformUtil.getResourceAsString("example/templateProp.json");
- ModelProperties prop = new ModelProperties(modelName, controlName, CldsEvent.ACTION_SUBMIT, modelBpmnProp, modelProp);
- String blueprint = SdcReq.formatBlueprint(refProp, prop, docText);
- System.out.println("blueprint=" + blueprint);
- }
-
-}
diff --git a/src/test/java/org/onap/clamp/clds/it/DcaeIT.java b/src/test/java/org/onap/clamp/clds/it/DcaeIT.java
index aef4c64f..54b27974 100644
--- a/src/test/java/org/onap/clamp/clds/it/DcaeIT.java
+++ b/src/test/java/org/onap/clamp/clds/it/DcaeIT.java
@@ -48,7 +48,7 @@ public class DcaeIT extends AbstractIT {
String modelName = "example-model";
String controlName = "ClosedLoop-FRWL-SIG-1582f840-2881-11e6-b4ec-005056a9d756";
- ModelProperties prop = new ModelProperties(modelName, controlName, CldsEvent.ACTION_SUBMIT, modelBpmnProp, modelProp);
+ ModelProperties prop = new ModelProperties(modelName, controlName, CldsEvent.ACTION_SUBMIT, true, modelBpmnProp, modelProp);
String dcaeReq = DcaeReq.format(refProp, prop);
System.out.println("dcaeReq=" + dcaeReq);
diff --git a/src/test/java/org/onap/clamp/clds/it/PolicyClientIT.java b/src/test/java/org/onap/clamp/clds/it/PolicyClientIT.java
index d0fcf42e..7960c6af 100644
--- a/src/test/java/org/onap/clamp/clds/it/PolicyClientIT.java
+++ b/src/test/java/org/onap/clamp/clds/it/PolicyClientIT.java
@@ -5,16 +5,16 @@
* 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.
+ * 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
+ *
+ * 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============================================
* ===================================================================
@@ -34,18 +34,20 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.clamp.clds.AbstractIT;
+import org.onap.clamp.clds.client.req.TcaMPolicyReq;
import org.onap.clamp.clds.model.CldsEvent;
-import org.onap.clamp.clds.model.prop.ModelProperties;
+import org.onap.clamp.clds.model.prop.*;
import org.onap.policy.api.AttributeType;
+import org.skyscreamer.jsonassert.JSONAssert;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.test.context.junit4.SpringRunner;
import org.onap.clamp.clds.client.req.OperationalPolicyReq;
import org.onap.clamp.clds.client.req.StringMatchPolicyReq;
-import org.onap.clamp.clds.model.prop.Policy;
-import org.onap.clamp.clds.model.prop.StringMatch;
import org.onap.clamp.clds.transform.TransformUtil;
+import static org.junit.Assert.assertEquals;
+
/**
* Test Policy API in org.onap.clamp.ClampDesigner.client package - replicate
* Policy Delegates in tests.
@@ -67,105 +69,131 @@ public class PolicyClientIT extends AbstractIT {
}
private void createUpdateStringMatch(String actionCd) throws Exception {
- ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, modelBpmnProp, modelProp);
- String stringMatchPolicyRequestUuid = UUID.randomUUID().toString();
- String policyJson = StringMatchPolicyReq.format(refProp, prop);
- System.out.println("String Match policyJson=" + policyJson);
- String responseMessage = policyClient.sendMicroService(policyJson, prop, stringMatchPolicyRequestUuid);
- System.out.println(responseMessage);
+ ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, false, modelBpmnProp, modelProp);
+ StringMatch stringMatch = prop.getType(StringMatch.class);
+ if (stringMatch.isFound()) {
+ String stringMatchPolicyRequestUuid = UUID.randomUUID().toString();
+
+ String policyJson = StringMatchPolicyReq.format(refProp, prop);
+ String correctValue = TransformUtil.getResourceAsString("expected/stringmatch.json");
+ JSONAssert.assertEquals(policyJson, correctValue, true);
+ String responseMessage = "";
+ try {
+ responseMessage = policyClient.sendMicroService(policyJson, prop, stringMatchPolicyRequestUuid);
+ } catch (Exception e) {
+ assertTrue(e.getMessage().contains("Policy send failed: PE500 "));
+ }
+ System.out.println(responseMessage);
+ }
}
private void createUpdateOperationalPolicy(String actionCd) throws Exception {
- ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, modelBpmnProp, modelProp);
- String operationalPolicyRequestUuid = UUID.randomUUID().toString();
- Map<AttributeType, Map<String, String>> attributes = OperationalPolicyReq.formatAttributes(refProp, prop);
- String responseMessage = policyClient.sendBrms(attributes, prop, operationalPolicyRequestUuid);
- System.out.println(responseMessage);
+ ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, false, modelBpmnProp, modelProp);
+ Policy policy = prop.getType(Policy.class);
+ if (policy.isFound()) {
+ for (PolicyChain policyChain : policy.getPolicyChains()) {
+ String operationalPolicyRequestUuid = UUID.randomUUID().toString();
+
+ Map<AttributeType, Map<String, String>> attributes = OperationalPolicyReq.formatAttributes(refProp,
+ prop, policy.getId(), policyChain);
+ String responseMessage = policyClient.sendBrms(attributes, prop, operationalPolicyRequestUuid);
+ System.out.println(responseMessage);
+ }
+ }
}
- private void createUpdatePolicies(String actionCd) throws Exception {
- createUpdateStringMatch(actionCd);
- createUpdateOperationalPolicy(actionCd);
+ private void createUpdateTcaPolicy(String actionCd) throws Exception {
+ ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, false, modelBpmnProp, modelProp);
+ Tca tca = prop.getTca();
+ if (tca.isFound()) {
+ String tcaPolicyRequestUuid = UUID.randomUUID().toString();
+ String policyJson = TcaMPolicyReq.formatTca(refProp, prop);
+ String correctValue = TransformUtil.getResourceAsString("expected/tca.json");
+ JSONAssert.assertEquals(policyJson, correctValue, true);
+ String responseMessage = "";
+ try {
+ responseMessage = policyClient.sendMicroService(policyJson, prop, tcaPolicyRequestUuid);
+ } catch (Exception e) {
+ assertTrue(e.getMessage().contains("Policy send failed: PE500 "));
+ }
+ System.out.println(responseMessage);
+ }
}
private void deleteStringMatchPolicy(String actionCd) throws Exception {
- ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, modelBpmnProp, modelProp);
- StringMatch stringMatch = prop.getStringMatch();
- prop.setCurrentModelElementId(stringMatch.getId());
- String responseMessage = policyClient.deleteMicrosService(prop);
- System.out.println(responseMessage);
+ ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, false, modelBpmnProp, modelProp);
+
+ StringMatch stringMatch = prop.getType(StringMatch.class);
+ if (stringMatch.isFound()) {
+ prop.setCurrentModelElementId(stringMatch.getId());
+ String responseMessage = "";
+ try {
+ responseMessage = policyClient.deleteMicrosService(prop);
+ } catch (Exception e) {
+ assertTrue(e.getMessage().contains("Policy delete failed: PE500 "));
+ }
+ System.out.println(responseMessage);
+ }
}
private void deleteOperationalPolicy(String actionCd) throws Exception {
- ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, modelBpmnProp, modelProp);
- Policy policy = prop.getPolicy();
- prop.setCurrentModelElementId(policy.getId());
- String responseMessage = policyClient.deleteBrms(prop);
- System.out.println(responseMessage);
+ ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, false, modelBpmnProp, modelProp);
+
+ Policy policy = prop.getType(Policy.class);
+ if (policy.isFound()) {
+ prop.setCurrentModelElementId(policy.getId());
+ for (PolicyChain policyChain : policy.getPolicyChains()) {
+ prop.setPolicyUniqueId(policyChain.getPolicyId());
+ String responseMessage = policyClient.deleteBrms(prop);
+ System.out.println(responseMessage);
+ }
+ }
}
- private void deletePolicies(String actionCd) throws Exception {
- deleteStringMatchPolicy(actionCd);
- deleteOperationalPolicy(actionCd);
- }
+ private void deleteTcaPolicy(String actionCd) throws Exception {
+ ModelProperties prop = new ModelProperties(modelName, controlName, actionCd, false, modelBpmnProp, modelProp);
- /**
- * Delete policies so we can start with a clean state. But this is just a
- * precaution - the policies might not already exists. So ignore errors in
- * attempting to do this.
- *
- * @param actionCd
- */
- private void cleanUpPolicies(String actionCd) {
- try {
- deleteStringMatchPolicy(actionCd);
- } catch (Exception e) {
- System.err.println(
- "TestPolicyClient: The following error is ok - attempting delete in case the policy exists - the goal is to start with clean slate");
- }
- try {
- deleteOperationalPolicy(actionCd);
- } catch (Exception e) {
- System.err.println(
- "TestPolicyClient: The following error is ok - attempting delete in case the policy exists - the goal is to start with clean slate");
+ Tca tca = prop.getTca();
+ if (tca.isFound()) {
+ prop.setCurrentModelElementId(tca.getId());
+ String responseMessage = "";
+ try {
+ responseMessage = policyClient.deleteMicrosService(prop);
+ } catch (Exception e) {
+ assertTrue(e.getMessage().contains("Policy delete failed: PE500 "));
+ }
+
+ System.out.println(responseMessage);
}
}
- @Test
- public void testCreateUpdateDeletePolicy() throws Exception {
-
- cleanUpPolicies(CldsEvent.ACTION_DELETE);
- TimeUnit.SECONDS.sleep(5);
- System.out.println("entered into update");
- String actionCd;
-
- try {
- actionCd = CldsEvent.ACTION_SUBMIT;
- createUpdatePolicies(actionCd);
- } catch (Exception e) {
- assertTrue(e.getMessage().contains("Policy send failed: PE500 "));
- }
+ // @Test
+ public void testCreateUpdateDeleteStringMatchPolicy() throws Exception {
- try {
- actionCd = CldsEvent.ACTION_RESUBMIT;
- createUpdatePolicies(actionCd);
- } catch (Exception e) {
- assertTrue(e.getMessage().contains("Policy send failed: PE500 "));
- }
+ createUpdateStringMatch(CldsEvent.ACTION_SUBMIT);
- try {
- actionCd = CldsEvent.ACTION_RESUBMIT;
- createUpdatePolicies(actionCd);
- } catch (Exception e) {
- assertTrue(e.getMessage().contains("Policy send failed: PE500 "));
- }
+ TimeUnit.SECONDS.sleep(20);
- try {
- TimeUnit.SECONDS.sleep(20);
- deletePolicies(CldsEvent.ACTION_DELETE);
- } catch (Exception e) {
- assertTrue(e.getMessage().contains("Unable to get valid Response from PDP"));
- }
+ deleteStringMatchPolicy(CldsEvent.ACTION_DELETE);
+ }
+
+ // @Test
+ public void testCreateUpdateDeleteOperationalPolicy() throws Exception {
+
+ createUpdateOperationalPolicy(CldsEvent.ACTION_SUBMIT);
+
+ TimeUnit.SECONDS.sleep(20);
+
+ deleteOperationalPolicy(CldsEvent.ACTION_DELETE);
+ }
+
+ @Test
+ public void testCreateUpdateDeleteTcaPolicy() throws Exception {
+
+ createUpdateTcaPolicy(CldsEvent.ACTION_SUBMIT);
+
+ TimeUnit.SECONDS.sleep(20);
+ deleteTcaPolicy(CldsEvent.ACTION_DELETE);
}
}
diff --git a/src/test/java/org/onap/clamp/clds/it/PropJsonBuilderIT.java b/src/test/java/org/onap/clamp/clds/it/PropJsonBuilderIT.java
index 7eeb04eb..ca849e17 100644
--- a/src/test/java/org/onap/clamp/clds/it/PropJsonBuilderIT.java
+++ b/src/test/java/org/onap/clamp/clds/it/PropJsonBuilderIT.java
@@ -5,16 +5,16 @@
* 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.
+ * 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
+ *
+ * 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============================================
* ===================================================================
@@ -23,58 +23,59 @@
package org.onap.clamp.clds.it;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import org.onap.clamp.clds.AbstractIT;
-import org.onap.clamp.clds.client.req.SdcReq;
-import org.onap.clamp.clds.model.CldsAsdcServiceDetail;
+import java.io.IOException;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.onap.clamp.clds.AbstractIT;
+import org.onap.clamp.clds.client.req.SdcReq;
+import org.onap.clamp.clds.model.CldsSdcServiceDetail;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.test.context.junit4.SpringRunner;
-import java.io.IOException;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
/**
- * Test ASDC API - stand alone (except for some config).
- * Replicates getAsdcServices and getAsdcServicesByUUID in the CldsService
- * Adds test of putting putting an artifact to VF.
- * TODO Also needs update and perhaps delete tests.
+ * Test SDC API - stand alone (except for some config). Replicates
+ * getSdcServices and getSdcServicesByUUID in the CldsService Adds test of
+ * putting putting an artifact to VF. TODO Also needs update and perhaps delete
+ * tests.
*/
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class PropJsonBuilderIT extends AbstractIT {
- private String globalPropsPartial;
+ private String globalPropsPartial;
private ObjectMapper mapper;
@Before
public void setUp() throws IOException {
- String url = refProp.getStringValue("asdc.serviceUrl");
- String catalogUrl = refProp.getStringValue("asdc.catalog.url");
- String basicAuth = SdcReq.getAsdcBasicAuth(refProp);
+ String url = refProp.getStringValue("sdc.serviceUrl");
+ String catalogUrl = refProp.getStringValue("sdc.catalog.url");
+ String basicAuth = SdcReq.getSdcBasicAuth(refProp);
System.out.println("value of string and basicAuth:" + url + basicAuth);
- CldsAsdcServiceDetail cldsservicedetail = new CldsAsdcServiceDetail();
- // cldsservicedetail.set
+ CldsSdcServiceDetail cldsservicedetail = new CldsSdcServiceDetail();
+ // cldsservicedetail.set
String globalProps = refProp.getStringValue("globalPropsTest");
globalPropsPartial = refProp.getStringValue("globalPropsPartialTest");
mapper = new ObjectMapper();
}
/**
- * List services from ASDC.
- * List meta data for a particular service from ASDC.
- * Test uploading artifact to a VF in ASDC.
+ * List services from SDC. List meta data for a particular service from SDC.
+ * Test uploading artifact to a VF in SDC.
*/
@Test
- public void testAsdc() throws Exception {
-// String createEmptySharedObject = createEmptySharedObject();
-// System.out.println("value of emptySharedObject:" + createEmptySharedObject);
+ public void testSdc() throws Exception {
+ // String createEmptySharedObject = createEmptySharedObject();
+ // System.out.println("value of emptySharedObject:" +
+ // createEmptySharedObject);
sampleJsonObject();
System.out.println(createTestEmptySharedObject());
}
@@ -83,8 +84,8 @@ public class PropJsonBuilderIT extends AbstractIT {
ArrayNode arrayNode = mapper.createArrayNode();
/**
- * Create three JSON Objects objectNode1, objectNode2, objectNode3
- * Add all these three objects in the array
+ * Create three JSON Objects objectNode1, objectNode2, objectNode3 Add
+ * all these three objects in the array
*/
ObjectNode objectNode1 = mapper.createObjectNode();
@@ -107,8 +108,8 @@ public class PropJsonBuilderIT extends AbstractIT {
arrayNode.add(objectNode3);
/**
- * We can directly write the JSON in the console.
- * But it wont be pretty JSON String
+ * We can directly write the JSON in the console. But it wont be pretty
+ * JSON String
*/
System.out.println(arrayNode.toString());
@@ -121,17 +122,8 @@ public class PropJsonBuilderIT extends AbstractIT {
private String createEmptySharedObject() throws JsonProcessingException {
/**
- * "": {
- "vf": {
- "": ""
- },
- "location": {
- "": ""
- },
- "alarmCondition": {
- "": ""
- }
- }
+ * "": { "vf": { "": "" }, "location": { "": "" }, "alarmCondition": {
+ * "": "" } }
*/
ObjectNode emptyObjectNode = mapper.createObjectNode();
emptyObjectNode.put("", "");
@@ -149,10 +141,7 @@ public class PropJsonBuilderIT extends AbstractIT {
emptyServiceObjectNode.putPOJO("", samArrayNode);
/**
- * "vf": {
- * " ": " ",
- * "DCAE_CLAMP_DEMO3 1": "DCAE_CLAMP_DEMO3"
- * }
+ * "vf": { " ": " ", "DCAE_CLAMP_DEMO3 1": "DCAE_CLAMP_DEMO3" }
*
*/
ObjectNode vfObjectNode2 = mapper.createObjectNode();
@@ -164,11 +153,8 @@ public class PropJsonBuilderIT extends AbstractIT {
vfObjectNode2.putPOJO("vf", vfArrayNode);
/**
- * "location": {
- "SNDGCA64": "San Diego SAN3",
- "ALPRGAED": "Alpharetta PDK1",
- "LSLEILAA": "Lisle DPA3"
- },
+ * "location": { "SNDGCA64": "San Diego SAN3", "ALPRGAED":
+ * "Alpharetta PDK1", "LSLEILAA": "Lisle DPA3" },
*/
ObjectNode locationObjectNode2 = mapper.createObjectNode();
ObjectNode sandiegoLocationNode = mapper.createObjectNode();
@@ -182,9 +168,9 @@ public class PropJsonBuilderIT extends AbstractIT {
locationObjectNode2.putPOJO("location", locationArrayNode);
/**
- * "alarmCondition": {
- "A+Fallback+Operation+will+soon+be+started": "A Fallback Operation will soon be started",
- "BRM%2C+Auto+Export+Backup+Failed": "BRM, Auto Export Backup Failed",
+ * "alarmCondition": { "A+Fallback+Operation+will+soon+be+started":
+ * "A Fallback Operation will soon be started",
+ * "BRM%2C+Auto+Export+Backup+Failed": "BRM, Auto Export Backup Failed",
*/
ObjectNode alarmConditionObjectNode2 = mapper.createObjectNode();
ObjectNode alamrCondition1 = mapper.createObjectNode();
@@ -214,18 +200,8 @@ public class PropJsonBuilderIT extends AbstractIT {
byServiceBasicObjetNode.putPOJO("byService", byServiceBasicArrayNode);
/**
- * "byVf": {
- "": {
- "vfc": {
- "": ""
- },
- "03596c12-c7e3-44b7-8994-5cdfeda8afdd": {
- "vfc": {
- " ": " "
- }
- }
- }
- }
+ * "byVf": { "": { "vfc": { "": "" },
+ * "03596c12-c7e3-44b7-8994-5cdfeda8afdd": { "vfc": { " ": " " } } } }
*/
ObjectNode byVfCBasicNode = mapper.createObjectNode();
@@ -262,17 +238,8 @@ public class PropJsonBuilderIT extends AbstractIT {
ObjectNode locationJsonNode = (ObjectNode) mapper.readValue(locationStringValue, JsonNode.class);
ObjectNode alarmStringJsonNode = (ObjectNode) mapper.readValue(alarmStringValue, JsonNode.class);
/**
- * "": {
- "vf": {
- "": ""
- },
- "location": {
- "": ""
- },
- "alarmCondition": {
- "": ""
- }
- }
+ * "": { "vf": { "": "" }, "location": { "": "" }, "alarmCondition": {
+ * "": "" } }
*/
ObjectNode emptyObjectNode = mapper.createObjectNode();
emptyObjectNode.put("", "");
@@ -284,10 +251,7 @@ public class PropJsonBuilderIT extends AbstractIT {
emptyServiceObjectNode.putPOJO("", vfObjectNode);
/**
- * "vf": {
- * " ": " ",
- * "DCAE_CLAMP_DEMO3 1": "DCAE_CLAMP_DEMO3"
- * }
+ * "vf": { " ": " ", "DCAE_CLAMP_DEMO3 1": "DCAE_CLAMP_DEMO3" }
*
*/
ObjectNode vfObjectNode2 = mapper.createObjectNode();
@@ -297,43 +261,32 @@ public class PropJsonBuilderIT extends AbstractIT {
vfObjectNode2.putPOJO("vf", dcaeClampDemo3Node);
/**
- * "location": {
- "SNDGCA64": "San Diego SAN3",
- "ALPRGAED": "Alpharetta PDK1",
- "LSLEILAA": "Lisle DPA3"
- },
+ * "location": { "SNDGCA64": "San Diego SAN3", "ALPRGAED":
+ * "Alpharetta PDK1", "LSLEILAA": "Lisle DPA3" },
*/
-// ObjectNode sandiegoLocationNode = mapper.createObjectNode();
-// sandiegoLocationNode.put("SNDGCA64","San Diego SAN3");
-// sandiegoLocationNode.put("ALPRGAED","Alpharetta PDK1");
+ // ObjectNode sandiegoLocationNode = mapper.createObjectNode();
+ // sandiegoLocationNode.put("SNDGCA64","San Diego SAN3");
+ // sandiegoLocationNode.put("ALPRGAED","Alpharetta PDK1");
vfObjectNode2.putPOJO("location", locationJsonNode);
/**
- * "alarmCondition": {
- "A+Fallback+Operation+will+soon+be+started": "A Fallback Operation will soon be started",
- "BRM%2C+Auto+Export+Backup+Failed": "BRM, Auto Export Backup Failed",
+ * "alarmCondition": { "A+Fallback+Operation+will+soon+be+started":
+ * "A Fallback Operation will soon be started",
+ * "BRM%2C+Auto+Export+Backup+Failed": "BRM, Auto Export Backup Failed",
*/
-// ObjectNode alamrCondition1 = mapper.createObjectNode();
-// alamrCondition1.put("A+Fallback+Operation+will+soon+be+started","A Fallback Operation will soon be started");
-// alamrCondition1.put("BRM%2C+Scheduled+Backup+Failed","BRM, Scheduled Backup Failed");
+ // ObjectNode alamrCondition1 = mapper.createObjectNode();
+ // alamrCondition1.put("A+Fallback+Operation+will+soon+be+started","A
+ // Fallback Operation will soon be started");
+ // alamrCondition1.put("BRM%2C+Scheduled+Backup+Failed","BRM, Scheduled
+ // Backup Failed");
vfObjectNode2.putPOJO("alarmCondition", alarmStringJsonNode);
emptyServiceObjectNode.putPOJO("c989a551-69f7-4b30-b10a-2e85bb227c30", vfObjectNode2);
ObjectNode byServiceBasicObjetNode = mapper.createObjectNode();
byServiceBasicObjetNode.putPOJO("byService", emptyServiceObjectNode);
/**
- * "byVf": {
- "": {
- "vfc": {
- "": ""
- },
- "03596c12-c7e3-44b7-8994-5cdfeda8afdd": {
- "vfc": {
- " ": " "
- }
- }
- }
- }
+ * "byVf": { "": { "vfc": { "": "" },
+ * "03596c12-c7e3-44b7-8994-5cdfeda8afdd": { "vfc": { " ": " " } } } }
*/
ObjectNode emptyvfcobjectNode = mapper.createObjectNode();
@@ -352,19 +305,10 @@ public class PropJsonBuilderIT extends AbstractIT {
return readTree.toString();
}
- private String createCldsSharedObject(CldsAsdcServiceDetail cldsAsdcServiceDetail) throws IOException {
+ private String createCldsSharedObject(CldsSdcServiceDetail CldsSdcServiceDetail) throws IOException {
/**
- * "": {
- "vf": {
- "": ""
- },
- "location": {
- "": ""
- },
- "alarmCondition": {
- "": ""
- }
- }
+ * "": { "vf": { "": "" }, "location": { "": "" }, "alarmCondition": {
+ * "": "" } }
*/
ObjectNode emptyObjectNode = mapper.createObjectNode();
emptyObjectNode.put("", "");
@@ -376,10 +320,7 @@ public class PropJsonBuilderIT extends AbstractIT {
emptyServiceObjectNode.putPOJO("", vfObjectNode);
/**
- * "vf": {
- * " ": " ",
- * "DCAE_CLAMP_DEMO3 1": "DCAE_CLAMP_DEMO3"
- * }
+ * "vf": { " ": " ", "DCAE_CLAMP_DEMO3 1": "DCAE_CLAMP_DEMO3" }
*
*/
ObjectNode vfObjectNode2 = mapper.createObjectNode();
@@ -389,11 +330,8 @@ public class PropJsonBuilderIT extends AbstractIT {
vfObjectNode2.putPOJO("vf", dcaeClampDemo3Node);
/**
- * "location": {
- "SNDGCA64": "San Diego SAN3",
- "ALPRGAED": "Alpharetta PDK1",
- "LSLEILAA": "Lisle DPA3"
- },
+ * "location": { "SNDGCA64": "San Diego SAN3", "ALPRGAED":
+ * "Alpharetta PDK1", "LSLEILAA": "Lisle DPA3" },
*/
ObjectNode sandiegoLocationNode = mapper.createObjectNode();
sandiegoLocationNode.put("SNDGCA64", "San Diego SAN3");
@@ -401,9 +339,9 @@ public class PropJsonBuilderIT extends AbstractIT {
vfObjectNode2.putPOJO("location", sandiegoLocationNode);
/**
- * "alarmCondition": {
- "A+Fallback+Operation+will+soon+be+started": "A Fallback Operation will soon be started",
- "BRM%2C+Auto+Export+Backup+Failed": "BRM, Auto Export Backup Failed",
+ * "alarmCondition": { "A+Fallback+Operation+will+soon+be+started":
+ * "A Fallback Operation will soon be started",
+ * "BRM%2C+Auto+Export+Backup+Failed": "BRM, Auto Export Backup Failed",
*/
ObjectNode alamrCondition1 = mapper.createObjectNode();
alamrCondition1.put("A+Fallback+Operation+will+soon+be+started", "A Fallback Operation will soon be started");
@@ -414,18 +352,8 @@ public class PropJsonBuilderIT extends AbstractIT {
byServiceBasicObjetNode.putPOJO("byService", emptyServiceObjectNode);
/**
- * "byVf": {
- "": {
- "vfc": {
- "": ""
- },
- "03596c12-c7e3-44b7-8994-5cdfeda8afdd": {
- "vfc": {
- " ": " "
- }
- }
- }
- }
+ * "byVf": { "": { "vfc": { "": "" },
+ * "03596c12-c7e3-44b7-8994-5cdfeda8afdd": { "vfc": { " ": " " } } } }
*/
ObjectNode emptyvfcobjectNode = mapper.createObjectNode();
diff --git a/src/test/java/org/onap/clamp/clds/model/prop/CustomModelElement.java b/src/test/java/org/onap/clamp/clds/model/prop/CustomModelElement.java
new file mode 100644
index 00000000..d0ba7455
--- /dev/null
+++ b/src/test/java/org/onap/clamp/clds/model/prop/CustomModelElement.java
@@ -0,0 +1,47 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * 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============================================
+ * ===================================================================
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.clamp.clds.model.prop;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+/**
+ * A CustomModelElement to test the capability to add new elements on the fly.
+ */
+public class CustomModelElement extends ModelElement {
+
+ private static final String CUSTOM_TYPE = "customType";
+
+ /**
+ *
+ */
+ public CustomModelElement(ModelProperties modelProp, ModelBpmn modelBpmn, JsonNode modelJson) {
+ super(CUSTOM_TYPE, modelProp, modelBpmn, modelJson);
+ topicPublishes = getValueByName("topicPublishes");
+ }
+
+ public static final String getType() {
+ return CUSTOM_TYPE;
+ }
+
+}
diff --git a/src/test/java/org/onap/clamp/clds/model/prop/CustomModelElementTest.java b/src/test/java/org/onap/clamp/clds/model/prop/CustomModelElementTest.java
new file mode 100644
index 00000000..9c9cb4a7
--- /dev/null
+++ b/src/test/java/org/onap/clamp/clds/model/prop/CustomModelElementTest.java
@@ -0,0 +1,67 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * 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============================================
+ * ===================================================================
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.clamp.clds.model.prop;
+
+import java.io.IOException;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.onap.clamp.clds.transform.TransformUtil;
+
+public class CustomModelElementTest {
+
+ public CustomModelElementTest() {
+ }
+
+ @Test
+ public void testNewElement() {
+
+ try {
+ String modelBpmnProp = TransformUtil.getResourceAsString("example/modelBpmnProp.json");
+ String modelProp = TransformUtil.getResourceAsString("example/modelProp.json");
+ String modName = "example-model-name";
+ String controlName = "example-control-name";
+
+ CustomModelElement customModelElement = null;
+
+ // Instantiate first, we should not have our CustomModelElement yet
+ ModelProperties prop = new ModelProperties(modName, controlName, null, true, modelBpmnProp, modelProp);
+
+ Assert.assertNotNull(prop);
+
+ customModelElement = prop.getType(CustomModelElement.class);
+
+ Assert.assertNull(customModelElement);
+
+ ModelProperties.registerModelElement(CustomModelElement.class, CustomModelElement.getType());
+
+ customModelElement = prop.getType(CustomModelElement.class);
+
+ Assert.assertNotNull(customModelElement);
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/test/java/org/onap/clamp/clds/model/prop/ModelPropertiesTest.java b/src/test/java/org/onap/clamp/clds/model/prop/ModelPropertiesTest.java
index 54a7a4a7..1038e5de 100644
--- a/src/test/java/org/onap/clamp/clds/model/prop/ModelPropertiesTest.java
+++ b/src/test/java/org/onap/clamp/clds/model/prop/ModelPropertiesTest.java
@@ -5,16 +5,16 @@
* 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.
+ * 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
+ *
+ * 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============================================
* ===================================================================
@@ -26,7 +26,7 @@ package org.onap.clamp.clds.model.prop;
import org.onap.clamp.clds.transform.TransformUtil;
import org.junit.Assert;
import org.junit.Test;
-
+import static org.junit.Assert.assertEquals;
import java.io.IOException;
/**
@@ -41,33 +41,54 @@ public class ModelPropertiesTest {
String modName = "example-model-name";
String controlName = "example-control-name";
- ModelProperties prop = new ModelProperties(modName, controlName, null, modelBpmnProp, modelProp);
+ ModelProperties prop = new ModelProperties(modName, controlName, null, true, modelBpmnProp, modelProp);
Assert.assertEquals(modName, prop.getModelName());
Assert.assertEquals(controlName, prop.getControlName());
Assert.assertEquals(null, prop.getActionCd());
Global g = prop.getGlobal();
- Assert.assertEquals("df6fcd2b-1932-429e-bb13-0cd0d32113cb", g.getService());
- Assert.assertEquals("[SNDGCA64, ALPRGAED]", g.getLocation().toString());
- Assert.assertEquals("[4b49acee-cf70-4b20-b956-a4fe0c1a8239]", g.getResourceVf().toString());
-
- Collector c = prop.getCollector();
- Assert.assertEquals("Collector_", c.getId());
- Assert.assertEquals("DCAE-COLLECTOR-UCSNMP", c.getTopicPublishes());
+ Assert.assertEquals("0f983e18-4603-4bb4-a98c-e29691fb16a1", g.getService());
+ Assert.assertEquals("[SNDGCA64]", g.getLocation().toString());
+ Assert.assertEquals("[6c7aaec2-59eb-41d9-8681-b7f976ab668d]", g.getResourceVf().toString());
- StringMatch sm = prop.getStringMatch();
+ StringMatch sm = prop.getType(StringMatch.class);
Assert.assertEquals("StringMatch_", sm.getId());
- Assert.assertEquals("DCAE-CL-EVENT", sm.getTopicPublishes());
- Policy p = prop.getPolicy();
+ Policy p = prop.getType(Policy.class);
Assert.assertEquals("Policy_", p.getId());
Assert.assertEquals(null, p.getTopicPublishes());
- Assert.assertEquals("DCAE-CL-EVENT", p.getTopicSubscribes());
- Assert.assertEquals(500, p.getTimeout().intValue());
-
- Tca t = prop.getTca();
+ Assert.assertEquals(null, p.getTopicSubscribes());
+
+ Tca t = prop.getType(Tca.class);
Assert.assertEquals("Narra", t.getTcaItems().get(0).getTcaName());
Assert.assertEquals(Integer.valueOf(4), t.getTcaItems().get(0).getTcaThreshholds().get(0).getThreshhold());
}
+ @Test
+ public void testPolicy() throws IOException {
+
+ String modelBpmnProp = TransformUtil.getResourceAsString("example/modelBpmnPropForPolicy.json");
+ System.out.println(modelBpmnProp);
+
+ String modelProp = TransformUtil.getResourceAsString("example/modelPropForPolicy.json");
+ System.out.println(modelProp);
+
+ ModelProperties prop = new ModelProperties("example-model-name", "example-control-name", null, true, modelBpmnProp, modelProp);
+ System.out.println("attempting prop.getGlobal()...");
+ Global g = prop.getGlobal();
+ System.out.println("attempting prop.getStringMatch()...");
+ StringMatch stringMatch = prop.getType(StringMatch.class);
+ if(stringMatch.isFound()){
+ System.out.println("stringMatch json object is present...");
+ assertEquals("1", stringMatch.getResourceGroups().get(0).getPolicyId());
+ }
+ System.out.println("attempting prop.getPolicy()...");
+ Policy policy = prop.getType(Policy.class);
+ if(policy.isFound()){
+ System.out.println("policy json object is present...");
+ assertEquals("1", policy.getPolicyChains().get(0).getPolicyId());
+ }
+ }
+
+
} \ No newline at end of file
diff --git a/src/test/resources/clds/clds-reference.properties b/src/test/resources/clds/clds-reference.properties
index 64879895..7cedc130 100644
--- a/src/test/resources/clds/clds-reference.properties
+++ b/src/test/resources/clds/clds-reference.properties
@@ -37,10 +37,10 @@ tca.signature.template={"nfNamingCode":"ENBE","target":"common_id","targetType":
dcae.template={"properties":{"service_name":"","service_ids":[],"vnf_ids":[],"location_ids":[]},"template":{"string_matching":{"dcae":{"inputTopic":"","outputTopic":"","closedLoopControlName":"","closedLoopEventClient":"configuration.dcae.microservice.stringmatcher.xml","policyName":"","policyScope":"service=vSCP;resource=F5;type=configuration","policyVersion":"v0.0.1","serviceConfigurations":{}}}}}
dcae.decode.service_ids={"vUSP":["vUSP - vCTS"],"Trinity":["ASBGv TLS VNF","ASBGv No TLS","ASBGv (NO TLS) VNF","ASBGv TLS","NSBGv VNF","NSBGv"],"vSCP":["AKRON_vSCP_F5_FW-SVC/vSCP_F5_FW 1","ALLEN_vSCP_F5_FW-SVC/vSCP_F5_FW 1"],"vProbes":["vProbes - FW"]}
#
-# ASDC request blueprint properties
+# SDC request blueprint properties
#
-asdc.template={}
-asdc.decode.service_ids={}
+sdc.template={}
+sdc.decode.service_ids={}
#
#
# General Policy request properties
@@ -73,25 +73,34 @@ sm.rulegroup.vSCP=false
#
op.policyDescription=from clds
# default
-op.templateName=ClosedLoopvUSP
+op.templateName=ClosedLoopGuardvUSP
op.operationTopic=APPC-CL
op.notificationTopic=POLICY-CL-MGT
op.controller=1610-vUSP
# by service: vSCP
op.templateName.vSCP=ClosedLoopTemplate
op.controller.vSCP=1607-f5fw
-#
-# Asdc service properties
-asdc.catalog.url=http://127.0.0.1:8080/sdc/v1/catalog/
-asdc.hostUrl=http://127.0.0.1:8080
-asdc.serviceUrl=http://127.0.0.1:8080/sdc/v1/catalog/services
-asdc.serviceUsername=test
-asdc.servicePassword=123456
-asdc.artifactLabel=blueprintclampcockpit
-asdc.asdcX-ECOMP-InstanceID=CLAMP
-asdc.artifactType=DCAE_INVENTORY_BLUEPRINT
-asdc.locationArtifactLabel=LocationClampCockpit
-asdc.locationArtifactType=DCAE_INVENTORY_JSON
+op.eNodeB.templateName=CLeNodeB
+op.eNodeB.operationTopic=com.onap.sdnr.RanCLRequest-v00
+op.eNodeB.notificationTopic=com.onap-policy.IST-ENODEB-CL
+op.eNodeB.controller=ClosedLoop-eNodeB
+op.eNodeB.recipe={"eNodeBRecipes":[{"Actor":"AOTS","Recipe":"checkENodeBTicketHours","ParentPolicy":"","PPConditions":"","Retry":"0","TimeLimit":"120"},{"Actor":"AOTS","Recipe":"checkEquipmentStatus","ParentPolicy":"checkENodeBTicketHours","PPConditions":"Success","Retry":"0","TimeLimit":"120"},{"Actor":"AOTS","Recipe":"checkEimStatus","ParentPolicy":"checkEquipmentStatus","PPConditions":"Success","Retry":"0","TimeLimit":"120"},{"Actor":"AOTS","Recipe":"checkMaintenanceWindow","ParentPolicy":"checkEimStatus","PPConditions":"Success","Retry":"0","TimeLimit":"120"},{"Actor":"SDNR","Recipe":"Reset","ParentPolicy":"checkMaintenanceWindow","PPConditions":"Success","Retry":"","TimeLimit":""}]}
+op.eNodeB.timeWindow=35
+op.eNodeB.limit=2
+op.eNodeB.period=10s
+#
+# sdc service properties
+sdc.catalog.url=http://127.0.0.1:8080/sdc/v1/catalog/
+sdc.hostUrl=http://127.0.0.1:8080
+sdc.serviceUrl=http://127.0.0.1:8080/sdc/v1/catalog/services
+sdc.serviceUsername=test
+sdc.servicePassword=123456
+sdc.artifactLabel=blueprintclampcockpit
+sdc.sdcX-InstanceID=CLAMP
+sdc.artifactType=DCAE_INVENTORY_BLUEPRINT
+sdc.locationArtifactLabel=LocationClampCockpit
+sdc.locationArtifactType=DCAE_INVENTORY_JSON
+sdc.InstanceID=X-ONAP-InstanceID
#
#
#
diff --git a/src/test/resources/example/modelBpmnProp.json b/src/test/resources/example/modelBpmnProp.json
index 140a5679..26fd884d 100644
--- a/src/test/resources/example/modelBpmnProp.json
+++ b/src/test/resources/example/modelBpmnProp.json
@@ -1 +1,41 @@
-{"collector":[{"id":"Collector_", "from":"StartEvent_1"}],"stringMatch":[{"id":"StringMatch_", "from":"Collector_"}],"policy":[{"id":"Policy_", "from":"StringMatch_"}],"tca":[{"id":"TCA_", "from":""}]} \ No newline at end of file
+{
+ "collector":
+ [
+ {
+ "id": "Collector_",
+ "from": "StartEvent_1"
+ }
+ ],
+
+ "stringMatch":
+ [
+ {
+ "id": "StringMatch_",
+ "from": "Collector_"
+ }
+ ],
+
+ "policy":
+ [
+ {
+ "id": "Policy_",
+ "from": "StringMatch_"
+ }
+ ],
+
+ "tca":
+ [
+ {
+ "id": "TCA_",
+ "from": ""
+ }
+ ],
+
+ "customType":
+ [
+ {
+ "id": "CustomType_",
+ "from": ""
+ }
+ ]
+} \ No newline at end of file
diff --git a/src/test/resources/example/modelBpmnPropForPolicy.json b/src/test/resources/example/modelBpmnPropForPolicy.json
new file mode 100644
index 00000000..243f7e80
--- /dev/null
+++ b/src/test/resources/example/modelBpmnPropForPolicy.json
@@ -0,0 +1,26 @@
+{
+ "collector":
+ [
+
+ ],
+ "stringMatch":
+ [
+
+ ],
+
+ "policy":
+ [
+ {
+ "id": "Policy_",
+ "from": "StartEvent_1"
+ }
+ ],
+
+ "tca":
+ [
+ {
+ "id": "TCA_",
+ "from": ""
+ }
+ ]
+} \ No newline at end of file
diff --git a/src/test/resources/example/modelProp.json b/src/test/resources/example/modelProp.json
index 831bf2d7..8b8e984f 100644
--- a/src/test/resources/example/modelProp.json
+++ b/src/test/resources/example/modelProp.json
@@ -1,369 +1,789 @@
{
- "Collector_":[
- {
- "name":"topicPublishes",
- "value":"DCAE-COLLECTOR-UCSNMP"
- }
- ],
- "global":[
- {
- "name":"service",
- "value":[
- "df6fcd2b-1932-429e-bb13-0cd0d32113cb"
- ]
- },
- {
- "name":"vf",
- "value":[
- "4b49acee-cf70-4b20-b956-a4fe0c1a8239"
- ]
- },
- {
- "name":"location",
- "value":[
- "SNDGCA64",
- "ALPRGAED"
- ]
- }
- ],
- "StringMatch_":[
+ "Collector_":
[
- {
- "name":"topicPublishes",
- "value":"DCAE-CL-EVENT"
- }
+ {
+ "name": "topicPublishes",
+ "value": "DCAE-COLLECTOR-UCSNMP"
+ }
],
- {
- "serviceConfigurations":[
- [
- {
- "name":"aaiMatchingFields",
- "value":[
- "Identiy"
- ]
- },
- {
- "name":"aaiSendFields",
- "value":[
- "VMID"
- ]
- },
- {
- "name":"groupNumber",
- "value":[
- "1"
- ]
- },
- {
- "name":"timeWindow",
- "value":[
- "1"
+
+ "global":
+ [
+ {
+ "name": "service",
+ "value":
+ [
+ "0f983e18-4603-4bb4-a98c-e29691fb16a1"
]
- },
- {
- "name":"ageLimit",
- "value":[
- "1600"
+ },
+
+ {
+ "name": "vf",
+ "value":
+ [
+ "6c7aaec2-59eb-41d9-8681-b7f976ab668d"
]
- },
- {
- "name":"createClosedLoopEventId",
- "value":[
- "Initial"
+ },
+
+ {
+ "name": "actionSet",
+ "value":
+ [
+ "enbRecipe"
]
- },
- {
- "name":"outputEventName",
- "value":[
- "OnSet"
+ },
+
+ {
+ "name": "location",
+ "value":
+ [
+ "SNDGCA64"
]
- },
- {
- "stringSet":[
- {
- "name":"alarmCondition",
- "value":[
- "Reports a transient alarm condition when an outgoing Ro message send fails"
- ]
- },
- {
- "name":"eventSeverity",
- "value":[
- "WARNING"
- ]
- },
- {
- "name":"eventSourceType",
- "value":[
- "f5BigIP"
+ }
+ ],
+
+ "HighlandPark_":
+ [
+ [
+ {
+ "name": "topicPublishes",
+ "value": "DCAE-HIGHLANDPARK-EVENT-OUTPUT-VOIP"
+ }
+ ],
+
+ {
+ "serviceConfigurations":
+ [
+ [
+ {
+ "name": "alarmCondition",
+ "value":
+ [
+ "Reports a transient alarm condition when an incoming ACR message is in conflict with former ACR in one diameter session"
+ ]
+ },
+
+ {
+ "name": "eventSourceType",
+ "value":
+ [
+ "f5BigIP"
+ ]
+ },
+
+ {
+ "name": "eventSeverity",
+ "value":
+ [
+ "NORMAL"
+ ]
+ }
+ ],
+
+ [
+ {
+ "name": "alarmCondition",
+ "value":
+ [
+ "Reports a transient alarm condition when an incoming ACR message is in conflict with former ACR in one diameter session"
+ ]
+ },
+
+ {
+ "name": "eventSourceType",
+ "value":
+ [
+ "f5BigIP"
+ ]
+ },
+
+ {
+ "name": "eventSeverity",
+ "value":
+ [
+ "NORMAL"
+ ]
+ }
]
- }
]
- }
+ }
+ ],
+
+ "StringMatch_":
+ {
+ "Group1":
+ [
+ {
+ "name": "rgname",
+ "value": "1493749598520"
+ },
+
+ {
+ "name": "rgfriendlyname",
+ "value": "Group1"
+ },
+
+ {
+ "name": "policyName",
+ "value": "Policy1"
+ },
+
+ {
+ "name": "policyId",
+ "value": "1"
+ },
+
+ {
+ "serviceConfigurations":
+ [
+ [
+ {
+ "name": "aaiMatchingFields",
+ "value":
+ [
+ "complex.city",
+ "vserver.vserver-name"
+ ]
+ },
+
+ {
+ "name": "aaiSendFields",
+ "value":
+ [
+ "complex.city",
+ "vserver.vserver-name"
+ ]
+ },
+
+ {
+ "name": "timeWindow",
+ "value":
+ [
+ "100"
+ ]
+ },
+
+ {
+ "name": "ageLimit",
+ "value":
+ [
+ "100"
+ ]
+ },
+
+ {
+ "name": "createClosedLoopEventId",
+ "value":
+ [
+ "Initial"
+ ]
+ },
+
+ {
+ "name": "outputEventName",
+ "value":
+ [
+ "ONSET"
+ ]
+ },
+
+ {
+ "stringSet":
+ [
+ {
+ "name": "alarmCondition",
+ "value":
+ [
+ "Reports a transient alarm condition when an outgoing Ro message send fails"
+ ]
+ },
+
+ {
+ "name": "eventSeverity",
+ "value":
+ [
+ "WARNING"
+ ]
+ },
+
+ {
+ "name": "eventSourceType",
+ "value":
+ [
+ "f5BigIP"
+ ]
+ }
+ ]
+ }
+ ]
+ ]
+ }
],
+
+ "Group2":
[
- {
- "name":"aaiMatchingFields",
- "value":[
- "VMID"
- ]
- },
- {
- "name":"aaiSendFields",
- "value":[
- "Identiy"
- ]
- },
- {
- "name":"groupNumber",
- "value":[
- "1"
- ]
- },
- {
- "name":"timeWindow",
- "value":[
- "0"
- ]
- },
- {
- "name":"ageLimit",
- "value":[
- "1600"
- ]
- },
- {
- "name":"createClosedLoopEventId",
- "value":[
- "Close"
- ]
- },
- {
- "name":"outputEventName",
- "value":[
- "Abatement"
- ]
- },
- {
- "stringSet":[
- {
- "name":"alarmCondition",
- "value":[
- "Reports a transient alarm condition when an outgoing GTP' message send fails"
+ {
+ "name": "rgname",
+ "value": "1493749665149"
+ },
+
+ {
+ "name": "rgfriendlyname",
+ "value": "Group2"
+ },
+
+ {
+ "name": "policyName",
+ "value": "Policy2"
+ },
+
+ {
+ "name": "policyId",
+ "value": "2"
+ },
+
+ {
+ "serviceConfigurations":
+ [
+ [
+ {
+ "name": "aaiMatchingFields",
+ "value":
+ [
+ "cloud-region.identity-url",
+ "vserver.vserver-name"
+ ]
+ },
+
+ {
+ "name": "aaiSendFields",
+ "value":
+ [
+ "cloud-region.identity-url",
+ "vserver.vserver-name"
+ ]
+ },
+
+ {
+ "name": "timeWindow",
+ "value":
+ [
+ "1000"
+ ]
+ },
+
+ {
+ "name": "ageLimit",
+ "value":
+ [
+ "1000"
+ ]
+ },
+
+ {
+ "name": "createClosedLoopEventId",
+ "value":
+ [
+ "Initial"
+ ]
+ },
+
+ {
+ "name": "outputEventName",
+ "value":
+ [
+ "ONSET"
+ ]
+ },
+
+ {
+ "stringSet":
+ [
+ {
+ "name": "alarmCondition",
+ "value":
+ [
+ "LSS_asdaCommunicationFailure"
+ ]
+ },
+
+ {
+ "name": "eventSeverity",
+ "value":
+ [
+ "WARNING"
+ ]
+ },
+
+ {
+ "name": "eventSourceType",
+ "value":
+ [
+ "f5BigIP"
+ ]
+ }
+ ]
+ }
+ ],
+
+ [
+ {
+ "name": "aaiMatchingFields",
+ "value":
+ [
+ "generic-vnf.vnf-name",
+ "vserver.vserver-name"
+ ]
+ },
+
+ {
+ "name": "aaiSendFields",
+ "value":
+ [
+ "generic-vnf.vnf-name",
+ "vserver.vserver-name"
+ ]
+ },
+
+ {
+ "name": "timeWindow",
+ "value":
+ [
+ "3000"
+ ]
+ },
+
+ {
+ "name": "ageLimit",
+ "value":
+ [
+ "3000"
+ ]
+ },
+
+ {
+ "name": "createClosedLoopEventId",
+ "value":
+ [
+ "Initial"
+ ]
+ },
+
+ {
+ "name": "outputEventName",
+ "value":
+ [
+ "ABATED"
+ ]
+ },
+
+ {
+ "stringSet":
+ [
+ {
+ "name": "alarmCondition",
+ "value":
+ [
+ "LSS_asdaCommunicationFailure"
+ ]
+ },
+
+ {
+ "name": "eventSeverity",
+ "value":
+ [
+ "MAJOR"
+ ]
+ },
+
+ {
+ "name": "eventSourceType",
+ "value":
+ [
+ "f5BigIP"
+ ]
+ }
+ ]
+ }
+ ]
]
- },
- {
- "name":"eventSeverity",
- "value":[
- "NORMAL"
+ }
+ ]
+ },
+
+ "Policy_":
+ {
+ "Policy1":
+ [
+ {
+ "name": "pname",
+ "value": "Policy1"
+ },
+
+ {
+ "name": "pid",
+ "value": "1"
+ },
+
+ {
+ "name": "timeout",
+ "value": "500"
+ },
+
+ {
+ "policyConfigurations":
+ [
+ [
+ {
+ "name": "recipe",
+ "value":
+ [
+ "restart"
+ ]
+ },
+
+ {
+ "name": "maxRetries",
+ "value":
+ [
+ "3"
+ ]
+ },
+
+ {
+ "name": "retryTimeLimit",
+ "value":
+ [
+ "180"
+ ]
+ },
+
+ {
+ "name": "_id",
+ "value":
+ [
+ "n9bQ4t6"
+ ]
+ },
+
+ {
+ "name": "parentPolicy",
+ "value":
+ [
+ ""
+ ]
+ }
+ ],
+
+ [
+ {
+ "name": "recipe",
+ "value":
+ [
+ "rebuild"
+ ]
+ },
+
+ {
+ "name": "maxRetries",
+ "value":
+ [
+ "3"
+ ]
+ },
+
+ {
+ "name": "retryTimeLimit",
+ "value":
+ [
+ "180"
+ ]
+ },
+
+ {
+ "name": "_id",
+ "value":
+ [
+ "ItE5xKT"
+ ]
+ },
+
+ {
+ "name": "parentPolicy",
+ "value":
+ [
+ "n9bQ4t6"
+ ]
+ },
+
+ {
+ "name": "parentPolicyConditions",
+ "value":
+ [
+ "Failure_Retries",
+ "Failure_Timeout",
+ "Failure_Exception",
+ "Failure"
+ ]
+ }
+ ]
]
- },
- {
- "name":"eventSourceType",
- "value":[
- "f5BigIP"
+ }
+ ],
+
+ "Policy2":
+ [
+ {
+ "name": "pname",
+ "value": "Policy2"
+ },
+
+ {
+ "name": "pid",
+ "value": "2"
+ },
+
+ {
+ "name": "timeout",
+ "value": "500"
+ },
+
+ {
+ "policyConfigurations":
+ [
+ [
+ {
+ "name": "recipe",
+ "value":
+ [
+ "restart"
+ ]
+ },
+
+ {
+ "name": "maxRetries",
+ "value":
+ [
+ "3"
+ ]
+ },
+
+ {
+ "name": "retryTimeLimit",
+ "value":
+ [
+ "180"
+ ]
+ },
+
+ {
+ "name": "_id",
+ "value":
+ [
+ "n9bQ4t6"
+ ]
+ },
+
+ {
+ "name": "parentPolicy",
+ "value":
+ [
+ ""
+ ]
+ }
+ ],
+
+ [
+ {
+ "name": "recipe",
+ "value":
+ [
+ "rebuild"
+ ]
+ },
+
+ {
+ "name": "maxRetries",
+ "value":
+ [
+ "3"
+ ]
+ },
+
+ {
+ "name": "retryTimeLimit",
+ "value":
+ [
+ "180"
+ ]
+ },
+
+ {
+ "name": "_id",
+ "value":
+ [
+ "ItE5xKT"
+ ]
+ },
+
+ {
+ "name": "parentPolicy",
+ "value":
+ [
+ "n9bQ4t6"
+ ]
+ },
+
+ {
+ "name": "parentPolicyConditions",
+ "value":
+ [
+ "Failure_Retries",
+ "Failure_Timeout",
+ "Failure_Exception",
+ "Failure"
+ ]
+ }
+ ]
]
- }
- ]
- }
+ }
]
- ]
- }
- ],
- "Policy_":[
- [
- {
- "name":"timeout",
- "value":"500"
- }
- ],
+ },
+
+ "TCA_":
{
- "policyConfigurations":[
+ "Narra":
[
- {
- "name":"recipe",
- "value":[
- "restart"
- ]
- },
- {
- "name":"maxRetries",
- "value":[
- "3"
- ]
- },
- {
- "name":"retryTimeLimit",
- "value":[
- "180"
- ]
- },
- {
- "name":"_id",
- "value":[
- "n9bQ4t6"
- ]
- },
- {
- "name":"parentPolicy",
- "value":[
- ""
- ]
- }
+ {
+ "name": "tname",
+ "value": "Narra"
+ },
+
+ {
+ "name": "tuuid",
+ "value": "886be8da-14fe-tca1-d04b-d13b55d58df9"
+ },
+
+ {
+ "name": "tnfc",
+ "value": "ENBE"
+ },
+
+ {
+ "name": "tcaEnab",
+ "value": "on"
+ },
+
+ {
+ "name": "tcaPol",
+ "value": "Policy1"
+ },
+
+ {
+ "name": "tcaPolId",
+ "value": "1"
+ },
+
+ {
+ "name": "tcaInt",
+ "value": "2"
+ },
+
+ {
+ "name": "tcaSev",
+ "value": "Warning"
+ },
+
+ {
+ "name": "tcaVio",
+ "value": "3"
+ },
+
+ {
+ "serviceConfigurations":
+ [
+ [
+ "PMRRCCONNESTABFAILCELLLATENCY",
+ "LESS",
+ "4",
+ "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value"
+ ],
+
+ [
+ "PMRAATTCBRA",
+ "GREATER",
+ "30",
+ "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value"
+ ]
+ ]
+ }
],
+
+ "Srini":
[
- {
- "name":"recipe",
- "value":[
- "rebuild"
- ]
- },
- {
- "name":"maxRetries",
- "value":[
- "3"
- ]
- },
- {
- "name":"retryTimeLimit",
- "value":[
- "180"
- ]
- },
- {
- "name":"_id",
- "value":[
- "ItE5xKT"
- ]
- },
- {
- "name":"parentPolicy",
- "value":[
- "n9bQ4t6"
- ]
- },
- {
- "name":"parentPolicyConditions",
- "value":[
- "Failure_Retries",
- "Failure_Timeout",
- "Failure_Exception",
- "Failure"
- ]
- }
+ {
+ "name": "tname",
+ "value": "Srini"
+ },
+
+ {
+ "name": "tuuid",
+ "value": "8b5ba88d-f4b4-tf0e-50b1-78a5a7dd412d"
+ },
+
+ {
+ "name": "tnfc",
+ "value": "ENBE"
+ },
+
+ {
+ "name": "tcaEnab",
+ "value": "on"
+ },
+
+ {
+ "name": "tcaPol",
+ "value": "Policy2"
+ },
+
+ {
+ "name": "tcaPolId",
+ "value": "2"
+ },
+
+ {
+ "name": "tcaInt",
+ "value": "10"
+ },
+
+ {
+ "name": "tcaSev",
+ "value": "Critical"
+ },
+
+ {
+ "name": "tcaVio",
+ "value": "5"
+ },
+
+ {
+ "serviceConfigurations":
+ [
+ [
+ "PMRRCCONNESTABFAILCELLLATENCY",
+ "EQUAL",
+ "3",
+ "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value"
+ ],
+
+ [
+ "PMRAATTCBRA",
+ "GREATER",
+ "30",
+ "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value"
+ ]
+ ]
+ }
]
- ]
}
- ],
-
- "TCA_":{
- "Narra":[
- {
- "name": "tname",
- "value": "Narra"
- },
- {
- "name": "tuuid",
- "value": "886be8da-14fe-tca1-d04b-d13b55d58df9"
- },
- {
- "name": "tnfc",
- "value": "ENBE"
- },
- {
- "name": "tcaEnab",
- "value": "on"
- },
- {
- "name": "tcaPol",
- "value": "Policy1"
- },
- {
- "name": "tcaPolId",
- "value": "1"
- },
- {
- "name": "tcaInt",
- "value": "2"
- },
- {
- "name": "tcaSev",
- "value": "Warning"
- },
- {
- "name": "tcaVio",
- "value": "3"
- },
- {
- "serviceConfigurations":[
- [
- "PMRRCCONNESTABFAILCELLLATENCY",
- "LESS",
- "4",
- "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value"
- ],
- [
- "PMRAATTCBRA",
- "GREATER",
- "30",
- "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value"
- ]
- ]
- }
- ],
- "Srini":[
- {
- "name": "tname",
- "value": "Srini"
- },
- {
- "name": "tuuid",
- "value": "8b5ba88d-f4b4-tf0e-50b1-78a5a7dd412d"
- },
- {
- "name": "tnfc",
- "value": "ENBE"
- },
- {
- "name": "tcaEnab",
- "value": "on"
- },
- {
- "name": "tcaPol",
- "value": "Policy2"
- },
- {
- "name": "tcaPolId",
- "value": "2"
- },
- {
- "name": "tcaInt",
- "value": "10"
- },
- {
- "name": "tcaSev",
- "value": "Critical"
- },
- {
- "name": "tcaVio",
- "value": "5"
- },
- {
- "serviceConfigurations":[
- [
- "PMRRCCONNESTABFAILCELLLATENCY",
- "EQUAL",
- "3",
- "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value"
- ],
- [
- "PMRAATTCBRA",
- "GREATER",
- "30",
- "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value"
- ]
- ]
- }
- ]
- }
} \ No newline at end of file
diff --git a/src/test/resources/example/modelPropForPolicy.json b/src/test/resources/example/modelPropForPolicy.json
new file mode 100644
index 00000000..6923e1a6
--- /dev/null
+++ b/src/test/resources/example/modelPropForPolicy.json
@@ -0,0 +1,404 @@
+{
+ "global":
+ [
+ {
+ "name": "service",
+ "value":
+ [
+ "0f983e18-4603-4bb4-a98c-e29691fb16a1"
+ ]
+ },
+
+ {
+ "name": "vf",
+ "value":
+ [
+ "6c7aaec2-59eb-41d9-8681-b7f976ab668d"
+ ]
+ },
+
+ {
+ "name": "location",
+ "value":
+ [
+ "SNDGCA64"
+ ]
+ }
+ ],
+
+ "Policy_":
+ {
+ "Policy1":
+ [
+ {
+ "name": "pname",
+ "value": "Policy1"
+ },
+
+ {
+ "name": "pid",
+ "value": "1"
+ },
+
+ {
+ "name": "timeout",
+ "value": "500"
+ },
+
+ {
+ "policyConfigurations":
+ [
+ [
+ {
+ "name": "recipe",
+ "value":
+ [
+ "restart"
+ ]
+ },
+
+ {
+ "name": "maxRetries",
+ "value":
+ [
+ "3"
+ ]
+ },
+
+ {
+ "name": "retryTimeLimit",
+ "value":
+ [
+ "180"
+ ]
+ },
+
+ {
+ "name": "_id",
+ "value":
+ [
+ "n9bQ4t6"
+ ]
+ },
+
+ {
+ "name": "parentPolicy",
+ "value":
+ [
+ ""
+ ]
+ }
+ ],
+
+ [
+ {
+ "name": "recipe",
+ "value":
+ [
+ "rebuild"
+ ]
+ },
+
+ {
+ "name": "maxRetries",
+ "value":
+ [
+ "3"
+ ]
+ },
+
+ {
+ "name": "retryTimeLimit",
+ "value":
+ [
+ "180"
+ ]
+ },
+
+ {
+ "name": "_id",
+ "value":
+ [
+ "ItE5xKT"
+ ]
+ },
+
+ {
+ "name": "parentPolicy",
+ "value":
+ [
+ "n9bQ4t6"
+ ]
+ },
+
+ {
+ "name": "parentPolicyConditions",
+ "value":
+ [
+ "Failure_Retries",
+ "Failure_Timeout",
+ "Failure_Exception",
+ "Failure"
+ ]
+ }
+ ]
+ ]
+ }
+ ],
+
+ "Policy2":
+ [
+ {
+ "name": "pname",
+ "value": "Policy2"
+ },
+
+ {
+ "name": "pid",
+ "value": "2"
+ },
+
+ {
+ "name": "timeout",
+ "value": "500"
+ },
+
+ {
+ "policyConfigurations":
+ [
+ [
+ {
+ "name": "recipe",
+ "value":
+ [
+ "restart"
+ ]
+ },
+
+ {
+ "name": "maxRetries",
+ "value":
+ [
+ "3"
+ ]
+ },
+
+ {
+ "name": "retryTimeLimit",
+ "value":
+ [
+ "180"
+ ]
+ },
+
+ {
+ "name": "_id",
+ "value":
+ [
+ "n9bQ4t6"
+ ]
+ },
+
+ {
+ "name": "parentPolicy",
+ "value":
+ [
+ ""
+ ]
+ }
+ ],
+
+ [
+ {
+ "name": "recipe",
+ "value":
+ [
+ "rebuild"
+ ]
+ },
+
+ {
+ "name": "maxRetries",
+ "value":
+ [
+ "3"
+ ]
+ },
+
+ {
+ "name": "retryTimeLimit",
+ "value":
+ [
+ "180"
+ ]
+ },
+
+ {
+ "name": "_id",
+ "value":
+ [
+ "ItE5xKT"
+ ]
+ },
+
+ {
+ "name": "parentPolicy",
+ "value":
+ [
+ "n9bQ4t6"
+ ]
+ },
+
+ {
+ "name": "parentPolicyConditions",
+ "value":
+ [
+ "Failure_Retries",
+ "Failure_Timeout",
+ "Failure_Exception",
+ "Failure"
+ ]
+ }
+ ]
+ ]
+ }
+ ]
+ },
+
+ "TCA_":
+ {
+ "Narra":
+ [
+ {
+ "name": "tname",
+ "value": "Narra"
+ },
+
+ {
+ "name": "tuuid",
+ "value": "886be8da-14fe-tca1-d04b-d13b55d58df9"
+ },
+
+ {
+ "name": "tnfc",
+ "value": "ENBE"
+ },
+
+ {
+ "name": "tcaEnab",
+ "value": "on"
+ },
+
+ {
+ "name": "tcaPol",
+ "value": "Policy1"
+ },
+
+ {
+ "name": "tcaPolId",
+ "value": "1"
+ },
+
+ {
+ "name": "tcaInt",
+ "value": "2"
+ },
+
+ {
+ "name": "tcaSev",
+ "value": "Warning"
+ },
+
+ {
+ "name": "tcaVio",
+ "value": "3"
+ },
+
+ {
+ "serviceConfigurations":
+ [
+ [
+ "PMRRCCONNESTABFAILCELLLATENCY",
+ "LESS",
+ "4",
+ "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value"
+ ],
+
+ [
+ "PMRAATTCBRA",
+ "GREATER",
+ "30",
+ "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value"
+ ]
+ ]
+ }
+ ],
+
+ "Srini":
+ [
+ {
+ "name": "tname",
+ "value": "Srini"
+ },
+
+ {
+ "name": "tuuid",
+ "value": "8b5ba88d-f4b4-tf0e-50b1-78a5a7dd412d"
+ },
+
+ {
+ "name": "tnfc",
+ "value": "ENBE"
+ },
+
+ {
+ "name": "tcaEnab",
+ "value": "on"
+ },
+
+ {
+ "name": "tcaPol",
+ "value": "Policy2"
+ },
+
+ {
+ "name": "tcaPolId",
+ "value": "2"
+ },
+
+ {
+ "name": "tcaInt",
+ "value": "10"
+ },
+
+ {
+ "name": "tcaSev",
+ "value": "Critical"
+ },
+
+ {
+ "name": "tcaVio",
+ "value": "5"
+ },
+
+ {
+ "serviceConfigurations":
+ [
+ [
+ "PMRRCCONNESTABFAILCELLLATENCY",
+ "EQUAL",
+ "3",
+ "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value"
+ ],
+
+ [
+ "PMRAATTCBRA",
+ "GREATER",
+ "30",
+ "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value"
+ ]
+ ]
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/src/test/resources/example/templatePropForTca.json b/src/test/resources/example/templatePropForTca.json
new file mode 100644
index 00000000..9f1ce1da
--- /dev/null
+++ b/src/test/resources/example/templatePropForTca.json
@@ -0,0 +1,10 @@
+{
+ "global": [
+ {
+ "name": "service",
+ "value": [
+ "tosca_definitions_version: cloudify_dsl_1_2\r\n\r\nimports:\r\n- http://www.getcloudify.org/spec/cloudify/3.3.1/types.yaml\r\n- http://135.207.127.211/1607_prod/type_files/cdap_app.yaml\r\n\r\nnode_templates:\r\n MTCA:\r\n type: dcae.nodes.cdap_app\r\n properties:\r\n service_name: \"cdap-mtca-central\"\r\n deployment_JSON: |-\r\n {\r\n \"clusterService\": {\"$ref\": \"/services/vm-cdap-cluster-central/instances/rdm2c\"},\r\n \"namespace\": \"MTCA\",\r\n \"appNames\": [ \"cdap-mtca\" ],\r\n \"flowNames\": [ \"cdap-mtca.TCAVESCollectorFlow\" ],\r\n \"workerNames\": [\"cdap-mtca.TCADMaaPMRSubscriberWorker\", \"cdap-mtca.TCADMaaPMRPublisherWorker\"],\r\n \"serviceNames\" : [],\r\n \"apps\": {\r\n \"cdap-mtca\": {\r\n \"jarFile\": \"/opt/app/cdap-apps/dcae-analytics-mtca-1.0.0.jar\",\r\n \"artifactName\": \"dcae-analytics-mtca\",\r\n \"version\": \"1.0.0\",\r\n \"appConfigFileContent\": \"{config:{ \\\"appName\\\":\\\"cdap-mtca\\\", \\\"appDescription\\\":\\\"DCAE Analytics Threshold Crossing Alert Application\\\", \\\"tcaSubscriberOutputStreamName\\\":\\\"TCASubscriberOutputStream\\\", \\\"thresholdCalculatorFlowletInstances\\\":2, \\\"tcaVESMessageStatusTableName\\\":\\\"TCAVESMessageStatusTable\\\", \\\"tcaVESMessageStatusTableTTLSeconds\\\":864000, \\\"tcaVESAlertsTableName\\\":\\\"TCAVESAlertsTable\\\", \\\"tcaVESAlertsTableTTLSeconds\\\":1728000 }}\"\r\n }\r\n },\r\n \r\n \"configuration\": {\r\n \"$class\": \"com.att.ecomp.dcae.clamp.common.MThresholdCrossingConfiguration\",\r\n \"subscriberContentType\": \"\",\r\n \"subscriberConsumerId\": \"c12\",\r\n \"subscriberConsumerGroup\": \"OpenDCAE-c12\",\r\n \"subscriberTimeoutMS\": \"-1\",\r\n \"subscriberMessageLimit\": \"-1\",\r\n \"subscriberPollingInterval\": \"20000\",\r\n \"publisherContentType\": \"application/json\",\r\n \"publisherMaxBatchSize\": \"10\",\r\n \"publisherMaxRecoveryQueueSize\": \"100000\",\r\n \"publisherPollingInterval\": \"20000\",\r\n \"publisherAlertWindowingTime\": \"86400\",\r\n \"policyName\": \"policy.dcae.configuration\",\r\n \"policyScope\": \"pnf=eNodeB;type=configuration\",\r\n \"policyVersion\": \"1.0.0\",\r\n \"domain\" : \"measurementsForVfScaling\",\r\n \r\n \"signatures\" : {\r\n \t }\r\n\r\n }\r\n }\r\n"
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/src/test/resources/expected/stringmatch.json b/src/test/resources/expected/stringmatch.json
new file mode 100644
index 00000000..52e6d01a
--- /dev/null
+++ b/src/test/resources/expected/stringmatch.json
@@ -0,0 +1 @@
+{"service":"StringMatchingConfiguration","location":"Edge","uuid":"TestUUID","policyName":"example_model06.ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_StringMatch_","description":"from clds","configName":"com.att.d2.policy.StringMatchingConfiguration","templateVersion":"1604","priority":"4","version":"1610","policyScope":"resource=F5,service=vSCP,type=configuration,closedLoopControlName=vSCP_F5_Firewall_d925ed73-8231-4d02-9545-db4e101f88f8","content":{"serviceConfigurations":{"Item1":{"rulegroup":"1493749598520","closedLoopControlName":"ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_1","aaiMatchingFields":["complex.city","vserver.vserver-name"],"aaiSendFields":["complex.city","vserver.vserver-name"],"stringSet":["eventSeverity","WARNING","alarmCondition","Reports a transient alarm condition when an outgoing Ro message send fails"],"timeWindow":"100","ageLimit":"100","createClosedLoopEventId":"Initial","outputEventName":"ONSET"},"Item2":{"rulegroup":"1493749665149","closedLoopControlName":"ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_2","aaiMatchingFields":["cloud-region.identity-url","vserver.vserver-name"],"aaiSendFields":["cloud-region.identity-url","vserver.vserver-name"],"stringSet":["eventSeverity","WARNING","alarmCondition","Reports a transient alarm condition when an outgoing Ro message send fails"],"timeWindow":"1000","ageLimit":"1000","createClosedLoopEventId":"Initial","outputEventName":"ONSET"},"Item3":{"rulegroup":"1493749665149","closedLoopControlName":"ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_2","aaiMatchingFields":["generic-vnf.vnf-name","vserver.vserver-name"],"aaiSendFields":["generic-vnf.vnf-name","vserver.vserver-name"],"stringSet":["eventSeverity","WARNING","alarmCondition","Reports a transient alarm condition when an outgoing Ro message send fails"],"timeWindow":"3000","ageLimit":"3000","createClosedLoopEventId":"Initial","outputEventName":"ABATED"}}}} \ No newline at end of file
diff --git a/src/test/resources/expected/tca.json b/src/test/resources/expected/tca.json
new file mode 100644
index 00000000..2fd16bde
--- /dev/null
+++ b/src/test/resources/expected/tca.json
@@ -0,0 +1,93 @@
+{
+ "service": "MThresholdCrossingConfiguration",
+ "location": "Edge",
+ "uuid": "TestUUID",
+ "policyName": "example_model06.ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_TCA_",
+ "description": "from clds",
+ "configName": "MThresholdCrossingConfiguration",
+ "templateVersion": "5.2.0.1",
+ "priority": "4",
+ "version": "5.2.0.1",
+ "policyScope": "resource=F5,service=vSCP,type=configuration,closedLoopControlName=vSCP_F5_Firewall_d925ed73-8231-4d02-9545-db4e101f88f8",
+ "content":
+ {
+ "$class": "com.att.ecomp.dcae.clamp.common.MThresholdCrossingConfiguration",
+ "domain": "measurementsForVfScaling",
+ "policyScope": "pnf=eNodeB;type=configuration",
+ "policyName": "policy.dcae.configuration",
+ "policyVersion": "1.0.0",
+ "subscriberContentType": "application/json",
+ "subscriberConsumerId": "c13",
+ "subscriberConsumerGroup": "OpenDCAE-c13",
+ "subscriberTimeoutMS": "-1",
+ "subscriberMessageLimit": "-1",
+ "subscriberPollingInterval": "20000",
+ "publisherContentType": "application/json",
+ "publisherMaxBatchSize": "10",
+ "publisherMaxRecoveryQueueSize": "100000",
+ "publisherPollingInterval": "20000",
+ "publisherAlertWindowingTime": "86400",
+ "signatures":
+ [
+ {
+ "nfNamingCode": "ENBE",
+ "target": "common_id",
+ "targetType": "eNodeB",
+ "useCaseName": "Narra",
+ "signatureName": "Narra_886be8da-14fe-tca1-d04b-d13b55d58df9",
+ "signatureUuid": "886be8da-14fe-tca1-d04b-d13b55d58df9",
+ "closedLoopControlName": "ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_1",
+ "severity": "Warning",
+ "version": "1.0.2",
+ "maxInterval": 2,
+ "minMessageViolations": 3,
+ "thresholds":
+ [
+ {
+ "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value",
+ "thresholdName": "PMRRCCONNESTABFAILCELLLATENCY",
+ "thresholdValue": 4,
+ "direction": "LESS"
+ },
+
+ {
+ "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value",
+ "thresholdName": "PMRAATTCBRA",
+ "thresholdValue": 30,
+ "direction": "GREATER"
+ }
+ ]
+ },
+
+ {
+ "nfNamingCode": "ENBE",
+ "target": "common_id",
+ "targetType": "eNodeB",
+ "useCaseName": "Srini",
+ "signatureName": "Srini_8b5ba88d-f4b4-tf0e-50b1-78a5a7dd412d",
+ "signatureUuid": "8b5ba88d-f4b4-tf0e-50b1-78a5a7dd412d",
+ "closedLoopControlName": "ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_2",
+ "severity": "Critical",
+ "version": "1.0.2",
+ "maxInterval": 10,
+ "minMessageViolations": 5,
+ "thresholds":
+ [
+ {
+ "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value",
+ "thresholdName": "PMRRCCONNESTABFAILCELLLATENCY",
+ "thresholdValue": 3,
+ "direction": "EQUAL"
+ },
+
+ {
+ "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value",
+ "thresholdName": "PMRAATTCBRA",
+ "thresholdValue": 30,
+ "direction": "GREATER"
+ }
+ ]
+ }
+ ]
+ }
+} \ No newline at end of file