From c88676ec64c4c870252502bc1cfaa8990c8fd964 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Mon, 13 Jul 2020 16:06:57 -0400 Subject: Remove legacy actor code from models Deleted legacy actor code. That includes deleting most of the XxxManager classes. Issue-ID: POLICY-2559 Change-Id: I1ef1b900ca1d23e88da64b2c95a18986feb1b765 Signed-off-by: Jim Hahn --- .../ActorServiceProviderTest.java | 61 ---------------------- .../actorserviceprovider/DummyActor.java | 34 ------------ 2 files changed, 95 deletions(-) delete mode 100644 models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceProviderTest.java (limited to 'models-interactions/model-actors/actorServiceProvider/src/test') diff --git a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceProviderTest.java b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceProviderTest.java deleted file mode 100644 index abf156b58..000000000 --- a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/ActorServiceProviderTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * TestActorServiceProvider - * ================================================================================ - * Copyright (C) 2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.controlloop.actorserviceprovider; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; -import org.onap.policy.controlloop.actorserviceprovider.spi.Actor; - -// TODO combine this with ActorServiceTest - -public class ActorServiceProviderTest { - - private static final String DOROTHY = "Dorothy"; - - @Test - public void testActorServiceProvider() { - ActorService actorService = new ActorService(); - - assertTrue(actorService.getActors().size() >= 1); - - Actor dummyActor = actorService.getActor(DummyActor.class.getSimpleName()); - - assertEquals("DummyActor", dummyActor.actor()); - - assertEquals(2, dummyActor.recipes().size()); - assertEquals(DOROTHY, dummyActor.recipes().get(0)); - assertEquals("Wizard", dummyActor.recipes().get(1)); - - assertEquals(2, dummyActor.recipeTargets(DOROTHY).size()); - assertEquals(2, dummyActor.recipePayloads(DOROTHY).size()); - - // verify that we get a new actor object if we create a new service - Actor dummyActor2 = new ActorService().getActor(DummyActor.class.getSimpleName()); - assertNotNull(dummyActor2); - assertNotSame(dummyActor, dummyActor2); - } -} diff --git a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/DummyActor.java b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/DummyActor.java index 76cadffa6..f10694de6 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/DummyActor.java +++ b/models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/DummyActor.java @@ -22,8 +22,6 @@ package org.onap.policy.controlloop.actorserviceprovider; -import java.util.ArrayList; -import java.util.List; import org.onap.policy.controlloop.actorserviceprovider.impl.ActorImpl; public class DummyActor extends ActorImpl { @@ -31,36 +29,4 @@ public class DummyActor extends ActorImpl { public DummyActor() { super(DummyActor.class.getSimpleName()); } - - @Override - public String actor() { - return this.getClass().getSimpleName(); - } - - @Override - public List recipes() { - List recipeList = new ArrayList<>(); - recipeList.add("Dorothy"); - recipeList.add("Wizard"); - - return recipeList; - } - - @Override - public List recipeTargets(String recipe) { - List recipeTargetList = new ArrayList<>(); - recipeTargetList.add("Wicked Witch"); - recipeTargetList.add("Wizard of Oz"); - - return recipeTargetList; - } - - @Override - public List recipePayloads(String recipe) { - List recipePayloadList = new ArrayList<>(); - recipePayloadList.add("Dorothy"); - recipePayloadList.add("Toto"); - - return recipePayloadList; - } } -- cgit 1.2.3-korg