From c6012167b9692eb38bcb479f233543e93c51c998 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Thu, 2 Jul 2020 09:30:52 -0400 Subject: Rename XxxActorServiceProvider to XxxActor Renamed the actors and their test classes. Addressed review comments: - some license dates Issue-ID: POLICY-2684 Change-Id: Ic9d83e146ef36bb305496d541166cb9f80544025 Signed-off-by: Jim Hahn --- .../policy/controlloop/actor/guard/GuardActor.java | 40 ++++++++++++++++++ .../actor/guard/GuardActorServiceProvider.java | 40 ------------------ ...licy.controlloop.actorserviceprovider.spi.Actor | 2 +- .../actor/guard/GuardActorServiceProviderTest.java | 48 ---------------------- .../controlloop/actor/guard/GuardActorTest.java | 48 ++++++++++++++++++++++ 5 files changed, 89 insertions(+), 89 deletions(-) create mode 100644 models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/GuardActor.java delete mode 100644 models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/GuardActorServiceProvider.java delete mode 100644 models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardActorServiceProviderTest.java create mode 100644 models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardActorTest.java (limited to 'models-interactions/model-actors/actor.guard/src') diff --git a/models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/GuardActor.java b/models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/GuardActor.java new file mode 100644 index 000000000..59b509291 --- /dev/null +++ b/models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/GuardActor.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP + * ================================================================================ + * Copyright (C) 2018-2019 Huawei Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. + * ================================================================================ + * 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.actor.guard; + +import org.onap.policy.controlloop.actorserviceprovider.impl.HttpActor; +import org.onap.policy.controlloop.actorserviceprovider.impl.OperationPartial; + +public class GuardActor extends HttpActor { + // actor name + public static final String NAME = OperationPartial.GUARD_ACTOR_NAME; + + /** + * Constructs the object. + */ + public GuardActor() { + super(NAME, GuardActorParams.class); + + addOperator(new DecisionOperator(NAME, DecisionOperation.NAME, DecisionOperation::new)); + } +} diff --git a/models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/GuardActorServiceProvider.java b/models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/GuardActorServiceProvider.java deleted file mode 100644 index 1cf09d399..000000000 --- a/models-interactions/model-actors/actor.guard/src/main/java/org/onap/policy/controlloop/actor/guard/GuardActorServiceProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SdncActorServiceProvider - * ================================================================================ - * Copyright (C) 2018-2019 Huawei Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. - * ================================================================================ - * 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.actor.guard; - -import org.onap.policy.controlloop.actorserviceprovider.impl.HttpActor; -import org.onap.policy.controlloop.actorserviceprovider.impl.OperationPartial; - -public class GuardActorServiceProvider extends HttpActor { - // actor name - public static final String NAME = OperationPartial.GUARD_ACTOR_NAME; - - /** - * Constructs the object. - */ - public GuardActorServiceProvider() { - super(NAME, GuardActorParams.class); - - addOperator(new DecisionOperator(NAME, DecisionOperation.NAME, DecisionOperation::new)); - } -} diff --git a/models-interactions/model-actors/actor.guard/src/main/resources/META-INF/services/org.onap.policy.controlloop.actorserviceprovider.spi.Actor b/models-interactions/model-actors/actor.guard/src/main/resources/META-INF/services/org.onap.policy.controlloop.actorserviceprovider.spi.Actor index dd4368504..16d7591fa 100644 --- a/models-interactions/model-actors/actor.guard/src/main/resources/META-INF/services/org.onap.policy.controlloop.actorserviceprovider.spi.Actor +++ b/models-interactions/model-actors/actor.guard/src/main/resources/META-INF/services/org.onap.policy.controlloop.actorserviceprovider.spi.Actor @@ -1 +1 @@ -org.onap.policy.controlloop.actor.guard.GuardActorServiceProvider +org.onap.policy.controlloop.actor.guard.GuardActor diff --git a/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardActorServiceProviderTest.java b/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardActorServiceProviderTest.java deleted file mode 100644 index 0ad8161c6..000000000 --- a/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardActorServiceProviderTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - * ================================================================================ - * Copyright (C) 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.actor.guard; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.util.Arrays; -import java.util.stream.Collectors; -import org.junit.Test; -import org.onap.policy.controlloop.actor.test.BasicActor; - -public class GuardActorServiceProviderTest extends BasicActor { - - @Test - public void test() { - final GuardActorServiceProvider prov = new GuardActorServiceProvider(); - - // verify that it has the operators we expect - var expected = Arrays.asList(DecisionOperation.NAME).stream().sorted().collect(Collectors.toList()); - var actual = prov.getOperationNames().stream().sorted().collect(Collectors.toList()); - - assertEquals(expected.toString(), actual.toString()); - - // verify that it all plugs into the ActorService - verifyActorService(GuardActorServiceProvider.NAME, "service.yaml"); - - assertTrue(prov.getOperator(DecisionOperation.NAME) instanceof DecisionOperator); - } -} diff --git a/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardActorTest.java b/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardActorTest.java new file mode 100644 index 000000000..e5c3f139d --- /dev/null +++ b/models-interactions/model-actors/actor.guard/src/test/java/org/onap/policy/controlloop/actor/guard/GuardActorTest.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP + * ================================================================================ + * Copyright (C) 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.actor.guard; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.stream.Collectors; +import org.junit.Test; +import org.onap.policy.controlloop.actor.test.BasicActor; + +public class GuardActorTest extends BasicActor { + + @Test + public void test() { + final GuardActor prov = new GuardActor(); + + // verify that it has the operators we expect + var expected = Arrays.asList(DecisionOperation.NAME).stream().sorted().collect(Collectors.toList()); + var actual = prov.getOperationNames().stream().sorted().collect(Collectors.toList()); + + assertEquals(expected.toString(), actual.toString()); + + // verify that it all plugs into the ActorService + verifyActorService(GuardActor.NAME, "service.yaml"); + + assertTrue(prov.getOperator(DecisionOperation.NAME) instanceof DecisionOperator); + } +} -- cgit 1.2.3-korg