From 10b21aae2bde224ab7f91f4b5ab1b89369c8fd1c Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 8 May 2019 14:33:57 -0400 Subject: Add payload to vFW policy yaml Added new "streams" payload to vFW policy yaml files. Removed references to pg-streams. Also deleted directories that were moved to policy/models. Also removed references to trafficgenerator. Updated licenses. Removed some trailing whitespace. Change-Id: I6becaa573628eee677f0959fadf86f9a9f032f88 Issue-ID: POLICY-1752 Signed-off-by: Jim Hahn --- .../controlloop/ControlLoopEventStatusTest.java | 41 -------- .../policy/controlloop/ControlLoopEventTest.java | 96 ----------------- .../controlloop/ControlLoopNotificationTest.java | 117 --------------------- .../ControlLoopNotificationTypeTest.java | 49 --------- .../controlloop/ControlLoopOperationTest.java | 89 ---------------- .../ControlLoopOperationWrapperTest.java | 50 --------- .../controlloop/ControlLoopResponseTest.java | 65 ------------ .../controlloop/ControlLoopTargetTypeTest.java | 39 ------- .../controlloop/PhysicalControlLoopEventTest.java | 37 ------- .../PhysicalControlLoopNotificationTest.java | 38 ------- .../controlloop/VirtualControlLoopEventTest.java | 49 --------- .../VirtualControlLoopNotificationTest.java | 58 ---------- .../controlloop/params/ControlLoopParamsTest.java | 50 --------- 13 files changed, 778 deletions(-) delete mode 100644 controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventStatusTest.java delete mode 100644 controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventTest.java delete mode 100644 controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTest.java delete mode 100644 controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTypeTest.java delete mode 100644 controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java delete mode 100644 controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationWrapperTest.java delete mode 100644 controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopResponseTest.java delete mode 100644 controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopTargetTypeTest.java delete mode 100644 controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopEventTest.java delete mode 100644 controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopNotificationTest.java delete mode 100644 controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopEventTest.java delete mode 100644 controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopNotificationTest.java delete mode 100644 controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/params/ControlLoopParamsTest.java (limited to 'controlloop/common/model-impl/events/src/test') diff --git a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventStatusTest.java b/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventStatusTest.java deleted file mode 100644 index b4944fc42..000000000 --- a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventStatusTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * controlloop - * ================================================================================ - * Copyright (C) 2018 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; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; - -import org.junit.Test; - -public class ControlLoopEventStatusTest { - - @Test - public void test() { - ControlLoopEventStatus status = ControlLoopEventStatus.ABATED; - assertEquals(ControlLoopEventStatus.ABATED, ControlLoopEventStatus.toStatus(status.toString())); - assertNotEquals(ControlLoopEventStatus.ONSET, ControlLoopEventStatus.toStatus(status.toString())); - - status = ControlLoopEventStatus.ONSET; - assertEquals(ControlLoopEventStatus.ONSET, ControlLoopEventStatus.toStatus(status.toString())); - assertNotEquals(ControlLoopEventStatus.ABATED, ControlLoopEventStatus.toStatus(status.toString())); - assertEquals(ControlLoopEventStatus.ABATED, ControlLoopEventStatus.toStatus("abatement")); - } -} diff --git a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventTest.java b/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventTest.java deleted file mode 100644 index 9da12aaab..000000000 --- a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * controlloop - * ================================================================================ - * Copyright (C) 2018 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; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import java.util.UUID; -import org.junit.Test; - -public class ControlLoopEventTest { - - private class TestControlLoopEvent extends ControlLoopEvent { - private static final long serialVersionUID = 1L; - - public TestControlLoopEvent() { - super(); - } - - public TestControlLoopEvent(ControlLoopEvent event) { - super(event); - } - } - - @Test - public void test() { - ControlLoopEvent event = new TestControlLoopEvent(); - - assertEquals("1.0.2", event.getVersion()); - - event = new TestControlLoopEvent(null); - assertEquals("1.0.2", event.getVersion()); - - event.setClosedLoopControlName("name"); - assertEquals("name", event.getClosedLoopControlName()); - - event.setClosedLoopEventClient("client"); - assertEquals("client", event.getClosedLoopEventClient()); - - event.setClosedLoopEventStatus(ControlLoopEventStatus.ONSET); - assertEquals(ControlLoopEventStatus.ONSET, event.getClosedLoopEventStatus()); - - event.setFrom("from"); - assertEquals("from", event.getFrom()); - - event.setPayload("payload"); - assertEquals("payload", event.getPayload()); - - event.setPolicyName("policyname"); - assertEquals("policyname", event.getPolicyName()); - - event.setPolicyScope("scope"); - assertEquals("scope", event.getPolicyScope()); - - event.setPolicyVersion("1"); - assertEquals("1", event.getPolicyVersion()); - - UUID id = UUID.randomUUID(); - event.setRequestId(id); - assertEquals(id, event.getRequestId()); - - event.setTarget("target"); - assertEquals("target", event.getTarget()); - - event.setTargetType(ControlLoopTargetType.VF); - assertEquals(ControlLoopTargetType.VF, event.getTargetType()); - - event.setVersion("foo"); - assertEquals("foo", event.getVersion()); - - ControlLoopEvent event2 = new TestControlLoopEvent(event); - assertTrue(event2.isEventStatusValid()); - - event2.setClosedLoopEventStatus(null); - assertFalse(event2.isEventStatusValid()); - } -} diff --git a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTest.java b/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTest.java deleted file mode 100644 index de03cc265..000000000 --- a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTest.java +++ /dev/null @@ -1,117 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * controlloop - * ================================================================================ - * Copyright (C) 2018 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; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.time.ZoneOffset; -import java.time.ZonedDateTime; -import java.util.Collections; -import java.util.UUID; -import org.junit.Test; -import org.onap.policy.controlloop.util.Serialization; - -public class ControlLoopNotificationTest { - - private class TestControlLoopNotification extends ControlLoopNotification { - private static final long serialVersionUID = 1L; - - public TestControlLoopNotification() { - super(); - } - - public TestControlLoopNotification(ControlLoopEvent event) { - super(event); - } - } - - @Test - public void test() { - ControlLoopNotification notification = new TestControlLoopNotification(); - - assertEquals("1.0.2", notification.getVersion()); - - notification.setClosedLoopControlName("name"); - assertEquals("name", notification.getClosedLoopControlName()); - - notification.setClosedLoopEventClient("client"); - assertEquals("client", notification.getClosedLoopEventClient()); - - notification.setFrom("from"); - assertEquals("from", notification.getFrom()); - - notification.setHistory(Collections.emptyList()); - assertTrue(notification.getHistory().size() == 0); - - notification.setMessage("message"); - assertEquals("message", notification.getMessage()); - - notification.setNotification(ControlLoopNotificationType.ACTIVE); - assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification()); - - ZonedDateTime time = ZonedDateTime.now(ZoneOffset.UTC); - notification.setNotificationTime(time); - assertEquals(time, notification.getNotificationTime()); - - notification.setOpsClTimer(Integer.valueOf(1000)); - assertEquals(Integer.valueOf(1000), notification.getOpsClTimer()); - - notification.setPolicyName("name"); - assertEquals("name", notification.getPolicyName()); - - notification.setPolicyScope("scope"); - assertEquals("scope", notification.getPolicyScope()); - - notification.setPolicyVersion("1"); - assertEquals("1", notification.getPolicyVersion()); - - UUID id = UUID.randomUUID(); - notification.setRequestId(id); - assertEquals(id, notification.getRequestId()); - - notification.setTarget("target"); - assertEquals("target", notification.getTarget()); - - notification.setTargetType(ControlLoopTargetType.VFC); - assertEquals(ControlLoopTargetType.VFC, notification.getTargetType()); - - VirtualControlLoopEvent event = new VirtualControlLoopEvent(); - event.setClosedLoopControlName("controlloop"); - - TestControlLoopNotification notification2 = new TestControlLoopNotification(event); - assertEquals("controlloop", notification2.getClosedLoopControlName()); - - notification2.setVersion("1"); - assertEquals("1", notification2.getVersion()); - - String json = Serialization.gsonPretty.toJson(notification); - - TestControlLoopNotification notification3 = Serialization.gson.fromJson(json, - TestControlLoopNotification.class); - - // - // There is no equals for the class - chose not to create one - // - assertEquals(notification.getRequestId(), notification3.getRequestId()); - - } -} diff --git a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTypeTest.java b/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTypeTest.java deleted file mode 100644 index 63103ac8f..000000000 --- a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopNotificationTypeTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * controlloop - * ================================================================================ - * Copyright (C) 2018 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; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -import org.junit.Test; - -public class ControlLoopNotificationTypeTest { - - @Test - public void test() { - - assertEquals(ControlLoopNotificationType.ACTIVE, ControlLoopNotificationType.toType("ACTIVE")); - assertEquals(ControlLoopNotificationType.REJECTED, ControlLoopNotificationType.toType("REJECTED")); - assertEquals(ControlLoopNotificationType.OPERATION, ControlLoopNotificationType.toType("OPERATION")); - assertEquals(ControlLoopNotificationType.OPERATION_SUCCESS, - ControlLoopNotificationType.toType("OPERATION: SUCCESS")); - assertEquals(ControlLoopNotificationType.OPERATION_FAILURE, - ControlLoopNotificationType.toType("OPERATION: FAILURE")); - assertEquals(ControlLoopNotificationType.FINAL_FAILURE, - ControlLoopNotificationType.toType("FINAL: FAILURE")); - assertEquals(ControlLoopNotificationType.FINAL_SUCCESS, - ControlLoopNotificationType.toType("FINAL: SUCCESS")); - assertEquals(ControlLoopNotificationType.FINAL_OPENLOOP, - ControlLoopNotificationType.toType("FINAL: OPENLOOP")); - - assertNull(ControlLoopNotificationType.toType("foo")); - } -} diff --git a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java b/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java deleted file mode 100644 index 6c6a83e85..000000000 --- a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * controlloop - * ================================================================================ - * Copyright (C) 2018 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; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.time.Instant; -import org.junit.Test; - -public class ControlLoopOperationTest { - - @Test - public void test() { - ControlLoopOperation operation = new ControlLoopOperation(); - - assertEquals(operation, operation); - assertNotEquals(operation, new String()); - assertNotEquals(operation, null); - - assertTrue(operation.hashCode() != 0); - assertTrue(operation.toString().startsWith("ControlLoopOperation")); - - assertNotNull(operation); - - operation.setActor("actor"); - assertEquals("actor", operation.getActor()); - - operation.setOperation("operation"); - assertEquals("operation", operation.getOperation()); - - Instant now = Instant.now(); - operation.setStart(now); - assertEquals(now, operation.getStart()); - operation.setEnd(now); - assertEquals(now, operation.getEnd()); - - operation.setMessage("message"); - assertEquals("message", operation.getMessage()); - - operation.setOutcome("outcome"); - assertEquals("outcome", operation.getOutcome()); - - operation.setSubRequestId("1"); - assertEquals("1", operation.getSubRequestId()); - - operation.setTarget("target"); - assertEquals("target", operation.getTarget()); - - assertTrue(operation.hashCode() != 0); - - ControlLoopOperation operation2 = new ControlLoopOperation(operation); - assertEquals(now, operation2.getEnd()); - - assertEquals(operation, operation2); - - operation2.setActor("foo"); - assertNotEquals(operation, operation2); - - operation = new ControlLoopOperation(null); - assertNotNull(operation.getStart()); - - assertNotEquals(operation, operation2); - - assertTrue(operation.toMessage().startsWith("actor=")); - assertTrue(operation.toHistory().startsWith("actor=")); - - } -} diff --git a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationWrapperTest.java b/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationWrapperTest.java deleted file mode 100644 index 8d25c8eac..000000000 --- a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopOperationWrapperTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * controlloop - * ================================================================================ - * Copyright (C) 2018 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; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.util.UUID; -import org.junit.Test; - -public class ControlLoopOperationWrapperTest { - - @Test - public void test() { - ControlLoopOperationWrapper wrapper = new ControlLoopOperationWrapper(); - - assertNotNull(wrapper); - - ControlLoopOperation operation = new ControlLoopOperation(); - wrapper.setOperation(operation); - UUID id = UUID.randomUUID(); - wrapper.setRequestId(id); - - ControlLoopOperationWrapper wrapper2 = new ControlLoopOperationWrapper(wrapper.getRequestId(), - wrapper.getOperation()); - - assertEquals(operation, wrapper2.getOperation()); - assertEquals(id, wrapper2.getRequestId()); - - - } -} diff --git a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopResponseTest.java b/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopResponseTest.java deleted file mode 100644 index 3bab0aef4..000000000 --- a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopResponseTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * controlloop - * ================================================================================ - * Copyright (C) 2019 Wipro Limited 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; - -import static org.junit.Assert.assertEquals; - -import java.util.UUID; -import org.junit.Test; - -public class ControlLoopResponseTest { - - @Test - public void test() { - ControlLoopResponse rsp = new ControlLoopResponse(); - - assertEquals("1.0.0", rsp.getVersion()); - - rsp = new ControlLoopResponse(null); - assertEquals("1.0.0", rsp.getVersion()); - - rsp.setClosedLoopControlName("name"); - assertEquals("name", rsp.getClosedLoopControlName()); - - rsp.setFrom("from"); - assertEquals("from", rsp.getFrom()); - - rsp.setPayload("payload"); - assertEquals("payload", rsp.getPayload()); - - rsp.setPolicyName("policyname"); - assertEquals("policyname", rsp.getPolicyName()); - - rsp.setPolicyVersion("1"); - assertEquals("1", rsp.getPolicyVersion()); - - UUID id = UUID.randomUUID(); - rsp.setRequestId(id); - assertEquals(id, rsp.getRequestId()); - - rsp.setTarget("target"); - assertEquals("target", rsp.getTarget()); - - rsp.setVersion("foo"); - assertEquals("foo", rsp.getVersion()); - - } -} diff --git a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopTargetTypeTest.java b/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopTargetTypeTest.java deleted file mode 100644 index 1afd1f674..000000000 --- a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopTargetTypeTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * controlloop - * ================================================================================ - * Copyright (C) 2018 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; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -import org.junit.Test; - -public class ControlLoopTargetTypeTest { - - @Test - public void test() { - assertEquals(ControlLoopTargetType.VM, ControlLoopTargetType.toType("VM")); - assertEquals(ControlLoopTargetType.VF, ControlLoopTargetType.toType("VF")); - assertEquals(ControlLoopTargetType.VFC, ControlLoopTargetType.toType("VFC")); - assertEquals(ControlLoopTargetType.VNF, ControlLoopTargetType.toType("VNF")); - - assertNull(ControlLoopTargetType.toType("foo")); - } -} diff --git a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopEventTest.java b/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopEventTest.java deleted file mode 100644 index b0f08e15b..000000000 --- a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopEventTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * controlloop - * ================================================================================ - * Copyright (C) 2018 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; - -import static org.junit.Assert.assertNotNull; - -import org.junit.Test; - -public class PhysicalControlLoopEventTest { - - @Test - public void test() { - PhysicalControlLoopEvent event = new PhysicalControlLoopEvent(); - assertNotNull(event); - - PhysicalControlLoopEvent event2 = new PhysicalControlLoopEvent(event); - assertNotNull(event2); - } -} diff --git a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopNotificationTest.java b/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopNotificationTest.java deleted file mode 100644 index e10707bc1..000000000 --- a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/PhysicalControlLoopNotificationTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * controlloop - * ================================================================================ - * Copyright (C) 2018 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; - -import static org.junit.Assert.assertNotNull; - -import org.junit.Test; - -public class PhysicalControlLoopNotificationTest { - - @Test - public void test() { - PhysicalControlLoopNotification notification = new PhysicalControlLoopNotification(); - assertNotNull(notification); - - PhysicalControlLoopNotification notification2 = new PhysicalControlLoopNotification( - new PhysicalControlLoopEvent()); - assertNotNull(notification2); - } -} diff --git a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopEventTest.java b/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopEventTest.java deleted file mode 100644 index 49837d191..000000000 --- a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopEventTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * controlloop - * ================================================================================ - * Copyright (C) 2018 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; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; - -import java.time.Instant; -import org.junit.Test; - -public class VirtualControlLoopEventTest { - - @Test - public void test() { - VirtualControlLoopEvent event = new VirtualControlLoopEvent(); - - assertNotNull(event); - assertNotNull(event.getAai()); - - Instant now = Instant.now(); - event.setClosedLoopAlarmStart(now); - event.setClosedLoopAlarmEnd(now); - - VirtualControlLoopEvent event2 = new VirtualControlLoopEvent(event); - assertEquals(now, event2.getClosedLoopAlarmStart()); - - event = new VirtualControlLoopEvent(null); - assertNull(event.getClosedLoopAlarmStart()); - } -} diff --git a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopNotificationTest.java b/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopNotificationTest.java deleted file mode 100644 index 9adfebea2..000000000 --- a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopNotificationTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * controlloop - * ================================================================================ - * Copyright (C) 2018 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; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.time.Instant; -import java.util.Collections; -import org.junit.Test; - -public class VirtualControlLoopNotificationTest { - - @Test - public void test() { - VirtualControlLoopNotification notification = new VirtualControlLoopNotification(); - assertNotNull(notification); - - notification.setAai(Collections.emptyMap()); - assertTrue(notification.getAai().isEmpty()); - - Instant now = Instant.now(); - notification.setClosedLoopAlarmStart(now); - - notification.setClosedLoopAlarmEnd(now); - - VirtualControlLoopEvent event = new VirtualControlLoopEvent(); - - Instant later = Instant.now(); - event.setAai(Collections.emptyMap()); - event.setClosedLoopAlarmStart(later); - event.setClosedLoopAlarmEnd(later); - - notification = new VirtualControlLoopNotification(event); - assertEquals(later, notification.getClosedLoopAlarmStart()); - assertEquals(later, notification.getClosedLoopAlarmEnd()); - - } -} diff --git a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/params/ControlLoopParamsTest.java b/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/params/ControlLoopParamsTest.java deleted file mode 100644 index 065345a1a..000000000 --- a/controlloop/common/model-impl/events/src/test/java/org/onap/policy/controlloop/params/ControlLoopParamsTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * controlloop - * ================================================================================ - * Copyright (C) 2018 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.params; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -public class ControlLoopParamsTest { - - @Test - public void test() { - ControlLoopParams params = new ControlLoopParams(); - assertNotNull(params); - - params.setClosedLoopControlName("name"); - params.setControlLoopYaml("yaml"); - params.setPolicyName("name"); - params.setPolicyScope("scope"); - params.setPolicyVersion("1"); - - ControlLoopParams params2 = new ControlLoopParams(params); - - assertTrue(params2.getClosedLoopControlName().equals("name")); - assertTrue(params2.getControlLoopYaml().equals("yaml")); - assertTrue(params2.getPolicyName().equals("name")); - assertTrue(params2.getPolicyScope().equals("scope")); - assertTrue(params2.getPolicyVersion().equals("1")); - - } -} -- cgit 1.2.3-korg