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 2012/09/07 14:17:54 UTC

svn commit: r1381992 - in /karaf/trunk/itests/src/test/java/org/apache/karaf/itests: KarafEnterpriseFeaturesTest.java KarafSpringFeaturesTest.java KarafStandardFeaturesTest.java

Author: jbonofre
Date: Fri Sep  7 12:17:53 2012
New Revision: 1381992

URL: http://svn.apache.org/viewvc?rev=1381992&view=rev
Log:
[KARAF-1798] Add enterprise and spring features itest

Added:
    karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafEnterpriseFeaturesTest.java
    karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafSpringFeaturesTest.java
Modified:
    karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafStandardFeaturesTest.java

Added: karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafEnterpriseFeaturesTest.java
URL: http://svn.apache.org/viewvc/karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafEnterpriseFeaturesTest.java?rev=1381992&view=auto
==============================================================================
--- karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafEnterpriseFeaturesTest.java (added)
+++ karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafEnterpriseFeaturesTest.java Fri Sep  7 12:17:53 2012
@@ -0,0 +1,56 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.karaf.itests;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.junit.ExamReactorStrategy;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
+
+import static org.junit.Assert.assertTrue;
+
+@RunWith(JUnit4TestRunner.class)
+@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
+public class KarafEnterpriseFeaturesTest extends KarafTestSupport {
+
+    @Test
+    public void installTransactionFeature() throws Exception {
+        executeCommand("feature:install transaction");
+        String transactionFeatureStatus = executeCommand("feature:list -i | grep transaction");
+        assertTrue("transaction feature is not installed", !transactionFeatureStatus.isEmpty());
+    }
+
+    @Test
+    public void installJpaFeature() throws Exception {
+        executeCommand("feature:install jpa");
+        String jpaFeatureStatus = executeCommand("feature:list -i | grep jpa");
+        assertTrue("jpa feature is not installed", !jpaFeatureStatus.isEmpty());
+    }
+
+    @Test
+    public void installJndiFeature() throws Exception {
+        executeCommand("feature:install jndi");
+        String jndiFeatureStatus = executeCommand("feature:list -i | grep jndi");
+        assertTrue("jndi feature is not installed", !jndiFeatureStatus.isEmpty());
+    }
+
+    @Test
+    public void installApplicationWithoutIsolationFeature() throws Exception {
+        executeCommand("feature:install application-without-isolation");
+        String applicationWithoutIsolationFeatureStatus = executeCommand("feature:list -i | grep application-without-isolation");
+        assertTrue("application-without-isolation feature is not installed", !applicationWithoutIsolationFeatureStatus.isEmpty());
+    }
+
+}

