You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by rm...@apache.org on 2014/03/08 19:04:15 UTC

git commit: DELTASPIKE-537 using an arquillian archive appender to enrich apps with test utilities when needed instead of doing it manually and breaking app scanning

Repository: deltaspike
Updated Branches:
  refs/heads/master c015a6c2e -> a740dc595


DELTASPIKE-537 using an arquillian archive appender to enrich apps with test utilities when needed instead of doing it manually and breaking app scanning


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

Branch: refs/heads/master
Commit: a740dc59564cb9faf9e0100eb37277fdc8e2b4bd
Parents: c015a6c
Author: Romain Manni-Bucau <rm...@gmail.com>
Authored: Sat Mar 8 18:57:47 2014 +0100
Committer: Romain Manni-Bucau <rm...@gmail.com>
Committed: Sat Mar 8 18:57:47 2014 +0100

----------------------------------------------------------------------
 deltaspike/test-utils/pom.xml                   |  5 +++
 .../DeltaspikeServerUtilAppender.java           | 39 ++++++++++++++++++++
 .../arquillian/DeltaspikeTestUtilExtension.java | 31 ++++++++++++++++
 .../src/main/resources/META-INF/beans.xml       | 23 ------------
 ....jboss.arquillian.core.spi.LoadableExtension |  1 +
 5 files changed, 76 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/a740dc59/deltaspike/test-utils/pom.xml
----------------------------------------------------------------------
diff --git a/deltaspike/test-utils/pom.xml b/deltaspike/test-utils/pom.xml
index a28e8fe..bb74932 100644
--- a/deltaspike/test-utils/pom.xml
+++ b/deltaspike/test-utils/pom.xml
@@ -42,6 +42,11 @@
             <artifactId>shrinkwrap-api</artifactId>
             <version>${shrinkwrap.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.jboss.arquillian.container</groupId>
+            <artifactId>arquillian-container-test-spi</artifactId>
+            <version>${arquillian.version}</version>
+        </dependency>
     </dependencies>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/a740dc59/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/arquillian/DeltaspikeServerUtilAppender.java
----------------------------------------------------------------------
diff --git a/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/arquillian/DeltaspikeServerUtilAppender.java b/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/arquillian/DeltaspikeServerUtilAppender.java
new file mode 100644
index 0000000..52d79a8
--- /dev/null
+++ b/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/arquillian/DeltaspikeServerUtilAppender.java
@@ -0,0 +1,39 @@
+/*
+ * 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.test.arquillian;
+
+import org.apache.deltaspike.test.category.DeltaSpikeTest;
+import org.apache.deltaspike.test.utils.Serializer;
+import org.jboss.arquillian.container.test.spi.client.deployment.CachedAuxilliaryArchiveAppender;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+
+public class DeltaspikeServerUtilAppender extends CachedAuxilliaryArchiveAppender
+{
+    @Override
+    protected Archive<?> buildArchive()
+    {
+        return ShrinkWrap.create(JavaArchive.class, "test-utils.jar")
+                .addPackage(Serializer.class.getPackage())
+                .addPackage(DeltaSpikeTest.class.getPackage())
+                .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/a740dc59/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/arquillian/DeltaspikeTestUtilExtension.java
----------------------------------------------------------------------
diff --git a/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/arquillian/DeltaspikeTestUtilExtension.java b/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/arquillian/DeltaspikeTestUtilExtension.java
new file mode 100644
index 0000000..2b5bbae
--- /dev/null
+++ b/deltaspike/test-utils/src/main/java/org/apache/deltaspike/test/arquillian/DeltaspikeTestUtilExtension.java
@@ -0,0 +1,31 @@
+/*
+ * 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.test.arquillian;
+
+import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveAppender;
+import org.jboss.arquillian.core.spi.LoadableExtension;
+
+public class DeltaspikeTestUtilExtension implements LoadableExtension
+{
+    @Override
+    public void register(final ExtensionBuilder extensionBuilder)
+    {
+        extensionBuilder.service(AuxiliaryArchiveAppender.class, DeltaspikeServerUtilAppender.class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/a740dc59/deltaspike/test-utils/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/deltaspike/test-utils/src/main/resources/META-INF/beans.xml b/deltaspike/test-utils/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 4070730..0000000
--- a/deltaspike/test-utils/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?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.
--->
-<beans xmlns="http://java.sun.com/xml/ns/javaee"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
-</beans>

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/a740dc59/deltaspike/test-utils/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
----------------------------------------------------------------------
diff --git a/deltaspike/test-utils/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/deltaspike/test-utils/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
new file mode 100644
index 0000000..b1c0bc0
--- /dev/null
+++ b/deltaspike/test-utils/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
@@ -0,0 +1 @@
+org.apache.deltaspike.test.arquillian.DeltaspikeTestUtilExtension