summaryrefslogtreecommitdiffstats
path: root/feature-lifecycle/src/test
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2021-01-04 15:58:25 +0000
committerliamfallon <liam.fallon@est.tech>2021-01-04 16:22:19 +0000
commitca2f61793ab1d971414c25c68f9007c7c9abfaac (patch)
treef3551785175224a2007dc9eff4b1fea078f22538 /feature-lifecycle/src/test
parent223519c0c263ea2f9b2b9a94efe52d40ab2cf6f7 (diff)
Changed identifiers to concept identifiers
The policy models tosca classes ToscaPolicyIdentifier and ToscaPolicyIdentifierOptVersion can be used to identify any TOSCA concept, not just TOSCA policies so they are renamed to ToscaConceptIdentifier and ToscaCinceptIdentifierOptVersion respectively. The class ToscaPolicyTypeIdentifier is redundant and is replaced by ToscaConceptIdentifier. Issue-ID: POLICY-2900 Change-Id: I677cc1f8730001b300ab2041f2d57c2485cbc4ed Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'feature-lifecycle/src/test')
-rw-r--r--feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActivePoliciesTest.java13
-rw-r--r--feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java9
-rw-r--r--feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStatePassiveTest.java7
-rw-r--r--feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeArtifactControllerTest.java7
4 files changed, 20 insertions, 16 deletions
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActivePoliciesTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActivePoliciesTest.java
index 2b0e65bf..d961dce3 100644
--- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActivePoliciesTest.java
+++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActivePoliciesTest.java
@@ -1,6 +1,7 @@
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2021 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,8 +45,8 @@ import org.onap.policy.common.utils.network.NetworkUtil;
import org.onap.policy.models.pdp.concepts.PdpStateChange;
import org.onap.policy.models.pdp.concepts.PdpUpdate;
import org.onap.policy.models.pdp.enums.PdpState;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
/**
* Lifecycle State Active Test.
@@ -104,9 +105,9 @@ public class LifecycleStateActivePoliciesTest extends LifecycleStateRunningTest
public void testUpdatePolicies() throws IOException, CoderException {
assertEquals(2, fsm.policyTypesMap.size());
assertNotNull(fsm.getPolicyTypesMap().get(
- new ToscaPolicyTypeIdentifier("onap.policies.native.drools.Controller", "1.0.0")));
+ new ToscaConceptIdentifier("onap.policies.native.drools.Controller", "1.0.0")));
assertNotNull(fsm.getPolicyTypesMap().get(
- new ToscaPolicyTypeIdentifier("onap.policies.native.drools.Artifact", "1.0.0")));
+ new ToscaConceptIdentifier("onap.policies.native.drools.Artifact", "1.0.0")));
//
// create controller using native policy
@@ -177,11 +178,11 @@ public class LifecycleStateActivePoliciesTest extends LifecycleStateRunningTest
assertEquals(3, fsm.policyTypesMap.size());
assertNotNull(fsm.getPolicyTypesMap().get(
- new ToscaPolicyTypeIdentifier("onap.policies.native.drools.Controller", "1.0.0")));
+ new ToscaConceptIdentifier("onap.policies.native.drools.Controller", "1.0.0")));
assertNotNull(fsm.getPolicyTypesMap().get(
- new ToscaPolicyTypeIdentifier("onap.policies.native.drools.Artifact", "1.0.0")));
+ new ToscaConceptIdentifier("onap.policies.native.drools.Artifact", "1.0.0")));
assertNotNull(fsm.getPolicyTypesMap().get(
- new ToscaPolicyTypeIdentifier("onap.policies.controlloop.operational.common.Drools",
+ new ToscaConceptIdentifier("onap.policies.controlloop.operational.common.Drools",
"1.0.0")));
// invalid controller name
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java
index 39a3a939..8a5ea6e4 100644
--- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java
+++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java
@@ -1,6 +1,7 @@
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2021 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,8 +47,8 @@ import org.onap.policy.models.pdp.concepts.PdpStateChange;
import org.onap.policy.models.pdp.concepts.PdpStatus;
import org.onap.policy.models.pdp.concepts.PdpUpdate;
import org.onap.policy.models.pdp.enums.PdpState;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
/**
* Lifecycle State Active Test.
@@ -215,11 +216,11 @@ public class LifecycleStateActiveTest extends LifecycleStateRunningTest {
assertEquals(qlength + 1, fsm.client.getSink().getRecentEvents().length);
assertEquals(3, fsm.policyTypesMap.size());
assertNotNull(fsm.getPolicyTypesMap().get(
- new ToscaPolicyTypeIdentifier("onap.policies.native.drools.Controller", "1.0.0")));
+ new ToscaConceptIdentifier("onap.policies.native.drools.Controller", "1.0.0")));
assertNotNull(fsm.getPolicyTypesMap().get(
- new ToscaPolicyTypeIdentifier("onap.policies.native.drools.Artifact", "1.0.0")));
+ new ToscaConceptIdentifier("onap.policies.native.drools.Artifact", "1.0.0")));
assertNotNull(fsm.getPolicyTypesMap().get(
- new ToscaPolicyTypeIdentifier("onap.policies.controlloop.operational.common.Drools",
+ new ToscaConceptIdentifier("onap.policies.controlloop.operational.common.Drools",
"1.0.0")));
PdpStatus cachedStatus = new StandardCoder()
.decode(fsm.client.getSink().getRecentEvents()[qlength], PdpStatus.class);
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStatePassiveTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStatePassiveTest.java
index 23c6e201..9547aa47 100644
--- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStatePassiveTest.java
+++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStatePassiveTest.java
@@ -3,6 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2021 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,8 +44,8 @@ import org.onap.policy.models.pdp.concepts.PdpUpdate;
import org.onap.policy.models.pdp.enums.PdpHealthStatus;
import org.onap.policy.models.pdp.enums.PdpMessageType;
import org.onap.policy.models.pdp.enums.PdpState;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
/**
* Lifecycle State Passive Tests.
@@ -73,12 +74,12 @@ public class LifecycleStatePassiveTest extends LifecycleStateRunningTest {
fsm.start(controllerSupport.getController());
assertSame(controllerSupport.getController(),
((PolicyTypeDroolsController) fsm.getController(
- new ToscaPolicyTypeIdentifier(
+ new ToscaConceptIdentifier(
ControllerSupport.POLICY_TYPE_COMPLIANT_OP, ControllerSupport.POLICY_TYPE_VERSION)))
.controllers().get(0));
fsm.stop(controllerSupport.getController());
- assertNull(fsm.getController(new ToscaPolicyTypeIdentifier(ControllerSupport.POLICY_TYPE_COMPLIANT_OP,
+ assertNull(fsm.getController(new ToscaConceptIdentifier(ControllerSupport.POLICY_TYPE_COMPLIANT_OP,
ControllerSupport.POLICY_TYPE_VERSION)));
fsm.shutdown();
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeArtifactControllerTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeArtifactControllerTest.java
index cd17385d..3c8be31c 100644
--- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeArtifactControllerTest.java
+++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/PolicyTypeNativeArtifactControllerTest.java
@@ -3,6 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2021 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,8 +36,8 @@ import org.onap.policy.drools.controller.internal.MavenDroolsController;
import org.onap.policy.drools.controller.internal.NullDroolsController;
import org.onap.policy.drools.domain.models.artifact.NativeArtifactPolicy;
import org.onap.policy.drools.system.PolicyControllerConstants;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
/**
* Rules Controller Test.
@@ -61,7 +62,7 @@ public class PolicyTypeNativeArtifactControllerTest extends LifecycleStateRunnin
nativePolicy = fsm.getDomainMaker().convertTo(policy, NativeArtifactPolicy.class);
controller =
new PolicyTypeNativeArtifactController(fsm,
- new ToscaPolicyTypeIdentifier("onap.policies.native.drools.Artifact", "1.0.0"));
+ new ToscaConceptIdentifier("onap.policies.native.drools.Artifact", "1.0.0"));
assertTrue(controllerSupport.getController().getDrools().isBrained());
assertFalse(controllerSupport.getController().isAlive());
@@ -147,4 +148,4 @@ public class PolicyTypeNativeArtifactControllerTest extends LifecycleStateRunnin
assertTrue(controllerSupport.getController().getDrools() instanceof MavenDroolsController);
}
-} \ No newline at end of file
+}