Added: karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafSpringFeaturesTest.java
URL: http://svn.apache.org/viewvc/karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafSpringFeaturesTest.java?rev=1381992&view=auto
==============================================================================
--- karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafSpringFeaturesTest.java (added)
+++ karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafSpringFeaturesTest.java Fri Sep  7 12:17:53 2012
@@ -0,0 +1,138 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.karaf.itests;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.junit.ExamReactorStrategy;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
+
+import static org.junit.Assert.assertTrue;
+
+@RunWith(JUnit4TestRunner.class)
+@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
+public class KarafSpringFeaturesTest extends KarafTestSupport {
+
+    @Test
+    public void installSpringFeature() throws Exception {
+        executeCommand("feature:install spring");
+        String springFeatureStatus = executeCommand("feature:list -i | grep spring");
+        assertTrue("spring feature is not installed", !springFeatureStatus.isEmpty());
+    }
+
+    @Test
+    public void installSpringAspectsFeature() throws Exception {
+        executeCommand("feature:install spring-aspects");
+        String springAspectsFeatureStatus = executeCommand("feature:list -i | grep spring-aspects");
+        assertTrue("spring-aspects feature is not installed", !springAspectsFeatureStatus.isEmpty());
+    }
+
+    @Test
+    public void installSpringDmFeature() throws Exception {
+        executeCommand("feature:install spring-dm");
+        String springDmFeatureStatus = executeCommand("feature:list -i | grep spring-dm");
+        assertTrue("spring-dm feature is not installed", !springDmFeatureStatus.isEmpty());
+    }
+
+    @Test
+    public void installSpringDmWebFeature() throws Exception {
+        executeCommand("feature:install spring-dm-web");
+        String springDmWebFeatureStatus = executeCommand("feature:list -i | grep spring-dm-web");
+        assertTrue("spring-dm-web feature is not installed", !springDmWebFeatureStatus.isEmpty());
+    }
+
+    @Test
+    public void installSpringInstrumentFeature() throws Exception {
+        executeCommand("feature:install spring-instrument");
+        String springInstrumentFeatureStatus = executeCommand("feature:list -i | grep spring-instrument");
+        assertTrue("spring-instrument feature is not installed", !springInstrumentFeatureStatus.isEmpty());
+    }
+
+    @Test
+    public void installSpringJdbcFeature() throws Exception {
+        executeCommand("feature:install spring-jdbc");
+        String springJdbcFeatureStatus = executeCommand("feature:list -i | grep spring-jdbc");
+        assertTrue("spring-jdbc feature is not installed", !springJdbcFeatureStatus.isEmpty());
+    }
+
+    @Test
+    public void installSpringJmsFeature() throws Exception {
+        executeCommand("feature:install spring-jms");
+        String springJmsFeatureStatus = executeCommand("feature:list -i | grep spring-jms");
+        assertTrue("spring-jms feature is not installed", !springJmsFeatureStatus.isEmpty());
+    }
+
+    @Test
+    @Ignore
+    // TODO fix the spring-struts feature
+    public void installSpringStrutsFeature() throws Exception {
+        executeCommand("feature:install spring-struts");
+        String springStrutsFeatureStatus = executeCommand("feature:list -i | grep spring-struts");
+        assertTrue("spring-struts feature is not installed", !springStrutsFeatureStatus.isEmpty());
+    }
+
+    @Test
+    public void installSpringTestFeature() throws Exception {
+        executeCommand("feature:install spring-test");
+        String springTestFeatureStatus = executeCommand("feature:list -i | grep spring-test");
+        assertTrue("spring-test feature is not installed", !springTestFeatureStatus.isEmpty());
+    }
+
+    @Test
+    public void installSpringOrmFeature() throws Exception {
+        executeCommand("feature:install spring-orm");
+        String springOrmFeatureStatus = executeCommand("feature:list -i | grep spring-orm");
+        assertTrue("spring-orm feature is not installed", !springOrmFeatureStatus.isEmpty());
+    }
+
+    @Test
+    public void installSpringOxmFeature() throws Exception {
+        executeCommand("feature:install spring-oxm");
+        String springOxmFeatureStatus = executeCommand("feature:list -i | grep spring-oxm");
+        assertTrue("spring-oxm feature is not installed", !springOxmFeatureStatus.isEmpty());
+    }
+
+    @Test
+    public void installSpringTxFeature() throws Exception {
+        executeCommand("feature:install spring-tx");
+        String springTxFeatureStatus = executeCommand("feature:list -i | grep spring-tx");
+        assertTrue("spring-tx feature is not installed", !springTxFeatureStatus.isEmpty());
+    }
+
+    @Test
+    public void installSpringWebFeature() throws Exception {
+        executeCommand("feature:install spring-web");
+        String springWebFeatureStatus = executeCommand("feature:list -i | grep spring-web");
+        assertTrue("spring-web feature is not installed", !springWebFeatureStatus.isEmpty());
+    }
+
+    @Test
+    @Ignore
+    // TODO fix the spring-web-portlet feature
+    public void installSpringWebPortletFeature() throws Exception {
+        executeCommand("feature:install spring-web-portlet");
+        String springWebPortletFeatureStatus = executeCommand("feature:list -i | grep spring-web-portlet");
+        assertTrue("spring-web-portlet feature is not installed", !springWebPortletFeatureStatus.isEmpty());
+    }
+
+    @Test
+    public void installGeminiBlueprintFeature() throws Exception {
+        executeCommand("feature:install gemini-blueprint");
+        String geminiBlueprintFeatureStatus = executeCommand("feature:list -i | grep gemini-blueprint");
+        assertTrue("gemini-blueprint feature is not installed", !geminiBlueprintFeatureStatus.isEmpty());
+    }
+
+}

