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@2769 1c488680-804c-0410-94cd-c6b725194a0e
- Loading branch information
Showing
9 changed files
with
106 additions
and
1 deletion.
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
6 changes: 6 additions & 0 deletions
6
tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Bar.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,6 @@ | ||
package org.jboss.webbeans.test.unit.lookup; | ||
|
||
public class Bar | ||
{ | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Baz.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,6 @@ | ||
package org.jboss.webbeans.test.unit.lookup; | ||
|
||
public class Baz | ||
{ | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Foo.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,11 @@ | ||
package org.jboss.webbeans.test.unit.lookup; | ||
|
||
public class Foo extends FooBase<Bar> | ||
{ | ||
|
||
public String getName() | ||
{ | ||
return "foo"; | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
tests/src/test/java/org/jboss/webbeans/test/unit/lookup/FooBase.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,11 @@ | ||
package org.jboss.webbeans.test.unit.lookup; | ||
|
||
public class FooBase<T> | ||
{ | ||
|
||
public String getName() | ||
{ | ||
return "foobase"; | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
tests/src/test/java/org/jboss/webbeans/test/unit/lookup/FooProducer.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,14 @@ | ||
package org.jboss.webbeans.test.unit.lookup; | ||
|
||
import javax.enterprise.inject.Produces; | ||
|
||
public class FooProducer | ||
{ | ||
|
||
@Produces @Special | ||
public FooBase<Baz> produce() | ||
{ | ||
return new FooBase<Baz>(); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
tests/src/test/java/org/jboss/webbeans/test/unit/lookup/LookupFoo.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,22 @@ | ||
package org.jboss.webbeans.test.unit.lookup; | ||
|
||
import javax.enterprise.inject.Current; | ||
|
||
public class LookupFoo | ||
{ | ||
|
||
@Current Foo foo; | ||
|
||
@Special FooBase<Baz> foobaz; | ||
|
||
public Foo getFoo() | ||
{ | ||
return foo; | ||
} | ||
|
||
public FooBase<Baz> getFoobaz() | ||
{ | ||
return foobaz; | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Special.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,16 @@ | ||
package org.jboss.webbeans.test.unit.lookup; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
import javax.enterprise.inject.BindingType; | ||
|
||
@BindingType | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE}) | ||
public @interface Special | ||
{ | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Wbri256Test.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,19 @@ | ||
package org.jboss.webbeans.test.unit.lookup; | ||
|
||
import org.jboss.testharness.impl.packaging.Artifact; | ||
import org.jboss.webbeans.test.AbstractWebBeansTest; | ||
import org.testng.annotations.Test; | ||
|
||
@Artifact | ||
public class Wbri256Test extends AbstractWebBeansTest | ||
{ | ||
|
||
@Test | ||
public void testParameterizedInjection() | ||
{ | ||
LookupFoo lookupFoo = getCurrentManager().getInstanceByType(LookupFoo.class); | ||
assert lookupFoo.getFoo().getName().equals("foo"); | ||
assert lookupFoo.getFoobaz().getName().equals("foobase"); | ||
} | ||
|
||
} |