karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1535701 - in /karaf/trunk/itests/src/test/java/org/apache/karaf/itests: ./ features/
Date Fri, 25 Oct 2013 11:37:50 GMT
Author: cschneider
Date: Fri Oct 25 11:37:49 2013
New Revision: 1535701

URL: http://svn.apache.org/r1535701
Log:
Some small test improvements

Removed:
    karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/BootFeaturesTest.java
Modified:
    karaf/trunk/itests/src/test/java/org/apache/karaf/itests/FeatureTest.java
    karaf/trunk/itests/src/test/java/org/apache/karaf/itests/HttpTest.java
    karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java
    karaf/trunk/itests/src/test/java/org/apache/karaf/itests/ObrTest.java
    karaf/trunk/itests/src/test/java/org/apache/karaf/itests/WebTest.java
    karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/EnterpriseFeaturesTest.java
    karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/SpringFeaturesTest.java
    karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/StandardFeaturesTest.java

Modified: karaf/trunk/itests/src/test/java/org/apache/karaf/itests/FeatureTest.java
URL: http://svn.apache.org/viewvc/karaf/trunk/itests/src/test/java/org/apache/karaf/itests/FeatureTest.java?rev=1535701&r1=1535700&r2=1535701&view=diff
==============================================================================
--- karaf/trunk/itests/src/test/java/org/apache/karaf/itests/FeatureTest.java (original)
+++ karaf/trunk/itests/src/test/java/org/apache/karaf/itests/FeatureTest.java Fri Oct 25 11:37:49
2013
@@ -33,7 +33,7 @@ public class FeatureTest extends KarafTe
 
     @Test
     public void bootFeatures() throws Exception {
-        assertContains("standard", executeCommand("feature:list -i"));
+        assertFeaturesInstalled("standard", "config", "region", "package", "kar", "management");
     }
 
     @Test

Modified: karaf/trunk/itests/src/test/java/org/apache/karaf/itests/HttpTest.java
URL: http://svn.apache.org/viewvc/karaf/trunk/itests/src/test/java/org/apache/karaf/itests/HttpTest.java?rev=1535701&r1=1535700&r2=1535701&view=diff
==============================================================================
--- karaf/trunk/itests/src/test/java/org/apache/karaf/itests/HttpTest.java (original)
+++ karaf/trunk/itests/src/test/java/org/apache/karaf/itests/HttpTest.java Fri Oct 25 11:37:49
2013
@@ -32,9 +32,8 @@ import org.ops4j.pax.exam.spi.reactors.P
 public class HttpTest extends KarafTestSupport {
 
     @Before
-    public void installHttpFeature() {
-        System.out.println(executeCommand("feature:install http"));
-        System.out.println(executeCommand("feature:install webconsole"));
+    public void installHttpFeature() throws Exception {
+    	installAndAssertFeature("webconsole");
     }
 
     @Test

Modified: karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java
URL: http://svn.apache.org/viewvc/karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java?rev=1535701&r1=1535700&r2=1535701&view=diff
==============================================================================
--- karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java (original)
+++ karaf/trunk/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java Fri Oct
25 11:37:49 2013
@@ -18,7 +18,6 @@ import static org.ops4j.pax.exam.CoreOpt
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
 
 import java.io.ByteArrayOutputStream;
 import java.io.File;
@@ -52,7 +51,6 @@ import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.ProbeBuilder;
 import org.ops4j.pax.exam.TestProbeBuilder;
-import org.ops4j.pax.exam.karaf.options.LogLevelOption;
 import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -99,7 +97,6 @@ public class KarafTestSupport {
             // KarafDistributionOption.debugConfiguration("8889", true),
             karafDistributionConfiguration().frameworkUrl(karafUrl).name("Apache Karaf").unpackDirectory(new
File("target/exam")),
             keepRuntimeFolder(),
-            logLevel(LogLevelOption.LogLevel.INFO),
             editConfigurationFilePut("etc/org.apache.karaf.features.cfg", "featuresBoot",
"config,standard,region,package,kar,management"),
             editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port",
HTTP_PORT),
             editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiRegistryPort",
RMI_REG_PORT),
@@ -330,5 +327,16 @@ public class KarafTestSupport {
 	    }
 	    return false;
 	}
+	
+    protected void installAndAssertFeature(String feature) throws Exception {
+        featureService.installFeature(feature);
+        assertFeatureInstalled(feature);
+    }
+    
+    protected void installAssertAndUninstallFeature(String feature) throws Exception {
+        featureService.installFeature(feature);
+        assertFeatureInstalled(feature);
+        featureService.uninstallFeature(feature);
+    }
 
 }

