[weld-dev] Patches for ticket https://issues.jboss.org/browse/WELD-1287

Charles Moulliard cmoulliard at redhat.com
Thu Dec 20 10:24:52 EST 2012


Hi,

I have created 2 patched for the folloing ticket :

https://issues.jboss.org/browse/WELD-1287

If someone can apply my patches that should be great.

Remark : Only the properties files + resources directory should be 
installed from patch one

Regards,

-- 
Ir. Charles Moulliard
Sr. Enterprise Architect / Apache Committer | RedHat, Inc
FuseSource is now part of Red Hat
cmoullia at redhat.com | mobile: +32 473 604 014 | RedHat.com 
<http://www.redhat.com>
skype: cmoulliard | twitter: @cmoulliard
blog: cmoulliard.blogspot.com <http://cmoulliard.blogspot.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20121220/18b5fa7e/attachment-0001.html 
-------------- next part --------------
>From 60b24d02721183c5441eab273c0827bd38a55418 Mon Sep 17 00:00:00 2001
From: Charles Moulliard <cmoulliard at fusesource.com>
Date: Wed, 19 Dec 2012 09:22:11 +0100
Subject: [PATCH] WELD-1287: Add integration test to validate weld osgi on
 Apache Karaf

---
 .../osgi/tests/karaf/ContainerTest.java            |  11 ++
 .../osgi/tests/karaf/WeldOSGIContainerSupport.java |  11 ++
 .../environment/osgi/tests/karaf/config.properties | 124 +++++++++++++++++++++
 .../environment/osgi/tests/karaf/custom.properties |  30 +++++
 4 files changed, 176 insertions(+)
 create mode 100644 environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/ContainerTest.java
 create mode 100644 environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/WeldOSGIContainerSupport.java
 create mode 100644 environments/osgi/tests/tester/src/test/resources/org/jboss/weld/environment/osgi/tests/karaf/config.properties
 create mode 100644 environments/osgi/tests/tester/src/test/resources/org/jboss/weld/environment/osgi/tests/karaf/custom.properties

