diff options
Diffstat (limited to 'controlloop')
7 files changed, 61 insertions, 36 deletions
diff --git a/controlloop/common/controller-frankfurt/src/test/resources/config/event-manager.properties b/controlloop/common/controller-frankfurt/src/test/resources/config/event-manager.properties index 1b9592cb3..a54f5e0b0 100644 --- a/controlloop/common/controller-frankfurt/src/test/resources/config/event-manager.properties +++ b/controlloop/common/controller-frankfurt/src/test/resources/config/event-manager.properties @@ -52,6 +52,13 @@ actor.service.APPC.operations.Rebuild.placeholder= actor.service.APPC.operations.ModifyConfig.sinkTopic=APPC-CL actor.service.APPC.operations.ModifyConfig.sourceTopic=APPC-CL +actor.service.CDS.operations.any.host=localhost +actor.service.CDS.operations.any.port=7878 +actor.service.CDS.operations.any.username=grpc-username +actor.service.CDS.operations.any.password=grpc-password +actor.service.CDS.operations.any.timeout=10 + +# these will be deleted once the actor change has been merged actor.service.CDS.any.host=localhost actor.service.CDS.any.port=7878 actor.service.CDS.any.username=grpc-username @@ -75,6 +82,14 @@ actor.service.SO.waitSecGet=20 actor.service.SO.operations.VF\ Module\ Create.path=serviceInstantiation/v7/serviceInstances actor.service.SO.operations.VF\ Module\ Delete.path=serviceInstances/v7 +actor.service.VFC.operations.Restart.clientName=VFC +actor.service.VFC.operations.Restart.pathGet=jobs +actor.service.VFC.operations.Restart.maxGets=20 +actor.service.VFC.operations.Restart.waitSecGet=20 +actor.service.VFC.operations.Restart.path=ns +actor.service.VFC.operations.Restart.timeoutSec=60 + +# these will be deleted once the actor change has been merged actor.service.VFC.Restart.clientName=VFC actor.service.VFC.Restart.pathGet=jobs actor.service.VFC.Restart.maxGets=20 diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java index db16c4528..2d9fb7e1d 100644 --- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java +++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java @@ -647,8 +647,8 @@ public class ControlLoopEventManagerTest { VirtualControlLoopEvent onsetEvent = getOnsetEvent(); ControlLoopEventManager manager = makeManager(onsetEvent); - assertTrue(0 == manager.getControlLoopTimeout(null)); - assertTrue(120 == manager.getControlLoopTimeout(120)); + assertEquals(0, manager.getControlLoopTimeout(null)); + assertEquals(120, manager.getControlLoopTimeout(120)); InputStream is = new FileInputStream(new File(TEST_YAML)); final String yamlString = IOUtils.toString(is, StandardCharsets.UTF_8); @@ -673,8 +673,8 @@ public class ControlLoopEventManagerTest { assertNotNull(notification); assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification()); - assertTrue(0 == manager.getControlLoopTimeout(null)); - assertTrue(120 == manager.getControlLoopTimeout(120)); + assertEquals(0, manager.getControlLoopTimeout(null)); + assertEquals(120, manager.getControlLoopTimeout(120)); } @Test @@ -690,8 +690,8 @@ public class ControlLoopEventManagerTest { assertNotNull(notification); assertEquals(ControlLoopNotificationType.ACTIVE, notification.getNotification()); - assertTrue(0 == manager.getControlLoopTimeout(null)); - assertTrue(120 == manager.getControlLoopTimeout(120)); + assertEquals(0, manager.getControlLoopTimeout(null)); + assertEquals(120, manager.getControlLoopTimeout(120)); } @Test diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java index 4cb365a76..b64d9484e 100644 --- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java +++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java @@ -226,7 +226,7 @@ public class ControlLoopOperationManagerTest { // PolicyResult result = manager.onResponse(dmaapResponse); logger.debug("{}", manager); - assertTrue(result == null); + assertNull(result); assertFalse(manager.isOperationComplete()); assertTrue(manager.isOperationRunning()); // @@ -239,7 +239,7 @@ public class ControlLoopOperationManagerTest { dmaapResponse.setBody(outputBody); result = manager.onResponse(dmaapResponse); logger.debug("{}", manager); - assertTrue(result.equals(PolicyResult.FAILURE)); + assertEquals(PolicyResult.FAILURE, result); assertFalse(manager.isOperationComplete()); assertFalse(manager.isOperationRunning()); // @@ -268,7 +268,7 @@ public class ControlLoopOperationManagerTest { // result = manager.onResponse(dmaapResponse); logger.debug("{}", manager); - assertTrue(result == null); + assertNull(result); assertFalse(manager.isOperationComplete()); assertTrue(manager.isOperationRunning()); // @@ -281,15 +281,15 @@ public class ControlLoopOperationManagerTest { dmaapResponse.setBody(outputBody); result = manager.onResponse(dmaapResponse); logger.debug("{}", manager); - assertTrue(result.equals(PolicyResult.FAILURE)); + assertEquals(PolicyResult.FAILURE, result); // // Should be complete now // assertTrue(manager.isOperationComplete()); assertFalse(manager.isOperationRunning()); assertNotNull(manager.getOperationResult()); - assertTrue(manager.getOperationResult().equals(PolicyResult.FAILURE_RETRIES)); - assertTrue(manager.getHistory().size() == 2); + assertEquals(PolicyResult.FAILURE_RETRIES, manager.getOperationResult()); + assertEquals(2, manager.getHistory().size()); } @Test @@ -354,7 +354,7 @@ public class ControlLoopOperationManagerTest { // PolicyResult result = manager.onResponse(dmaapResponse); logger.debug("{}", manager); - assertTrue(result == null); + assertNull(result); assertFalse(manager.isOperationComplete()); assertTrue(manager.isOperationRunning()); // @@ -364,8 +364,8 @@ public class ControlLoopOperationManagerTest { logger.debug("{}", manager); assertTrue(manager.isOperationComplete()); assertFalse(manager.isOperationRunning()); - assertTrue(manager.getHistory().size() == 1); - assertTrue(manager.getOperationResult().equals(PolicyResult.FAILURE_TIMEOUT)); + assertEquals(1, manager.getHistory().size()); + assertEquals(PolicyResult.FAILURE_TIMEOUT, manager.getOperationResult()); // // Now we are going to Fail the previous request // @@ -381,8 +381,8 @@ public class ControlLoopOperationManagerTest { // assertTrue(manager.isOperationComplete()); assertFalse(manager.isOperationRunning()); - assertTrue(manager.getHistory().size() == 1); - assertTrue(manager.getOperationResult().equals(PolicyResult.FAILURE_TIMEOUT)); + assertEquals(1, manager.getHistory().size()); + assertEquals(PolicyResult.FAILURE_TIMEOUT, manager.getOperationResult()); } @Test diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties index 853991714..5a4bf04d9 100644 --- a/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties +++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties @@ -53,6 +53,13 @@ actor.service.APPC.operations.Rebuild.placeholder= actor.service.APPC.operations.ModifyConfig.sinkTopic=APPC-CL actor.service.APPC.operations.ModifyConfig.sourceTopic=APPC-CL +actor.service.CDS.operations.any.host=${envd:CDS_GRPC_HOST:} +actor.service.CDS.operations.any.port=${envd:CDS_GRPC_PORT:} +actor.service.CDS.operations.any.username=${envd:CDS_GRPC_USERNAME:} +actor.service.CDS.operations.any.password=${envd:CDS_GRPC_PASSWORD:} +actor.service.CDS.operations.any.timeout=10 + +# these will be deleted once the actor change has been merged actor.service.CDS.any.host=${envd:CDS_GRPC_HOST:} actor.service.CDS.any.port=${envd:CDS_GRPC_PORT:} actor.service.CDS.any.username=${envd:CDS_GRPC_USERNAME:} @@ -76,6 +83,14 @@ actor.service.SO.waitSecGet=20 actor.service.SO.operations.VF\ Module\ Create.path=serviceInstantiation/v7/serviceInstances actor.service.SO.operations.VF\ Module\ Delete.path=serviceInstances/v7 +actor.service.VFC.operations.Restart.clientName=VFC +actor.service.VFC.operations.Restart.pathGet=jobs +actor.service.VFC.operations.Restart.maxGets=20 +actor.service.VFC.operations.Restart.waitSecGet=20 +actor.service.VFC.operations.Restart.path=ns +actor.service.VFC.operations.Restart.timeoutSec=60 + +# these will be deleted once the actor change has been merged actor.service.VFC.Restart.clientName=VFC actor.service.VFC.Restart.pathGet=jobs actor.service.VFC.Restart.maxGets=20 diff --git a/controlloop/common/guard/src/test/java/org/onap/policy/guard/PolicyGuardYamlToXacmlTest.java b/controlloop/common/guard/src/test/java/org/onap/policy/guard/PolicyGuardYamlToXacmlTest.java index 75dc73c27..e15ae920d 100644 --- a/controlloop/common/guard/src/test/java/org/onap/policy/guard/PolicyGuardYamlToXacmlTest.java +++ b/controlloop/common/guard/src/test/java/org/onap/policy/guard/PolicyGuardYamlToXacmlTest.java @@ -179,11 +179,6 @@ public class PolicyGuardYamlToXacmlTest { } @Test - public void testFromYamlToXacmlBlacklist() { - // fail("Not yet implemented"); - } - - @Test public void testGenerateXacmlGuardBlacklist() throws IOException { final File tempYamlFile = File.createTempFile(ONAPPF_FILE, "yaml"); tempYamlFile.deleteOnExit(); diff --git a/controlloop/m2/appclcm/src/test/java/appclcm/AppcLcmHealthCheckOperationTest.java b/controlloop/m2/appclcm/src/test/java/appclcm/AppcLcmHealthCheckOperationTest.java index 25f8043f2..f49204e65 100644 --- a/controlloop/m2/appclcm/src/test/java/appclcm/AppcLcmHealthCheckOperationTest.java +++ b/controlloop/m2/appclcm/src/test/java/appclcm/AppcLcmHealthCheckOperationTest.java @@ -158,7 +158,7 @@ public class AppcLcmHealthCheckOperationTest { AppcLcmDmaapWrapper healthCheckResp = Serialization.gson.fromJson(lcmRespJson, AppcLcmDmaapWrapper.class); operation.incomingMessage(healthCheckResp); - assertEquals(operation.getResult(), PolicyResult.SUCCESS); + assertEquals(PolicyResult.SUCCESS, operation.getResult()); } @Test @@ -179,7 +179,7 @@ public class AppcLcmHealthCheckOperationTest { AppcLcmDmaapWrapper healthCheckResp = Serialization.gson.fromJson(lcmRespJson, AppcLcmDmaapWrapper.class); operation.incomingMessage(healthCheckResp); - assertEquals(operation.getResult(), PolicyResult.FAILURE); + assertEquals(PolicyResult.FAILURE, operation.getResult()); } @Test @@ -200,7 +200,7 @@ public class AppcLcmHealthCheckOperationTest { AppcLcmDmaapWrapper healthCheckResp = Serialization.gson.fromJson(lcmRespJson, AppcLcmDmaapWrapper.class); operation.incomingMessage(healthCheckResp); - assertEquals(operation.getResult(), PolicyResult.FAILURE_EXCEPTION); + assertEquals(PolicyResult.FAILURE_EXCEPTION, operation.getResult()); } @Test @@ -221,7 +221,7 @@ public class AppcLcmHealthCheckOperationTest { AppcLcmDmaapWrapper healthCheckResp = Serialization.gson.fromJson(lcmRespJson, AppcLcmDmaapWrapper.class); operation.incomingMessage(healthCheckResp); - assertEquals(operation.getResult(), PolicyResult.FAILURE_EXCEPTION); + assertEquals(PolicyResult.FAILURE_EXCEPTION, operation.getResult()); } @Test @@ -242,7 +242,7 @@ public class AppcLcmHealthCheckOperationTest { AppcLcmDmaapWrapper healthCheckResp = Serialization.gson.fromJson(lcmRespJson, AppcLcmDmaapWrapper.class); operation.incomingMessage(healthCheckResp); - assertEquals(operation.getResult(), PolicyResult.FAILURE); + assertEquals(PolicyResult.FAILURE, operation.getResult()); } @Test @@ -260,7 +260,7 @@ public class AppcLcmHealthCheckOperationTest { AppcLcmDmaapWrapper healthCheckResp = Serialization.gson.fromJson(lcmRespJson, AppcLcmDmaapWrapper.class); operation.incomingMessage(healthCheckResp); - assertEquals(operation.getResult(), PolicyResult.FAILURE_EXCEPTION); + assertEquals(PolicyResult.FAILURE_EXCEPTION, operation.getResult()); } @Test @@ -278,7 +278,7 @@ public class AppcLcmHealthCheckOperationTest { AppcLcmDmaapWrapper healthCheckResp = Serialization.gson.fromJson(lcmRespJson, AppcLcmDmaapWrapper.class); operation.incomingMessage(healthCheckResp); - assertEquals(operation.getResult(), PolicyResult.FAILURE_EXCEPTION); + assertEquals(PolicyResult.FAILURE_EXCEPTION, operation.getResult()); } @Test @@ -331,4 +331,4 @@ public class AppcLcmHealthCheckOperationTest { operation.incomingMessage(healthCheckResp); assertEquals(null, operation.getResult()); } -}
\ No newline at end of file +} diff --git a/controlloop/m2/appclcm/src/test/java/appclcm/AppcLcmOperationTest.java b/controlloop/m2/appclcm/src/test/java/appclcm/AppcLcmOperationTest.java index 5bd65eb74..cd28ab408 100644 --- a/controlloop/m2/appclcm/src/test/java/appclcm/AppcLcmOperationTest.java +++ b/controlloop/m2/appclcm/src/test/java/appclcm/AppcLcmOperationTest.java @@ -164,7 +164,7 @@ public class AppcLcmOperationTest { assertEquals("Restart", appcRequest.getAction()); assertNotNull(appcRequest.getActionIdentifiers()); assertEquals(event.getAai().get("generic-vnf.vnf-id"), appcRequest.getActionIdentifiers().get("vnf-id")); - assertEquals(appcRequest.getActionIdentifiers().get("vserver-id"), null); + assertNull(appcRequest.getActionIdentifiers().get("vserver-id")); assertNull(appcRequest.getPayload()); logger.info("vnf restart request: {}", Serialization.gson.toJson(request, AppcLcmDmaapWrapper.class)); @@ -224,7 +224,7 @@ public class AppcLcmOperationTest { assertEquals("Rebuild", appcRequest.getAction()); assertNotNull(appcRequest.getActionIdentifiers()); assertEquals(event.getAai().get("generic-vnf.vnf-id"), appcRequest.getActionIdentifiers().get("vnf-id")); - assertEquals(appcRequest.getActionIdentifiers().get("vserver-id"), null); + assertNull(appcRequest.getActionIdentifiers().get("vserver-id")); assertNull(appcRequest.getPayload()); logger.info("vnf rebuild request: {}", Serialization.gson.toJson(request, AppcLcmDmaapWrapper.class)); @@ -284,7 +284,7 @@ public class AppcLcmOperationTest { assertEquals("Migrate", appcRequest.getAction()); assertNotNull(appcRequest.getActionIdentifiers()); assertEquals(event.getAai().get("generic-vnf.vnf-id"), appcRequest.getActionIdentifiers().get("vnf-id")); - assertEquals(appcRequest.getActionIdentifiers().get("vserver-id"), null); + assertNull(appcRequest.getActionIdentifiers().get("vserver-id")); assertNull(appcRequest.getPayload()); logger.info("vnf migrate request: {}", Serialization.gson.toJson(request, AppcLcmDmaapWrapper.class)); @@ -344,7 +344,7 @@ public class AppcLcmOperationTest { assertEquals("Evacuate", appcRequest.getAction()); assertNotNull(appcRequest.getActionIdentifiers()); assertEquals(event.getAai().get("generic-vnf.vnf-id"), appcRequest.getActionIdentifiers().get("vnf-id")); - assertEquals(appcRequest.getActionIdentifiers().get("vserver-id"), null); + assertNull(appcRequest.getActionIdentifiers().get("vserver-id")); assertNull(appcRequest.getPayload()); logger.info("vnf evacuate request: {}", Serialization.gson.toJson(request, AppcLcmDmaapWrapper.class)); @@ -408,7 +408,7 @@ public class AppcLcmOperationTest { assertEquals("Reboot", appcRequest.getAction()); assertNotNull(appcRequest.getActionIdentifiers()); assertEquals(event.getAai().get("generic-vnf.vnf-id"), appcRequest.getActionIdentifiers().get("vnf-id")); - assertEquals(appcRequest.getActionIdentifiers().get("vserver-id"), null); + assertNull(appcRequest.getActionIdentifiers().get("vserver-id")); assertNotNull(appcRequest.getPayload()); logger.info("vnf reboot request: {}", Serialization.gson.toJson(request, AppcLcmDmaapWrapper.class)); @@ -724,4 +724,4 @@ public class AppcLcmOperationTest { operation.incomingMessage(validEvent); assertEquals(PolicyResult.SUCCESS, operation.getResult()); } -}
\ No newline at end of file +} |