You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by li...@apache.org on 2012/01/05 01:30:18 UTC

git commit: [DELTASPIKE-35] Getting a working setup

Updated Branches:
  refs/heads/master bfe998d6c -> 105c4f4a8


[DELTASPIKE-35] Getting a working setup

The jbossas-managed-7 profile works correctly (provided you have JBOSS_HOME set to a working AS7.1 install). I had to
 move around some of the dependencies and profile stuff to get it to work correctly.


Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/105c4f4a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/105c4f4a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/105c4f4a

Branch: refs/heads/master
Commit: 105c4f4a85397aa8a374458ed0c32f5029408e76
Parents: bfe998d
Author: Jason Porter <li...@apache.org>
Authored: Wed Jan 4 17:28:55 2012 -0700
Committer: Jason Porter <li...@apache.org>
Committed: Wed Jan 4 17:28:55 2012 -0700

----------------------------------------------------------------------
 deltaspike/core/impl/pom.xml                       |   76 +++-
 deltaspike/core/integration-test/pom.xml           |   80 +++-
 .../core/api/provider/BeanManagerProviderTest.java |   70 +++
 .../integration/core/api/provider/TestBean.java    |   40 ++
 .../testutil/ShrinkWrapArchiveUtil.java            |  345 +++++++++++++++
 .../src/test/resources/arquillian.xml              |   40 ++
 deltaspike/parent/pom.xml                          |   53 +--
 7 files changed, 637 insertions(+), 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/105c4f4a/deltaspike/core/impl/pom.xml
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/pom.xml b/deltaspike/core/impl/pom.xml
index 8399a52..c092c76 100644
--- a/deltaspike/core/impl/pom.xml
+++ b/deltaspike/core/impl/pom.xml
@@ -1,23 +1,43 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<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">
 <!--
-    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.
--->
+  ~ 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.
+  -->
+
+<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">
+    <!--
+        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.
+    -->
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
@@ -39,7 +59,27 @@
             <artifactId>deltaspike-core-api</artifactId>
             <version>${project.version}</version>
         </dependency>
+
     </dependencies>
 
+    <profiles>
+        <profile>
+            <id>OWB</id>
+
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+
+            <dependencies>
+                <dependency>
+                    <groupId>org.jboss.arquillian.container</groupId>
+                    <artifactId>arquillian-openwebbeans-embedded-1</artifactId>
+                    <version>1.0.0.CR2</version>
+                    <scope>test</scope>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
+
 </project>
 

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/105c4f4a/deltaspike/core/integration-test/pom.xml
----------------------------------------------------------------------
diff --git a/deltaspike/core/integration-test/pom.xml b/deltaspike/core/integration-test/pom.xml
index d3ad757..bfc71fa 100644
--- a/deltaspike/core/integration-test/pom.xml
+++ b/deltaspike/core/integration-test/pom.xml
@@ -1,23 +1,43 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<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">
 <!--
-    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.
--->
+  ~ 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.
+  -->
+
+<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">
+    <!--
+        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.
+    -->
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
@@ -52,6 +72,18 @@
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>org.apache.deltaspike.core</groupId>
+            <artifactId>deltaspike-core-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.deltaspike.core</groupId>
+            <artifactId>deltaspike-core-impl</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
     </dependencies>
 
     <build>
@@ -73,9 +105,10 @@
                     <artifactId>maven-surefire-plugin</artifactId>
                     <version>${maven.surefire.plugin.version}</version>
                     <configuration>
-                        <skip>true</skip> <!-- Skip the tests normally -->
+                        <skip>true</skip>
+                        <!-- Skip the tests normally -->
                         <!-- Groups need to be setup for each profile -->
