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@2133 1c488680-804c-0410-94cd-c6b725194a0e
- Loading branch information
Showing
12 changed files
with
210 additions
and
86 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
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
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
43 changes: 43 additions & 0 deletions
43
tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/ordering/BootstrapTest.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,43 @@ | ||
package org.jboss.webbeans.test.unit.bootstrap.ordering; | ||
|
||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import javax.inject.manager.Bean; | ||
|
||
import org.jboss.testharness.impl.packaging.Artifact; | ||
import org.jboss.testharness.impl.packaging.Packaging; | ||
import org.jboss.testharness.impl.packaging.PackagingType; | ||
import org.jboss.webbeans.bean.ProducerMethodBean; | ||
import org.jboss.webbeans.bean.RIBean; | ||
import org.jboss.webbeans.bean.SimpleBean; | ||
import org.jboss.webbeans.test.unit.AbstractWebBeansTest; | ||
import org.testng.annotations.Test; | ||
|
||
@Artifact | ||
@Packaging(PackagingType.EAR) | ||
public class BootstrapTest extends AbstractWebBeansTest | ||
{ | ||
|
||
@Test(groups="bootstrap") | ||
public void testProducerMethodBean() | ||
{ | ||
//deployBeans(TarantulaProducer.class); | ||
List<Bean<?>> beans = manager.getBeans(); | ||
Map<Class<?>, Bean<?>> classes = new HashMap<Class<?>, Bean<?>>(); | ||
for (Bean<?> bean : beans) | ||
{ | ||
if (bean instanceof RIBean) | ||
{ | ||
classes.put(((RIBean<?>) bean).getType(), bean); | ||
} | ||
} | ||
assert classes.containsKey(TarantulaProducer.class); | ||
assert classes.containsKey(Tarantula.class); | ||
|
||
assert classes.get(TarantulaProducer.class) instanceof SimpleBean; | ||
assert classes.get(Tarantula.class) instanceof ProducerMethodBean; | ||
} | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/ordering/DeadlyAnimal.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; | ||
|
||
interface DeadlyAnimal | ||
{ | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/ordering/DeadlySpider.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; | ||
|
||
interface DeadlySpider extends DeadlyAnimal | ||
{ | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/ordering/DefangedTarantula.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 DefangedTarantula extends Tarantula | ||
{ | ||
|
||
} |
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/bootstrap/ordering/Spider.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 Spider implements Animal | ||
{ | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/ordering/Tame.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 Tame | ||
{ | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/ordering/Tarantula.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 Tarantula extends Spider implements DeadlySpider | ||
{ | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/ordering/TarantulaProducer.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,13 @@ | ||
package org.jboss.webbeans.test.unit.bootstrap.ordering; | ||
|
||
import javax.inject.Produces; | ||
|
||
public class TarantulaProducer | ||
{ | ||
|
||
@Produces @Tame public Tarantula produceTameTarantula() | ||
{ | ||
return new DefangedTarantula(); | ||
} | ||
|
||
} |