felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r772643 - in /felix/trunk/karaf: gshell/gshell-admin/ gshell/gshell-config/ gshell/gshell-features/ gshell/gshell-log/ gshell/gshell-obr/ gshell/gshell-osgi/ gshell/gshell-packages/ gshell/gshell-run/ gshell/gshell-wrapper/ itests/ itests/s...
Date Thu, 07 May 2009 13:19:48 GMT
Author: gnodet
Date: Thu May  7 13:19:47 2009
New Revision: 772643

URL: http://svn.apache.org/viewvc?rev=772643&view=rev
Log:
Fix problem with exported commands not being available from the console, fix integration tests

Removed:
    felix/trunk/karaf/itests/src/test/java/org/apache/servicemix/
Modified:
    felix/trunk/karaf/gshell/gshell-admin/pom.xml
    felix/trunk/karaf/gshell/gshell-config/pom.xml
    felix/trunk/karaf/gshell/gshell-features/pom.xml
    felix/trunk/karaf/gshell/gshell-log/pom.xml
    felix/trunk/karaf/gshell/gshell-obr/pom.xml
    felix/trunk/karaf/gshell/gshell-osgi/pom.xml
    felix/trunk/karaf/gshell/gshell-packages/pom.xml
    felix/trunk/karaf/gshell/gshell-run/   (props changed)
    felix/trunk/karaf/gshell/gshell-wrapper/pom.xml
    felix/trunk/karaf/itests/pom.xml
    felix/trunk/karaf/itests/src/test/java/org/apache/felix/karaf/gshell/itests/AbstractIntegrationTest.java
    felix/trunk/karaf/itests/src/test/java/org/apache/felix/karaf/gshell/itests/CoreTest.java
    felix/trunk/karaf/itests/src/test/java/org/apache/felix/karaf/gshell/itests/FeaturesTest.java

Modified: felix/trunk/karaf/gshell/gshell-admin/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-admin/pom.xml?rev=772643&r1=772642&r2=772643&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-admin/pom.xml (original)
+++ felix/trunk/karaf/gshell/gshell-admin/pom.xml Thu May  7 13:19:47 2009
@@ -161,6 +161,7 @@
                         <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
                         <Export-Package>${pom.artifactId}*;version=${project.version}</Export-Package>
                         <Import-Package>
+                            org.apache.geronimo.gshell.command,
                             org.apache.geronimo.gshell.wisdom.command,
                             org.apache.geronimo.gshell.wisdom.registry,
                             org.apache.felix.karaf.gshell.core,

Modified: felix/trunk/karaf/gshell/gshell-config/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-config/pom.xml?rev=772643&r1=772642&r2=772643&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-config/pom.xml (original)
+++ felix/trunk/karaf/gshell/gshell-config/pom.xml Thu May  7 13:19:47 2009
@@ -76,6 +76,7 @@
                         <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
                         <Export-Package>${pom.artifactId}*;version=${project.version}</Export-Package>
                         <Import-Package>
+                            org.apache.geronimo.gshell.command,
                             org.apache.geronimo.gshell.wisdom.command,
                             org.apache.geronimo.gshell.wisdom.registry,
                             org.apache.felix.karaf.gshell.core,

Modified: felix/trunk/karaf/gshell/gshell-features/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-features/pom.xml?rev=772643&r1=772642&r2=772643&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/pom.xml (original)
+++ felix/trunk/karaf/gshell/gshell-features/pom.xml Thu May  7 13:19:47 2009
@@ -92,9 +92,10 @@
                         <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
                         <Export-Package>${pom.artifactId}*;version=${project.version}</Export-Package>
                         <Import-Package>
+                            org.apache.geronimo.gshell.command,
                             org.apache.geronimo.gshell.wisdom.command,
-                            org.apache.felix.karaf.gshell.core,
                             org.apache.geronimo.gshell.wisdom.registry,
+                            org.apache.felix.karaf.gshell.core,
                             org.springframework.beans.factory.config,
                             *
                         </Import-Package>

