Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@1995 1c488680-804c-0410-94cd-c6b725194a0e
- Loading branch information
Showing
4 changed files
with
85 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/IntInjection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.jboss.webbeans.test.unit.implementation.producer; | ||
|
||
import javax.inject.Initializer; | ||
|
||
public class IntInjection | ||
{ | ||
|
||
int value; | ||
|
||
@Initializer public IntInjection(Integer integer) | ||
{ | ||
this.value = integer; | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/ManagerProducer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.jboss.webbeans.test.unit.implementation.producer; | ||
|
||
import javax.inject.Current; | ||
import javax.inject.Produces; | ||
import javax.inject.manager.InjectionPoint; | ||
import javax.inject.manager.Manager; | ||
|
||
class ManagerProducer | ||
{ | ||
|
||
@Current Manager manager; | ||
|
||
private static boolean injectionPointInjected; | ||
|
||
public static boolean isInjectionPointInjected() | ||
{ | ||
return injectionPointInjected; | ||
} | ||
|
||
public static void setInjectionPointInjected(boolean injectionPointInjected) | ||
{ | ||
ManagerProducer.injectionPointInjected = injectionPointInjected; | ||
} | ||
|
||
@Produces | ||
Integer create(InjectionPoint point) | ||
{ | ||
injectionPointInjected = point != null; | ||
return 10; | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
...c/test/java/org/jboss/webbeans/test/unit/implementation/producer/ManagerProducerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.jboss.webbeans.test.unit.implementation.producer; | ||
|
||
import org.jboss.testharness.impl.packaging.Artifact; | ||
import org.jboss.webbeans.test.unit.AbstractWebBeansTest; | ||
import org.testng.annotations.Test; | ||
|
||
@Artifact | ||
public class ManagerProducerTest extends AbstractWebBeansTest | ||
{ | ||
@Test(description="WBRI-183") | ||
public void testInjectManagerProducer() | ||
{ | ||
ManagerProducer.setInjectionPointInjected(false); | ||
manager.getInstanceByType(IntInjection.class); | ||
assert ManagerProducer.isInjectionPointInjected(); | ||
} | ||
|
||
} |