deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rafab...@apache.org
Subject deltaspike git commit: DELTASPIKE-1141 modify FutureableTest and LockedTest to contain beans.xml with relevant interceptors.
Date Wed, 04 May 2016 19:34:31 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master a05d9baaa -> d2558b7dd


DELTASPIKE-1141 modify FutureableTest and LockedTest to contain beans.xml with relevant interceptors.


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

Branch: refs/heads/master
Commit: d2558b7ddf682e41bc829d69bbdafa4927c23887
Parents: a05d9ba
Author: Matej Novotny <manovotn@redhat.com>
Authored: Wed May 4 15:07:00 2016 +0200
Committer: Matej Novotny <manovotn@redhat.com>
Committed: Wed May 4 15:07:00 2016 +0200

----------------------------------------------------------------------
 deltaspike/core/impl/pom.xml                         |  7 +++++++
 .../test/core/impl/future/FutureableTest.java        | 11 ++++++++++-
 .../deltaspike/test/core/impl/lock/LockedTest.java   | 15 ++++++++++++---
 3 files changed, 29 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/d2558b7d/deltaspike/core/impl/pom.xml
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/pom.xml b/deltaspike/core/impl/pom.xml
index 67d3831..e3fefaa 100644
--- a/deltaspike/core/impl/pom.xml
+++ b/deltaspike/core/impl/pom.xml
@@ -67,6 +67,13 @@
             <artifactId>geronimo-ejb_3.1_spec</artifactId>
             <scope>test</scope>
         </dependency>
+        
+        <!-- Allows to create beans.xml files with certain content -->        
+        <dependency>
+            <groupId>org.jboss.shrinkwrap.descriptors</groupId>
+            <artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 </project>

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/d2558b7d/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/future/FutureableTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/future/FutureableTest.java
b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/future/FutureableTest.java
index 53dd1b3..5dec0a7 100644
--- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/future/FutureableTest.java
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/future/FutureableTest.java
@@ -29,20 +29,29 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.inject.Inject;
+
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
+import org.apache.deltaspike.core.impl.future.FutureableInterceptor;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.descriptor.api.Descriptors;
+import org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor;
+
 @RunWith(Arquillian.class)
 public class FutureableTest {
     @Deployment
     public static WebArchive deploy()
     {
+        // create beans.xml with added interceptor
+        BeansDescriptor beans = Descriptors.create(BeansDescriptor.class);
+        beans.getOrCreateInterceptors().clazz(FutureableInterceptor.class.getName());
         JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "FutureableTest.jar")
                 .addPackage(Service.class.getPackage().getName())
-                .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
+                .addAsManifestResource(new StringAsset(beans.exportAsString()), "beans.xml");
 
         return ShrinkWrap.create(WebArchive.class, "FutureableTest.war")
                 .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive())

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/d2558b7d/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/lock/LockedTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/lock/LockedTest.java
b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/lock/LockedTest.java
index c0f43ce..a869438 100644
--- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/lock/LockedTest.java
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/lock/LockedTest.java
@@ -29,6 +29,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.inject.Inject;
+
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -37,16 +38,24 @@ import java.util.concurrent.atomic.AtomicReference;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
+import org.apache.deltaspike.core.impl.lock.LockedInterceptor;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.descriptor.api.Descriptors;
+import org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor;
+
 @RunWith(Arquillian.class)
 public class LockedTest {
     @Deployment
     public static WebArchive deploy()
     {
-        JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "FutureableTest.jar")
+        // create beans.xml with added interceptor
+        BeansDescriptor beans = Descriptors.create(BeansDescriptor.class);
+        beans.getOrCreateInterceptors().clazz(LockedInterceptor.class.getName());
+        JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "LockedTest.jar")
                 .addPackage(Service.class.getPackage().getName())
-                .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
+                .addAsManifestResource(new StringAsset(beans.exportAsString()), "beans.xml");
 
-        return ShrinkWrap.create(WebArchive.class, "FutureableTest.war")
+        return ShrinkWrap.create(WebArchive.class, "LockedTest.war")
                 .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive())
                 .addAsLibraries(testJar)
                 .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");


Mime
View raw message