Modified: karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafStandardFeaturesTest.java
URL: http://svn.apache.org/viewvc/karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafStandardFeaturesTest.java?rev=1381992&r1=1381991&r2=1381992&view=diff
==============================================================================
--- karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafStandardFeaturesTest.java (original)
+++ karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafStandardFeaturesTest.java Fri Sep  7 12:17:53 2012
@@ -20,8 +20,6 @@ import org.ops4j.pax.exam.junit.ExamReac
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 @RunWith(JUnit4TestRunner.class)
@@ -55,77 +53,77 @@ public class KarafStandardFeaturesTest e
 
     @Test
     public void installWrapperFeature() throws Exception {
-        System.out.println(executeCommand("feature:install wrapper"));
+        executeCommand("feature:install wrapper");
         String wrapperFeatureStatus = executeCommand("feature:list -i | grep wrapper");
         assertTrue("wrapper feature is not installed", !wrapperFeatureStatus.isEmpty());
     }
 
     @Test
     public void installObrFeature() throws Exception {
-        System.out.println(executeCommand("feature:install obr"));
+        executeCommand("feature:install obr");
         String obrFeatureStatus = executeCommand("feature:list -i | grep obr");
         assertTrue("obr feature is not installed", !obrFeatureStatus.isEmpty());
     }
 
     @Test
     public void installJettyFeature() throws Exception {
-        System.out.println(executeCommand("feature:install jetty"));
+        executeCommand("feature:install jetty");
         String jettyFeatureStatus = executeCommand("feature:list -i | grep jetty");
         assertTrue("jetty feature is not installed", !jettyFeatureStatus.isEmpty());
     }
 
     @Test
     public void installHttpFeature() throws Exception {
-        System.out.println(executeCommand("feature:install http"));
+        executeCommand("feature:install http");
         String httpFeatureStatus = executeCommand("feature:list -i | grep http");
         assertTrue("http feature is not installed", !httpFeatureStatus.isEmpty());
     }
 
     @Test
     public void installHttpWhiteboardFeature() throws Exception {
-        System.out.println(executeCommand("feature:install http-whiteboard"));
+        executeCommand("feature:install http-whiteboard");
         String httpWhiteboardFeatureStatus = executeCommand("feature:list -i | grep http-whiteboard");
         assertTrue("http-whiteboard feature is not installed", !httpWhiteboardFeatureStatus.isEmpty());
     }
 
     @Test
     public void installWarFeature() throws Exception {
-        System.out.println(executeCommand("feature:install war"));
+        executeCommand("feature:install war");
         String warFeatureStatus = executeCommand("feature:list -i | grep war");
         assertTrue("war feature is not installed", !warFeatureStatus.isEmpty());
     }
 
     @Test
     public void installWebConsoleFeature() throws Exception {
-        System.out.println(executeCommand("feature:install webconsole"));
+        executeCommand("feature:install webconsole");
         String webConsoleFeatureStatus = executeCommand("feature:list -i | grep webconsole");
         assertTrue("webconsole feature is not installed", !webConsoleFeatureStatus.isEmpty());
     }
 
     @Test
     public void installSchedulerFeature() throws Exception {
-        System.out.println(executeCommand("feature:install scheduler"));
+        executeCommand("feature:install scheduler");
         String schedulerFeatureStatus = executeCommand("feature:list -i | grep scheduler");
         assertTrue("scheduler feature is not installed", !schedulerFeatureStatus.isEmpty());
     }
 
     @Test
     public void installEventAdminFeature() throws Exception {
-        System.out.println(executeCommand("feature:install eventadmin"));
+        executeCommand("feature:install eventadmin");
         String eventAdminFeatureStatus = executeCommand("feature:list -i | grep eventadmin");
         assertTrue("eventadmin feature is not installed", !eventAdminFeatureStatus.isEmpty());
     }
 
     @Test
     public void installJasyptEncryptionFeature() throws Exception {
-        System.out.println(executeCommand("feature:install jasypt-encryption"));
+        executeCommand("feature:install jasypt-encryption");
         String jasyptEncryptionFeatureStatus = executeCommand("feature:list -i | grep jasypt-encryption");
         assertTrue("jasypt-encryption feature is not installed", !jasyptEncryptionFeatureStatus.isEmpty());
     }
 
     @Test
     public void installScrFeature() throws Exception {
-        System.out.println(executeCommand("feature:install scr"));
+        executeCommand("feature:install scr");
         String scrFeatureStatus = executeCommand("feature:list -i | grep scr");
         assertTrue("scr feature is not installed", !scrFeatureStatus.isEmpty());
     }