You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by ma...@apache.org on 2017/11/30 09:36:14 UTC

deltaspike git commit: DELTASPIKE-1304 CdiTestRunner will not use flat deployment for Weld.

Repository: deltaspike
Updated Branches:
  refs/heads/master 126362e4f -> 390d270cc


DELTASPIKE-1304 CdiTestRunner will not use flat deployment for Weld.


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

Branch: refs/heads/master
Commit: 390d270cca6b300ab3f617ba4e61a69029952227
Parents: 126362e
Author: Matej Novotny <ma...@apache.org>
Authored: Thu Nov 30 10:33:52 2017 +0100
Committer: Matej Novotny <ma...@apache.org>
Committed: Thu Nov 30 10:33:52 2017 +0100

----------------------------------------------------------------------
 .../deltaspike/testcontrol/api/junit/CdiTestRunner.java       | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/390d270c/deltaspike/modules/test-control/api/src/main/java/org/apache/deltaspike/testcontrol/api/junit/CdiTestRunner.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/test-control/api/src/main/java/org/apache/deltaspike/testcontrol/api/junit/CdiTestRunner.java b/deltaspike/modules/test-control/api/src/main/java/org/apache/deltaspike/testcontrol/api/junit/CdiTestRunner.java
index fd17416..e05b871 100644
--- a/deltaspike/modules/test-control/api/src/main/java/org/apache/deltaspike/testcontrol/api/junit/CdiTestRunner.java
+++ b/deltaspike/modules/test-control/api/src/main/java/org/apache/deltaspike/testcontrol/api/junit/CdiTestRunner.java
@@ -460,6 +460,13 @@ public class CdiTestRunner extends BlockJUnit4ClassRunner
             {
                 if (!CdiTestSuiteRunner.isContainerStarted())
                 {
+                    // We are setting this system property to make the deployment for Weld "flat"
+                    // This (amongst other things) means that alternatives enabled via beans.xml will be 
+                    // enabled globally
+                    // Beginning with Weld 2.x you could use Weld.property(), but here we depend on Weld 1.x API
+                    // Note that Weld 1 was "flat" anyway, so this property only affects newer versions of Weld
+                    System.setProperty("org.jboss.weld.se.archive.isolation", "false");
+
                     container.boot(CdiTestSuiteRunner.getTestContainerConfig());
                     setContainerStarted();