-                        <parallel>methods</parallel>
+                        <parallel>none</parallel>
                         <includes>
                             <!-- TODO: Leave the default or allow any class name for a test? -->
                             <include>**/*.java</include>
@@ -105,6 +138,7 @@
     <profiles>
         <profile>
             <id>jbossas-managed-7</id>
+            <!-- JBOSS_HOME must be set for this work correctly -->
             <dependencies>
 
                 <dependency>
@@ -137,6 +171,9 @@
                         <artifactId>maven-surefire-plugin</artifactId>
                         <version>${maven.surefire.plugin.version}</version>
                         <configuration>
+                            <systemProperties>
+                                <arquillian.launch>jbossas-managed-7</arquillian.launch>
+                            </systemProperties>
                             <!-- Groups need to be setup for each profile -->
                             <groups>
                                 org.apache.deltaspike.integration.FullProfileCategory,
@@ -177,6 +214,9 @@
                         <artifactId>maven-surefire-plugin</artifactId>
                         <version>${maven.surefire.plugin.version}</version>
                         <configuration>
+                            <systemProperties>
+                                <arquillian.launch>glassfish-remote-3.1</arquillian.launch>
+                            </systemProperties>
                             <!-- Groups need to be setup for each profile -->
                             <groups>
                                 org.apache.deltaspike.integration.FullProfileCategory,

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/105c4f4a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/provider/BeanManagerProviderTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/provider/BeanManagerProviderTest.java b/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/provider/BeanManagerProviderTest.java
new file mode 100644
index 0000000..d90b777
--- /dev/null
+++ b/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/provider/BeanManagerProviderTest.java
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+
+package org.apache.deltaspike.integration.core.api.provider;
+
+
+import org.apache.deltaspike.core.api.provider.BeanManagerProvider;
+import org.apache.deltaspike.integration.FullProfileCategory;
+import org.apache.deltaspike.integration.SeCategory;
+import org.apache.deltaspike.integration.WebProfileCategory;
+import org.apache.deltaspike.integration.testutil.ShrinkWrapArchiveUtil;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+import javax.enterprise.inject.spi.BeanManager;
+
+@RunWith(Arquillian.class)
+@Category(SeCategory.class)
+public class BeanManagerProviderTest
+{
+    /**
+     * X TODO creating a WebArchive is only a workaround because JavaArchive cannot contain other archives.
+     */
+    @Deployment
+    public static WebArchive deploy()
+    {
+        return ShrinkWrap.create(WebArchive.class)
+                         .addAsLibraries(ShrinkWrapArchiveUtil.getArchives(null,
+                                 "META-INF/beans.xml",
+                                 new String[] {"org.apache.deltaspike"},
+                                 null))
+                .addClass(TestBean.class)
+                        // Must add the categories to the archive
+                .addClasses(SeCategory.class, WebProfileCategory.class, FullProfileCategory.class)
+                .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
+    }
+
+    @Test
+    public void testBeanManagerProvider() throws Exception
+    {
+        BeanManagerProvider bmp = BeanManagerProvider.getInstance();
+        Assert.assertNotNull(bmp);
+
+        BeanManager bm = bmp.getBeanManager();
+        Assert.assertNotNull(bm);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/105c4f4a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/provider/TestBean.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/provider/TestBean.java b/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/provider/TestBean.java
new file mode 100644
index 0000000..d9477a2
--- /dev/null
+++ b/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/provider/TestBean.java
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+
+package org.apache.deltaspike.integration.core.api.provider;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Named;
+
+@Named("extraNameBean")
+@ApplicationScoped
+public class TestBean
+{
+    int i = 4711;
+
+    public int getI()
+    {
+        return i;
+    }
+
+    public void setI(int i)
+    {
+        this.i = i;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/105c4f4a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/testutil/ShrinkWrapArchiveUtil.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/testutil/ShrinkWrapArchiveUtil.java b/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/testutil/ShrinkWrapArchiveUtil.java
new file mode 100644
index 0000000..fd06a0d
--- /dev/null
+++ b/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/testutil/ShrinkWrapArchiveUtil.java
@@ -0,0 +1,345 @@
+/*
+ * 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.
+ */
+
+package org.apache.deltaspike.integration.testutil;
+
+
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.jar.JarInputStream;
+import java.util.logging.Logger;
+import java.util.zip.ZipEntry;
+
+
+/**
+ * Lots of neat little helpers to more easily create JavaArchives from marker files on the classpath.
+ * This should finally get moved to ShrinkWrap core!
+ *
+ * @author <a href="mailto:struberg@yahoo.de">Mark Struberg</a>
+ * @deprecated This class should get moved to ShrinkWrap itself!
+ */
+public class ShrinkWrapArchiveUtil
+{
+    private static final Logger LOG = Logger.getLogger(ShrinkWrapArchiveUtil.class.getName());
+
+    /**
+     * Resolve all markerFiles from the current ClassPath and package the root nodes
+     * into a JavaArchive.
+     *
+     * @param classLoader            to use
+     * @param markerFile
+     * @param includeIfPackageExists if not null, we will only create JavaArchives if the given package exists
+     * @param excludeIfPackageExists if not null, we will <b>not</b> create JavaArchives if the given package exists.
+     *                               This has a higher precedence than includeIfPackageExists.
+     * @return
+     */
+    public static JavaArchive[] getArchives(ClassLoader classLoader,
+                                            String markerFile,
+                                            String[] includeIfPackageExists,
+                                            String[] excludeIfPackageExists)
+    {
+        if (classLoader == null)
+        {
+            classLoader = ShrinkWrapArchiveUtil.class.getClassLoader();
+        }
+
+        try
+        {
+            Enumeration<URL> foundFiles = classLoader.getResources(markerFile);
+
+            List<JavaArchive> archives = new ArrayList<JavaArchive>();
+
+            while (foundFiles.hasMoreElements())
+            {
+                URL foundFile = foundFiles.nextElement();
+                LOG.fine("Evaluating Java ClassPath URL " + foundFile.toExternalForm());
+
+                JavaArchive archive = createArchive(foundFile, markerFile, includeIfPackageExists, excludeIfPackageExists);
+                if (archive != null)
+                {
+                    LOG.info("Adding Java ClassPath URL as JavaArchive " + foundFile.toExternalForm());
+                    archives.add(archive);
+                }
+            }
+
+            return archives.toArray(new JavaArchive[archives.size()]);
+        }
+        catch (IOException ioe)
+        {
+            throw new RuntimeException(ioe);
+        }
+
+    }
+
+    private static JavaArchive createArchive(URL foundFile, String markerFile,
+                                             String[] includeIfPackageExists, String[] excludeIfPackageExists)
+            throws IOException
+    {
+        String urlString = foundFile.toString();
+        int idx = urlString.lastIndexOf(markerFile);
+        urlString = urlString.substring(0, idx);
+
+        String jarUrlPath = isJarUrl(urlString);
+        if (jarUrlPath != null)
+        {
+            return addJarArchive((new URL(ensureCorrectUrlFormat(jarUrlPath))).openStream(),
+                    includeIfPackageExists, excludeIfPackageExists);
+        }
+        else
+        {
+            File f = new File((new URL(ensureCorrectUrlFormat(urlString))).getFile());
+            if (!f.exists())
+            {
+                // try a fallback if the URL contains %20 -> spaces
+                if (urlString.contains("%20"))
+                {
+                    urlString = urlString.replaceAll("%20", " ");
+                    f = new File((new URL(ensureCorrectUrlFormat(urlString))).getFile());
+                }
+
+            }
+
+            return addFileArchive(f, includeIfPackageExists, excludeIfPackageExists);
+        }
+    }
+
+    private static JavaArchive addJarArchive(InputStream inputStream,
+                                             String[] includeIfPackageExists,
+                                             String[] excludeIfPackageExists)
+            throws IOException
+    {
+        JavaArchive ret = null;
+        JavaArchive javaArchive = ShrinkWrap.create(JavaArchive.class);
+
+        if (includeIfPackageExists == null)
+        {
+            // no include rule, thus add it immediately
+            ret = javaArchive;
+        }
+
+        JarInputStream jar = new JarInputStream(inputStream);
+        try
+        {
+            for (ZipEntry jarEntry = jar.getNextEntry(); jarEntry != null; jarEntry = jar.getNextEntry())
+            {
+                String entryName = jarEntry.getName();
+
+                if (jarEntry.isDirectory())
+                {
+                    // exclude rule
+                    if (excludeIfPackageExists(entryName, excludeIfPackageExists))
+                    {
+                        return null;
+                    }
+
+                    if (ret == null && includeIfPackageExists(entryName, includeIfPackageExists))
+                    {
+                        ret = javaArchive;
+                    }
+
+                    continue;
+                }
+
+                if (entryName.endsWith(".class"))
+                {
+                    String className = pathToClassName(entryName.substring(0, entryName.length() - (".class".length())));
+                    javaArchive.addClass(className);
+                }
+                else
+                {
+                    javaArchive.addAsResource(entryName);
+                }
+            }
+        }
+        finally
+        {
+            try
+            {
+                jar.close();
+            }
+            catch (IOException ignored)
+            {
+                // all fine
+            }
+        }
+
+        return ret;
+    }
+
+    private static JavaArchive addFileArchive(File archiveBasePath,
+                                              String[] includeIfPackageExists,
+                                              String[] excludeIfPackageExists)
+            throws IOException
+    {
+        if (!archiveBasePath.exists())
+        {
+            return null;
+        }
+
+        JavaArchive ret = null;
+        JavaArchive javaArchive = ShrinkWrap.create(JavaArchive.class);
+
+        if (includeIfPackageExists == null)
+        {
+            // no include rule, thus add it immediately
+            ret = javaArchive;
+        }
+
+        int basePathLength = archiveBasePath.getAbsolutePath().length() + 1;
+
+        for (File archiveEntry : collectArchiveEntries(archiveBasePath))
+        {
+            String entryName = archiveEntry.getAbsolutePath().substring(basePathLength);
+
+            // exclude rule
+            if (excludeIfPackageExists(entryName, excludeIfPackageExists))
+            {
+                return null;
+            }
+
+            // include rule
+            if (ret == null && includeIfPackageExists(entryName, includeIfPackageExists))
+            {
+                ret = javaArchive;
+            }
+
+            if (entryName.endsWith(".class"))
+            {
+                String className = pathToClassName(entryName.substring(0, entryName.length() - (".class".length())));
+
+                javaArchive.addClass(className);
+            }
+            else
+            {
+                javaArchive.addAsResource(entryName.replace('\\', '/'));
+            }
+        }
+
+        return ret;
+    }
+
+    private static List<File> collectArchiveEntries(File archiveBasePath)
+    {
+        if (archiveBasePath.isDirectory())
+        {
+            List<File> archiveEntries = new ArrayList<File>();
+            File[] files = archiveBasePath.listFiles();
+
+            for (File file : files)
+            {
+                if (file.isDirectory())
+                {
+                    archiveEntries.addAll(collectArchiveEntries(file));
+                }
+                else
+                {
+                    archiveEntries.add(file);
+                }
+            }
+
+            return archiveEntries;
+        }
+
+        return Collections.EMPTY_LIST;
+    }
+
+
+    private static boolean excludeIfPackageExists(String jarEntryName, String[] excludeOnPackages)
+    {
+        if (excludeOnPackages != null)
+        {
+            String packageName = pathToClassName(jarEntryName);
+
+            for (String excludeOnPackage : excludeOnPackages)
+            {
+                if (packageName.startsWith(excludeOnPackage))
+                {
+                    return true;
+                }
+            }
+        }
+
+        return false;
+    }
+
+    private static boolean includeIfPackageExists(String jarEntryName, String[] includeOnPackages)
+    {
+        if (includeOnPackages == null)
+        {
+            return true;
+        }
+
+        String packageName = pathToClassName(jarEntryName);
+
+        for (String includeOnPackage : includeOnPackages)
+        {
+            if (packageName.startsWith(includeOnPackage))
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * check if the given url path is a Jar
+     *
+     * @param urlPath
+     * @return
+     */
+    private static String isJarUrl(String urlPath)
+    {
+        // common prefixes of the url are: jar: (tomcat), zip: (weblogic) and wsjar: (websphere)
+        final int jarColon = urlPath.indexOf(':');
+        if (urlPath.endsWith("!/") && jarColon > 0)
+        {
+            urlPath = urlPath.substring(jarColon + 1, urlPath.length() - 2);
+            return urlPath;
+        }
+
+        return null;
+    }
+
+    private static String ensureCorrectUrlFormat(String url)
+    {
+        //fix for wls
+        if (!url.startsWith("file:/"))
+        {
+            url = "file:/" + url;
+        }
+        return url;
+    }
+
+    private static String pathToClassName(String pathName)
+    {
+        return pathName.replace('/', '.').replace('\\', '.');   // replace unix and windows separators
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/105c4f4a/deltaspike/core/integration-test/src/test/resources/arquillian.xml
----------------------------------------------------------------------
diff --git a/deltaspike/core/integration-test/src/test/resources/arquillian.xml b/deltaspike/core/integration-test/src/test/resources/arquillian.xml
new file mode 100644
index 0000000..4ab3ece
--- /dev/null
+++ b/deltaspike/core/integration-test/src/test/resources/arquillian.xml
@@ -0,0 +1,40 @@
+<!--
+  ~ 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.
+  -->
+
+<arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+
+    <!--Uncomment to have test archives exported to the file system for inspection -->
+    <!--
+    <engine>
+        <property name="deploymentExportPath">target/</property>
+    </engine>
+    -->
+
+    <container qualifier="jbossas-managed-7">
+        <configuration>
+            <property name="javaVmArguments">-client -noverify -XX:+UseFastAccessorMethods -Xms64m -Xmx1024m
+                -XX:MaxPermSize=512m
+            </property>
+            <property name="outputToConsole">false</property>
+            <property name="allowConnectingToRunningServer">true</property>
+        </configuration>
+    </container>
+
+</arquillian>

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/105c4f4a/deltaspike/parent/pom.xml
----------------------------------------------------------------------
diff --git a/deltaspike/parent/pom.xml b/deltaspike/parent/pom.xml
index a11e66a..4106f17 100644
--- a/deltaspike/parent/pom.xml
+++ b/deltaspike/parent/pom.xml
@@ -1,23 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-    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.
--->
-<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">
+  ~ 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.
+  -->
+<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>
 
     <parent>
@@ -362,8 +363,8 @@
                             <tasks>
                                 <copy todir="${project.build.directory}/apidocs/META-INF">
                                     <fileset dir="${basedir}">
-                                        <include name="LICENSE.txt" />
-                                        <include name="NOTICE.txt" />
+                                        <include name="LICENSE.txt"/>
+                                        <include name="NOTICE.txt"/>
                                     </fileset>
                                 </copy>
                             </tasks>
@@ -378,8 +379,9 @@
                         <configuration>
                             <tasks>
                                 <!-- Copy javadoc to another directory, to keep javadoc of previous versions on site -->
-                                <copy todir="${project.build.directory}/site/apidocs-${project.version}" failonerror="false">
-                                    <fileset dir="${project.build.directory}/site/apidocs" />
+                                <copy todir="${project.build.directory}/site/apidocs-${project.version}"
+                                      failonerror="false">
+                                    <fileset dir="${project.build.directory}/site/apidocs"/>
                                 </copy>
                             </tasks>
                         </configuration>
@@ -505,13 +507,6 @@
                     <artifactId>openwebbeans-resource</artifactId>
                 </dependency>
 
-                <dependency>
-                    <groupId>org.jboss.arquillian.container</groupId>
-                    <artifactId>arquillian-openwebbeans-embedded-1</artifactId>
-                    <version>1.0.0.CR2</version>
-                    <scope>test</scope>
-                </dependency>
-
             </dependencies>
         </profile>