diff --git a/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/ContainerTest.java b/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/ContainerTest.java
new file mode 100644
index 0000000..d185fa3
--- /dev/null
+++ b/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/ContainerTest.java
@@ -0,0 +1,11 @@
+package org.jboss.weld.environment.osgi.tests.karaf;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: chmoulli
+ * Date: 19/12/12
+ * Time: 08:53
+ * To change this template use File | Settings | File Templates.
+ */
+public class ContainerTest {
+}
diff --git a/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/WeldOSGIContainerSupport.java b/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/WeldOSGIContainerSupport.java
new file mode 100644
index 0000000..bbe51a3
--- /dev/null
+++ b/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/WeldOSGIContainerSupport.java
@@ -0,0 +1,11 @@
+package org.jboss.weld.environment.osgi.tests.karaf;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: chmoulli
+ * Date: 19/12/12
+ * Time: 09:08
+ * To change this template use File | Settings | File Templates.
+ */
+public class WeldOSGIContainerSupport {
+}
diff --git a/environments/osgi/tests/tester/src/test/resources/org/jboss/weld/environment/osgi/tests/karaf/config.properties b/environments/osgi/tests/tester/src/test/resources/org/jboss/weld/environment/osgi/tests/karaf/config.properties
new file mode 100644
index 0000000..544c508
--- /dev/null
+++ b/environments/osgi/tests/tester/src/test/resources/org/jboss/weld/environment/osgi/tests/karaf/config.properties
@@ -0,0 +1,124 @@
+################################################################################
+#
+#    Licensed to the Apache Software Foundation (ASF) under one or more
+#    contributor license agreements.  See the NOTICE file distributed with
+#    this work for additional information regarding copyright ownership.
+#    The ASF licenses this file to You 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.
+#
+################################################################################
+
+# FIXING PAX-EXAM BUG
+
+#
+# This file lists Karaf default settings for this particular version of Karaf.
+# For easier maintenance when upgrading Karaf and to better document which
+# default values have changed, it is recommended to place any changes to
+# these values in a custom.properties file in the same folder as this file.
+# Each value specified in custom.properties will override the default value
+# here.
+#
+
+#
+# Properties file inclusions (as a space separated list of relative paths)
+# Included files will override the values specified in this file
+# NB: ${includes} properties files are mandatory, it means that Karaf will not start
+# if the include file is not found
+#
+${includes} = jre.properties custom.properties
+
+#
+# Properties file inclusions (as a space separated list of relative paths)
+# Included files will override the values specified in this file
+# NB: ${optionals} properties files are optionals, it means that Karaf will just
+# display a warning message but the bootstrap will be performed
+#
+# ${optionals} = my.properties
+
+
+#
+# Framework selection properties
+#
+karaf.framework=felix
+
+#
+# Location of the OSGi frameworks
+#
+karaf.framework.equinox=${karaf.default.repository}/org/eclipse/osgi/3.8.0.v20120529-1548/osgi-3.8.0.v20120529-1548.jar
+karaf.framework.felix=${karaf.default.repository}/org/apache/felix/org.apache.felix.framework/4.0.3/org.apache.felix.framework-4.0.3.jar
+
+#
+# Framework config properties.
+#
+org.osgi.framework.system.packages= \
+ org.osgi.framework.startlevel;uses:="org.osgi.framework";version="1.0", \
+ org.osgi.framework.wiring;uses:="org.osgi.resource,org.osgi.framework";version="1.1", \
+ org.osgi.framework.hooks.bundle;uses:="org.osgi.framework";version="1.1", \
+ org.osgi.framework.hooks.service;uses:="org.osgi.framework";version="1.1", \
+ org.osgi.framework.hooks.resolver;uses:="org.osgi.framework.wiring";version="1.0", \
+ org.osgi.framework.launch;uses:="org.osgi.framework";version="1.1", \
+ org.osgi.framework.namespace;uses:="org.osgi.resource";version="1.0", \
+ org.osgi.framework;version="1.7",\
+ org.osgi.framework.hooks.weaving;uses:="org.osgi.framework.wiring";version="1.0",\
+ org.osgi.resource;version="1.0",org.osgi.service.url;version="1.0",\
+ org.osgi.service.startlevel;uses:="org.osgi.framework";version="1.1",\
+ org.osgi.service.packageadmin;uses:="org.osgi.framework";version="1.2",\
+ org.osgi.service.url;version="1.0", \
+ org.osgi.util.tracker;uses:="org.osgi.framework";version="1.5.1", \
+ org.apache.karaf.jaas.boot;version="2.3.0", \
+ org.apache.karaf.jaas.boot.principal;version="2.3.0", \
+ org.apache.karaf.version;version="2.3.0", \
+ ${jre-${java.specification.version}}
+
+# Extra packages appended after standard packages
+# org.osgi.framework.system.packages.extra=
+
+# javax.transaction is needed to avoid class loader constraint violation when using javax.sql
+org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,sun.*,com.sun.*,javax.transaction,javax.transaction.*
+
+# OSGi Execution Environment
+org.osgi.framework.executionenvironment=J2SE-1.7,JavaSE-1.7,J2SE-1.6,JavaSE-1.6,J2SE-1.5,JavaSE-1.5,J2SE-1.4,JavaSE-1.4,J2SE-1.3,JavaSE-1.3,J2SE-1.2,,JavaSE-1.2,CDC-1.1/Foundation-1.1,CDC-1.0/Foundation-1.0,J2ME,OSGi/Minimum-1.1,OSGi/Minimum-1.0
+
+# Set the parent classloader for the bundle to the classloader that loads the Framework (i.e. everything in lib/*.jar)
+org.osgi.framework.bundle.parent=framework
+
+# To enable the use of the startup.properties file to control the start level:
+karaf.auto.start=startup.properties
+
+org.osgi.framework.startlevel.beginning=100
+karaf.startlevel.bundle=80
+
+karaf.shutdown.port.file=${karaf.data}/port
+
+#
+# FileMonitor properties
+#
+felix.fileinstall.dir    = ${karaf.base}/etc
+felix.fileinstall.filter = .*\\.cfg
+felix.fileinstall.poll   = 1000
+felix.fileinstall.noInitialDelay = true
+felix.fileinstall.log.level = 3
+
+#
+# Delay for writing the framework state to disk in equinox
+# must be  >= 1000 and <= 1800000
+#
+eclipse.stateSaveDelayInterval = 1000
+
+#
+# OBR Repository list
+# This property will be modified by the obr:addUrl and obr:removeUrl commands.
+#
+obr.repository.url =
+
+karaf.delay.console=false
+
diff --git a/environments/osgi/tests/tester/src/test/resources/org/jboss/weld/environment/osgi/tests/karaf/custom.properties b/environments/osgi/tests/tester/src/test/resources/org/jboss/weld/environment/osgi/tests/karaf/custom.properties
new file mode 100644
index 0000000..fbdb62a
--- /dev/null
+++ b/environments/osgi/tests/tester/src/test/resources/org/jboss/weld/environment/osgi/tests/karaf/custom.properties
@@ -0,0 +1,30 @@
+################################################################################
+#
+#    Licensed to the Apache Software Foundation (ASF) under one or more
+#    contributor license agreements.  See the NOTICE file distributed with
+#    this work for additional information regarding copyright ownership.
+#    The ASF licenses this file to You 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.
+#
+################################################################################
+
+#
+# All the values specified here will override the default values given
+# in config.properties.
+#
+
+karaf.systemBundlesStartLevel=50
+
+#
+# You can place any customized configuration here.
+#
+
-- 
1.7.11.1

