summaryrefslogtreecommitdiffstats
path: root/policy-management/src/test/java/org
diff options
context:
space:
mode:
authormmis <michael.morris@ericsson.com>2018-07-30 19:24:09 +0100
committermmis <michael.morris@ericsson.com>2018-07-30 19:31:55 +0100
commit7e80f2ce69d5d16224ffcbfa424836a035a26878 (patch)
treebe8212c72fd604e6765aca410a2cbd2807b54e72 /policy-management/src/test/java/org
parent64f53ef14f5a9ea98208fd2b835bfb01fda9a5f9 (diff)
Copy policy-endpoints from drools-pdp to common
Issue-ID: POLICY-967 Change-Id: Ib19d3a89ffa328c39f7871bff59efb3dd1617f7a Signed-off-by: mmis <michael.morris@ericsson.com>
Diffstat (limited to 'policy-management/src/test/java/org')
-rw-r--r--policy-management/src/test/java/org/onap/policy/drools/protocol/coders/EventProtocolCoderTest.java4
-rw-r--r--policy-management/src/test/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolsetTest.java4
-rw-r--r--policy-management/src/test/java/org/onap/policy/drools/server/restful/test/RestManagerTest.java20
-rw-r--r--policy-management/src/test/java/org/onap/policy/drools/system/test/PolicyEngineTest.java10
4 files changed, 19 insertions, 19 deletions
diff --git a/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/EventProtocolCoderTest.java b/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/EventProtocolCoderTest.java
index a23820cf..b42c64b1 100644
--- a/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/EventProtocolCoderTest.java
+++ b/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/EventProtocolCoderTest.java
@@ -26,7 +26,7 @@ import static org.junit.Assert.assertTrue;
import java.util.Properties;
import org.junit.Test;
-import org.onap.policy.common.endpoints.event.comm.impl.ProxyTopicEndpointManager;
+import org.onap.policy.common.endpoints.event.comm.TopicEndpoint;
import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
import org.onap.policy.drools.protocol.configuration.DroolsConfiguration;
@@ -82,7 +82,7 @@ public class EventProtocolCoderTest {
final Properties noopSinkProperties = new Properties();
noopSinkProperties.put(PolicyEndPointProperties.PROPERTY_NOOP_SINK_TOPICS, NOOP_TOPIC);
- ProxyTopicEndpointManager.getInstance().addTopicSinks(noopSinkProperties);
+ TopicEndpoint.manager.addTopicSinks(noopSinkProperties);
EventProtocolCoder.manager.addEncoder(ENCODER_GROUP, ENCODER_ARTIFACT, NOOP_TOPIC,
DroolsConfiguration.class.getCanonicalName(), new JsonProtocolFilter(), null, null,
diff --git a/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolsetTest.java b/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolsetTest.java
index 02b09bb1..aa04f407 100644
--- a/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolsetTest.java
+++ b/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/ProtocolCoderToolsetTest.java
@@ -36,8 +36,8 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.kie.api.builder.ReleaseId;
+import org.onap.policy.common.endpoints.event.comm.TopicEndpoint;
import org.onap.policy.common.endpoints.event.comm.TopicSink;
-import org.onap.policy.common.endpoints.event.comm.impl.ProxyTopicEndpointManager;
import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
import org.onap.policy.drools.controller.DroolsController;
import org.onap.policy.drools.controller.internal.MavenDroolsControllerTest;
@@ -242,7 +242,7 @@ public class ProtocolCoderToolsetTest {
Properties sinkConfig = new Properties();
sinkConfig.put(PolicyEndPointProperties.PROPERTY_NOOP_SINK_TOPICS, JUNIT_PROTOCOL_CODER_TOPIC);
- List<? extends TopicSink> noopTopics = ProxyTopicEndpointManager.getInstance().addTopicSinks(sinkConfig);
+ List<? extends TopicSink> noopTopics = TopicEndpoint.manager.addTopicSinks(sinkConfig);
Properties droolsControllerConfig = new Properties();
droolsControllerConfig.put(DroolsProperties.RULES_GROUPID, releaseId.getGroupId());
diff --git a/policy-management/src/test/java/org/onap/policy/drools/server/restful/test/RestManagerTest.java b/policy-management/src/test/java/org/onap/policy/drools/server/restful/test/RestManagerTest.java
index 0f57cd97..e96a4b91 100644
--- a/policy-management/src/test/java/org/onap/policy/drools/server/restful/test/RestManagerTest.java
+++ b/policy-management/src/test/java/org/onap/policy/drools/server/restful/test/RestManagerTest.java
@@ -43,7 +43,7 @@ import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
-import org.onap.policy.common.endpoints.event.comm.impl.ProxyTopicEndpointManager;
+import org.onap.policy.common.endpoints.event.comm.TopicEndpoint;
import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
import org.onap.policy.drools.persistence.SystemPersistence;
import org.onap.policy.drools.system.PolicyController;
@@ -65,10 +65,10 @@ public class RestManagerTest {
private static final String UEB_SOURCE_SERVER_PROPERTY = PolicyEndPointProperties.PROPERTY_UEB_SOURCE_TOPICS + "."
+ UEB_TOPIC + PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
- private static final String UEB_SINK_SERVER_PROPERTY = PolicyEndPointProperties.PROPERTY_UEB_SINK_TOPICS + "." + UEB_TOPIC
- + PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
- private static final String DMAAP_SOURCE_SERVER_PROPERTY = PolicyEndPointProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "."
- + DMAAP_TOPIC + PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
+ private static final String UEB_SINK_SERVER_PROPERTY = PolicyEndPointProperties.PROPERTY_UEB_SINK_TOPICS + "."
+ + UEB_TOPIC + PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
+ private static final String DMAAP_SOURCE_SERVER_PROPERTY = PolicyEndPointProperties.PROPERTY_DMAAP_SOURCE_TOPICS
+ + "." + DMAAP_TOPIC + PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
private static final String DMAAP_SINK_SERVER_PROPERTY = PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS + "."
+ DMAAP_TOPIC + PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
private static final String UEB_SERVER = "localhost";
@@ -81,10 +81,10 @@ public class RestManagerTest {
private static final String DMAAP_SOURCE_PASSWD_KEY = PolicyEndPointProperties.PROPERTY_DMAAP_SOURCE_TOPICS + "."
+ DMAAP_TOPIC + PolicyEndPointProperties.PROPERTY_TOPIC_AAF_PASSWORD_SUFFIX;
- private static final String DMAAP_SINK_MECHID_KEY = PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS + "." + DMAAP_TOPIC
- + PolicyEndPointProperties.PROPERTY_TOPIC_AAF_MECHID_SUFFIX;
- private static final String DMAAP_SINK_PASSWD_KEY = PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS + "." + DMAAP_TOPIC
- + PolicyEndPointProperties.PROPERTY_TOPIC_AAF_PASSWORD_SUFFIX;
+ private static final String DMAAP_SINK_MECHID_KEY = PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS + "."
+ + DMAAP_TOPIC + PolicyEndPointProperties.PROPERTY_TOPIC_AAF_MECHID_SUFFIX;
+ private static final String DMAAP_SINK_PASSWD_KEY = PolicyEndPointProperties.PROPERTY_DMAAP_SINK_TOPICS + "."
+ + DMAAP_TOPIC + PolicyEndPointProperties.PROPERTY_TOPIC_AAF_PASSWORD_SUFFIX;
private static final String FOO_CONTROLLER_FILE = FOO_CONTROLLER + "-controller.properties";
@@ -137,7 +137,7 @@ public class RestManagerTest {
public static void tearDown() throws IOException, InterruptedException {
/* Shutdown managed resources */
PolicyController.factory.shutdown();
- ProxyTopicEndpointManager.getInstance().shutdown();
+ TopicEndpoint.manager.shutdown();
PolicyEngine.manager.stop();
Thread.sleep(10000L);
client.close();
diff --git a/policy-management/src/test/java/org/onap/policy/drools/system/test/PolicyEngineTest.java b/policy-management/src/test/java/org/onap/policy/drools/system/test/PolicyEngineTest.java
index 88d25563..c6a4ffb8 100644
--- a/policy-management/src/test/java/org/onap/policy/drools/system/test/PolicyEngineTest.java
+++ b/policy-management/src/test/java/org/onap/policy/drools/system/test/PolicyEngineTest.java
@@ -34,9 +34,9 @@ import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
+import org.onap.policy.common.endpoints.event.comm.TopicEndpoint;
import org.onap.policy.common.endpoints.event.comm.TopicSink;
-import org.onap.policy.common.endpoints.event.comm.bus.impl.IndexedNoopTopicSinkFactory;
-import org.onap.policy.common.endpoints.event.comm.impl.ProxyTopicEndpointManager;
+import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicSink;
import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
import org.onap.policy.drools.persistence.SystemPersistence;
import org.onap.policy.drools.properties.DroolsProperties;
@@ -198,7 +198,7 @@ public class PolicyEngineTest {
final Properties noopSinkProperties = new Properties();
noopSinkProperties.put(PolicyEndPointProperties.PROPERTY_NOOP_SINK_TOPICS, NOOP_TOPIC);
- ProxyTopicEndpointManager.getInstance().addTopicSinks(noopSinkProperties).get(0).start();
+ TopicEndpoint.manager.addTopicSinks(noopSinkProperties).get(0).start();
EventProtocolCoder.manager.addEncoder(ENCODER_GROUP, ENCODER_ARTIFACT, NOOP_TOPIC,
DroolsConfiguration.class.getCanonicalName(), new JsonProtocolFilter(), null, null,
@@ -207,7 +207,7 @@ public class PolicyEngineTest {
assertTrue(PolicyEngine.manager.deliver(NOOP_TOPIC,
new DroolsConfiguration(ENCODER_GROUP, ENCODER_ARTIFACT, ENCODER_VERSION)));
- final TopicSink sink = IndexedNoopTopicSinkFactory.getInstance().get(NOOP_TOPIC);
+ final TopicSink sink = NoopTopicSink.factory.get(NOOP_TOPIC);
assertTrue(sink.getRecentEvents()[0].contains(ENCODER_GROUP));
assertTrue(sink.getRecentEvents()[0].contains(ENCODER_ARTIFACT));
@@ -280,7 +280,7 @@ public class PolicyEngineTest {
/* Shutdown managed resources */
PolicyController.factory.shutdown();
- ProxyTopicEndpointManager.getInstance().shutdown();
+ TopicEndpoint.manager.shutdown();
PolicyEngine.manager.stop();
Thread.sleep(10000L);