Author: pete.muir(a)jboss.org
Date: 2009-03-16 18:47:34 -0400 (Mon, 16 Mar 2009)
New Revision: 2057
Added:
ri/trunk/tests/
ri/trunk/tests/pom.xml
ri/trunk/tests/src/
ri/trunk/tests/src/main/
ri/trunk/tests/src/main/java/
ri/trunk/tests/src/main/resources/
ri/trunk/tests/src/test/
ri/trunk/tests/src/test/debug-resources/
ri/trunk/tests/src/test/debug-resources/META-INF/
ri/trunk/tests/src/test/debug-resources/META-INF/web-beans-tck.properties
ri/trunk/tests/src/test/java/
ri/trunk/tests/src/test/java/org/
ri/trunk/tests/src/test/java/org/jboss/
ri/trunk/tests/src/test/java/org/jboss/webbeans/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/ExampleTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Game.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Generator.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Mock.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockExampleTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockSentenceTranslator.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Random.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/SentenceParser.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/SentenceTranslator.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/TextTranslator.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Translator.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Animal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/AnotherDeploymentType.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Cow.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Tuna.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Animal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlyAnimal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlySpider.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DefangedTarantula.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Hound.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/HoundLocal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Salmon.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ScottishFish.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/SeaBass.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Sole.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Spider.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tame.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tarantula.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/TarantulaProducer.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tuna.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Whitefish.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Elephant.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/ElephantLocal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Hound.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/HoundLocal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Panther.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/PantherLocal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Synchronous.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Tame.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Tiger.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/TigerLocal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Animal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Elephant.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/ElephantLocal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Hound.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/HoundLocal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Panther.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/PantherLocal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Salmon.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/ScottishFish.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/SeaBass.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Sole.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Synchronous.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tame.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tiger.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/TigerLocal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tuna.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Whitefish.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Animal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Salmon.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/ScottishFish.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/SeaBass.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Sole.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Tuna.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Whitefish.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/Hound.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/HoundLocal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/Tame.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Animal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/DeadlyAnimal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/DeadlySpider.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/DefangedTarantula.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Spider.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Tame.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Tarantula.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/TarantulaProducer.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/BootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/Tuna.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ContextTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/PassivatingContextTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/Animal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalOrderStereotype.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalStereotype.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/Order.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/RequestScopedAnimalStereotype.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/StereotypesTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/ejb/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBean.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBeanLocal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Animal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Antelope.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Order.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Hat.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/HatRemote.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/Foo.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/FooLocal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockInvocationContext.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockSessionBeanInterceptor.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/SessionBeanInterceptorTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/ExceptionHandlingTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/FooException.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/Large.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/Lorry_Broken.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/Ship.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/ShipProducer_Broken.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/WrappedSimpleBean.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedListInjection.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducer.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/IntInjection.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/ManagerProducer.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/ManagerProducerTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/Foo.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/Mouse.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/MouseLocal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Air.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Bar.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Bird.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Car.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentLooping.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentLoopingProducer.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentSelfConsumingDependentProducer.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentSelfConsumingNormalProducer.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Farm.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Fish.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Foo.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Food.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/House.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalLooping.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalLoopingProducer.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalSelfConsumingDependentProducer.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalSelfConsumingNormalProducer.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Petrol.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Pig.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Planet.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingDependent.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingDependent1.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingNormal.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingNormal1.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Space.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Violation.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Water.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/AnotherDeploymentType.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/BeansXmlParserTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/Order.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/AnotherDeploymentType.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java
ri/trunk/tests/src/test/resources/
ri/trunk/tests/src/test/resources/META-INF/
ri/trunk/tests/src/test/resources/META-INF/web-beans-tck.properties
ri/trunk/tests/src/test/resources/jndi.properties
ri/trunk/tests/src/test/resources/org/
ri/trunk/tests/src/test/resources/org/jboss/
ri/trunk/tests/src/test/resources/org/jboss/testharness/
ri/trunk/tests/src/test/resources/org/jboss/testharness/impl/
ri/trunk/tests/src/test/resources/org/jboss/testharness/impl/packaging/
ri/trunk/tests/src/test/resources/org/jboss/testharness/impl/packaging/ear/
ri/trunk/tests/src/test/resources/org/jboss/testharness/impl/packaging/ear/ejb-jar.xml
ri/trunk/tests/src/test/resources/org/jboss/testharness/impl/packaging/jsr299/
ri/trunk/tests/src/test/resources/org/jboss/testharness/impl/packaging/jsr299/default/
ri/trunk/tests/src/test/resources/org/jboss/testharness/impl/packaging/jsr299/default/beans.xml
ri/trunk/tests/src/test/resources/org/jboss/webbeans/
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/examples/
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/examples/beans.xml
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/bootstrap/
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/bootstrap/test-beans.xml
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/default-beans.xml
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/duplicate-deployments-beans.xml
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/parser/
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/parser/user-defined-beans.xml
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml
ri/trunk/tests/unit-tests.xml
Removed:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/examples/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Animal.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/AnotherDeploymentType.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/BootstrapTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Cow.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Tuna.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/context/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/definition/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/ejb/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBean.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBeanLocal.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Hat.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/HatRemote.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedListInjection.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducer.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/Foo.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/AnotherDeploymentType.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/BeansXmlParserTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/beans/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/parser/
ri/trunk/impl/src/test/resources/jndi.properties
ri/trunk/impl/src/test/resources/org/jboss/testharness/impl/packaging/ear/
ri/trunk/impl/src/test/resources/org/jboss/testharness/impl/packaging/jsr299/default/
ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/examples/
ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/bootstrap/
ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/default-beans.xml
ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/duplicate-deployments-beans.xml
ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/parser/
ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml
ri/trunk/impl/unit-tests.xml
Modified:
ri/trunk/pom.xml
Log:
move tests
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,117 +0,0 @@
-package org.jboss.webbeans.test.unit;
-
-import java.io.IOException;
-import java.lang.annotation.Annotation;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.inject.Production;
-import javax.inject.Standard;
-
-import org.jboss.testharness.AbstractTest;
-import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.context.DependentContext;
-import org.jboss.webbeans.util.EnumerationIterable;
-import org.testng.ITestContext;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.BeforeSuite;
-
-public abstract class AbstractWebBeansTest extends AbstractTest
-{
-
- protected abstract static class RunInDependentContext
- {
-
- protected void setup()
- {
- DependentContext.INSTANCE.setActive(true);
- }
-
- protected void cleanup()
- {
- DependentContext.INSTANCE.setActive(false);
- }
-
- public final void run() throws Exception
- {
- try
- {
- setup();
- execute();
- }
- finally
- {
- cleanup();
- }
- }
-
- protected abstract void execute() throws Exception;
-
- }
-
- protected static final int BUILT_IN_BEANS = 3;
-
- protected ManagerImpl manager;
-
- public static boolean visited = false;
-
- @Override
- @BeforeSuite
- public void beforeSuite(ITestContext context) throws Exception
- {
- if (!isInContainer())
- {
- getCurrentConfiguration().setStandaloneContainers(new
StandaloneContainersImpl());
-
getCurrentConfiguration().getExtraPackages().add(AbstractWebBeansTest.class.getPackage().getName());
- }
- super.beforeSuite(context);
- }
-
- @BeforeMethod
- public void before() throws Exception
- {
- this.manager = CurrentManager.rootManager();
- }
-
- @AfterMethod
- public void after() throws Exception
- {
- manager = null;
- }
-
-
- protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
- {
- return getDefaultDeploymentTypes();
- }
-
- @SuppressWarnings("unchecked")
- protected final List<Class<? extends Annotation>>
getDefaultDeploymentTypes()
- {
- return Arrays.asList(Standard.class, Production.class);
- }
-
- protected Iterable<URL> getResources(String name)
- {
- if (name.startsWith("/"))
- {
- name = name.substring(1);
- }
- else
- {
- name = getClass().getPackage().getName().replace(".", "/") +
"/" + name;
- }
- try
- {
- return new
EnumerationIterable<URL>(getClass().getClassLoader().getResources(name));
- }
- catch (IOException e)
- {
- throw new RuntimeException("Error loading resource from classloader" +
name, e);
- }
- }
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,78 +0,0 @@
-package org.jboss.webbeans.test.unit;
-
-import java.net.URL;
-
-import org.jboss.testharness.api.DeploymentException;
-import org.jboss.testharness.spi.StandaloneContainers;
-import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.mock.MockEELifecycle;
-import org.jboss.webbeans.mock.MockServletLifecycle;
-import org.jboss.webbeans.mock.MockWebBeanDiscovery;
-
-public class StandaloneContainersImpl implements StandaloneContainers
-{
-
- // TODO this is a hack ;-)
- public static Class<? extends MockServletLifecycle> lifecycleClass =
MockEELifecycle.class;
-
- private MockServletLifecycle lifecycle;
-
- public void deploy(Iterable<Class<?>> classes, Iterable<URL>
beansXml) throws DeploymentException
- {
- try
- {
- this.lifecycle = lifecycleClass.newInstance();
- }
- catch (InstantiationException e1)
- {
- throw new DeploymentException("Error instantiating lifeycle", e1);
- }
- catch (IllegalAccessException e1)
- {
- throw new DeploymentException("Error instantiating lifeycle", e1);
- }
- lifecycle.initialize();
- try
- {
- MockWebBeanDiscovery discovery = lifecycle.getWebBeanDiscovery();
- discovery.setWebBeanClasses(classes);
- if (beansXml != null)
- {
- discovery.setWebBeansXmlFiles(beansXml);
- }
- lifecycle.beginApplication();
- }
- catch (Exception e)
- {
- throw new DeploymentException("Error deploying beans", e);
- }
- lifecycle.beginSession();
- lifecycle.beginRequest();
- }
-
- public void deploy(Iterable<Class<?>> classes) throws DeploymentException
- {
- deploy(classes, null);
- }
-
- public void cleanup()
- {
- // Np-op
-
- }
-
- public void setup()
- {
- // No-op
- }
-
- public void undeploy()
- {
- lifecycle.endRequest();
- lifecycle.endSession();
- lifecycle.endApplication();
- CurrentManager.setRootManager(null);
- lifecycle = null;
- }
-
-}
Deleted: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Animal.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Animal.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Animal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.unit.bootstrap;
-
-interface Animal
-{
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/AnotherDeploymentType.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/AnotherDeploymentType.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/AnotherDeploymentType.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,20 +0,0 @@
-package org.jboss.webbeans.test.unit.bootstrap;
-
-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
-{
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/BootstrapTest.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/BootstrapTest.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/BootstrapTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,32 +0,0 @@
-package org.jboss.webbeans.test.unit.bootstrap;
-
-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.test.unit.AbstractWebBeansTest;
-import org.testng.annotations.Test;
-
-@Artifact
-(a)Packaging(PackagingType.EAR)
-public class BootstrapTest extends AbstractWebBeansTest
-{
-
- @Test(groups="bootstrap")
- public void testInitializedEvent()
- {
- assert InitializedObserver.observered;
- }
-
- @Test(groups="bootstrap")
- public void testRequestContextActiveDuringInitializtionEvent()
- {
- assert InitializedObserverWhichUsesRequestContext.name == new Tuna().getName();
- }
-
- @Test(groups={"bootstrap"})
- public void testApplicationContextActiveDuringInitializtionEvent()
- {
- assert Cow.mooed;
- }
-
-}
Deleted: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Cow.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Cow.java 2009-03-16
22:43:16 UTC (rev 2056)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Cow.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,16 +0,0 @@
-package org.jboss.webbeans.test.unit.bootstrap;
-
-import javax.context.ApplicationScoped;
-
-@ApplicationScoped
-class Cow implements Animal
-{
-
- public static boolean mooed = false;
-
- public void moo()
- {
- mooed = true;
- }
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,19 +0,0 @@
-package org.jboss.webbeans.test.unit.bootstrap;
-
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-import org.jboss.webbeans.mock.MockEELifecycle;
-import org.testng.annotations.Test;
-
-public class DiscoverFailsBootstrapTest
-{
-
- @Test(groups="bootstrap", expectedExceptions=IllegalStateException.class)
- public void testDiscoverFails()
- {
- MockEELifecycle lifecycle = new MockEELifecycle();
- lifecycle.getBootstrap().getServices().add(WebBeanDiscovery.class, null);
- lifecycle.initialize();
- lifecycle.beginApplication();
- }
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,17 +0,0 @@
-package org.jboss.webbeans.test.unit.bootstrap;
-
-import javax.event.Observes;
-import javax.inject.manager.Initialized;
-import javax.inject.manager.Manager;
-
-class InitializedObserver
-{
-
- public static boolean observered;
-
- public void observeInitialized(@Observes @Initialized Manager manager)
- {
- observered = true;
- }
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,18 +0,0 @@
-package org.jboss.webbeans.test.unit.bootstrap;
-
-import javax.event.Observes;
-import javax.inject.Current;
-import javax.inject.manager.Initialized;
-import javax.inject.manager.Manager;
-
-class InitializedObserverWhichUsesApplicationContext
-{
-
- @Current Cow cow;
-
- public void observeInitialized(@Observes @Initialized Manager manager)
- {
- cow.moo();
- }
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,20 +0,0 @@
-package org.jboss.webbeans.test.unit.bootstrap;
-
-import javax.event.Observes;
-import javax.inject.Current;
-import javax.inject.manager.Initialized;
-import javax.inject.manager.Manager;
-
-class InitializedObserverWhichUsesRequestContext
-{
-
- public static String name;
-
- @Current Tuna tuna;
-
- public void observeInitialized(@Observes @Initialized Manager manager)
- {
- name = tuna.getName();
- }
-
-}
Deleted: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Tuna.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Tuna.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Tuna.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,14 +0,0 @@
-package org.jboss.webbeans.test.unit.bootstrap;
-
-import javax.context.RequestScoped;
-
-@RequestScoped
-class Tuna
-{
-
- public String getName()
- {
- return "Ophir";
- }
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,30 +0,0 @@
-package org.jboss.webbeans.test.unit.bootstrap;
-
-import javax.inject.Production;
-import javax.inject.Standard;
-
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.Packaging;
-import org.jboss.testharness.impl.packaging.PackagingType;
-import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
-import org.jboss.webbeans.WebBean;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
-import org.testng.annotations.Test;
-
-@Artifact
-(a)Packaging(PackagingType.EAR)
-(a)BeansXml("test-beans.xml")
-public class XmlBootstrapTest extends AbstractWebBeansTest
-{
-
- @Test
- public void testDeploymentTypesLoadedFromBeansXml()
- {
- assert manager.getEnabledDeploymentTypes().size() == 4;
- assert manager.getEnabledDeploymentTypes().get(0).equals(Standard.class);
- assert manager.getEnabledDeploymentTypes().get(1).equals(WebBean.class);
- assert manager.getEnabledDeploymentTypes().get(2).equals(Production.class);
- assert
manager.getEnabledDeploymentTypes().get(3).equals(AnotherDeploymentType.class);
- }
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,80 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation;
-
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
-import javax.inject.New;
-
-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.EnterpriseBean;
-import org.jboss.webbeans.bean.NewEnterpriseBean;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.literal.NewLiteral;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
-import org.jboss.webbeans.util.Proxies.TypeInfo;
-import org.testng.annotations.Test;
-
-@Artifact
-(a)Packaging(PackagingType.EAR)
-public class NewEnterpriseBeanTest extends AbstractWebBeansTest
-{
-
- private static final New NEW_LITERAL = new NewLiteral();
-
- private EnterpriseBean<WrappedEnterpriseBeanLocal> wrappedEnterpriseBean;
- private NewEnterpriseBean<WrappedEnterpriseBeanLocal> newEnterpriseBean;
-
- public void initNewBean() {
-
- assert manager.resolveByType(WrappedEnterpriseBeanLocal.class).size() == 1;
- assert manager.resolveByType(WrappedEnterpriseBeanLocal.class).iterator().next()
instanceof EnterpriseBean;
- wrappedEnterpriseBean = (EnterpriseBean<WrappedEnterpriseBeanLocal>)
manager.resolveByType(WrappedEnterpriseBeanLocal.class).iterator().next();
-
- assert manager.resolveByType(WrappedEnterpriseBeanLocal.class, NEW_LITERAL).size()
== 1;
- assert manager.resolveByType(WrappedEnterpriseBeanLocal.class,
NEW_LITERAL).iterator().next() instanceof NewEnterpriseBean;
- newEnterpriseBean = (NewEnterpriseBean<WrappedEnterpriseBeanLocal>)
manager.resolveByType(WrappedEnterpriseBeanLocal.class, NEW_LITERAL).iterator().next();
-
- }
-
- @Test(groups = { "new", "broken" })
- public void testNewBeanHasImplementationClassOfInjectionPointType()
- {
- initNewBean();
- assert newEnterpriseBean.getType().equals(WrappedEnterpriseBeanLocal.class);
- }
-
- @Test(groups = { "new" })
- public void testNewBeanIsEnterpriseWebBeanIfParameterTypeIsEnterpriseWebBean()
- {
- initNewBean();
- assert wrappedEnterpriseBean.getType().equals(newEnterpriseBean.getType());
- assert manager.getEjbDescriptorCache().containsKey(newEnterpriseBean.getType());
- }
-
- @Test(groups = { "new" })
- public void testNewBeanHasSameInitializerMethodsAsWrappedBean()
- {
- initNewBean();
- assert
newEnterpriseBean.getInitializerMethods().equals(wrappedEnterpriseBean.getInitializerMethods());
- }
-
- @Test(groups = { "new" })
- public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
- {
- initNewBean();
- Set<? extends AnnotatedItem<?, ?>> wrappedBeanInjectionPoints =
wrappedEnterpriseBean.getInjectionPoints();
- Set<? extends AnnotatedItem<?, ?>> newBeanInjectionPoints =
newEnterpriseBean.getInjectionPoints();
- assert wrappedBeanInjectionPoints.equals(newBeanInjectionPoints);
- }
-
- @Test(groups = { "new" })
- public void testNewBeanHasNoDisposalMethods()
- {
- initNewBean();
- Class<?> type =
TypeInfo.ofTypes(newEnterpriseBean.getTypes()).getSuperClass();
- assert manager.resolveDisposalMethods(type,
newEnterpriseBean.getBindings().toArray(new Annotation[0])).isEmpty();
- }
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBean.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBean.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBean.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,16 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation;
-
-import javax.annotation.Named;
-import javax.context.SessionScoped;
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-
-@SessionScoped
-@Stateful
-@Named("John")
-class WrappedEnterpriseBean implements WrappedEnterpriseBeanLocal
-{
- @Remove
- public void bye() {
- }
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBeanLocal.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBeanLocal.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBeanLocal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,9 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation;
-
-import javax.ejb.Local;
-
-@Local
-public interface WrappedEnterpriseBeanLocal
-{
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,24 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation.enterprise;
-
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.IntegrationTest;
-import org.jboss.testharness.impl.packaging.Packaging;
-import org.jboss.testharness.impl.packaging.PackagingType;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
-import org.testng.annotations.Test;
-
-@Artifact
-@IntegrationTest
-(a)Packaging(PackagingType.EAR)
-public class EnterpriseBeanTest extends AbstractWebBeansTest
-{
-
- @Test(description="WBRI-179")
- public void testSFSBWithOnlyRemoteInterfacesDeploys()
- {
-
- }
-
-
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Hat.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Hat.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Hat.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,9 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation.enterprise;
-
-import javax.ejb.Stateful;
-
-@Stateful
-public class Hat implements HatRemote
-{
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/HatRemote.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/HatRemote.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/HatRemote.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,9 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation.enterprise;
-
-import javax.ejb.Remote;
-
-@Remote
-public interface HatRemote
-{
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedListInjection.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedListInjection.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedListInjection.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,45 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation.producer.field;
-
-import java.util.List;
-
-import javax.inject.Current;
-import javax.inject.Initializer;
-
-public class ParameterizedListInjection
-{
-
- private List<String> value;
-
- @Current
- private List<String> fieldInjection;
-
- private List<String> setterInjection;
-
- @Initializer
- public void init(List<String> setterInjection)
- {
- this.setterInjection = setterInjection;
- }
-
- @Initializer
- public ParameterizedListInjection(List<String> com)
- {
- this.value = com;
- }
-
- public java.util.List<String> getValue()
- {
- return value;
- }
-
- public List<String> getFieldInjection()
- {
- return fieldInjection;
- }
-
- public List<String> getSetterInjection()
- {
- return setterInjection;
- }
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducer.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducer.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducer.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,17 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation.producer.field;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.inject.Produces;
-
-public class ParameterizedProducer
-{
-
- @Produces
- public List<String> create()
- {
- return Arrays.asList("aaa", "bbb");
- }
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,26 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation.producer.field;
-
-import java.util.List;
-
-import javax.inject.TypeLiteral;
-
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
-import org.testng.annotations.Test;
-
-@Artifact
-public class ParameterizedProducerTest extends AbstractWebBeansTest
-{
-
- @Test
- public void testInjectManagerProducer()
- {
- assert manager.getInstanceByType(new
TypeLiteral<List<String>>(){}).size() == 2;
-
- ParameterizedListInjection item =
manager.getInstanceByType(ParameterizedListInjection.class);
- assert item.getFieldInjection().size() == 2;
- assert item.getValue().size() == 2;
- assert item.getSetterInjection().size() == 2;
-
- }
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/Foo.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/Foo.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/Foo.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,18 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation.proxy;
-
-import java.io.Serializable;
-
-import javax.annotation.Named;
-import javax.context.RequestScoped;
-
-@Named
-@RequestScoped
-class Foo implements Serializable
-{
-
- public String getMsg()
- {
- return "Hi";
- }
-
-}
\ No newline at end of file
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,17 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation.proxy;
-
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
-import org.testng.annotations.Test;
-
-@Artifact
-public class ProxyTest extends AbstractWebBeansTest
-{
-
- @Test(description="WBRI-122")
- public void testImplementationClassImplementsSerializable()
- {
- manager.getInstanceByName("foo");
- }
-
-}
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/AnotherDeploymentType.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/AnotherDeploymentType.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/AnotherDeploymentType.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,20 +0,0 @@
-package org.jboss.webbeans.test.unit.xml;
-
-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
-{
-
-}
\ No newline at end of file
Deleted:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/BeansXmlParserTest.java
===================================================================
---
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/BeansXmlParserTest.java 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/BeansXmlParserTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,73 +0,0 @@
-package org.jboss.webbeans.test.unit.xml;
-
-import java.net.URL;
-import java.util.Iterator;
-
-import javax.inject.DeploymentException;
-import javax.inject.Production;
-import javax.inject.Standard;
-
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.Resource;
-import org.jboss.testharness.impl.packaging.Resources;
-import org.jboss.webbeans.bootstrap.BeansXmlParser;
-import org.jboss.webbeans.mock.MockResourceLoader;
-import org.jboss.webbeans.resources.spi.ResourceLoader;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
-import org.testng.annotations.Test;
-
-@Artifact
-@Resources({
-
@Resource(destination="WEB-INF/classes/org/jboss/webbeans/test/unit/xml/default-beans.xml",
source="/org/jboss/webbeans/test/unit/xml/default-beans.xml"),
-
@Resource(destination="WEB-INF/classes/org/jboss/webbeans/test/unit/xml/duplicate-deployments-beans.xml",
source="/org/jboss/webbeans/test/unit/xml/duplicate-deployments-beans.xml"),
-
@Resource(destination="WEB-INF/classes/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml",
source="/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml")
-})
-public class BeansXmlParserTest extends AbstractWebBeansTest
-{
-
- private static final ResourceLoader RESOURCE_LOADER = new MockResourceLoader();
-
- // Quick unit tests for the parser
- @Test
- public void testDefaultDeploymentTypes()
- {
- Iterable<URL> urls = getResources("default-beans.xml");
- int i = 0;
- Iterator<URL> it = urls.iterator();
- while (it.hasNext())
- {
- i++;
- it.next();
- }
- assert i == 1;
- BeansXmlParser parser = new BeansXmlParser(RESOURCE_LOADER, urls);
- parser.parse();
- assert parser.getEnabledDeploymentTypes().size() == 2;
- assert parser.getEnabledDeploymentTypes().get(0).equals(Standard.class);
- assert parser.getEnabledDeploymentTypes().get(1).equals(Production.class);
- }
-
- @Test
- public void testUserDefinedDeploymentType()
- {
- Iterable<URL> urls = getResources("user-defined-beans.xml");
- BeansXmlParser parser = new BeansXmlParser(RESOURCE_LOADER, urls);
- parser.parse();
- assert parser.getEnabledDeploymentTypes().size() == 3;
- assert parser.getEnabledDeploymentTypes().get(0).equals(Standard.class);
- assert parser.getEnabledDeploymentTypes().get(1).equals(Production.class);
- assert
parser.getEnabledDeploymentTypes().get(2).equals(AnotherDeploymentType.class);
- }
-
- /**
- * Test case for WBRI-21.
- */
- @Test(expectedExceptions=DeploymentException.class, description="WBRI-21")
- public void testDuplicateDeployElement()
- {
- Iterable<URL> urls =
getResources("duplicate-deployments-beans.xml");
- BeansXmlParser parser = new BeansXmlParser(RESOURCE_LOADER, urls);
- parser.parse();
- }
-
-}
Deleted: ri/trunk/impl/src/test/resources/jndi.properties
===================================================================
--- ri/trunk/impl/src/test/resources/jndi.properties 2009-03-16 22:43:16 UTC (rev 2056)
+++ ri/trunk/impl/src/test/resources/jndi.properties 2009-03-16 22:47:34 UTC (rev 2057)
@@ -1,4 +0,0 @@
-#jboss JNDI properties
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
\ No newline at end of file
Deleted:
ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/default-beans.xml
===================================================================
---
ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/default-beans.xml 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/default-beans.xml 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,6 +0,0 @@
-<Beans xmlns="urn:java:ee">
- <Deploy>
- <Standard />
- <Production />
- </Deploy>
-</Beans>
Deleted:
ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/duplicate-deployments-beans.xml
===================================================================
---
ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/duplicate-deployments-beans.xml 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/duplicate-deployments-beans.xml 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,10 +0,0 @@
-<Beans xmlns="urn:java:ee">
- <Deploy>
- <Standard />
- <Production />
- </Deploy>
- <Deploy>
- <Standard />
- <Production />
- </Deploy>
-</Beans>
Deleted:
ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml
===================================================================
---
ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml 2009-03-16
22:43:16 UTC (rev 2056)
+++
ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml 2009-03-16
22:47:34 UTC (rev 2057)
@@ -1,19 +0,0 @@
-<Beans xmlns="urn:java:ee"
xmlns:myapp="urn:java:org.jboss.webbeans.test.unit.xml.beans"
- xmlns:test="urn:java:org.jboss.webbeans.test.unit.xml">
- <Deploy>
- <Standard />
- <Production />
- <test:AnotherDeploymentType />
- </Deploy>
- <myapp:Order>
- <ConversationScoped />
- <myapp:PaymentProcessor>
- <myapp:Asynchronous />
- </myapp:PaymentProcessor>
- <myapp:User />
- </myapp:Order>
- <myapp:Login>
- <ConversationScoped />
- <BindingType />
- </myapp:Login>
-</Beans>
\ No newline at end of file
Deleted: ri/trunk/impl/unit-tests.xml
===================================================================
--- ri/trunk/impl/unit-tests.xml 2009-03-16 22:43:16 UTC (rev 2056)
+++ ri/trunk/impl/unit-tests.xml 2009-03-16 22:47:34 UTC (rev 2057)
@@ -1,50 +0,0 @@
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-
-<suite name="Web Beans RI" verbose="1" >
-
- <test name="Web Beans RI">
- <groups>
- <run>
-<!--
- <exclude name="specialization" />
- <exclude name="deployment" />
- <exclude name="disposalMethod" />
-
- <exclude name="observerMethod" />
- <exclude name="deferredEvent" />
- <exclude name="ejb3" />
- <exclude name="webservice" />
- <exclude name="annotationDefinition" />
- <exclude name="webbeansxml" />
- <exclude name="el" />
- <exclude name="jms" />
- <exclude name="interceptors" />
- <exclude name="decorators" />
- <exclude name="servlet" />
-
- <exclude name="passivation" />
- <exclude name="singletons" />
- <exclude name="ejbjarxml" />
- <exclude name="beanDestruction" />
- <exclude name="commonAnnotations" />
--->
- <exclude name="stub" />
- <exclude name="broken" />
- </run>
- </groups>
- <packages>
- <package name="org.jboss.webbeans.test.examples" />
- <package name="org.jboss.webbeans.test.unit.bootstrap" />
- <package name="org.jboss.webbeans.test.unit.context" />
- <package name="org.jboss.webbeans.test.unit.definition" />
- <package name="org.jboss.webbeans.test.unit.event" />
- <package name="org.jboss.webbeans.test.unit.implementation" />
- <package name="org.jboss.webbeans.test.unit.implementation.proxy"
/>
- <package
name="org.jboss.webbeans.test.unit.implementation.exceptions" />
- <package name="org.jboss.webbeans.test.unit.lookup" />
- <package name="org.jboss.webbeans.test.unit.lookup.circular" />
- <package name="org.jboss.webbeans.test.unit.xml" />
- </packages>
- </test>
-
-</suite>
\ No newline at end of file
Modified: ri/trunk/pom.xml
===================================================================
--- ri/trunk/pom.xml 2009-03-16 22:43:16 UTC (rev 2056)
+++ ri/trunk/pom.xml 2009-03-16 22:47:34 UTC (rev 2057)
@@ -69,6 +69,7 @@
<module>spi</module>
<module>core-api</module>
<module>impl</module>
+ <module>tests</module>
<module>porting-package</module>
<module>jboss-tck-runner</module>
</modules>
Added: ri/trunk/tests/pom.xml
===================================================================
--- ri/trunk/tests/pom.xml (rev 0)
+++ ri/trunk/tests/pom.xml 2009-03-16 22:47:34 UTC (rev 2057)
@@ -0,0 +1,202 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>webbeans-parent</artifactId>
+ <groupId>org.jboss.webbeans</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-core-tests</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <name>Web Beans Core Tests</name>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ <exclusions>
+ <exclusion>
+ <artifactId>junit</artifactId>
+ <groupId>junit</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness-jboss-as-5</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <defaultGoal>test</defaultGoal>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <suiteXmlFiles>
+ <suiteXmlFile>unit-tests.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-test-report</id>
+ <phase>test</phase>
+ <goals>
+ <goal>report-only</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+
<outputDirectory>${project.build.directory}/surefire-reports</outputDirectory>
+ <outputName>test-report</outputName>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>incontainer</id>
+ <activation>
+ <property>
+ <name>incontainer</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <stripVersion>true</stripVersion>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness</artifactId>
+ <overWrite>true</overWrite>
+
<outputDirectory>${project.build.directory}/classes/lib</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>javax.el</groupId>
+ <artifactId>el-ri</artifactId>
+ <overWrite>true</overWrite>
+
<outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <suiteXmlFiles>
+ <suiteXmlFile>unit-tests.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ <systemProperties>
+ <property>
+ <name>org.jboss.testharness.standalone</name>
+ <value>false</value>
+ </property>
+ <property>
+ <name>jboss-as.dir</name>
+ <value>../jboss-as</value>
+ </property>
+ <property>
+ <name>jboss.force.restart</name>
+ <value>true</value>
+ </property>
+ <property>
+
<name>org.jboss.testharness.runIntegrationTests</name>
+ <value>true</value>
+ </property>
+ <property>
+
<name>org.jboss.testharness.libraryDirectory</name>
+ <value>target/dependency/lib</value>
+ </property>
+ <property>
+
<name>org.jboss.testharness.outputDirectory</name>
+ <value>target</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>write-artifacts-to-disk</id>
+ <activation>
+ <property>
+ <name>dumpArtifacts</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-test-artifacts</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <mainClass>org.jboss.testharness.api.TCK</mainClass>
+ <classpathScope>test</classpathScope>
+ <systemProperties>
+ <systemProperty>
+ <key>dumpArtifacts</key>
+ <value>true</value>
+ </systemProperty>
+ <systemProperty>
+ <key>org.jboss.testharness.outputDirectory</key>
+ <value>target/test-artifacts</value>
+ </systemProperty>
+ <systemProperty>
+ <key>org.jboss.testharness.libraryDirectory</key>
+ <value>target/dependency/lib</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+
+</project>
Added: ri/trunk/tests/src/test/debug-resources/META-INF/web-beans-tck.properties
===================================================================
--- ri/trunk/tests/src/test/debug-resources/META-INF/web-beans-tck.properties
(rev 0)
+++ ri/trunk/tests/src/test/debug-resources/META-INF/web-beans-tck.properties 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,7 @@
+# Configuration for running incontainer tests from your IDE
+# Alter the path webbeans accordingly (relative from the tck/impl dir)
+org.jboss.testharness.standalone=false
+jboss-as.dir=../../webbeans/jboss-as
+jboss.force.restart=false
+org.jboss.testharness.libraryDirectory=../../webbeans/impl/target/dependency/lib
+org.jboss.testharness.runIntegrationTests=true
\ No newline at end of file
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/ExampleTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/ExampleTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/ExampleTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,56 @@
+package org.jboss.webbeans.test.examples;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class ExampleTest extends AbstractWebBeansTest
+{
+ @Test
+ public void testGameGenerator() throws Exception {
+
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Game game1 = manager.getInstanceByType(Game.class);
+ Game game2 = manager.getInstanceByType(Game.class);
+ assert game1!=game2;
+ assert game1.getNumber()!=game2.getNumber();
+ Generator gen1 = manager.getInstanceByType(Generator.class);
+ Generator gen2 = manager.getInstanceByType(Generator.class);
+ assert gen1.getRandom()!=null;
+ assert gen1.getRandom()==gen2.getRandom();
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testSentenceTranslator() throws Exception {
+
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ TextTranslator tt1 = manager.getInstanceByType(TextTranslator.class);
+ try
+ {
+ tt1.translate("hello world");
+ assert false;
+ }
+ catch (UnsupportedOperationException uoe)
+ {
+ //expected
+ }
+ }
+
+ }.run();
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Game.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Game.java
(rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Game.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test.examples;
+
+import javax.inject.Initializer;
+
+public class Game
+{
+ private final int number;
+
+ @Initializer
+ Game(@Random int number)
+ {
+ this.number = number;
+ }
+
+ public int getNumber()
+ {
+ return number;
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Generator.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Generator.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Generator.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test.examples;
+
+import javax.context.ApplicationScoped;
+import javax.inject.Produces;
+
+@ApplicationScoped
+public class Generator {
+
+ private java.util.Random random = new java.util.Random( System.currentTimeMillis() );
+
+ java.util.Random getRandom()
+ {
+ return random;
+ }
+
+ @Produces @Random int next() {
+ return getRandom().nextInt(100);
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Mock.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Mock.java
(rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Mock.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test.examples;
+
+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
+public @interface Mock
+{
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockExampleTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockExampleTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockExampleTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,31 @@
+package org.jboss.webbeans.test.examples;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)BeansXml("beans.xml")
+public class MockExampleTest extends AbstractWebBeansTest
+{
+
+ @Test
+ public void testMockSentenceTranslator() throws Exception {
+
+ //manager.setEnabledDeploymentTypes(Arrays.asList(Standard.class, Production.class,
Mock.class));
+
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ TextTranslator tt2 = manager.getInstanceByType(TextTranslator.class);
+ assert "Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
amet.".equals( tt2.translate("Hello world. How's tricks?") );
+ }
+
+ }.run();
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockSentenceTranslator.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockSentenceTranslator.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/MockSentenceTranslator.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.test.examples;
+
+@Mock
+public class MockSentenceTranslator implements Translator {
+ public String translate(String sentence) {
+ return "Lorem ipsum dolor sit amet";
+ }
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Random.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Random.java
(rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Random.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.examples;
+
+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
+public @interface Random
+{
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/SentenceParser.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/SentenceParser.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/SentenceParser.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,10 @@
+package org.jboss.webbeans.test.examples;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class SentenceParser {
+ public List<String> parse(String text) {
+ return Arrays.asList( text.split("[.?]") );
+ }
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/SentenceTranslator.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/SentenceTranslator.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/SentenceTranslator.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.test.examples;
+
+
+public class SentenceTranslator implements Translator {
+public String translate(String sentence) {
+ throw new UnsupportedOperationException();
+}
+}
\ No newline at end of file
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/TextTranslator.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/TextTranslator.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/TextTranslator.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.test.examples;
+
+import javax.inject.Initializer;
+
+public class TextTranslator {
+ private SentenceParser sentenceParser;
+ private Translator sentenceTranslator;
+
+ @Initializer
+ TextTranslator(SentenceParser sentenceParser, Translator sentenceTranslator) {
+ this.sentenceParser = sentenceParser;
+ this.sentenceTranslator = sentenceTranslator;
+ }
+
+ public String translate(String text) {
+ StringBuilder sb = new StringBuilder();
+ for (String sentence: sentenceParser.parse(text)) {
+ sb.append(sentenceTranslator.translate(sentence)).append(". ");
+ }
+ return sb.toString().trim();
+ }
+
+}
\ No newline at end of file
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Translator.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Translator.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/examples/Translator.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.test.examples;
+
+import javax.ejb.Local;
+
+@Local
+public interface Translator {
+ public String translate(String sentence);
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,117 @@
+package org.jboss.webbeans.test.unit;
+
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.inject.Production;
+import javax.inject.Standard;
+
+import org.jboss.testharness.AbstractTest;
+import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.context.DependentContext;
+import org.jboss.webbeans.util.EnumerationIterable;
+import org.testng.ITestContext;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.BeforeSuite;
+
+public abstract class AbstractWebBeansTest extends AbstractTest
+{
+
+ protected abstract static class RunInDependentContext
+ {
+
+ protected void setup()
+ {
+ DependentContext.INSTANCE.setActive(true);
+ }
+
+ protected void cleanup()
+ {
+ DependentContext.INSTANCE.setActive(false);
+ }
+
+ public final void run() throws Exception
+ {
+ try
+ {
+ setup();
+ execute();
+ }
+ finally
+ {
+ cleanup();
+ }
+ }
+
+ protected abstract void execute() throws Exception;
+
+ }
+
+ protected static final int BUILT_IN_BEANS = 3;
+
+ protected ManagerImpl manager;
+
+ public static boolean visited = false;
+
+ @Override
+ @BeforeSuite
+ public void beforeSuite(ITestContext context) throws Exception
+ {
+ if (!isInContainer())
+ {
+ getCurrentConfiguration().setStandaloneContainers(new
StandaloneContainersImpl());
+
getCurrentConfiguration().getExtraPackages().add(AbstractWebBeansTest.class.getPackage().getName());
+ }
+ super.beforeSuite(context);
+ }
+
+ @BeforeMethod
+ public void before() throws Exception
+ {
+ this.manager = CurrentManager.rootManager();
+ }
+
+ @AfterMethod
+ public void after() throws Exception
+ {
+ manager = null;
+ }
+
+
+ protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
+ {
+ return getDefaultDeploymentTypes();
+ }
+
+ @SuppressWarnings("unchecked")
+ protected final List<Class<? extends Annotation>>
getDefaultDeploymentTypes()
+ {
+ return Arrays.asList(Standard.class, Production.class);
+ }
+
+ protected Iterable<URL> getResources(String name)
+ {
+ if (name.startsWith("/"))
+ {
+ name = name.substring(1);
+ }
+ else
+ {
+ name = getClass().getPackage().getName().replace(".", "/") +
"/" + name;
+ }
+ try
+ {
+ return new
EnumerationIterable<URL>(getClass().getClassLoader().getResources(name));
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Error loading resource from classloader" +
name, e);
+ }
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/StandaloneContainersImpl.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,78 @@
+package org.jboss.webbeans.test.unit;
+
+import java.net.URL;
+
+import org.jboss.testharness.api.DeploymentException;
+import org.jboss.testharness.spi.StandaloneContainers;
+import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.mock.MockEELifecycle;
+import org.jboss.webbeans.mock.MockServletLifecycle;
+import org.jboss.webbeans.mock.MockWebBeanDiscovery;
+
+public class StandaloneContainersImpl implements StandaloneContainers
+{
+
+ // TODO this is a hack ;-)
+ public static Class<? extends MockServletLifecycle> lifecycleClass =
MockEELifecycle.class;
+
+ private MockServletLifecycle lifecycle;
+
+ public void deploy(Iterable<Class<?>> classes, Iterable<URL>
beansXml) throws DeploymentException
+ {
+ try
+ {
+ this.lifecycle = lifecycleClass.newInstance();
+ }
+ catch (InstantiationException e1)
+ {
+ throw new DeploymentException("Error instantiating lifeycle", e1);
+ }
+ catch (IllegalAccessException e1)
+ {
+ throw new DeploymentException("Error instantiating lifeycle", e1);
+ }
+ lifecycle.initialize();
+ try
+ {
+ MockWebBeanDiscovery discovery = lifecycle.getWebBeanDiscovery();
+ discovery.setWebBeanClasses(classes);
+ if (beansXml != null)
+ {
+ discovery.setWebBeansXmlFiles(beansXml);
+ }
+ lifecycle.beginApplication();
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Error deploying beans", e);
+ }
+ lifecycle.beginSession();
+ lifecycle.beginRequest();
+ }
+
+ public void deploy(Iterable<Class<?>> classes) throws DeploymentException
+ {
+ deploy(classes, null);
+ }
+
+ public void cleanup()
+ {
+ // Np-op
+
+ }
+
+ public void setup()
+ {
+ // No-op
+ }
+
+ public void undeploy()
+ {
+ lifecycle.endRequest();
+ lifecycle.endSession();
+ lifecycle.endApplication();
+ CurrentManager.setRootManager(null);
+ lifecycle = null;
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Animal.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Animal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Animal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap;
+
+interface Animal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/AnotherDeploymentType.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/AnotherDeploymentType.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/AnotherDeploymentType.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test.unit.bootstrap;
+
+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
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/BootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/BootstrapTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/BootstrapTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,32 @@
+package org.jboss.webbeans.test.unit.bootstrap;
+
+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.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Packaging(PackagingType.EAR)
+public class BootstrapTest extends AbstractWebBeansTest
+{
+
+ @Test(groups="bootstrap")
+ public void testInitializedEvent()
+ {
+ assert InitializedObserver.observered;
+ }
+
+ @Test(groups="bootstrap")
+ public void testRequestContextActiveDuringInitializtionEvent()
+ {
+ assert InitializedObserverWhichUsesRequestContext.name == new Tuna().getName();
+ }
+
+ @Test(groups={"bootstrap"})
+ public void testApplicationContextActiveDuringInitializtionEvent()
+ {
+ assert Cow.mooed;
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Cow.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Cow.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Cow.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.unit.bootstrap;
+
+import javax.context.ApplicationScoped;
+
+@ApplicationScoped
+class Cow implements Animal
+{
+
+ public static boolean mooed = false;
+
+ public void moo()
+ {
+ mooed = true;
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.test.unit.bootstrap;
+
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.mock.MockEELifecycle;
+import org.testng.annotations.Test;
+
+public class DiscoverFailsBootstrapTest
+{
+
+ @Test(groups="bootstrap", expectedExceptions=IllegalStateException.class)
+ public void testDiscoverFails()
+ {
+ MockEELifecycle lifecycle = new MockEELifecycle();
+ lifecycle.getBootstrap().getServices().add(WebBeanDiscovery.class, null);
+ lifecycle.initialize();
+ lifecycle.beginApplication();
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.test.unit.bootstrap;
+
+import javax.event.Observes;
+import javax.inject.manager.Initialized;
+import javax.inject.manager.Manager;
+
+class InitializedObserver
+{
+
+ public static boolean observered;
+
+ public void observeInitialized(@Observes @Initialized Manager manager)
+ {
+ observered = true;
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.test.unit.bootstrap;
+
+import javax.event.Observes;
+import javax.inject.Current;
+import javax.inject.manager.Initialized;
+import javax.inject.manager.Manager;
+
+class InitializedObserverWhichUsesApplicationContext
+{
+
+ @Current Cow cow;
+
+ public void observeInitialized(@Observes @Initialized Manager manager)
+ {
+ cow.moo();
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test.unit.bootstrap;
+
+import javax.event.Observes;
+import javax.inject.Current;
+import javax.inject.manager.Initialized;
+import javax.inject.manager.Manager;
+
+class InitializedObserverWhichUsesRequestContext
+{
+
+ public static String name;
+
+ @Current Tuna tuna;
+
+ public void observeInitialized(@Observes @Initialized Manager manager)
+ {
+ name = tuna.getName();
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Tuna.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Tuna.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/Tuna.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.unit.bootstrap;
+
+import javax.context.RequestScoped;
+
+@RequestScoped
+class Tuna
+{
+
+ public String getName()
+ {
+ return "Ophir";
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/XmlBootstrapTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,30 @@
+package org.jboss.webbeans.test.unit.bootstrap;
+
+import javax.inject.Production;
+import javax.inject.Standard;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.jboss.webbeans.WebBean;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Packaging(PackagingType.EAR)
+(a)BeansXml("test-beans.xml")
+public class XmlBootstrapTest extends AbstractWebBeansTest
+{
+
+ @Test
+ public void testDeploymentTypesLoadedFromBeansXml()
+ {
+ assert manager.getEnabledDeploymentTypes().size() == 4;
+ assert manager.getEnabledDeploymentTypes().get(0).equals(Standard.class);
+ assert manager.getEnabledDeploymentTypes().get(1).equals(WebBean.class);
+ assert manager.getEnabledDeploymentTypes().get(2).equals(Production.class);
+ assert
manager.getEnabledDeploymentTypes().get(3).equals(AnotherDeploymentType.class);
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Animal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Animal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Animal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+interface Animal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlyAnimal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlyAnimal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlyAnimal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+interface DeadlyAnimal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlySpider.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlySpider.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DeadlySpider.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+interface DeadlySpider extends DeadlyAnimal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DefangedTarantula.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DefangedTarantula.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/DefangedTarantula.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+class DefangedTarantula extends Tarantula
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Hound.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Hound.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Hound.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import javax.annotation.Named;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+@Stateful
+@Tame
+@Named("Pongo")
+class Hound implements HoundLocal
+{
+ @Remove
+ public void bye() {
+ }
+
+ public void ping()
+ {
+
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/HoundLocal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/HoundLocal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/HoundLocal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import javax.ejb.Local;
+
+@Local
+public interface HoundLocal
+{
+
+ public void ping();
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Salmon.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Salmon.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Salmon.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import javax.annotation.Named;
+import javax.inject.Production;
+
+@Production
+@Named
+class Salmon implements ScottishFish
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ScottishFish.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ScottishFish.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ScottishFish.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+interface ScottishFish extends Animal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/SeaBass.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/SeaBass.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/SeaBass.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import javax.context.RequestScoped;
+import javax.inject.Production;
+
+@Production
+@RequestScoped
+class SeaBass implements Animal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,104 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.inject.AnnotationLiteral;
+import javax.inject.manager.Bean;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.bean.ProducerMethodBean;
+import org.jboss.webbeans.bean.RIBean;
+import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.mock.MockEELifecycle;
+import org.jboss.webbeans.mock.MockServletLifecycle;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.unit.StandaloneContainersImpl;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+@Artifact
+public class ServletEnvironmentTest extends AbstractWebBeansTest
+{
+
+ @BeforeClass
+ @Override
+ public void beforeClass() throws Throwable
+ {
+ StandaloneContainersImpl.lifecycleClass = MockServletLifecycle.class;
+ super.beforeClass();
+ }
+
+ @Override
+ @AfterClass(alwaysRun=true)
+ public void afterClass() throws Exception
+ {
+ StandaloneContainersImpl.lifecycleClass = MockEELifecycle.class;
+ super.afterClass();
+ }
+
+ @Test(groups="incontainer-broken")
+ public void testSimpleBeans()
+ {
+ 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(Tuna.class);
+ assert classes.containsKey(Salmon.class);
+ assert classes.containsKey(SeaBass.class);
+ assert classes.containsKey(Sole.class);
+
+ assert classes.get(Tuna.class) instanceof SimpleBean;
+ assert classes.get(Salmon.class) instanceof SimpleBean;
+ assert classes.get(SeaBass.class) instanceof SimpleBean;
+ assert classes.get(Sole.class) instanceof SimpleBean;
+ manager.getInstanceByType(Sole.class, new AnnotationLiteral<Whitefish>()
{}).ping();
+ }
+
+ @Test(groups="incontainer-broken")
+ 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;
+ manager.getInstanceByType(Tarantula.class, new AnnotationLiteral<Tame>()
{}).ping();
+ }
+
+ @Test(groups="incontainer-broken")
+ public void testSingleEnterpriseBean()
+ {
+ 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(Hound.class);
+ assert classes.get(Hound.class) instanceof SimpleBean;
+ manager.getInstanceByType(HoundLocal.class, new AnnotationLiteral<Tame>()
{}).ping();
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Sole.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Sole.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Sole.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import javax.annotation.Named;
+import javax.ejb.EJB;
+import javax.inject.Production;
+
+@Production
+@Whitefish
+@Named("whitefish")
+class Sole implements ScottishFish
+{
+
+ @EJB HoundLocal hound;
+
+ public void ping()
+ {
+
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Spider.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Spider.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Spider.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+class Spider implements Animal
+{
+
+ public final void layEggs()
+ {
+
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tame.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tame.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tame.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+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
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tarantula.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tarantula.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tarantula.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+class Tarantula extends Spider implements DeadlySpider
+{
+
+ public void ping()
+ {
+
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/TarantulaProducer.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/TarantulaProducer.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/TarantulaProducer.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import javax.inject.Produces;
+
+public class TarantulaProducer
+{
+
+ @Produces @Tame public Tarantula produceTameTarantula()
+ {
+ return new DefangedTarantula();
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tuna.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tuna.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Tuna.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+import javax.context.RequestScoped;
+
+@RequestScoped
+class Tuna
+{
+
+ public String getName()
+ {
+ return "Ophir";
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Whitefish.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Whitefish.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/Whitefish.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.bootstrap.environments;
+
+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
+public @interface Whitefish
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/BootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/BootstrapTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/BootstrapTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,45 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterprise;
+
+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.EnterpriseBean;
+import org.jboss.webbeans.bean.RIBean;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Packaging(PackagingType.EAR)
+public class BootstrapTest extends AbstractWebBeansTest
+{
+
+ @Test(groups="bootstrap")
+ public void testMultipleEnterpriseBean()
+ {
+ 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(Hound.class);
+ assert classes.containsKey(Elephant.class);
+ assert classes.containsKey(Panther.class);
+ assert classes.containsKey(Tiger.class);
+
+ assert classes.get(Hound.class) instanceof EnterpriseBean;
+ assert classes.get(Elephant.class) instanceof EnterpriseBean;
+ assert classes.get(Panther.class) instanceof EnterpriseBean;
+ assert classes.get(Tiger.class) instanceof EnterpriseBean;
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Elephant.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Elephant.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Elephant.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterprise;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.inject.Production;
+
+@Production
+@Stateful
+class Elephant implements ElephantLocal
+{
+
+ @Remove
+ public void remove1()
+ {
+
+ }
+
+ @Remove
+ public void remove2()
+ {
+
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/ElephantLocal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/ElephantLocal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/ElephantLocal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface ElephantLocal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Hound.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Hound.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Hound.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterprise;
+
+import javax.annotation.Named;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+@Stateful
+@Tame
+@Named("Pongo")
+class Hound implements HoundLocal
+{
+ @Remove
+ public void bye() {
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/HoundLocal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/HoundLocal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/HoundLocal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface HoundLocal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Panther.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Panther.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Panther.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterprise;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.inject.Production;
+
+@Production
+@Stateful
+class Panther implements PantherLocal
+{
+
+ @Remove
+ public void remove(String foo)
+ {
+
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/PantherLocal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/PantherLocal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/PantherLocal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterprise;
+
+public interface PantherLocal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Synchronous.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Synchronous.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Synchronous.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterprise;
+
+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 })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Synchronous
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Tame.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Tame.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Tame.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterprise;
+
+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
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Tiger.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Tiger.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/Tiger.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterprise;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.inject.Production;
+
+@Production
+@Stateful
+@Synchronous
+public class Tiger implements TigerLocal
+{
+
+ @Remove
+ public void remove()
+ {
+
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/TigerLocal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/TigerLocal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterprise/TigerLocal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface TigerLocal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Animal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Animal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Animal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+interface Animal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/BootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/BootstrapTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/BootstrapTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,54 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+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.EnterpriseBean;
+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
+(a)Packaging(PackagingType.EAR)
+public class BootstrapTest extends AbstractWebBeansTest
+{
+
+ @Test(groups="bootstrap")
+ public void testMultipleEnterpriseAndSimpleBean()
+ {
+ 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(Hound.class);
+ assert classes.containsKey(Elephant.class);
+ assert classes.containsKey(Panther.class);
+ assert classes.containsKey(Tiger.class);
+ assert classes.containsKey(Tuna.class);
+ assert classes.containsKey(Salmon.class);
+ assert classes.containsKey(SeaBass.class);
+ assert classes.containsKey(Sole.class);
+
+ assert classes.get(Hound.class) instanceof EnterpriseBean;
+ assert classes.get(Elephant.class) instanceof EnterpriseBean;
+ assert classes.get(Panther.class) instanceof EnterpriseBean;
+ assert classes.get(Tiger.class) instanceof EnterpriseBean;
+ assert classes.get(Tuna.class) instanceof SimpleBean;
+ assert classes.get(Salmon.class) instanceof SimpleBean;
+ assert classes.get(SeaBass.class) instanceof SimpleBean;
+ assert classes.get(Sole.class) instanceof SimpleBean;
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Elephant.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Elephant.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Elephant.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.inject.Production;
+
+@Production
+@Stateful
+class Elephant implements ElephantLocal
+{
+
+ @Remove
+ public void remove1()
+ {
+
+ }
+
+ @Remove
+ public void remove2()
+ {
+
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/ElephantLocal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/ElephantLocal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/ElephantLocal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+import javax.ejb.Local;
+
+@Local
+public interface ElephantLocal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Hound.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Hound.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Hound.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+import javax.annotation.Named;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+@Stateful
+@Tame
+@Named("Pongo")
+class Hound implements HoundLocal
+{
+ @Remove
+ public void bye() {
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/HoundLocal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/HoundLocal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/HoundLocal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+import javax.ejb.Local;
+
+@Local
+public interface HoundLocal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Panther.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Panther.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Panther.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.inject.Production;
+
+@Production
+@Stateful
+class Panther implements PantherLocal
+{
+
+ @Remove
+ public void remove(String foo)
+ {
+
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/PantherLocal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/PantherLocal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/PantherLocal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+public interface PantherLocal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Salmon.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Salmon.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Salmon.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+import javax.annotation.Named;
+import javax.inject.Production;
+
+@Production
+@Named
+class Salmon implements ScottishFish
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/ScottishFish.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/ScottishFish.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/ScottishFish.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+interface ScottishFish extends Animal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/SeaBass.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/SeaBass.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/SeaBass.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+import javax.context.RequestScoped;
+import javax.inject.Production;
+
+@Production
+@RequestScoped
+class SeaBass implements Animal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Sole.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Sole.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Sole.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+import javax.annotation.Named;
+import javax.inject.Production;
+
+@Production
+@Whitefish
+@Named("whitefish")
+class Sole implements ScottishFish
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Synchronous.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Synchronous.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Synchronous.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+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 })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Synchronous
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tame.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tame.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tame.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+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
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tiger.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tiger.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tiger.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.inject.Production;
+
+@Production
+@Stateful
+@Synchronous
+public class Tiger implements TigerLocal
+{
+
+ @Remove
+ public void remove()
+ {
+
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/TigerLocal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/TigerLocal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/TigerLocal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+import javax.ejb.Local;
+
+@Local
+public interface TigerLocal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tuna.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tuna.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Tuna.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+import javax.context.RequestScoped;
+
+@RequestScoped
+class Tuna
+{
+
+ public String getName()
+ {
+ return "Ophir";
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Whitefish.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Whitefish.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleEnterpriseAndSimple/Whitefish.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleEnterpriseAndSimple;
+
+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
+public @interface Whitefish
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Animal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Animal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Animal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleSimple;
+
+interface Animal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/BootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/BootstrapTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/BootstrapTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,42 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleSimple;
+
+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.webbeans.bean.RIBean;
+import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class BootstrapTest extends AbstractWebBeansTest
+{
+
+ @Test(groups="bootstrap")
+ public void testMultipleSimpleBean()
+ {
+ 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(Tuna.class);
+ assert classes.containsKey(Salmon.class);
+ assert classes.containsKey(SeaBass.class);
+ assert classes.containsKey(Sole.class);
+
+ assert classes.get(Tuna.class) instanceof SimpleBean;
+ assert classes.get(Salmon.class) instanceof SimpleBean;
+ assert classes.get(SeaBass.class) instanceof SimpleBean;
+ assert classes.get(Sole.class) instanceof SimpleBean;
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Salmon.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Salmon.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Salmon.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleSimple;
+
+import javax.annotation.Named;
+import javax.inject.Production;
+
+@Production
+@Named
+class Salmon implements ScottishFish
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/ScottishFish.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/ScottishFish.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/ScottishFish.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleSimple;
+
+interface ScottishFish extends Animal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/SeaBass.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/SeaBass.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/SeaBass.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleSimple;
+
+import javax.context.RequestScoped;
+import javax.inject.Production;
+
+@Production
+@RequestScoped
+class SeaBass implements Animal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Sole.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Sole.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Sole.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleSimple;
+
+import javax.annotation.Named;
+import javax.inject.Production;
+
+@Production
+@Whitefish
+@Named("whitefish")
+class Sole implements ScottishFish
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Tuna.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Tuna.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Tuna.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleSimple;
+
+import javax.context.RequestScoped;
+
+@RequestScoped
+class Tuna
+{
+
+ public String getName()
+ {
+ return "Ophir";
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Whitefish.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Whitefish.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/multipleSimple/Whitefish.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.bootstrap.multipleSimple;
+
+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
+public @interface Whitefish
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/BootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/BootstrapTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/BootstrapTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,36 @@
+package org.jboss.webbeans.test.unit.bootstrap.singleEnterprise;
+
+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.RIBean;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Packaging(PackagingType.EAR)
+public class BootstrapTest extends AbstractWebBeansTest
+{
+
+ @Test(groups="bootstrap")
+ public void testSingleEnterpriseBean()
+ {
+ 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(Hound.class);
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/Hound.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/Hound.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/Hound.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.unit.bootstrap.singleEnterprise;
+
+import javax.annotation.Named;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+@Stateful
+@Tame
+@Named("Pongo")
+class Hound implements HoundLocal
+{
+ @Remove
+ public void bye() {
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/HoundLocal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/HoundLocal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/HoundLocal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.bootstrap.singleEnterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface HoundLocal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/Tame.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/Tame.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleEnterprise/Tame.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.bootstrap.singleEnterprise;
+
+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
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Animal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Animal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Animal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.singleProducerMethod;
+
+interface Animal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/BootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/BootstrapTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/BootstrapTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,43 @@
+package org.jboss.webbeans.test.unit.bootstrap.singleProducerMethod;
+
+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
+(a)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;
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/DeadlyAnimal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/DeadlyAnimal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/DeadlyAnimal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.singleProducerMethod;
+
+interface DeadlyAnimal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/DeadlySpider.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/DeadlySpider.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/DeadlySpider.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.singleProducerMethod;
+
+interface DeadlySpider extends DeadlyAnimal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/DefangedTarantula.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/DefangedTarantula.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/DefangedTarantula.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.singleProducerMethod;
+
+class DefangedTarantula extends Tarantula
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Spider.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Spider.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Spider.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.bootstrap.singleProducerMethod;
+
+class Spider implements Animal
+{
+
+ public final void layEggs()
+ {
+
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Tame.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Tame.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Tame.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.bootstrap.singleProducerMethod;
+
+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
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Tarantula.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Tarantula.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/Tarantula.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.bootstrap.singleProducerMethod;
+
+class Tarantula extends Spider implements DeadlySpider
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/TarantulaProducer.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/TarantulaProducer.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleProducerMethod/TarantulaProducer.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.test.unit.bootstrap.singleProducerMethod;
+
+import javax.inject.Produces;
+
+public class TarantulaProducer
+{
+
+ @Produces @Tame public Tarantula produceTameTarantula()
+ {
+ return new DefangedTarantula();
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/BootstrapTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/BootstrapTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/BootstrapTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,33 @@
+package org.jboss.webbeans.test.unit.bootstrap.singleSimple;
+
+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.webbeans.bean.RIBean;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class BootstrapTest extends AbstractWebBeansTest
+{
+
+ @Test(groups="bootstrap")
+ public void testSingleSimpleBean()
+ {
+ 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(Tuna.class);
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/Tuna.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/Tuna.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/singleSimple/Tuna.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.unit.bootstrap.singleSimple;
+
+import javax.context.RequestScoped;
+
+@RequestScoped
+class Tuna
+{
+
+ public String getName()
+ {
+ return "Ophir";
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ContextTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ContextTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ContextTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test.unit.context;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest
+public class ContextTest extends AbstractWebBeansTest
+{
+ // WBRI-155
+ @Test(description="WBRI155", groups="stub")
+ public void testSessionContextActiveForMultipleSimultaneousThreads()
+ {
+ // TODO impl
+ assert false;
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/PassivatingContextTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/PassivatingContextTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/PassivatingContextTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,56 @@
+package org.jboss.webbeans.test.unit.context;
+
+import javax.context.ApplicationScoped;
+import javax.context.ConversationScoped;
+import javax.context.RequestScoped;
+import javax.context.SessionScoped;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.metadata.MetaDataCache;
+import org.testng.annotations.Test;
+
+@Artifact
+public class PassivatingContextTest extends
org.jboss.webbeans.test.unit.AbstractWebBeansTest
+{
+
+ /**
+ * The built-in session and conversation scopes are passivating. No other
+ * built-in scope is passivating.
+ */
+ @Test(groups = { "contexts", "passivation" })
+ public void testIsSessionScopePassivating()
+ {
+ assert
MetaDataCache.instance().getScopeModel(SessionScoped.class).isPassivating();
+ }
+
+ /**
+ * The built-in session and conversation scopes are passivating. No other
+ * built-in scope is passivating.
+ */
+ @Test(groups = { "contexts", "passivation" })
+ public void testIsConversationScopePassivating()
+ {
+ assert
MetaDataCache.instance().getScopeModel(ConversationScoped.class).isPassivating();
+ }
+
+ /**
+ * The built-in session and conversation scopes are passivating. No other
+ * built-in scope is passivating.
+ */
+ @Test(groups = { "contexts", "passivation" })
+ public void testIsApplicationScopeNonPassivating()
+ {
+ assert
!MetaDataCache.instance().getScopeModel(ApplicationScoped.class).isPassivating();
+ }
+
+ /**
+ * The built-in session and conversation scopes are passivating. No other
+ * built-in scope is passivating.
+ */
+ @Test(groups = { "contexts", "passivation" })
+ public void testIsRequestScopeNonPassivating()
+ {
+ assert
!MetaDataCache.instance().getScopeModel(RequestScoped.class).isPassivating();
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/Animal.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/Animal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/Animal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.definition;
+
+interface Animal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalOrderStereotype.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalOrderStereotype.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalOrderStereotype.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.test.unit.definition;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.annotation.Stereotype;
+
+
+
+(a)Stereotype(requiredTypes={Animal.class, Order.class})
+@Target( { TYPE })
+@Retention(RUNTIME)
+@interface AnimalOrderStereotype
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalStereotype.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalStereotype.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalStereotype.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,21 @@
+package org.jboss.webbeans.test.unit.definition;
+
+import static java.lang.annotation.ElementType.FIELD;
+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.Retention;
+import java.lang.annotation.Target;
+
+import javax.annotation.Stereotype;
+import javax.context.RequestScoped;
+
+(a)Stereotype(requiredTypes=Animal.class)
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@RequestScoped
+@interface AnimalStereotype
+{
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/Order.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/Order.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/Order.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.definition;
+
+import javax.inject.Production;
+
+@Production
+class Order
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/RequestScopedAnimalStereotype.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/RequestScopedAnimalStereotype.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/RequestScopedAnimalStereotype.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.test.unit.definition;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.annotation.Stereotype;
+import javax.context.RequestScoped;
+
+(a)Stereotype(requiredTypes=Animal.class, supportedScopes=RequestScoped.class)
+@Target( { TYPE })
+@Retention(RUNTIME)
+public @interface RequestScopedAnimalStereotype
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/StereotypesTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/StereotypesTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/StereotypesTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,57 @@
+package org.jboss.webbeans.test.unit.definition;
+
+import java.util.Arrays;
+
+import javax.context.RequestScoped;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.metadata.StereotypeModel;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class StereotypesTest extends AbstractWebBeansTest
+{
+
+ @Test
+ public void testAnimalStereotype()
+ {
+ StereotypeModel<AnimalStereotype> animalStereotype = new
StereotypeModel<AnimalStereotype>(AnimalStereotype.class);
+ assert
animalStereotype.getDefaultScopeType().annotationType().equals(RequestScoped.class);
+ assert animalStereotype.getInterceptorBindings().size() == 0;
+ assert animalStereotype.getRequiredTypes().size() == 1;
+ assert animalStereotype.getRequiredTypes().contains(Animal.class);
+ assert animalStereotype.getSupportedScopes().size() == 0;
+ assert !animalStereotype.isBeanNameDefaulted();
+ assert animalStereotype.getDefaultDeploymentType() == null;
+ }
+
+ @Test
+ public void testAnimalOrderStereotype()
+ {
+ StereotypeModel<AnimalOrderStereotype> animalStereotype = new
StereotypeModel<AnimalOrderStereotype>(AnimalOrderStereotype.class);
+ assert animalStereotype.getDefaultScopeType() == null;
+ assert animalStereotype.getInterceptorBindings().size() == 0;
+ assert animalStereotype.getRequiredTypes().size() == 2;
+ Class<?> [] requiredTypes = {Animal.class, Order.class};
+ assert
animalStereotype.getRequiredTypes().containsAll(Arrays.asList(requiredTypes));
+ assert animalStereotype.getSupportedScopes().size() == 0;
+ assert !animalStereotype.isBeanNameDefaulted();
+ assert animalStereotype.getDefaultDeploymentType() == null;
+ }
+
+ @Test
+ public void testRequestScopedAnimalStereotype()
+ {
+ StereotypeModel<RequestScopedAnimalStereotype> animalStereotype = new
StereotypeModel<RequestScopedAnimalStereotype>(RequestScopedAnimalStereotype.class);
+ assert animalStereotype.getDefaultScopeType() == null;
+ assert animalStereotype.getInterceptorBindings().size() == 0;
+ assert animalStereotype.getRequiredTypes().size() == 1;
+ assert Animal.class.equals(animalStereotype.getRequiredTypes().iterator().next());
+ assert animalStereotype.getSupportedScopes().size() == 1;
+ assert animalStereotype.getSupportedScopes().contains(RequestScoped.class);
+ assert !animalStereotype.isBeanNameDefaulted();
+ assert animalStereotype.getDefaultDeploymentType() == null;
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,80 @@
+package org.jboss.webbeans.test.unit.implementation;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import javax.inject.New;
+
+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.EnterpriseBean;
+import org.jboss.webbeans.bean.NewEnterpriseBean;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.literal.NewLiteral;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.util.Proxies.TypeInfo;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Packaging(PackagingType.EAR)
+public class NewEnterpriseBeanTest extends AbstractWebBeansTest
+{
+
+ private static final New NEW_LITERAL = new NewLiteral();
+
+ private EnterpriseBean<WrappedEnterpriseBeanLocal> wrappedEnterpriseBean;
+ private NewEnterpriseBean<WrappedEnterpriseBeanLocal> newEnterpriseBean;
+
+ public void initNewBean() {
+
+ assert manager.resolveByType(WrappedEnterpriseBeanLocal.class).size() == 1;
+ assert manager.resolveByType(WrappedEnterpriseBeanLocal.class).iterator().next()
instanceof EnterpriseBean;
+ wrappedEnterpriseBean = (EnterpriseBean<WrappedEnterpriseBeanLocal>)
manager.resolveByType(WrappedEnterpriseBeanLocal.class).iterator().next();
+
+ assert manager.resolveByType(WrappedEnterpriseBeanLocal.class, NEW_LITERAL).size()
== 1;
+ assert manager.resolveByType(WrappedEnterpriseBeanLocal.class,
NEW_LITERAL).iterator().next() instanceof NewEnterpriseBean;
+ newEnterpriseBean = (NewEnterpriseBean<WrappedEnterpriseBeanLocal>)
manager.resolveByType(WrappedEnterpriseBeanLocal.class, NEW_LITERAL).iterator().next();
+
+ }
+
+ @Test(groups = { "new", "broken" })
+ public void testNewBeanHasImplementationClassOfInjectionPointType()
+ {
+ initNewBean();
+ assert newEnterpriseBean.getType().equals(WrappedEnterpriseBeanLocal.class);
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanIsEnterpriseWebBeanIfParameterTypeIsEnterpriseWebBean()
+ {
+ initNewBean();
+ assert wrappedEnterpriseBean.getType().equals(newEnterpriseBean.getType());
+ assert manager.getEjbDescriptorCache().containsKey(newEnterpriseBean.getType());
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasSameInitializerMethodsAsWrappedBean()
+ {
+ initNewBean();
+ assert
newEnterpriseBean.getInitializerMethods().equals(wrappedEnterpriseBean.getInitializerMethods());
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
+ {
+ initNewBean();
+ Set<? extends AnnotatedItem<?, ?>> wrappedBeanInjectionPoints =
wrappedEnterpriseBean.getInjectionPoints();
+ Set<? extends AnnotatedItem<?, ?>> newBeanInjectionPoints =
newEnterpriseBean.getInjectionPoints();
+ assert wrappedBeanInjectionPoints.equals(newBeanInjectionPoints);
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasNoDisposalMethods()
+ {
+ initNewBean();
+ Class<?> type =
TypeInfo.ofTypes(newEnterpriseBean.getTypes()).getSuperClass();
+ assert manager.resolveDisposalMethods(type,
newEnterpriseBean.getBindings().toArray(new Annotation[0])).isEmpty();
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBean.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBean.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBean.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.unit.implementation;
+
+import javax.annotation.Named;
+import javax.context.SessionScoped;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+@SessionScoped
+@Stateful
+@Named("John")
+class WrappedEnterpriseBean implements WrappedEnterpriseBeanLocal
+{
+ @Remove
+ public void bye() {
+ }
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBeanLocal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBeanLocal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBeanLocal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.implementation;
+
+import javax.ejb.Local;
+
+@Local
+public interface WrappedEnterpriseBeanLocal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Animal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Animal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Animal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.implementation.annotatedItem;
+
+interface Animal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Antelope.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Antelope.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Antelope.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,7 @@
+package org.jboss.webbeans.test.unit.implementation.annotatedItem;
+
+
+class Antelope implements Animal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,51 @@
+package org.jboss.webbeans.test.unit.implementation.annotatedItem;
+
+import java.lang.annotation.Annotation;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.annotation.Stereotype;
+import javax.inject.DeploymentType;
+import javax.inject.Production;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.introspector.AnnotatedClass;
+import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class ClassAnnotatedItemTest extends AbstractWebBeansTest
+{
+
+ @Test
+ public void testDeclaredAnnotations()
+ {
+ AnnotatedClass<Order> annotatedElement = AnnotatedClassImpl.of(Order.class);
+ assert annotatedElement.getAnnotationsAsSet().size() == 1;
+ assert annotatedElement.getAnnotation(Production.class) != null;
+ assert annotatedElement.getRawType().equals(Order.class);
+ }
+
+ @Test
+ public void testMetaAnnotations()
+ {
+ AnnotatedClass<Order> annotatedElement = AnnotatedClassImpl.of(Order.class);
+ Set<Annotation> annotations =
annotatedElement.getMetaAnnotations(DeploymentType.class);
+ assert annotations.size() == 1;
+ Iterator<Annotation> it = annotations.iterator();
+ Annotation production = it.next();
+ assert Production.class.equals(production.annotationType());
+ }
+
+ @Test
+ public void testEmpty()
+ {
+ AnnotatedClass<Order> annotatedElement = AnnotatedClassImpl.of(Order.class);
+ assert annotatedElement.getAnnotation(Stereotype.class) == null;
+ assert annotatedElement.getMetaAnnotations(Stereotype.class).size() == 0;
+ AnnotatedClass<Antelope> classWithNoAnnotations =
AnnotatedClassImpl.of(Antelope.class);
+ assert classWithNoAnnotations.getAnnotationsAsSet().size() == 0;
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Order.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Order.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Order.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.implementation.annotatedItem;
+
+import javax.inject.Production;
+
+@Production
+class Order
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest
+(a)Packaging(PackagingType.EAR)
+public class EnterpriseBeanTest extends AbstractWebBeansTest
+{
+
+ @Test(description="WBRI-179")
+ public void testSFSBWithOnlyRemoteInterfacesDeploys()
+ {
+
+ }
+
+
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Hat.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Hat.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Hat.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise;
+
+import javax.ejb.Stateful;
+
+@Stateful
+public class Hat implements HatRemote
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/HatRemote.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/HatRemote.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/HatRemote.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface HatRemote
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/Foo.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/Foo.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/Foo.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,10 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise.sbi;
+
+import javax.ejb.Stateful;
+
+
+@Stateful
+public class Foo implements FooLocal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/FooLocal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/FooLocal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/FooLocal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise.sbi;
+
+import javax.ejb.Local;
+
+@Local
+public interface FooLocal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockInvocationContext.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockInvocationContext.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockInvocationContext.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,48 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise.sbi;
+
+import java.lang.reflect.Method;
+import java.util.Map;
+
+import javax.interceptor.InvocationContext;
+
+public class MockInvocationContext implements InvocationContext
+{
+
+ private Foo foo = new Foo();
+
+ public Map<String, Object> getContextData()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Method getMethod()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Object[] getParameters()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Object getTarget()
+ {
+ return foo;
+ }
+
+ public Object proceed() throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setParameters(Object[] params)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockSessionBeanInterceptor.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockSessionBeanInterceptor.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockSessionBeanInterceptor.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise.sbi;
+
+import org.jboss.webbeans.bean.EnterpriseBean;
+import org.jboss.webbeans.ejb.SessionBeanInterceptor;
+
+public class MockSessionBeanInterceptor extends SessionBeanInterceptor
+{
+
+ @Override
+ public EnterpriseBean<Object> getBean()
+ {
+ return super.getBean();
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/SessionBeanInterceptorTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/SessionBeanInterceptorTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/SessionBeanInterceptorTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,47 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise.sbi;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import javax.inject.manager.Bean;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class SessionBeanInterceptorTest extends AbstractWebBeansTest
+{
+
+ @Test
+ public void testSerializeSessionBeanInterceptor() throws Exception
+ {
+ Bean<?> foobean = manager.getNewEnterpriseBeanMap().get(Foo.class);
+ assert foobean != null;
+ MockSessionBeanInterceptor interceptor = new MockSessionBeanInterceptor();
+ interceptor.postConstruct(new MockInvocationContext());
+ assert interceptor.getBean() != null;
+ Bean<?> bean = interceptor.getBean();
+ interceptor = (MockSessionBeanInterceptor) deserialize(serialize(interceptor));
+ assert interceptor.getBean() != null;
+ assert bean.equals(interceptor.getBean());
+ }
+
+ protected byte[] serialize(Object instance) throws IOException
+ {
+ ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bytes);
+ out.writeObject(instance);
+ return bytes.toByteArray();
+ }
+
+ protected Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException
+ {
+ ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
+ return in.readObject();
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/ExceptionHandlingTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/ExceptionHandlingTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/ExceptionHandlingTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,65 @@
+package org.jboss.webbeans.test.unit.implementation.exceptions;
+
+import javax.inject.AnnotationLiteral;
+import javax.inject.CreationException;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class ExceptionHandlingTest extends AbstractWebBeansTest
+{
+
+ @Test(expectedExceptions=FooException.class)
+ public void testCreationExceptionWrapsRealExceptionForSimpleBean() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ try
+ {
+ manager.getInstanceByType(Lorry_Broken.class);
+ }
+ catch (Exception e)
+ {
+ if (e instanceof CreationException)
+ {
+ throw (Exception) e.getCause();
+ }
+ }
+ }
+
+ }.run();
+ }
+
+
+ @Test(expectedExceptions=FooException.class)
+ public void testCreationExceptionWrapsRealExceptionForProducerBean() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ try
+ {
+ manager.getInstanceByType(Ship.class, new AnnotationLiteral<Large>()
{});
+ }
+ catch (Exception e)
+ {
+ if (e instanceof CreationException)
+ {
+ throw (Exception) e.getCause();
+ }
+ }
+ }
+
+ }.run();
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/FooException.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/FooException.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/FooException.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.implementation.exceptions;
+
+public class FooException extends Exception
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/Large.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/Large.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/Large.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.implementation.exceptions;
+
+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 Large
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/Lorry_Broken.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/Lorry_Broken.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/Lorry_Broken.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.implementation.exceptions;
+
+class Lorry_Broken
+{
+
+ public Lorry_Broken() throws Exception
+ {
+ throw new FooException();
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/Ship.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/Ship.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/Ship.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.implementation.exceptions;
+
+class Ship
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/ShipProducer_Broken.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/ShipProducer_Broken.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/exceptions/ShipProducer_Broken.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.unit.implementation.exceptions;
+
+import javax.inject.Produces;
+
+public class ShipProducer_Broken
+{
+
+ @Produces @Large
+ public Ship produceShip() throws FooException
+ {
+ throw new FooException();
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,71 @@
+package org.jboss.webbeans.test.unit.implementation.newsimple;
+
+import java.util.Set;
+
+import javax.inject.New;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.bean.NewSimpleBean;
+import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.literal.NewLiteral;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class NewSimpleBeanTest extends AbstractWebBeansTest
+{
+ private SimpleBean<WrappedSimpleBean> wrappedSimpleBean;
+ private NewSimpleBean<WrappedSimpleBean> newSimpleBean;
+
+ private static final New NEW_LITERAL = new NewLiteral();
+
+ public void initNewBean() {
+
+ assert manager.resolveByType(WrappedSimpleBean.class).size() == 1;
+ assert manager.resolveByType(WrappedSimpleBean.class).iterator().next() instanceof
SimpleBean;
+ wrappedSimpleBean = (SimpleBean<WrappedSimpleBean>)
manager.resolveByType(WrappedSimpleBean.class).iterator().next();
+
+ assert manager.resolveByType(WrappedSimpleBean.class, NEW_LITERAL).size() == 1;
+ assert manager.resolveByType(WrappedSimpleBean.class,
NEW_LITERAL).iterator().next() instanceof NewSimpleBean;
+ newSimpleBean = (NewSimpleBean<WrappedSimpleBean>)
manager.resolveByType(WrappedSimpleBean.class, NEW_LITERAL).iterator().next();
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasImplementationClassOfInjectionPointType()
+ {
+ initNewBean();
+ assert newSimpleBean.getType().equals(WrappedSimpleBean.class);
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanIsSimpleWebBeanIfParameterTypeIsSimpleWebBean()
+ {
+ initNewBean();
+ assert newSimpleBean.getType().equals(wrappedSimpleBean.getType());
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasSameConstructorAsWrappedBean()
+ {
+ initNewBean();
+ assert wrappedSimpleBean.getConstructor().equals(newSimpleBean.getConstructor());
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasSameInitializerMethodsAsWrappedBean()
+ {
+ initNewBean();
+ assert
newSimpleBean.getInitializerMethods().equals(wrappedSimpleBean.getInitializerMethods());
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
+ {
+ initNewBean();
+ Set<? extends AnnotatedItem<?, ?>> wrappedBeanInjectionPoints =
wrappedSimpleBean.getInjectionPoints();
+ Set<? extends AnnotatedItem<?, ?>> newBeanInjectionPoints =
newSimpleBean.getInjectionPoints();
+ assert wrappedBeanInjectionPoints.equals(newBeanInjectionPoints);
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/WrappedSimpleBean.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/WrappedSimpleBean.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/WrappedSimpleBean.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.test.unit.implementation.newsimple;
+
+import java.io.Serializable;
+
+import javax.annotation.Named;
+import javax.context.SessionScoped;
+
+@SessionScoped
+@Named("Fred")
+class WrappedSimpleBean implements Serializable
+{
+ public WrappedSimpleBean() {
+
+ }
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedListInjection.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedListInjection.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedListInjection.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,45 @@
+package org.jboss.webbeans.test.unit.implementation.producer.field;
+
+import java.util.List;
+
+import javax.inject.Current;
+import javax.inject.Initializer;
+
+public class ParameterizedListInjection
+{
+
+ private List<String> value;
+
+ @Current
+ private List<String> fieldInjection;
+
+ private List<String> setterInjection;
+
+ @Initializer
+ public void init(List<String> setterInjection)
+ {
+ this.setterInjection = setterInjection;
+ }
+
+ @Initializer
+ public ParameterizedListInjection(List<String> com)
+ {
+ this.value = com;
+ }
+
+ public java.util.List<String> getValue()
+ {
+ return value;
+ }
+
+ public List<String> getFieldInjection()
+ {
+ return fieldInjection;
+ }
+
+ public List<String> getSetterInjection()
+ {
+ return setterInjection;
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducer.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducer.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducer.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.test.unit.implementation.producer.field;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.inject.Produces;
+
+public class ParameterizedProducer
+{
+
+ @Produces
+ public List<String> create()
+ {
+ return Arrays.asList("aaa", "bbb");
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/ParameterizedProducerTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,26 @@
+package org.jboss.webbeans.test.unit.implementation.producer.field;
+
+import java.util.List;
+
+import javax.inject.TypeLiteral;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class ParameterizedProducerTest extends AbstractWebBeansTest
+{
+
+ @Test
+ public void testInjectManagerProducer()
+ {
+ assert manager.getInstanceByType(new
TypeLiteral<List<String>>(){}).size() == 2;
+
+ ParameterizedListInjection item =
manager.getInstanceByType(ParameterizedListInjection.class);
+ assert item.getFieldInjection().size() == 2;
+ assert item.getValue().size() == 2;
+ assert item.getSetterInjection().size() == 2;
+
+ }
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/IntInjection.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/IntInjection.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/IntInjection.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.test.unit.implementation.producer.field.method;
+
+import javax.inject.Initializer;
+
+public class IntInjection
+{
+
+ int value;
+
+ @Initializer public IntInjection(Integer integer)
+ {
+ this.value = integer;
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/ManagerProducer.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/ManagerProducer.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/ManagerProducer.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,32 @@
+package org.jboss.webbeans.test.unit.implementation.producer.field.method;
+
+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;
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/ManagerProducerTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/ManagerProducerTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/field/method/ManagerProducerTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.test.unit.implementation.producer.field.method;
+
+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();
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/Foo.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/Foo.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/Foo.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.test.unit.implementation.proxy;
+
+import java.io.Serializable;
+
+import javax.annotation.Named;
+import javax.context.RequestScoped;
+
+@Named
+@RequestScoped
+class Foo implements Serializable
+{
+
+ public String getMsg()
+ {
+ return "Hi";
+ }
+
+}
\ No newline at end of file
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.test.unit.implementation.proxy;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class ProxyTest extends AbstractWebBeansTest
+{
+
+ @Test(description="WBRI-122")
+ public void testImplementationClassImplementsSerializable()
+ {
+ manager.getInstanceByName("foo");
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,37 @@
+package org.jboss.webbeans.test.unit.implementation.proxy.enterprise;
+
+import javassist.util.proxy.ProxyObject;
+
+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.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Packaging(PackagingType.EAR)
+public class EnterpriseBeanProxyTest extends AbstractWebBeansTest
+{
+
+ /**
+ * <a
href="https://jira.jboss.org/jira/browse/WBRI-109">WBRI-109&...
+ */
+ @Test(description="WBRI-109")
+ public void testNoInterfaceView() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Object mouse = manager.getInstanceByType(MouseLocal.class);
+ assert mouse instanceof ProxyObject;
+ assert mouse instanceof MouseLocal;
+ }
+
+ }.run();
+
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/Mouse.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/Mouse.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/Mouse.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.implementation.proxy.enterprise;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class Mouse implements MouseLocal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/MouseLocal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/MouseLocal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/MouseLocal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.implementation.proxy.enterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface MouseLocal
+{
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Air.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Air.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Air.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.context.ApplicationScoped;
+import javax.inject.Initializer;
+
+@ApplicationScoped
+class Air
+{
+
+ public Air()
+ {
+
+ }
+
+ @Initializer
+ public Air(Bird bird)
+ {
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Bar.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Bar.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Bar.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,34 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.annotation.PostConstruct;
+import javax.context.ApplicationScoped;
+import javax.inject.Current;
+
+@ApplicationScoped
+class Bar
+{
+
+ public static boolean success;
+
+ @Current Foo foo;
+
+ public Bar()
+ {
+ success = false;
+ }
+
+ @PostConstruct
+ public void postConstruct()
+ {
+ if (foo.getName().equals("foo"))
+ {
+ success = true;
+ }
+ }
+
+ public String getName()
+ {
+ return "bar";
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Bird.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Bird.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Bird.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.context.ApplicationScoped;
+import javax.inject.Initializer;
+
+@ApplicationScoped
+class Bird
+{
+
+ private Air air;
+
+ public Bird()
+ {
+
+ }
+
+ @Initializer
+ public Bird(Air air)
+ {
+ this.air = air;
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Car.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Car.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Car.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,32 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Current;
+
+class Car
+{
+
+ public static boolean success;
+
+ @Current Petrol petrol;
+
+ public Car()
+ {
+ success = false;
+ }
+
+ @PostConstruct
+ public void postConstruct()
+ {
+ if (petrol.getName().equals("petrol"))
+ {
+ success = true;
+ }
+ }
+
+ public String getName()
+ {
+ return "herbie";
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,254 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class CircularDependencyTest extends AbstractWebBeansTest
+{
+
+
+ @Test
+ public void testCircularInjectionOnTwoNormalBeans() throws Exception
+ {
+ //deployBeans(Pig.class, Food.class);
+ manager.getInstanceByType(Pig.class).getName();
+ assert Pig.success;
+ assert Food.success;
+ }
+
+ @Test
+ public void testCircularInjectionOnOneNormalAndOneDependentBean() throws Exception
+ {
+ //deployBeans(Car.class, Petrol.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ manager.getInstanceByType(Car.class).getName();
+ assert Petrol.success;
+ assert Car.success;
+ }
+
+ }.run();
+
+ }
+
+ @Test
+ public void testCircularInjectionOnOneDependentAndOneNormalBean() throws Exception
+ {
+ //deployBeans(Car.class, Petrol.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ manager.getInstanceByType(Petrol.class).getName();
+ assert Petrol.success;
+ assert Car.success;
+ }
+
+ }.run();
+
+ }
+
+
+ @Test
+ public void testCircularInjectionOnTwoSimpleDependentBeans() throws Exception
+ {
+ //deployBeans(Foo.class, Bar.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ manager.getInstanceByType(Foo.class).getName();
+ assert Foo.success;
+ assert Bar.success;
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void
testDependentProducerMethodDeclaredOnDependentBeanWhichInjectsProducedBean() throws
Exception
+ {
+ //deployBeans(DependentSelfConsumingDependentProducer.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+
manager.getInstanceByType(DependentSelfConsumingDependentProducer.class).ping();
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testNormalProducerMethodDeclaredOnNormalBeanWhichInjectsProducedBean()
throws Exception
+ {
+ //deployBeans(NormalSelfConsumingNormalProducer.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ manager.getInstanceByType(NormalSelfConsumingNormalProducer.class).ping();
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testNormalProducerMethodDeclaredOnDependentBeanWhichInjectsProducedBean()
throws Exception
+ {
+ //deployBeans(DependentSelfConsumingNormalProducer.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+
manager.getInstanceByType(DependentSelfConsumingNormalProducer.class).ping();
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testDependentProducerMethodDeclaredOnNormalBeanWhichInjectsProducedBean()
throws Exception
+ {
+ //deployBeans(NormalSelfConsumingDependentProducer.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+
manager.getInstanceByType(NormalSelfConsumingDependentProducer.class).ping();
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testNormalSelfConsumingProducer() throws Exception
+ {
+ //deployBeans(NormalLoopingProducer.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ manager.getInstanceByType(Violation.class).ping();
+ }
+
+ }.run();
+ }
+
+ @Test(groups="broken", timeOut=1000)
+ public void testDependentSelfConsumingProducer() throws Exception
+ {
+ //deployBeans(DependentLoopingProducer.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ manager.getInstanceByType(Violation.class).ping();
+ }
+
+ }.run();
+ }
+
+ @Test(groups="broken", timeOut=1000)
+ public void testDependentCircularConstructors() throws Exception
+ {
+ //deployBeans(Water.class, Fish.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ manager.getInstanceByType(Fish.class);
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testNormalCircularConstructors() throws Exception
+ {
+ //deployBeans(Bird.class, Air.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ manager.getInstanceByType(Bird.class);
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testNormalAndDependentCircularConstructors() throws Exception
+ {
+ //deployBeans(Space.class, Planet.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ manager.getInstanceByType(Planet.class);
+ }
+
+ }.run();
+ }
+
+ @Test(groups="broken", timeOut=1000)
+ public void testSelfConsumingConstructorsOnDependentBean() throws Exception
+ {
+ //deployBeans(Farm.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ manager.getInstanceByType(Farm.class);
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testSelfConsumingConstructorsOnNormalBean() throws Exception
+ {
+ //deployBeans(House.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ manager.getInstanceByType(House.class);
+ }
+
+ }.run();
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentLooping.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentLooping.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentLooping.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+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 DependentLooping
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentLoopingProducer.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentLoopingProducer.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentLoopingProducer.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.inject.Produces;
+
+class DependentLoopingProducer
+{
+
+ @Produces @DependentLooping
+ public Violation produceViolation(@DependentLooping Violation violation) {
+ return new Violation();
+ }
+
+}
\ No newline at end of file
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentSelfConsumingDependentProducer.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentSelfConsumingDependentProducer.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentSelfConsumingDependentProducer.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.inject.Produces;
+
+class DependentSelfConsumingDependentProducer
+{
+ @SelfConsumingDependent Violation violation;
+
+ @Produces @SelfConsumingDependent
+ public Violation produceViolation() {
+ return new Violation();
+ }
+
+ public void ping() {
+
+ }
+}
\ No newline at end of file
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentSelfConsumingNormalProducer.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentSelfConsumingNormalProducer.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/DependentSelfConsumingNormalProducer.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.context.ApplicationScoped;
+import javax.inject.Produces;
+
+class DependentSelfConsumingNormalProducer
+{
+ @SelfConsumingNormal1 Violation violation;
+
+ @Produces @ApplicationScoped @SelfConsumingNormal1
+ public Violation produceViolation() {
+ return new Violation();
+ }
+
+ public void ping() {
+
+ }
+}
\ No newline at end of file
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Farm.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Farm.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Farm.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.inject.Initializer;
+
+class Farm
+{
+
+ @Initializer
+ public Farm(Farm farm)
+ {
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Fish.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Fish.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Fish.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.inject.Initializer;
+
+class Fish
+{
+
+ private Water water;
+
+ @Initializer
+ public Fish(Water water)
+ {
+ this.water = water;
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Foo.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Foo.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Foo.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,32 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Current;
+
+class Foo
+{
+
+ public static boolean success;
+
+ @Current Bar bar;
+
+ public Foo()
+ {
+ success = false;
+ }
+
+ @PostConstruct
+ public void postConstruct()
+ {
+ if (bar.getName().equals("bar"))
+ {
+ success = true;
+ }
+ }
+
+ public String getName()
+ {
+ return "foo";
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Food.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Food.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Food.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,34 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.annotation.PostConstruct;
+import javax.context.ApplicationScoped;
+import javax.inject.Current;
+
+@ApplicationScoped
+class Food
+{
+
+ public static boolean success;
+
+ @Current Pig pig;
+
+ public Food()
+ {
+ success = false;
+ }
+
+ @PostConstruct
+ public void postConstruct()
+ {
+ if (pig.getName().equals("john"))
+ {
+ success = true;
+ }
+ }
+
+ public String getName()
+ {
+ return "food";
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/House.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/House.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/House.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.context.ApplicationScoped;
+import javax.inject.Initializer;
+
+@ApplicationScoped
+class House
+{
+
+ // For serialization
+ public House() {}
+
+ @Initializer
+ public House(House house)
+ {
+ house.ping();
+ }
+
+ private void ping()
+ {
+
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalLooping.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalLooping.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalLooping.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+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 NormalLooping
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalLoopingProducer.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalLoopingProducer.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalLoopingProducer.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.context.ApplicationScoped;
+import javax.inject.Produces;
+
+@ApplicationScoped
+class NormalLoopingProducer
+{
+
+ @Produces @ApplicationScoped @NormalLooping
+ public Violation produceViolation(@NormalLooping Violation violation) {
+ return new Violation();
+ }
+
+}
\ No newline at end of file
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalSelfConsumingDependentProducer.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalSelfConsumingDependentProducer.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalSelfConsumingDependentProducer.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.context.ApplicationScoped;
+import javax.inject.Produces;
+
+@ApplicationScoped
+class NormalSelfConsumingDependentProducer
+{
+ @SelfConsumingDependent1 Violation violation;
+
+ @Produces @SelfConsumingDependent1
+ public Violation produceViolation() {
+ return new Violation();
+ }
+
+ public void ping() {
+
+ }
+}
\ No newline at end of file
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalSelfConsumingNormalProducer.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalSelfConsumingNormalProducer.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/NormalSelfConsumingNormalProducer.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.context.ApplicationScoped;
+import javax.inject.Produces;
+
+@ApplicationScoped
+class NormalSelfConsumingNormalProducer
+{
+ @SelfConsumingNormal Violation violation;
+
+ @Produces @ApplicationScoped @SelfConsumingNormal
+ public Violation produceViolation() {
+ return new Violation();
+ }
+
+ public void ping() {
+
+ }
+}
\ No newline at end of file
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Petrol.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Petrol.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Petrol.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,34 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.annotation.PostConstruct;
+import javax.context.ApplicationScoped;
+import javax.inject.Current;
+
+@ApplicationScoped
+class Petrol
+{
+
+ public static boolean success;
+
+ @Current Car car;
+
+ public Petrol()
+ {
+ success = false;
+ }
+
+ @PostConstruct
+ public void postConstruct()
+ {
+ if (car.getName().equals("herbie"))
+ {
+ success = true;
+ }
+ }
+
+ public String getName()
+ {
+ return "petrol";
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Pig.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Pig.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Pig.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,34 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.annotation.PostConstruct;
+import javax.context.ApplicationScoped;
+import javax.inject.Current;
+
+@ApplicationScoped
+class Pig
+{
+
+ public static boolean success;
+
+ @Current Food food;
+
+ public Pig()
+ {
+ success = false;
+ }
+
+ @PostConstruct
+ public void postConstruct()
+ {
+ if (food.getName().equals("food"))
+ {
+ success = true;
+ }
+ }
+
+ public String getName()
+ {
+ return "john";
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Planet.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Planet.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Planet.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.inject.Initializer;
+
+class Planet
+{
+
+ private Space space;
+
+ @Initializer
+ public Planet(Space space)
+ {
+ this.space = space;
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingDependent.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingDependent.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingDependent.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+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 SelfConsumingDependent
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingDependent1.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingDependent1.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingDependent1.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+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 SelfConsumingDependent1
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingNormal.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingNormal.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingNormal.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+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 SelfConsumingNormal
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingNormal1.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingNormal1.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/SelfConsumingNormal1.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+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 SelfConsumingNormal1
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Space.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Space.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Space.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.context.ApplicationScoped;
+import javax.inject.Initializer;
+
+@ApplicationScoped
+class Space
+{
+
+ // For serialization
+ public Space() {}
+
+ @Initializer
+ public Space(Planet planet)
+ {
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Violation.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Violation.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Violation.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import java.io.Serializable;
+
+class Violation implements Serializable
+{
+
+ public void ping()
+ {
+
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Water.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Water.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Water.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.test.unit.lookup.circular;
+
+import javax.inject.Initializer;
+
+class Water
+{
+ @Initializer
+ public Water(Fish fish)
+ {
+ }
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/AnotherDeploymentType.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/AnotherDeploymentType.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/AnotherDeploymentType.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test.unit.xml;
+
+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
+{
+
+}
\ No newline at end of file
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/BeansXmlParserTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/BeansXmlParserTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/BeansXmlParserTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,73 @@
+package org.jboss.webbeans.test.unit.xml;
+
+import java.net.URL;
+import java.util.Iterator;
+
+import javax.inject.DeploymentException;
+import javax.inject.Production;
+import javax.inject.Standard;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import org.jboss.webbeans.bootstrap.BeansXmlParser;
+import org.jboss.webbeans.mock.MockResourceLoader;
+import org.jboss.webbeans.resources.spi.ResourceLoader;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+@Resources({
+
@Resource(destination="WEB-INF/classes/org/jboss/webbeans/test/unit/xml/default-beans.xml",
source="/org/jboss/webbeans/test/unit/xml/default-beans.xml"),
+
@Resource(destination="WEB-INF/classes/org/jboss/webbeans/test/unit/xml/duplicate-deployments-beans.xml",
source="/org/jboss/webbeans/test/unit/xml/duplicate-deployments-beans.xml"),
+
@Resource(destination="WEB-INF/classes/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml",
source="/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml")
+})
+public class BeansXmlParserTest extends AbstractWebBeansTest
+{
+
+ private static final ResourceLoader RESOURCE_LOADER = new MockResourceLoader();
+
+ // Quick unit tests for the parser
+ @Test
+ public void testDefaultDeploymentTypes()
+ {
+ Iterable<URL> urls = getResources("default-beans.xml");
+ int i = 0;
+ Iterator<URL> it = urls.iterator();
+ while (it.hasNext())
+ {
+ i++;
+ it.next();
+ }
+ assert i == 1;
+ BeansXmlParser parser = new BeansXmlParser(RESOURCE_LOADER, urls);
+ parser.parse();
+ assert parser.getEnabledDeploymentTypes().size() == 2;
+ assert parser.getEnabledDeploymentTypes().get(0).equals(Standard.class);
+ assert parser.getEnabledDeploymentTypes().get(1).equals(Production.class);
+ }
+
+ @Test
+ public void testUserDefinedDeploymentType()
+ {
+ Iterable<URL> urls = getResources("user-defined-beans.xml");
+ BeansXmlParser parser = new BeansXmlParser(RESOURCE_LOADER, urls);
+ parser.parse();
+ assert parser.getEnabledDeploymentTypes().size() == 3;
+ assert parser.getEnabledDeploymentTypes().get(0).equals(Standard.class);
+ assert parser.getEnabledDeploymentTypes().get(1).equals(Production.class);
+ assert
parser.getEnabledDeploymentTypes().get(2).equals(AnotherDeploymentType.class);
+ }
+
+ /**
+ * Test case for WBRI-21.
+ */
+ @Test(expectedExceptions=DeploymentException.class, description="WBRI-21")
+ public void testDuplicateDeployElement()
+ {
+ Iterable<URL> urls =
getResources("duplicate-deployments-beans.xml");
+ BeansXmlParser parser = new BeansXmlParser(RESOURCE_LOADER, urls);
+ parser.parse();
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/Order.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/Order.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/Order.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.xml.beans;
+
+public class Order
+{
+
+}
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/AnotherDeploymentType.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/AnotherDeploymentType.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/AnotherDeploymentType.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,20 @@
+package org.jboss.webbeans.test.unit.xml.parser;
+
+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
+{
+
+}
\ No newline at end of file
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,63 @@
+package org.jboss.webbeans.test.unit.xml.parser;
+
+import java.lang.reflect.AnnotatedElement;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.jboss.webbeans.test.unit.xml.beans.Order;
+import org.jboss.webbeans.util.xml.XmlParserImpl;
+import org.testng.annotations.Test;
+
+@Artifact
+@Resources({
+ @Resource(source="/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml",
destination="WEB-INF/classes/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml"
)
+})
+(a)Classes({Order.class})
+public class XmlParserImplTest extends AbstractWebBeansTest
+{
+ @Test
+ public void testParse()
+ {
+ Set<URL> xmls = new HashSet<URL>();
+ Iterable<URL> urls = getResources("user-defined-beans.xml");
+
+ for (URL url : urls)
+ xmls.add(url);
+
+ XmlParserImpl parser = new XmlParserImpl();
+ Set<AnnotatedElement> aSet = parser.parse(xmls);
+
+ for(AnnotatedElement aElement : aSet){
+ assert aElement.equals(Order.class);
+ }
+ assert aSet.size() == 1;
+ }
+}
+
+/*
+<Beans xmlns="urn:java:ee"
xmlns:myapp="urn:java:com.mydomain.myapp"
+xmlns:test="urn:java:org.jboss.webbeans.test.unit.xml">
+<Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+</Deploy>
+<myapp:Order>
+ <ConversationScoped />
+ <myapp:PaymentProcessor>
+ <myapp:Asynchronous />
+ </myapp:PaymentProcessor>
+ <myapp:User />
+</myapp:Order>
+<myapp:Login>
+ <ConversationScoped />
+ <BindingType />
+</myapp:Login>
+</Beans>
+*/
Added: ri/trunk/tests/src/test/resources/META-INF/web-beans-tck.properties
===================================================================
--- ri/trunk/tests/src/test/resources/META-INF/web-beans-tck.properties
(rev 0)
+++ ri/trunk/tests/src/test/resources/META-INF/web-beans-tck.properties 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,3 @@
+org.jboss.testharness.spi.StandaloneContainers=org.jboss.webbeans.test.unit.StandaloneContainersImpl
+org.jboss.testharness.api.TestLauncher=org.jboss.testharness.impl.runner.servlet.ServletTestLauncher
+org.jboss.testharness.testPackage=org.jboss.webbeans.test
\ No newline at end of file
Added: ri/trunk/tests/src/test/resources/jndi.properties
===================================================================
--- ri/trunk/tests/src/test/resources/jndi.properties (rev 0)
+++ ri/trunk/tests/src/test/resources/jndi.properties 2009-03-16 22:47:34 UTC (rev 2057)
@@ -0,0 +1,4 @@
+#jboss JNDI properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
\ No newline at end of file
Added:
ri/trunk/tests/src/test/resources/org/jboss/testharness/impl/packaging/ear/ejb-jar.xml
===================================================================
---
ri/trunk/tests/src/test/resources/org/jboss/testharness/impl/packaging/ear/ejb-jar.xml
(rev 0)
+++
ri/trunk/tests/src/test/resources/org/jboss/testharness/impl/packaging/ear/ejb-jar.xml 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+ version="3.0">
+
+</ejb-jar>
Added:
ri/trunk/tests/src/test/resources/org/jboss/testharness/impl/packaging/jsr299/default/beans.xml
===================================================================
Added: ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/examples/beans.xml
===================================================================
--- ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/examples/beans.xml
(rev 0)
+++
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/examples/beans.xml 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.webbeans.test.examples">
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:Mock />
+ </Deploy>
+</Beans>
Added:
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/bootstrap/test-beans.xml
===================================================================
---
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/bootstrap/test-beans.xml
(rev 0)
+++
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/bootstrap/test-beans.xml 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,8 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.webbeans.test.unit.bootstrap">
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+</Beans>
Added:
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/default-beans.xml
===================================================================
--- ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/default-beans.xml
(rev 0)
+++
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/default-beans.xml 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,6 @@
+<Beans xmlns="urn:java:ee">
+ <Deploy>
+ <Standard />
+ <Production />
+ </Deploy>
+</Beans>
Added:
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/duplicate-deployments-beans.xml
===================================================================
---
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/duplicate-deployments-beans.xml
(rev 0)
+++
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/duplicate-deployments-beans.xml 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,10 @@
+<Beans xmlns="urn:java:ee">
+ <Deploy>
+ <Standard />
+ <Production />
+ </Deploy>
+ <Deploy>
+ <Standard />
+ <Production />
+ </Deploy>
+</Beans>
Added:
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/parser/user-defined-beans.xml
===================================================================
---
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/parser/user-defined-beans.xml
(rev 0)
+++
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/parser/user-defined-beans.xml 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,19 @@
+<Beans xmlns="urn:java:ee"
xmlns:myapp="urn:java:org.jboss.webbeans.test.unit.xml.beans"
+ xmlns:test="urn:java:org.jboss.webbeans.test.unit.xml.parser">
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+ <myapp:Order>
+ <ConversationScoped />
+ <myapp:PaymentProcessor>
+ <myapp:Asynchronous />
+ </myapp:PaymentProcessor>
+ <myapp:User />
+ </myapp:Order>
+ <myapp:Login>
+ <ConversationScoped />
+ <BindingType />
+ </myapp:Login>
+</Beans>
\ No newline at end of file
Added:
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml
===================================================================
---
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml
(rev 0)
+++
ri/trunk/tests/src/test/resources/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml 2009-03-16
22:47:34 UTC (rev 2057)
@@ -0,0 +1,19 @@
+<Beans xmlns="urn:java:ee"
xmlns:myapp="urn:java:org.jboss.webbeans.test.unit.xml.beans"
+ xmlns:test="urn:java:org.jboss.webbeans.test.unit.xml">
+ <Deploy>
+ <Standard />
+ <Production />
+ <test:AnotherDeploymentType />
+ </Deploy>
+ <myapp:Order>
+ <ConversationScoped />
+ <myapp:PaymentProcessor>
+ <myapp:Asynchronous />
+ </myapp:PaymentProcessor>
+ <myapp:User />
+ </myapp:Order>
+ <myapp:Login>
+ <ConversationScoped />
+ <BindingType />
+ </myapp:Login>
+</Beans>
\ No newline at end of file
Added: ri/trunk/tests/unit-tests.xml
===================================================================
--- ri/trunk/tests/unit-tests.xml (rev 0)
+++ ri/trunk/tests/unit-tests.xml 2009-03-16 22:47:34 UTC (rev 2057)
@@ -0,0 +1,50 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="Web Beans RI" verbose="1" >
+
+ <test name="Web Beans RI">
+ <groups>
+ <run>
+<!--
+ <exclude name="specialization" />
+ <exclude name="deployment" />
+ <exclude name="disposalMethod" />
+
+ <exclude name="observerMethod" />
+ <exclude name="deferredEvent" />
+ <exclude name="ejb3" />
+ <exclude name="webservice" />
+ <exclude name="annotationDefinition" />
+ <exclude name="webbeansxml" />
+ <exclude name="el" />
+ <exclude name="jms" />
+ <exclude name="interceptors" />
+ <exclude name="decorators" />
+ <exclude name="servlet" />
+
+ <exclude name="passivation" />
+ <exclude name="singletons" />
+ <exclude name="ejbjarxml" />
+ <exclude name="beanDestruction" />
+ <exclude name="commonAnnotations" />
+-->
+ <exclude name="stub" />
+ <exclude name="broken" />
+ </run>
+ </groups>
+ <packages>
+ <package name="org.jboss.webbeans.test.examples" />
+ <package name="org.jboss.webbeans.test.unit.bootstrap" />
+ <package name="org.jboss.webbeans.test.unit.context" />
+ <package name="org.jboss.webbeans.test.unit.definition" />
+ <package name="org.jboss.webbeans.test.unit.event" />
+ <package name="org.jboss.webbeans.test.unit.implementation" />
+ <package name="org.jboss.webbeans.test.unit.implementation.proxy"
/>
+ <package
name="org.jboss.webbeans.test.unit.implementation.exceptions" />
+ <package name="org.jboss.webbeans.test.unit.lookup" />
+ <package name="org.jboss.webbeans.test.unit.lookup.circular" />
+ <package name="org.jboss.webbeans.test.unit.xml" />
+ </packages>
+ </test>
+
+</suite>
\ No newline at end of file