-------------- next part --------------
>From cc2297cff2758c73a12cd497e5c5bb56dc1e9e6f Mon Sep 17 00:00:00 2001
From: Charles Moulliard <cmoulliard at fusesource.com>
Date: Thu, 20 Dec 2012 16:13:23 +0100
Subject: [PATCH] WELD-1287: Add integration test to validate weld osgi on
 Apache Karaf

---
 environments/osgi/tests/tester/pom.xml             | 245 ++++++++++++++++++++-
 .../osgi/tests/karaf/ContainerTest.java            |   8 +-
 .../osgi/tests/karaf/WeldOSGIContainerSupport.java |  11 +-
 .../environment/osgi/tests/util/Environment.java   |  11 +
 pom.xml                                            |  46 +++-
 5 files changed, 301 insertions(+), 20 deletions(-)

diff --git a/environments/osgi/tests/tester/pom.xml b/environments/osgi/tests/tester/pom.xml
index f2cd212..09c47aa 100644
--- a/environments/osgi/tests/tester/pom.xml
+++ b/environments/osgi/tests/tester/pom.xml
@@ -54,9 +54,10 @@
     <dependencies>
 
         <dependency>
-            <groupId>org.openengsb.labs.paxexam.karaf</groupId>
-            <artifactId>paxexam-karaf-options</artifactId>
-            <version>1.0.0</version>
+            <groupId>org.apache.karaf</groupId>
+            <artifactId>apache-karaf</artifactId>
+            <version>2.3.0</version>
+            <type>tar.gz</type>
             <scope>test</scope>
         </dependency>
 
@@ -67,18 +68,134 @@
         </dependency>
 
         <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-junit4</artifactId>
+            <groupId>org.apache.karaf</groupId>
+            <artifactId>apache-karaf</artifactId>
+            <version>2.3.0</version>
+            <type>tar.gz</type>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-aether</artifactId>
             <scope>test</scope>
         </dependency>
 
         <dependency>
             <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-container-native</artifactId>
+            <artifactId>pax-exam-link-mvn</artifactId>
             <scope>test</scope>
         </dependency>
 
         <dependency>