Modified: karaf/trunk/itests/src/test/java/org/apache/karaf/itests/ObrTest.java
URL: http://svn.apache.org/viewvc/karaf/trunk/itests/src/test/java/org/apache/karaf/itests/ObrTest.java?rev=1535701&r1=1535700&r2=1535701&view=diff
==============================================================================
--- karaf/trunk/itests/src/test/java/org/apache/karaf/itests/ObrTest.java (original)
+++ karaf/trunk/itests/src/test/java/org/apache/karaf/itests/ObrTest.java Fri Oct 25 11:37:49
2013
@@ -35,7 +35,7 @@ public class ObrTest extends KarafTestSu
 
     @Before
     public void installObrFeature() throws Exception {
-        System.out.println(executeCommand("feature:install obr"));
+    	installAndAssertFeature("obr");
     }
 
     @Test

Modified: karaf/trunk/itests/src/test/java/org/apache/karaf/itests/WebTest.java
URL: http://svn.apache.org/viewvc/karaf/trunk/itests/src/test/java/org/apache/karaf/itests/WebTest.java?rev=1535701&r1=1535700&r2=1535701&view=diff
==============================================================================
--- karaf/trunk/itests/src/test/java/org/apache/karaf/itests/WebTest.java (original)
+++ karaf/trunk/itests/src/test/java/org/apache/karaf/itests/WebTest.java Fri Oct 25 11:37:49
2013
@@ -34,8 +34,7 @@ public class WebTest extends KarafTestSu
 
     @Before
     public void installWarFeature() throws Exception {
-    	featureService.installFeature("war");
-    	assertFeatureInstalled("war");
+    	installAndAssertFeature("war");
     	assertBundleInstalled("org.apache.karaf.web.command");
     	//just sleep for a while so blueprint is able to pick up the new commands. 
     	Thread.sleep(2000);

Modified: karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/EnterpriseFeaturesTest.java
URL: http://svn.apache.org/viewvc/karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/EnterpriseFeaturesTest.java?rev=1535701&r1=1535700&r2=1535701&view=diff
==============================================================================
--- karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/EnterpriseFeaturesTest.java
(original)
+++ karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/EnterpriseFeaturesTest.java
Fri Oct 25 11:37:49 2013
@@ -24,11 +24,6 @@ import org.ops4j.pax.exam.spi.reactors.P
 @ExamReactorStrategy(PerMethod.class)
 public class EnterpriseFeaturesTest extends KarafTestSupport {
 
-    private void installAndAssertFeature(String feature) throws Exception {
-        featureService.installFeature(feature);
-        assertFeatureInstalled(feature);
-    }
-
     @Test
     public void installTransactionFeature() throws Exception {
         installAndAssertFeature("transaction");

Modified: karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/SpringFeaturesTest.java
URL: http://svn.apache.org/viewvc/karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/SpringFeaturesTest.java?rev=1535701&r1=1535700&r2=1535701&view=diff
==============================================================================
--- karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/SpringFeaturesTest.java
(original)
+++ karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/SpringFeaturesTest.java
Fri Oct 25 11:37:49 2013
@@ -25,11 +25,6 @@ import org.ops4j.pax.exam.spi.reactors.P
 @ExamReactorStrategy(PerMethod.class)
 public class SpringFeaturesTest extends KarafTestSupport {
 
-    private void installAndAssertFeature(String feature) throws Exception {
-        featureService.installFeature(feature);
-        assertFeatureInstalled(feature);
-    }
-
     @Test
     public void installSpringFeature() throws Exception {
         installAndAssertFeature("spring");

Modified: karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/StandardFeaturesTest.java
URL: http://svn.apache.org/viewvc/karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/StandardFeaturesTest.java?rev=1535701&r1=1535700&r2=1535701&view=diff
==============================================================================
--- karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/StandardFeaturesTest.java
(original)
+++ karaf/trunk/itests/src/test/java/org/apache/karaf/itests/features/StandardFeaturesTest.java
Fri Oct 25 11:37:49 2013
@@ -24,11 +24,6 @@ import org.ops4j.pax.exam.spi.reactors.P
 @ExamReactorStrategy(PerMethod.class)
 public class StandardFeaturesTest extends KarafTestSupport {
 
-    private void installAndAssertFeature(String feature) throws Exception {
-        featureService.installFeature(feature);
-        assertFeatureInstalled(feature);
-    }
-
     @Test
     public void installAriesAnnotationFeature() throws Exception {
         installAndAssertFeature("aries-annotation");



Mime
View raw message