You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2015/12/03 08:03:52 UTC

karaf git commit: Add instance start/stop commands itest

Repository: karaf
Updated Branches:
  refs/heads/master 9ae027d96 -> 2c99e8073


Add instance start/stop commands itest


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/2c99e807
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/2c99e807
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/2c99e807

Branch: refs/heads/master
Commit: 2c99e8073693f41c6fff38f890ae2ac69f76b33c
Parents: 9ae027d
Author: Jean-Baptiste Onofré <jb...@apache.org>
Authored: Thu Dec 3 08:03:35 2015 +0100
Committer: Jean-Baptiste Onofré <jb...@apache.org>
Committed: Thu Dec 3 08:03:35 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/karaf/itests/InstanceTest.java  | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/2c99e807/itests/src/test/java/org/apache/karaf/itests/InstanceTest.java
----------------------------------------------------------------------
diff --git a/itests/src/test/java/org/apache/karaf/itests/InstanceTest.java b/itests/src/test/java/org/apache/karaf/itests/InstanceTest.java
index a788976..0a5f809 100644
--- a/itests/src/test/java/org/apache/karaf/itests/InstanceTest.java
+++ b/itests/src/test/java/org/apache/karaf/itests/InstanceTest.java
@@ -58,6 +58,22 @@ public class InstanceTest extends KarafTestSupport {
         }
     }
 
+    @Test
+    public void createStartCommand() throws Exception {
+        System.out.println(executeCommand("instance:create itest"));
+        assertContains("itest", executeCommand("instance:list"));
+        System.out.println(executeCommand("instance:start itest"));
+        Thread.sleep(5000);
+        String output = executeCommand("instance:status itest");
+        System.out.println("itest instance status: " + output);
+        assertContains("Started", output);
+        System.out.println(executeCommand("instance:stop itest"));
+        Thread.sleep(5000);
+        output = executeCommand("instance:status itest");
+        System.out.println("itest instance status: " + output);
+        assertContains("Stopped", output);
+    }
+
     private int getInstancesNum(MBeanServerConnection connection, ObjectName name) throws Exception {
         TabularData instances = (TabularData) connection.getAttribute(name, "Instances");
         return instances.size();