Modified: felix/trunk/karaf/gshell/gshell-log/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-log/pom.xml?rev=772643&r1=772642&r2=772643&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-log/pom.xml (original)
+++ felix/trunk/karaf/gshell/gshell-log/pom.xml Thu May  7 13:19:47 2009
@@ -77,6 +77,7 @@
                         <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
                         <Export-Package>${pom.artifactId}*;version=${project.version}</Export-Package>
                         <Import-Package>
+                            org.apache.geronimo.gshell.command,
                             org.apache.geronimo.gshell.wisdom.command,
                             org.apache.geronimo.gshell.wisdom.registry,
                             org.apache.felix.karaf.gshell.core,

Modified: felix/trunk/karaf/gshell/gshell-obr/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-obr/pom.xml?rev=772643&r1=772642&r2=772643&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-obr/pom.xml (original)
+++ felix/trunk/karaf/gshell/gshell-obr/pom.xml Thu May  7 13:19:47 2009
@@ -68,8 +68,11 @@
                 <configuration>
                     <instructions>
                         <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
-                        <Export-Package>${pom.artifactId}*;version=${project.version}</Export-Package>
+                        <Export-Package>
+                            ${pom.artifactId}*;version=${project.version}
+                        </Export-Package>
                         <Import-Package>
+                            org.apache.geronimo.gshell.command,
                             org.apache.geronimo.gshell.wisdom.command,
                             org.apache.geronimo.gshell.wisdom.registry,
                             org.apache.felix.karaf.gshell.core,

Modified: felix/trunk/karaf/gshell/gshell-osgi/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-osgi/pom.xml?rev=772643&r1=772642&r2=772643&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-osgi/pom.xml (original)
+++ felix/trunk/karaf/gshell/gshell-osgi/pom.xml Thu May  7 13:19:47 2009
@@ -70,6 +70,7 @@
                         <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
                         <Export-Package>${pom.artifactId}*;version=${project.version}</Export-Package>
                         <Import-Package>
+                            org.apache.geronimo.gshell.command,
                             org.apache.geronimo.gshell.wisdom.command,
                             org.apache.geronimo.gshell.wisdom.registry,
                             org.apache.felix.karaf.gshell.core,

Modified: felix/trunk/karaf/gshell/gshell-packages/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-packages/pom.xml?rev=772643&r1=772642&r2=772643&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-packages/pom.xml (original)
+++ felix/trunk/karaf/gshell/gshell-packages/pom.xml Thu May  7 13:19:47 2009
@@ -71,6 +71,7 @@
                         <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
                         <Export-Package>${pom.artifactId}*;version=${project.version}</Export-Package>
                         <Import-Package>
+                            org.apache.geronimo.gshell.command,
                             org.apache.geronimo.gshell.wisdom.command,
                             org.apache.geronimo.gshell.wisdom.registry,
                             org.apache.felix.karaf.gshell.core,

Propchange: felix/trunk/karaf/gshell/gshell-run/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu May  7 13:19:47 2009
@@ -0,0 +1,8 @@
+target
+*.iml
+*.iws
+*.ipr
+.classpath
+.project
+.settings
+eclipse-classes

Modified: felix/trunk/karaf/gshell/gshell-wrapper/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/gshell/gshell-wrapper/pom.xml?rev=772643&r1=772642&r2=772643&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-wrapper/pom.xml (original)
+++ felix/trunk/karaf/gshell/gshell-wrapper/pom.xml Thu May  7 13:19:47 2009
@@ -99,6 +99,7 @@
                         <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
                         <Export-Package>${pom.artifactId}*;version=${project.version}</Export-Package>
                         <Import-Package>
+                            org.apache.geronimo.gshell.command,
                             org.apache.geronimo.gshell.wisdom.command,
                             org.apache.geronimo.gshell.wisdom.registry,
                             org.apache.felix.karaf.gshell.core,

