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 2013/08/16 11:25:30 UTC

git commit: DELTASPIKE-402 use BeanProvider instead Instance<> to work around old OWB bug

Updated Branches:
  refs/heads/master ede53193d -> ff62a1830


DELTASPIKE-402 use BeanProvider instead Instance<> to work around old OWB bug


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

Branch: refs/heads/master
Commit: ff62a1830a42026a2e6df146e6d91dd05f57af54
Parents: ede5319
Author: Mark Struberg <st...@apache.org>
Authored: Fri Aug 16 11:23:47 2013 +0200
Committer: Mark Struberg <st...@apache.org>
Committed: Fri Aug 16 11:23:47 2013 +0200

----------------------------------------------------------------------
 ...tialBeanAsAbstractClassWithInterceptorTest.java | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/ff62a183/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc003/PartialBeanAsAbstractClassWithInterceptorTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc003/PartialBeanAsAbstractClassWithInterceptorTest.java b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc003/PartialBeanAsAbstractClassWithInterceptorTest.java
index eca1799..e464257 100644
--- a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc003/PartialBeanAsAbstractClassWithInterceptorTest.java
+++ b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc003/PartialBeanAsAbstractClassWithInterceptorTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.deltaspike.test.core.api.partialbean.uc003;
 
+import org.apache.deltaspike.core.api.provider.BeanProvider;
 import org.apache.deltaspike.test.category.SeCategory;
 import org.apache.deltaspike.test.core.api.partialbean.shared.CustomInterceptorImpl;
 import org.apache.deltaspike.test.core.api.partialbean.shared.TestPartialBeanBinding;
@@ -37,8 +38,6 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 
-import javax.enterprise.inject.Instance;
-import javax.inject.Inject;
 
 @RunWith(Arquillian.class)
 @Category(SeCategory.class) //TODO use different category (only new versions of weld)
@@ -46,11 +45,6 @@ public class PartialBeanAsAbstractClassWithInterceptorTest
 {
     public static final String CONTAINER_WELD_2_0_0 = "weld-2\\.0\\.0\\..*";
 
-    // we only inject an Instance as the proxy creation for the Bean itself
-    // would trigger a nasty bug in Weld-2.0.0
-    @Inject
-    private Instance<PartialBean> partialBean;
-
     @Deployment
     public static WebArchive war()
     {
@@ -85,11 +79,16 @@ public class PartialBeanAsAbstractClassWithInterceptorTest
         // this test is known to not work under weld-2.0.0.Final and weld-2.0.0.SP1
         Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0));
 
-        String result = this.partialBean.get().getResult();
+        // we only inject an Instance as the proxy creation for the Bean itself
+        // would trigger a nasty bug in Weld-2.0.0
+        PartialBean partialBean = BeanProvider.getContextualReference(PartialBean.class);
+        Assert.assertNotNull(partialBean);
+
+        String result = partialBean.getResult();
 
         Assert.assertEquals("partial-test-true", result);
 
-        result = this.partialBean.get().getManualResult();
+        result = partialBean.getManualResult();
 
         //"manual-test-true" would be the goal, but it isn't supported (for now)
         Assert.assertEquals("manual-test-false", result);