From 92dd84cb28d341e9fff892adb4b616b8b795be91 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Fri, 7 Dec 2018 22:28:49 +0000 Subject: Fix checkstyle issues Some minor line length and formatting checkstyle warnings fixed. Change-Id: Ib92069bbdb444560083e6d0dbf5d16a3ab824d82 Issue-ID: POLICY-1074 Signed-off-by: liamfallon --- .../apex/core/deployment/DeploymentClientTest.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'core/core-deployment/src/test') diff --git a/core/core-deployment/src/test/java/org/onap/policy/apex/core/deployment/DeploymentClientTest.java b/core/core-deployment/src/test/java/org/onap/policy/apex/core/deployment/DeploymentClientTest.java index b12e526d7..d5b34a054 100644 --- a/core/core-deployment/src/test/java/org/onap/policy/apex/core/deployment/DeploymentClientTest.java +++ b/core/core-deployment/src/test/java/org/onap/policy/apex/core/deployment/DeploymentClientTest.java @@ -65,7 +65,7 @@ public class DeploymentClientTest { @SuppressWarnings("unchecked") @Test public void testDeploymentClientStart() throws Exception { - DeploymentClient deploymentClient = new DeploymentClient("localhost", 51273); + DeploymentClient deploymentClient = new DeploymentClient("localhost", 51332); final Field factoryField = deploymentClient.getClass().getDeclaredField("factory"); factoryField.setAccessible(true); @@ -81,7 +81,7 @@ public class DeploymentClientTest { Thread clientThread = new Thread(deploymentClient); clientThread.start(); - ThreadUtilities.sleep(20); + ThreadUtilities.sleep(100); assertTrue(deploymentClient.isStarted()); assertTrue(clientThread.isAlive()); @@ -114,26 +114,28 @@ public class DeploymentClientTest { @Test public void testDeploymentClientStartException() throws Exception { - DeploymentClient depoymentClient = new DeploymentClient("localhost", 51273); + DeploymentClient deploymentClient = new DeploymentClient("localhost", 51273); - final Field factoryField = depoymentClient.getClass().getDeclaredField("factory"); + final Field factoryField = deploymentClient.getClass().getDeclaredField("factory"); factoryField.setAccessible(true); - factoryField.set(depoymentClient, mockServiceFactory); + factoryField.set(deploymentClient, mockServiceFactory); Mockito.doReturn(mockService).when(mockServiceFactory).createClient(anyObject()); Mockito.doNothing().when(mockService).addMessageListener(anyObject()); Mockito.doThrow(new ApexRuntimeException("connection start failed")).when(mockService).startConnection(); - Thread clientThread = new Thread(depoymentClient); + Thread clientThread = new Thread(deploymentClient); clientThread.start(); ThreadUtilities.sleep(50); - assertFalse(depoymentClient.isStarted()); + assertFalse(deploymentClient.isStarted()); assertFalse(clientThread.isAlive()); - assertEquals(0, depoymentClient.getReceiveQueue().size()); + assertEquals(0, deploymentClient.getReceiveQueue().size()); ThreadUtilities.sleep(100); + + deploymentClient.stopClient(); } } -- cgit 1.2.3-korg