Modified: felix/trunk/karaf/itests/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/itests/pom.xml?rev=772643&r1=772642&r2=772643&view=diff
==============================================================================
--- felix/trunk/karaf/itests/pom.xml (original)
+++ felix/trunk/karaf/itests/pom.xml Thu May  7 13:19:47 2009
@@ -89,35 +89,6 @@
             <version>4.5</version>
             <scope>test</scope>
         </dependency>
-
-        <dependency>
-            <groupId>org.ops4j.pax.runner.profiles</groupId>
-            <artifactId>log</artifactId>
-            <version>1.3.0</version>
-            <type>composite</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.runner.profiles</groupId>
-            <artifactId>felix.config</artifactId>
-            <version>1.0.10</version>
-            <type>composite</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.runner.profiles</groupId>
-            <artifactId>spring</artifactId>
-            <version>2.5.6</version>
-            <type>composite</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.runner.profiles</groupId>
-            <artifactId>spring.dm</artifactId>
-            <version>1.2.0-rc1</version>
-            <type>composite</type>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 
     <repositories>
@@ -125,10 +96,6 @@
             <id>ops4j.releases</id>
             <url>http://repository.ops4j.org/maven2</url>
         </repository>
-        <repository>
-            <id>ops4j.profiles</id>
-            <url>http://scm.ops4j.org/repos/ops4j/projects/pax/runner-repository</url>
-        </repository>
     </repositories>
     <pluginRepositories>
         <pluginRepository>

Modified: felix/trunk/karaf/itests/src/test/java/org/apache/felix/karaf/gshell/itests/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/itests/src/test/java/org/apache/felix/karaf/gshell/itests/AbstractIntegrationTest.java?rev=772643&r1=772642&r2=772643&view=diff
==============================================================================
--- felix/trunk/karaf/itests/src/test/java/org/apache/felix/karaf/gshell/itests/AbstractIntegrationTest.java
(original)
+++ felix/trunk/karaf/itests/src/test/java/org/apache/felix/karaf/gshell/itests/AbstractIntegrationTest.java
Thu May  7 13:19:47 2009
@@ -16,6 +16,8 @@
  */
 package org.apache.felix.karaf.gshell.itests;
 
+import java.util.Dictionary;
+
 import org.ops4j.pax.exam.CoreOptions;
 import org.ops4j.pax.exam.Inject;
 import org.ops4j.pax.exam.Option;
@@ -39,6 +41,7 @@
 import org.osgi.framework.Filter;
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
 import org.osgi.util.tracker.ServiceTracker;
 
 public abstract class AbstractIntegrationTest {
@@ -71,11 +74,23 @@
             }
             Filter osgiFilter = FrameworkUtil.createFilter(flt);
             tracker = new ServiceTracker(bundleContext, osgiFilter, null);
-            tracker.open();
+            tracker.open(true);
             // Note that the tracker is not closed to keep the reference
-            // This is buggy, has the service reference may change i think
+            // This is buggy, as the service reference may change i think
             Object svc = type.cast(tracker.waitForService(timeout));
             if (svc == null) {
+
+                Dictionary dic = bundleContext.getBundle().getHeaders();
+                System.err.println("Test bundle headers: " + dic);
+                ServiceReference[] refs = bundleContext.getAllServiceReferences(null, null);
+                for (ServiceReference ref : refs) {
+                    System.err.println("ServiceReference: " + ref);
+                }
+                refs = bundleContext.getAllServiceReferences(null, flt);
+                for (ServiceReference ref : refs) {
+                    System.err.println("Filtered ServiceReference: " + ref);
+                }
+
                 throw new RuntimeException("Gave up waiting for service " + flt);
             }
             return type.cast(svc);
@@ -104,50 +119,4 @@
         return CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId).versionAsInProject();
     }
 
