From cf748512392e5d3257de629dc57fb353dc073c92 Mon Sep 17 00:00:00 2001 From: ramverma Date: Wed, 17 Jul 2019 11:03:26 +0000 Subject: Changing policy/distribution to use policy/models 1) Changed policy distribution framework to use entities from policy/models 2) Changed all the test cases. 3) Commented few test cases which will be fixed along with code fixes. 4) Will be removing the old policy entities once all the pieces are ready. Change-Id: I1fd7b975b2e072c0b24e429903c9ca4796173929 Issue-ID: POLICY-1888 Signed-off-by: ramverma --- .../policy/distribution/main/testclasses/DummyDecoder.java | 10 +++++----- .../distribution/main/testclasses/DummyPolicyForwarder.java | 11 ++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'main/src') diff --git a/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyDecoder.java b/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyDecoder.java index d210d970..b9ee0768 100644 --- a/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyDecoder.java +++ b/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyDecoder.java @@ -22,27 +22,27 @@ package org.onap.policy.distribution.main.testclasses; import java.util.Collection; -import org.onap.policy.distribution.model.Policy; import org.onap.policy.distribution.model.PolicyInput; import org.onap.policy.distribution.reception.decoding.PolicyDecoder; import org.onap.policy.distribution.reception.decoding.PolicyDecodingException; +import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity; /** * Class to create a dummy decoder for test cases. * * @author Ram Krishna Verma (ram.krishna.verma@ericsson.com) */ -public class DummyDecoder implements PolicyDecoder { +public class DummyDecoder implements PolicyDecoder { private boolean canHandleValue; - private Collection policesToReturn; + private Collection policesToReturn; public DummyDecoder() { this.canHandleValue = false; this.policesToReturn = null; } - public DummyDecoder(final boolean canHandleValue, final Collection policesToReturn) { + public DummyDecoder(final boolean canHandleValue, final Collection policesToReturn) { this.canHandleValue = canHandleValue; this.policesToReturn = policesToReturn; } @@ -53,7 +53,7 @@ public class DummyDecoder implements PolicyDecoder { } @Override - public Collection decode(final PolicyInput input) throws PolicyDecodingException { + public Collection decode(final PolicyInput input) throws PolicyDecodingException { return policesToReturn; } diff --git a/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyPolicyForwarder.java b/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyPolicyForwarder.java index c9c7fef2..f2779c85 100644 --- a/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyPolicyForwarder.java +++ b/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyPolicyForwarder.java @@ -22,9 +22,10 @@ package org.onap.policy.distribution.main.testclasses; import java.util.ArrayList; import java.util.Collection; + import org.onap.policy.distribution.forwarding.PolicyForwarder; import org.onap.policy.distribution.forwarding.PolicyForwardingException; -import org.onap.policy.distribution.model.Policy; +import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity; /** * Class to create a dummy forwarder for test cases. @@ -33,10 +34,10 @@ import org.onap.policy.distribution.model.Policy; */ public class DummyPolicyForwarder implements PolicyForwarder { private int numberOfPoliciesReceived = 0; - private Collection policiesReceived = new ArrayList<>(); + private Collection policiesReceived = new ArrayList<>(); @Override - public void forward(final Collection policies) throws PolicyForwardingException { + public void forward(final Collection policies) throws PolicyForwardingException { numberOfPoliciesReceived += policies.size(); policiesReceived.addAll(policies); } @@ -45,10 +46,10 @@ public class DummyPolicyForwarder implements PolicyForwarder { return numberOfPoliciesReceived; } - public boolean receivedPolicy(final Policy policy) { + public boolean receivedPolicy(final ToscaEntity policy) { return policiesReceived.contains(policy); } @Override - public void configure(String parameterGroupName) {} + public void configure(final String parameterGroupName) {} } -- cgit 1.2.3-korg