+            <groupId>org.openengsb.labs.paxexam.karaf</groupId>
+            <artifactId>paxexam-karaf-container</artifactId>
+            <version>1.0.0</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.karaf</groupId>
+                    <artifactId>org.apache.karaf.client</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam-spi</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam-container-rbc</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam-container-rbc-client</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam-container-remote</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam-invoker-junit</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam</artifactId>
+            <version>${pax.exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.swissbox</groupId>
+            <artifactId>pax-swissbox-tinybundles</artifactId>
+            <version>${pax.swissbox.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-spi</artifactId>
+            <version>${pax.exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-rbc</artifactId>
+            <version>${pax.exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-rbc-client</artifactId>
+            <version>${pax.exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-remote</artifactId>
+            <version>${pax.exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-extender-service</artifactId>
+            <version>${pax.exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-inject</artifactId>
+            <version>${pax.exam.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-invoker-junit</artifactId>
+            <version>${pax.exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit4</artifactId>
+            <version>${pax.exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+
+
+        <!--
+
+                <dependency>
             <groupId>org.ops4j.pax.url</groupId>
             <artifactId>pax-url-aether</artifactId>
             <scope>test</scope>
@@ -90,12 +207,114 @@
             <scope>test</scope>
         </dependency>
 
+                <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit4</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+               <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-native</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.openengsb.labs.paxexam.karaf</groupId>
+            <artifactId>paxexam-karaf-container</artifactId>
+            <version>1.0.0</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam-spi</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam-container-rbc</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam-container-rbc-client</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam-container-remote</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam-invoker-junit</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ops4j.pax.exam</groupId>
+                    <artifactId>pax-exam</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam</artifactId>
+            <version>${pax.exam.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-spi</artifactId>
+            <version>${pax.exam.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-rbc</artifactId>
+            <version>${pax.exam.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-rbc-client</artifactId>
+            <version>${pax.exam.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-remote</artifactId>
+            <version>${pax.exam.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-extender-service</artifactId>
+            <version>${pax.exam.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-inject</artifactId>
+            <version>${pax.exam.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-invoker-junit</artifactId>
+            <version>${pax.exam.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit4</artifactId>
+            <version>${pax.exam.version}</version>
+        </dependency>
+
+
+
+
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.framework</artifactId>
             <scope>test</scope>
         </dependency>
-
+                                   -->
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
@@ -119,6 +338,7 @@
         <dependency>
             <groupId>org.jboss.weld.osgi</groupId>
             <artifactId>weld-osgi-core-spi</artifactId>
+            <scope>test</scope>
         </dependency>
 
         <dependency>
@@ -243,4 +463,15 @@
 
     </dependencies>
 
+    <!-- -->
+    <repositories>
+        <repository>
+            <id>Apache Maven Repo</id>
+            <url>http://repo1.maven.org/maven2</url>
+        </repository>
+    </repositories>
+
+
+
+
 </project>
diff --git a/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/ContainerTest.java b/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/ContainerTest.java
index ea04e08..d2161a9 100644
--- a/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/ContainerTest.java
+++ b/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/ContainerTest.java
@@ -6,10 +6,11 @@ import org.jboss.weld.environment.osgi.tests.util.Environment;
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.junit.ExamReactorStrategy;
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
 import org.osgi.framework.*;
 
 import javax.enterprise.event.Event;
@@ -21,10 +22,10 @@ import java.util.Collection;
 
 import static org.jboss.weld.environment.osgi.tests.karaf.WeldOSGIContainerSupport.getDefaultKarafOptions;
 import static org.jboss.weld.environment.osgi.tests.util.Environment.toMavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.options;
 import static org.ops4j.pax.exam.OptionUtils.combine;
 
 @RunWith(JUnit4TestRunner.class)
+ at ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
 public class ContainerTest {
 
     @Configuration
@@ -33,7 +34,7 @@ public class ContainerTest {
 
                 getDefaultKarafOptions(),
 
-                Environment.toCDIOSGiEnvironment(
+                Environment.toCDIKarafEnvironment(
                         toMavenBundle("org.jboss.weld.osgi.tests", "weld-osgi-bundle1"),
                         toMavenBundle("org.jboss.weld.osgi.tests", "weld-osgi-bundle2"),
                         toMavenBundle("org.jboss.weld.osgi.tests", "weld-osgi-bundle3")
@@ -49,6 +50,7 @@ public class ContainerTest {
 
     @Test
     public void launchTest() throws InterruptedException, BundleException, InvalidSyntaxException {
+
         Environment.waitForEnvironment(context);
 
         Bundle bundle1 = null, bundle2 = null, bundle3 = null;
diff --git a/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/WeldOSGIContainerSupport.java b/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/WeldOSGIContainerSupport.java
index 3f40a59..0bf5c00 100644
--- a/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/WeldOSGIContainerSupport.java
+++ b/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/karaf/WeldOSGIContainerSupport.java
@@ -2,11 +2,13 @@ package org.jboss.weld.environment.osgi.tests.karaf;
 
 
 import org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption;
+import org.openengsb.labs.paxexam.karaf.options.LogLevelOption;
 import org.ops4j.pax.exam.Option;
 
 import java.io.File;
 
 import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
+import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.logLevel;
 import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.replaceConfigurationFile;
 import static org.ops4j.pax.exam.CoreOptions.maven;
 
@@ -17,16 +19,17 @@ public class WeldOSGIContainerSupport {
                 // Set the karaf environment with some customer configuration
                 new Option[]{
                         karafDistributionConfiguration()
-                                .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").versionAsInProject())
-                                        // This version is not actual karaf version that we use.
+                                .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").version("2.3.0"))
                                 .karafVersion("2.3.0")
                                 .name("Apache Karaf")
                                 .useDeployFolder(false).unpackDirectory(new File("target/paxexam/unpack/")),
 
                         KarafDistributionOption.keepRuntimeFolder(),
+                        logLevel(LogLevelOption.LogLevel.INFO),
+
                         // override the config.properties (to fix pax-exam bug)
-                        replaceConfigurationFile("etc/config.properties", new File("src/test/resources/org/jboss/weld/environment/osgi/tests/karaf/config.properties")),
-                        replaceConfigurationFile("etc/custom.properties", new File("src/test/resources/org/jboss/weld/environment/osgi/tests/karaf/custom.properties"))
+                        replaceConfigurationFile("etc/config.properties", new File("src/test/resources/org/jboss/weld/environment/osgi/tests/karaf/config.properties"))
+                        //replaceConfigurationFile("etc/custom.properties", new File("src/test/resources/org/jboss/weld/environment/osgi/tests/karaf/custom.properties"))
                 };
 
         return options;
diff --git a/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/util/Environment.java b/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/util/Environment.java
index cce0fc9..64148f7 100644
--- a/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/util/Environment.java
+++ b/environments/osgi/tests/tester/src/test/java/org/jboss/weld/environment/osgi/tests/util/Environment.java
@@ -54,6 +54,17 @@ public class Environment {
         return result.toArray(new Option[result.size()]);
     }
 
+    public static Option[] toCDIKarafEnvironment(Option... options) {
+        List<Option> result = new ArrayList<Option>();
+        result.add(toMavenBundle("org.jboss.weld.osgi", "weld-osgi-core-mandatory"));
+        result.add(toMavenBundle("org.jboss.weld.osgi", "weld-osgi-core-api"));
+        result.add(toMavenBundle("org.jboss.weld.osgi", "weld-osgi-core-spi"));
+        result.add(toMavenBundle("org.jboss.weld.osgi", "weld-osgi-core-extension"));
+        result.add(toMavenBundle("org.jboss.weld.osgi", "weld-osgi-core-integration"));
+        Collections.addAll(result, options);
+        return result.toArray(new Option[result.size()]);
+    }
+
     public static void waitForEnvironment(BundleContext context) throws InterruptedException {
         boolean ready = false;
         while (!ready) {
diff --git a/pom.xml b/pom.xml
index 1a96359..41c3d8d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.jboss.weld</groupId>
     <artifactId>weld-core-parent</artifactId>
@@ -79,7 +80,9 @@
         <jboss.interceptors.api.version>1.1</jboss.interceptors.api.version>
         <logback.version>0.9.29</logback.version>
         <pax.url.version>1.4.2</pax.url.version>
-        <pax.exam.version>2.5.0</pax.exam.version>
+        <pax.exam.version>2.4.0</pax.exam.version>
+        <pax.swissbox.version>1.3.1</pax.swissbox.version>
+        <openengsb.version>1.0.0</openengsb.version>
         <org.apache.felix.version>4.0.3</org.apache.felix.version>
         <!-- Weld API -->
         <weld.api.version>1.2.0.Beta1</weld.api.version>
@@ -541,8 +544,39 @@
 
             <dependency>
                 <groupId>org.ops4j.pax.exam</groupId>
+                <artifactId>pax-exam</artifactId>
+                <version>${pax.exam.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.ops4j.pax.exam</groupId>
                 <artifactId>pax-exam-container-native</artifactId>
                 <version>${pax.exam.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.openengsb.labs.paxexam.karaf</groupId>
+                <artifactId>paxexam-karaf-container</artifactId>
+                <version>${openengsb.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.ops4j.pax.swissbox</groupId>
+                <artifactId>pax-swissbox-tinybundles</artifactId>
+                <version>${pax.swissbox.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.ops4j.pax.exam</groupId>
+                <artifactId>pax-exam-container-rbc</artifactId>
+                <version>${pax.exam.version}</version>
+                <scope>test</scope>
+            </dependency>
+
+            <dependency>
+                <groupId>org.ops4j.pax.exam</groupId>
+                <artifactId>pax-exam-container-remote</artifactId>
+                <version>${pax.exam.version}</version>
                 <scope>test</scope>
             </dependency>
 
@@ -697,7 +731,7 @@
                         <configLocation>weld-checkstyle/checkstyle.xml</configLocation>
                         <consoleOutput>true</consoleOutput>
                         <failsOnError>true</failsOnError>
-                        <useFile />
+                        <useFile/>
                     </configuration>
                     <dependencies>
                         <dependency>
@@ -735,7 +769,7 @@
                                         </goals>
                                     </pluginExecutionFilter>
                                     <action>
-                                        <ignore />
+                                        <ignore/>
                                     </action>
                                 </pluginExecution>
                             </pluginExecutions>
@@ -773,8 +807,8 @@
         <connection>scm:git:git at github.com:weld/core.git</connection>
         <developerConnection>scm:git:git at github.com:weld/core.git</developerConnection>
         <url>scm:git:git at github.com:weld/core.git</url>
-      <tag>HEAD</tag>
-  </scm>
+        <tag>HEAD</tag>
+    </scm>
 
 
     <profiles>
-- 
1.7.11.1



More information about the weld-dev mailing list