-    @Configuration
-    public static Option[] configuration() {
-        Option[] options = options(
-            // install log service using pax runners profile abstraction (there are more
profiles, like DS)
-            profile("log").version("1.3.0"),
-            profile("felix.config").version("1.0.10"),
-            profile("spring.dm").version("1.2.0-rc1"),
-
-            // this is how you set the default log level when using pax logging (logProfile)
-            systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
-            systemProperty("karaf.name").value("root"),
-            systemProperty("karaf.base").value("target/smx.base"),
-            systemProperty("karaf.startLocalConsole").value("false"),
-            systemProperty("karaf.startRemoteShell").value("false"),
-
-            // hack system packages
-            systemPackages("org.apache.felix.karaf.main.spi;version=1.0.0", "org.apache.felix.karaf.jaas.boot"),
-            bootClasspathLibrary(mavenBundle("org.apache.felix.karaf.jaas", "org.apache.felix.karaf.jaas.boot")).afterFramework(),
-            bootClasspathLibrary(mavenBundle("org.apache.felix.karaf", "org.apache.felix.karaf.main")).afterFramework(),
-
-            // Bundles
-            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jline"),
-            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-httpclient"),
-            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-jexl"),
-            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-vfs"),
-            mavenBundle("org.apache.mina", "mina-core"),
-            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.oro"),
-            mavenBundle("org.apache.felix.karaf.jaas", "org.apache.felix.karaf.jaas.config"),
-            mavenBundle("org.apache.sshd", "sshd-core"),
-            mavenBundle("org.apache.felix.karaf.gshell", "org.apache.felix.karaf.gshell.core"),
-            mavenBundle("org.apache.felix.karaf.gshell", "org.apache.felix.karaf.gshell.osgi"),
-            mavenBundle("org.apache.felix.karaf.gshell", "org.apache.felix.karaf.gshell.log").noStart(),
-
-
-//            mavenBundle("org.apache.felix", "org.apache.felix.bundlerepository"),
-
-            scanFeatures(
-                    maven().groupId("org.apache.felix.karaf").artifactId("apache-felix-karaf").type("xml").classifier("features").versionAsInProject(),
-                    "obr", "wrapper"
-            ),
-
-            felix()
-        );
-        return options;
-    }
-
 }

Modified: felix/trunk/karaf/itests/src/test/java/org/apache/felix/karaf/gshell/itests/CoreTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/itests/src/test/java/org/apache/felix/karaf/gshell/itests/CoreTest.java?rev=772643&r1=772642&r2=772643&view=diff
==============================================================================
--- felix/trunk/karaf/itests/src/test/java/org/apache/felix/karaf/gshell/itests/CoreTest.java
(original)
+++ felix/trunk/karaf/itests/src/test/java/org/apache/felix/karaf/gshell/itests/CoreTest.java
Thu May  7 13:19:47 2009
@@ -19,27 +19,37 @@
 import org.apache.geronimo.gshell.commandline.CommandLineExecutionFailed;
 import org.apache.geronimo.gshell.registry.NoSuchCommandException;
 import org.apache.geronimo.gshell.shell.Shell;
+import org.apache.geronimo.gshell.command.Command;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Option;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+import static org.ops4j.pax.exam.CoreOptions.systemPackages;
+import static org.ops4j.pax.exam.CoreOptions.bootClasspathLibrary;
+import static org.ops4j.pax.exam.CoreOptions.felix;
 import org.ops4j.pax.exam.junit.Configuration;
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 import org.osgi.framework.Bundle;
 
 @RunWith(JUnit4TestRunner.class)
