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

git commit: DELTASPIKE-266 refactor Arquillian glue code into ArchiveUtils

Updated Branches:
  refs/heads/master b9967f1bf -> a338e11ac


DELTASPIKE-266 refactor Arquillian glue code into ArchiveUtils


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

Branch: refs/heads/master
Commit: a338e11aced1a1cc34d461e50714e154267c6f9c
Parents: b9967f1
Author: Mark Struberg <st...@apache.org>
Authored: Wed Oct 3 01:19:57 2012 +0200
Committer: Mark Struberg <st...@apache.org>
Committed: Wed Oct 3 01:19:57 2012 +0200

----------------------------------------------------------------------
 .../test/scope/view/ViewScopedContextTest.java     |   15 +++-------
 .../impl/test/scope/view/util/ArchiveUtils.java    |   22 +++++++++++++--
 2 files changed, 23 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/a338e11a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/jsf/impl/test/scope/view/ViewScopedContextTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/jsf/impl/test/scope/view/ViewScopedContextTest.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/jsf/impl/test/scope/view/ViewScopedContextTest.java
index 7f2599c..df7d8be 100644
--- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/jsf/impl/test/scope/view/ViewScopedContextTest.java
+++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/jsf/impl/test/scope/view/ViewScopedContextTest.java
@@ -21,6 +21,7 @@ package org.apache.deltaspike.jsf.impl.test.scope.view;
 
 import java.net.URL;
 
+import org.apache.deltaspike.jsf.impl.test.scope.view.util.ArchiveUtils;
 import org.apache.deltaspike.test.category.WebProfileCategory;
 import org.jboss.arquillian.ajocado.framework.GrapheneSelenium;
 import org.jboss.arquillian.container.test.api.Deployment;
@@ -28,11 +29,10 @@ import org.jboss.arquillian.container.test.api.RunAsClient;
 import org.jboss.arquillian.drone.api.annotation.Drone;
 import org.jboss.arquillian.junit.Arquillian;
 import org.jboss.arquillian.test.api.ArquillianResource;
-//X import org.jboss.arquillian.warp.WarpTest;
+import org.jboss.arquillian.warp.WarpTest;
 
 import org.jboss.shrinkwrap.api.ShrinkWrap;
 import org.jboss.shrinkwrap.api.asset.EmptyAsset;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
 import org.jboss.shrinkwrap.api.spec.WebArchive;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -41,7 +41,7 @@ import org.junit.runner.RunWith;
 /**
  * Test for the DeltaSpike ViewScoped context
  */
-//X @WarpTest
+@WarpTest
 @RunWith(Arquillian.class)
 @Category(WebProfileCategory.class)
 public class ViewScopedContextTest
@@ -60,17 +60,10 @@ public class ViewScopedContextTest
     public static WebArchive deploy()
     {
         // JAR with NO beans.xml!
-        JavaArchive testJar = ShrinkWrap
-                .create(JavaArchive.class, "viewScopedContextTest.jar")
-//X                 .addPackage(ViewScopedContextTest.class.getPackage())
-                .addPackage(GrapheneSelenium.class.getPackage())
-                .addPackage(WebProfileCategory.class.getPackage());
 
         return ShrinkWrap
                 .create(WebArchive.class, "viewScopedContextTest.war")
-                .addAsLibrary(testJar)
-
-                //X .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndJsfArchive())
+                .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndJsfArchive())
                 .addAsWebInfResource("viewScopedContextTest/WEB-INF/web.xml", "web.xml")
                 .addAsWebResource("viewScopedContextTest/index.html", "index.html")
                 .addAsWebResource("viewScopedContextTest/page1.xhtml", "page1.xhtml")

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/a338e11a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/jsf/impl/test/scope/view/util/ArchiveUtils.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/jsf/impl/test/scope/view/util/ArchiveUtils.java b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/jsf/impl/test/scope/view/util/ArchiveUtils.java
index de63825..6f654ee 100644
--- a/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/jsf/impl/test/scope/view/util/ArchiveUtils.java
+++ b/deltaspike/modules/jsf/impl/src/test/java/org/apache/deltaspike/jsf/impl/test/scope/view/util/ArchiveUtils.java
@@ -18,7 +18,14 @@
  */
 package org.apache.deltaspike.jsf.impl.test.scope.view.util;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.deltaspike.test.category.WebProfileCategory;
 import org.apache.deltaspike.test.utils.ShrinkWrapArchiveUtil;
+import org.jboss.arquillian.ajocado.framework.GrapheneSelenium;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
 import org.jboss.shrinkwrap.api.asset.Asset;
 import org.jboss.shrinkwrap.api.asset.StringAsset;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
@@ -39,10 +46,19 @@ public class ArchiveUtils
 
         excludedFiles = new String[]{"META-INF.apache-deltaspike.properties"};
 
+        // we also need quite some internal Arquillian classes on the client side
+        JavaArchive grapheneJar = ShrinkWrap
+                .create(JavaArchive.class, "graphene.jar")
+                .addPackage(GrapheneSelenium.class.getPackage())
+                .addPackage(WebProfileCategory.class.getPackage());
+
+        JavaArchive[] coreArchives = ShrinkWrapArchiveUtil.getArchives(null,
+                 "META-INF/beans.xml",
+                 new String[]{"org.apache.deltaspike.core", "org.apache.deltaspike.jsf"}, excludedFiles);
 
-        return ShrinkWrapArchiveUtil.getArchives(null,
-                "META-INF/beans.xml",
-                new String[]{"org.apache.deltaspike.core", "org.apache.deltaspike.jsf"}, excludedFiles);
+        List<JavaArchive> archives = new ArrayList<JavaArchive>(Arrays.asList(coreArchives));
+        archives.add(grapheneJar);
+        return archives.toArray(new JavaArchive[archives.size()]);
     }
 
     public static Asset getBeansXml()