Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ordering for specializing producer methods
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@2142 1c488680-804c-0410-94cd-c6b725194a0e
- Loading branch information
Showing
9 changed files
with
161 additions
and
14 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
20 changes: 20 additions & 0 deletions
20
.../src/test/java/org/jboss/webbeans/test/unit/bootstrap/ordering/AnotherDeploymentType.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,20 @@ | ||
package org.jboss.webbeans.test.unit.bootstrap.ordering; | ||
|
||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.ElementType.TYPE; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import javax.inject.DeploymentType; | ||
|
||
@Target( { TYPE, METHOD }) | ||
@Retention(RUNTIME) | ||
@Documented | ||
@DeploymentType | ||
@interface AnotherDeploymentType | ||
{ | ||
|
||
} |
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
22 changes: 22 additions & 0 deletions
22
tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/ordering/Expensive.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.bootstrap.ordering; | ||
|
||
import static java.lang.annotation.ElementType.FIELD; | ||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.ElementType.PARAMETER; | ||
import static java.lang.annotation.ElementType.TYPE; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import javax.inject.BindingType; | ||
|
||
@Target( { TYPE, METHOD, PARAMETER, FIELD }) | ||
@Retention(RUNTIME) | ||
@Documented | ||
@BindingType | ||
@interface Expensive | ||
{ | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/ordering/JewelryShop.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.bootstrap.ordering; | ||
|
||
import javax.inject.Produces; | ||
import javax.inject.Specializes; | ||
|
||
class JewelryShop extends Shop | ||
{ | ||
|
||
@Override @Produces @Specializes @Sparkly @AnotherDeploymentType | ||
public Product getExpensiveGift() | ||
{ | ||
return new Necklace(); | ||
} | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/ordering/Necklace.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.bootstrap.ordering; | ||
|
||
class Necklace extends Product | ||
{ | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/ordering/Product.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.bootstrap.ordering; | ||
|
||
class Product | ||
{ | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/ordering/Shop.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.bootstrap.ordering; | ||
|
||
import javax.annotation.Named; | ||
import javax.inject.Produces; | ||
|
||
|
||
class Shop | ||
{ | ||
|
||
@Produces @Expensive @Named | ||
public Product getExpensiveGift() | ||
{ | ||
return new Product(); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/ordering/Sparkly.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.bootstrap.ordering; | ||
|
||
import static java.lang.annotation.ElementType.FIELD; | ||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.ElementType.PARAMETER; | ||
import static java.lang.annotation.ElementType.TYPE; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import javax.inject.BindingType; | ||
|
||
@Target( { TYPE, METHOD, PARAMETER, FIELD }) | ||
@Retention(RUNTIME) | ||
@Documented | ||
@BindingType | ||
@interface Sparkly | ||
{ | ||
|
||
} |