sijie commented on a change in pull request #1995: [WIP] Migrate to test 
containers Part 5
URL: https://github.com/apache/incubator-pulsar/pull/1995#discussion_r197323561
 
 

 ##########
 File path: 
tests/integration/src/test/java/org/apache/pulsar/tests/integration/TestCLI.java
 ##########
 @@ -18,78 +18,69 @@
  */
 package org.apache.pulsar.tests.integration;
 
-import static org.testng.Assert.fail;
-
-import com.github.dockerjava.api.DockerClient;
-
-import java.util.concurrent.TimeUnit;
-
-import org.apache.pulsar.tests.DockerUtils;
 import org.apache.pulsar.tests.PulsarClusterUtils;
-import org.jboss.arquillian.test.api.ArquillianResource;
-import org.jboss.arquillian.testng.Arquillian;
+import org.apache.pulsar.tests.integration.cluster.Cluster3Bookie2Broker;
 import org.testng.Assert;
-import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
-public class TestCLI extends Arquillian {
-    private static String clusterName = "test";
+import static org.testng.Assert.fail;
 
-    @ArquillianResource
-    DockerClient docker;
+public class TestCLI {
+    private static final String clusterName = "test";
+    private Cluster3Bookie2Broker cluster;
 
-    @BeforeMethod
-    public void waitServicesUp() throws Exception {
-        Assert.assertTrue(PulsarClusterUtils.waitZooKeeperUp(docker, 
clusterName, 30, TimeUnit.SECONDS));
-        Assert.assertTrue(PulsarClusterUtils.waitAllBrokersUp(docker, 
clusterName));
+    @BeforeClass
+    public void setup() throws Exception {
+        cluster = new 
Cluster3Bookie2Broker(TestCompaction.class.getSimpleName());
+        cluster.start();
+        cluster.startAllBrokers();
+        cluster.startAllProxies();
     }
 
     @Test
     public void testDeprecatedCommands() throws Exception {
-        String broker = PulsarClusterUtils.brokerSet(docker, 
clusterName).stream().findAny().get();
-
-        Assert.assertFalse(DockerUtils.runCommand(docker, broker, 
"/pulsar/bin/pulsar-admin", "--help")
+        
Assert.assertFalse(cluster.execInBroker(PulsarClusterUtils.PULSAR_ADMIN, 
"--help")
                            .contains("Usage: properties "));
-        Assert.assertTrue(DockerUtils.runCommand(docker, broker,
-                                                 "/pulsar/bin/pulsar-admin", 
"properties",
-                                                 "create", 
"compaction-test-cli", "--allowed-clusters", clusterName,
-                                                 "--admin-roles", 
"admin").contains("deprecated"));
-        Assert.assertTrue(DockerUtils.runCommand(docker, broker, 
"/pulsar/bin/pulsar-admin", "properties", "list")
+        Assert.assertTrue(cluster.execInBroker(
+            PulsarClusterUtils.PULSAR_ADMIN, "properties",
+            "create", "compaction-test-cli", "--allowed-clusters", clusterName,
+            "--admin-roles", "admin").contains("deprecated"));
+        
Assert.assertTrue(cluster.execInBroker(PulsarClusterUtils.PULSAR_ADMIN, 
"properties", "list")
                           .contains("compaction-test-cli"));
-        Assert.assertTrue(DockerUtils.runCommand(docker, broker, 
"/pulsar/bin/pulsar-admin", "tenants", "list")
+        
Assert.assertTrue(cluster.execInBroker(PulsarClusterUtils.PULSAR_ADMIN, 
"tenants", "list")
                           .contains("compaction-test-cli"));
 
     }
 
-    @Test
-    public void testCreateSubscriptionCommand() throws Exception {
+    @Test(dependsOnMethods = "testDeprecatedCommands")
 
 Review comment:
   there are no dependencies between methods. they can be running in parallel.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to