From ee042a71c1abb78c42bc61c056620ec7d40e05d3 Mon Sep 17 00:00:00 2001 From: sdkottegoda Date: Fri, 3 Aug 2018 13:32:00 +0530 Subject: [PATCH] Modify CLI close tests --- .../broker/integration/standalone/cli/CloseCmdTest.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/integration/src/test/java/io/ballerina/messaging/broker/integration/standalone/cli/CloseCmdTest.java b/modules/integration/src/test/java/io/ballerina/messaging/broker/integration/standalone/cli/CloseCmdTest.java index e86b2602954..65013e90d1b 100644 --- a/modules/integration/src/test/java/io/ballerina/messaging/broker/integration/standalone/cli/CloseCmdTest.java +++ b/modules/integration/src/test/java/io/ballerina/messaging/broker/integration/standalone/cli/CloseCmdTest.java @@ -123,7 +123,7 @@ public void testCloseChannel(String username, String password, String hostName, ConnectionMetadata[] connectionMetadataBeforeClosing = getConnections(username, password); String[] cmd = {CLI_ROOT_COMMAND, Constants.CMD_CLOSE, Constants.CMD_CHANNEL, "1", "--connection", - connectionMetadataBeforeClosing[0].getId().toString()}; + connectionMetadataBeforeClosing[0].getId().toString(), Constants.IF_USED_FLAG}; String expectedLog = "Request accepted for forceful disconnection of channel 1 of connection " + connectionMetadataBeforeClosing[0].getId().toString(); @@ -180,13 +180,12 @@ public void testCloseConnection(String username, String password, String hostNam int channelCount = 3; //Create 3 connections each having 0, 1 and 2 channels respectively - List connections = new ArrayList<>(); connections.add(createConnection(channelCount, username, password, hostName, port)); ConnectionMetadata[] connectionMetadataBeforeClosing = getConnections(username, password); String[] cmd = {CLI_ROOT_COMMAND, Constants.CMD_CLOSE, Constants.CMD_CONNECTION, - connectionMetadataBeforeClosing[0].getId().toString()}; + connectionMetadataBeforeClosing[0].getId().toString(), Constants.IF_USED_FLAG}; String expectedLog = "Connection close request submitted successfully"; Main.main(cmd); @@ -198,9 +197,6 @@ public void testCloseConnection(String username, String password, String hostNam username, password); Assert.assertEquals(connectionMetadataAfterClosing.length, expectedConnectionCount, "Incorrect connection count after closing connection."); - - - closeConnections(connections); } @Test(groups = "StreamReading", description = "test command 'close connection [connection-id]' with a "