-public class CoreTest extends AbstractIntegrationTest{
+public class CoreTest extends AbstractIntegrationTest {
 
     @Test
     public void testHelp() throws Exception {
+        Thread.sleep(5000);
+
         Shell shell = getOsgiService(Shell.class);
         shell.execute("help");
     }
 
     @Test
     public void testInstallCommand() throws Exception {
+        Thread.sleep(5000);
+
         Shell shell = getOsgiService(Shell.class);
 
         try {
@@ -53,10 +63,14 @@
         Bundle b = getInstalledBundle("org.apache.felix.karaf.gshell.log");
         b.start();
 
+        Thread.sleep(1000);
+
         shell.execute("log/display");
 
         b.stop();
 
+        Thread.sleep(1000);
+
         try {
             shell.execute("log/display");
             fail("command should not exist");
@@ -68,6 +82,8 @@
 
     @Test
     public void testCommandGroup() throws Exception {
+        Thread.sleep(5000);
+
         Shell shell = getOsgiService(Shell.class);
         shell.execute("osgi");
         shell.execute("help");
@@ -78,6 +94,9 @@
     public void testCommandGroupAfterInstall() throws Exception {
         Bundle b = getInstalledBundle("org.apache.felix.karaf.gshell.log");
         b.start();
+
+        Thread.sleep(5000);
+
         Shell shell = getOsgiService(Shell.class);
         shell.execute("log");
         shell.execute("help");
@@ -86,7 +105,53 @@
 
     @Configuration
     public static Option[] configuration() {
-        return AbstractIntegrationTest.configuration();
+        Option[] options = options(
+            // this is how you set the default log level when using pax logging (logProfile)
+            systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
+            systemProperty("karaf.name").value("root"),
+            systemProperty("karaf.home").value("target/karaf.home"),
+            systemProperty("karaf.base").value("target/karaf.home"),
+            systemProperty("karaf.startLocalConsole").value("false"),
+            systemProperty("karaf.startRemoteShell").value("false"),
+
+            // hack system packages
+            systemPackages("org.apache.felix.karaf.main.spi;version=1.0.0", "org.apache.felix.karaf.jaas.boot;version=1.2.0"),
+            bootClasspathLibrary(mavenBundle("org.apache.felix.karaf.jaas", "org.apache.felix.karaf.jaas.boot")).afterFramework(),
+            bootClasspathLibrary(mavenBundle("org.apache.felix.karaf", "org.apache.felix.karaf.main")).afterFramework(),
+
+            // Log
+            mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
+            mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
+            // Felix Config Admin
+            mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
+            // Spring-DM
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.aopalliance"),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.cglib"),
+            mavenBundle("org.springframework", "spring-aop"),
+            mavenBundle("org.springframework", "spring-beans"),
+            mavenBundle("org.springframework", "spring-context"),
+            mavenBundle("org.springframework", "spring-core"),
+            mavenBundle("org.springframework.osgi", "spring-osgi-core"),
+            mavenBundle("org.springframework.osgi", "spring-osgi-extender"),
+            mavenBundle("org.springframework.osgi", "spring-osgi-io"),
+
+            // Bundles
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jline"),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-httpclient"),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-jexl"),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-vfs"),
+            mavenBundle("org.apache.mina", "mina-core"),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.oro"),
+            mavenBundle("org.apache.felix.karaf.jaas", "org.apache.felix.karaf.jaas.config"),
+            mavenBundle("org.apache.sshd", "sshd-core"),
+            mavenBundle("org.apache.felix.karaf.gshell", "org.apache.felix.karaf.gshell.core"),
+            mavenBundle("org.apache.felix.karaf.gshell", "org.apache.felix.karaf.gshell.run"),
+            mavenBundle("org.apache.felix.karaf.gshell", "org.apache.felix.karaf.gshell.osgi"),
+            mavenBundle("org.apache.felix.karaf.gshell", "org.apache.felix.karaf.gshell.log").noStart(),
+
+            felix()
+        );
+        return options;
     }
 
 }

Modified: felix/trunk/karaf/itests/src/test/java/org/apache/felix/karaf/gshell/itests/FeaturesTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/itests/src/test/java/org/apache/felix/karaf/gshell/itests/FeaturesTest.java?rev=772643&r1=772642&r2=772643&view=diff
==============================================================================
--- felix/trunk/karaf/itests/src/test/java/org/apache/felix/karaf/gshell/itests/FeaturesTest.java
(original)
+++ felix/trunk/karaf/itests/src/test/java/org/apache/felix/karaf/gshell/itests/FeaturesTest.java
Thu May  7 13:19:47 2009
@@ -16,10 +16,25 @@
  */
 package org.apache.felix.karaf.gshell.itests;
 
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+
 import org.apache.geronimo.gshell.shell.Shell;
+import org.apache.geronimo.gshell.command.Command;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Option;
+import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures;
+import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
+import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.waitForRBCFor;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+import static org.ops4j.pax.exam.CoreOptions.systemPackages;
+import static org.ops4j.pax.exam.CoreOptions.bootClasspathLibrary;
+import static org.ops4j.pax.exam.CoreOptions.felix;
+import static org.ops4j.pax.exam.CoreOptions.maven;
 import org.ops4j.pax.exam.junit.Configuration;
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 
@@ -28,14 +43,69 @@
 
     @Test
     public void testFeatures() throws Exception {
+        Thread.sleep(5000);
+
         Shell shell = getOsgiService(Shell.class);
-        shell.execute("obr");
-        shell.execute("wrapper");
+        shell.execute("obr/listUrl");
+        shell.execute("wrapper/install --help");
     }
 
     @Configuration
     public static Option[] configuration() {
-        return AbstractIntegrationTest.configuration();
+        Option[] options = options(
+            // this is how you set the default log level when using pax logging (logProfile)
+            systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
+            systemProperty("karaf.name").value("root"),
+            systemProperty("karaf.home").value("target/karaf.home"),
+            systemProperty("karaf.base").value("target/karaf.home"),
+            systemProperty("karaf.startLocalConsole").value("false"),
+            systemProperty("karaf.startRemoteShell").value("false"),
+
+            // hack system packages
+            systemPackages("org.apache.felix.karaf.main.spi;version=1.0.0", "org.apache.felix.karaf.jaas.boot;version=1.2.0"),
+            bootClasspathLibrary(mavenBundle("org.apache.felix.karaf.jaas", "org.apache.felix.karaf.jaas.boot")).afterFramework(),
+            bootClasspathLibrary(mavenBundle("org.apache.felix.karaf", "org.apache.felix.karaf.main")).afterFramework(),
+
+            // Log
+            mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
+            mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
+            // Felix Config Admin
+            mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
+            // Felix Preferences Service
+            mavenBundle("org.apache.felix", "org.apache.felix.prefs"),
+            // Spring-DM
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.aopalliance"),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.cglib"),
+            mavenBundle("org.springframework", "spring-aop"),
+            mavenBundle("org.springframework", "spring-beans"),
+            mavenBundle("org.springframework", "spring-context"),
+            mavenBundle("org.springframework", "spring-core"),
+            mavenBundle("org.springframework.osgi", "spring-osgi-core"),
+            mavenBundle("org.springframework.osgi", "spring-osgi-extender"),
+            mavenBundle("org.springframework.osgi", "spring-osgi-io"),
+
+            // Bundles
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jline"),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-httpclient"),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-jexl"),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-vfs"),
+            mavenBundle("org.apache.mina", "mina-core"),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.oro"),
+            mavenBundle("org.apache.felix.karaf.jaas", "org.apache.felix.karaf.jaas.config"),
+            mavenBundle("org.apache.sshd", "sshd-core"),
+            mavenBundle("org.apache.felix.karaf.gshell", "org.apache.felix.karaf.gshell.core"),
+            mavenBundle("org.apache.felix.karaf.gshell", "org.apache.felix.karaf.gshell.run"),
+            mavenBundle("org.apache.felix.karaf.gshell", "org.apache.felix.karaf.gshell.osgi"),
+            mavenBundle("org.apache.felix.karaf.gshell", "org.apache.felix.karaf.gshell.log").noStart(),
+
+            scanFeatures(
+                    maven().groupId("org.apache.felix.karaf").artifactId("apache-felix-karaf").type("xml").classifier("features").versionAsInProject(),
+                    "obr", "wrapper"
+            ),
+
+            felix()
+        );
+        return options;
     }
 
 }



Mime
View raw message