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 --- .../actorserviceprovider/impl/ActorImpl.java | 26 --------- .../actorserviceprovider/spi/Actor.java | 14 ----- .../ActorServiceProviderTest.java | 61 ---------------------- .../actorserviceprovider/DummyActor.java | 34 ------------ 4 files changed, 135 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') diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/ActorImpl.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/ActorImpl.java index c3c815e80..336860ecb 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/ActorImpl.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/ActorImpl.java @@ -21,8 +21,6 @@ package org.onap.policy.controlloop.actorserviceprovider.impl; import java.util.Collection; -import java.util.Collections; -import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -220,28 +218,4 @@ public class ActorImpl extends StartConfigPartial> implement "failed to shutdown operation {}.{}", actorName, oper.getName())); // @formatter:on } - - // TODO old code: remove lines down to **HERE** - - @Override - public String actor() { - return null; - } - - @Override - public List recipes() { - return Collections.emptyList(); - } - - @Override - public List recipeTargets(String recipe) { - return Collections.emptyList(); - } - - @Override - public List recipePayloads(String recipe) { - return Collections.emptyList(); - } - - // **HERE** } diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/spi/Actor.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/spi/Actor.java index 52d1a5a9a..ff1ed1798 100644 --- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/spi/Actor.java +++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/spi/Actor.java @@ -22,7 +22,6 @@ package org.onap.policy.controlloop.actorserviceprovider.spi; import java.util.Collection; -import java.util.List; import java.util.Map; import java.util.Set; import org.onap.policy.common.capabilities.Configurable; @@ -75,17 +74,4 @@ public interface Actor extends Startable, Configurable> { * @return the actor sequence number */ public int getSequenceNumber(); - - - // TODO old code: remove lines down to **HERE** - - String actor(); - - List recipes(); - - List recipeTargets(String recipe); - - List recipePayloads(String recipe); - - // **HERE** } 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