[webbeans-commits] Webbeans SVN: r2057 - in ri/trunk: impl and 71 other directories.
by webbeans-commits@lists.jboss.org
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)
-@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
+@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)
+@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</a>
+ */
+ @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
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2056 - in extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd: helpers and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-03-16 18:43:16 -0400 (Mon, 16 Mar 2009)
New Revision: 2056
Added:
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/NamespaceGenerator.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/test/
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/test/Foo.java
Modified:
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageInfo.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java
Log:
Namespace stuff
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageInfo.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageInfo.java 2009-03-16 22:20:41 UTC (rev 2055)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageInfo.java 2009-03-16 22:43:16 UTC (rev 2056)
@@ -15,6 +15,7 @@
private Document schema;
private String packageName;
private Map<String, Set<String>> typeReferences;
+ private String namespace;
public PackageInfo(String packageName)
{
@@ -26,8 +27,7 @@
{
for (TypedModel reference : references)
{
- String key = reference.isPrimitive() ? "" : reference.getTypePackage();
- Set<String> typeNames = typeReferences.get(key);
+ Set<String> typeNames = typeReferences.get(reference.getTypePackage());
if (typeNames == null)
{
typeNames = new HashSet<String>();
@@ -71,4 +71,14 @@
{
return typeReferences;
}
+
+ public String getNamespace()
+ {
+ return namespace;
+ }
+
+ public void setNamespace(String namespace)
+ {
+ this.namespace = namespace;
+ }
}
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java 2009-03-16 22:20:41 UTC (rev 2055)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java 2009-03-16 22:43:16 UTC (rev 2056)
@@ -120,7 +120,6 @@
}
// Place the new class model in the cache
helper.cacheClassModel(classModel);
- System.out.println(classModel);
return classModel;
}
Added: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/NamespaceGenerator.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/NamespaceGenerator.java (rev 0)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/NamespaceGenerator.java 2009-03-16 22:43:16 UTC (rev 2056)
@@ -0,0 +1,48 @@
+package org.jboss.webbeans.xsd.helpers;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+public class NamespaceGenerator
+{
+ private static final Set<String> URN_JAVA_EE = new HashSet<String>(Arrays.asList("java.lang", "java.util", "javax.annotation", "javax.inject", "javax.context", "javax.interceptor", "javax.decorator", "javax.event", "javax.ejb", "javax.persistence", "javax.xml.ws", "javax.jms", "javax.sql"));
+
+ public Map<String, Integer> counters = new HashMap<String, Integer>();
+
+ public String getNamespace(String packageName)
+ {
+ String shortName = getShortName(packageName);
+ if (URN_JAVA_EE.contains(getBasePackage(packageName)))
+ {
+ return "xmlns=\"urn:java:ee\"";
+ }
+ Integer count = counters.get(shortName);
+ String countString = "";
+ if (count == null)
+ {
+ count = new Integer(1);
+ counters.put(shortName, count);
+ }
+ else
+ {
+ count++;
+ countString = String.valueOf(count);
+ }
+ return "xmlns:" + shortName + countString + "=\"java:urn:" + packageName + "\"";
+ }
+
+ private String getBasePackage(String packageName)
+ {
+ return packageName.substring(0, getShortName(packageName).length());
+ }
+
+ private String getShortName(String packageName)
+ {
+ int lastDot = packageName.lastIndexOf(".");
+ return lastDot < 0 ? packageName : packageName.substring(lastDot + 1);
+ }
+
+}
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java 2009-03-16 22:20:41 UTC (rev 2055)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java 2009-03-16 22:43:16 UTC (rev 2056)
@@ -50,7 +50,6 @@
*/
public class XSDHelper
{
- public static final Set<String> URN_JAVA_EE = new HashSet<String>(Arrays.asList("java.lang", "java.util", "javax.annotation", "javax.inject", "javax.context", "javax.interceptor", "javax.decorator", "javax.event", "javax.ejb", "javax.persistence", "javax.xml.ws", "javax.jms", "javax.sql"));
// The filed of the annotation processing environment
private Filer filer;
@@ -58,6 +57,7 @@
private Map<String, ClassModel> classModelCache = new HashMap<String, ClassModel>();
// The XSD documents of the affected packages
private Map<String, PackageInfo> packageInfoMap = new HashMap<String, PackageInfo>();
+ private NamespaceGenerator namespaceGenerator = new NamespaceGenerator();
/**
* Creates a new helper
@@ -72,7 +72,7 @@
/**
* Reads package info
*
- * @param packageName The package name
+ * @param packageName The package name
* @return The package info of the package
* @throws DocumentException If the schema could not be parsed
* @throws IOException If the schema could not be read
@@ -174,7 +174,7 @@
*
* @param packageName The package name
* @param schema The schema
- * @throws IOException If the file could not be written
+ * @throws IOException If the file could not be written
*/
private void writeSchema(String packageName, Document schema) throws IOException
{
@@ -208,7 +208,8 @@
{
String packageName = classModel.getPackage();
PackageInfo packageInfo = packageInfoMap.get(packageName);
- if (packageInfo == null) {
+ if (packageInfo == null)
+ {
try
{
packageInfo = readPackageInfo(packageName);
@@ -224,10 +225,6 @@
packageInfoMap.put(packageName, packageInfo);
}
updateClassInSchema(classModel, packageInfo);
- System.out.println("-------------");
- for (Entry<String, Set<String>> e : packageInfo.getTypeReferences().entrySet()) {
- System.out.println(e.getKey() + "=>" + e.getValue());
- }
}
}
@@ -236,7 +233,11 @@
*/
public void writeSchemas()
{
- for (PackageInfo packageInfo : packageInfoMap.values()) {
+ for (PackageInfo packageInfo : packageInfoMap.values())
+ {
+ packageInfo.setNamespace(namespaceGenerator.getNamespace(packageInfo.getPackageName()));
+ System.out.println(packageInfo.getPackageName() + " (" + packageInfo.getNamespace() + ")");
+ System.out.println(packageInfo.getTypeReferences());
writePackageInfo(packageInfo);
}
}
@@ -262,18 +263,6 @@
}
/**
- * Gets the short name of a package (the last part)
- *
- * @param packageName The package name
- * @return A short name
- */
- private String getShortName(String packageName)
- {
- int lastDot = packageName.lastIndexOf(".");
- return lastDot < 0 ? packageName : packageName.substring(lastDot + 1);
- }
-
- /**
* Gets a cached class model
*
* @param FQN The FQN of the class
Added: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/test/Foo.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/test/Foo.java (rev 0)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/test/Foo.java 2009-03-16 22:43:16 UTC (rev 2056)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.xsd.test.test;
+
+public class Foo
+{
+
+}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2055 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck: tests/context/passivating and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-16 18:20:41 -0400 (Mon, 16 Mar 2009)
New Revision: 2055
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/packaging/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/runner/
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
Log:
fix test
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java 2009-03-16 22:19:57 UTC (rev 2054)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java 2009-03-16 22:20:41 UTC (rev 2055)
@@ -2,5 +2,10 @@
class HelsinkiNonSerializable
{
+
+ public void ping()
+ {
+
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-03-16 22:19:57 UTC (rev 2054)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-03-16 22:20:41 UTC (rev 2055)
@@ -179,11 +179,11 @@
assert getCurrentManager().resolveByType(TurkuLocal.class).size() == 1;
}
- @Test(expectedExceptions = IllegalProductException.class, groups = "broken")
+ @Test(expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "8.4", id = "cc")
public void testNonSerializableProducerFieldDeclaredPassivatingThrowsIllegalProductException()
{
- getCurrentManager().getInstanceByType(HelsinkiNonSerializable.class);
+ getCurrentManager().getInstanceByType(HelsinkiNonSerializable.class).ping();
}
}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2054 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-16 18:19:57 -0400 (Mon, 16 Mar 2009)
New Revision: 2054
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
fix wording
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-16 22:13:53 UTC (rev 2053)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-16 22:19:57 UTC (rev 2054)
@@ -2997,7 +2997,7 @@
</assertion>
<assertion id="ad">
- <text>The container-provided Manager bean has a binding type of @Current.</text>
+ <text>The container-provided Manager bean has a binding of @Current.</text>
</assertion>
<assertion id="b">
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2053 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-16 18:13:53 -0400 (Mon, 16 Mar 2009)
New Revision: 2053
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
Log:
8.4 tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer.java 2009-03-16 22:04:04 UTC (rev 2052)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityProducer.java 2009-03-16 22:13:53 UTC (rev 2053)
@@ -1,10 +1,13 @@
package org.jboss.jsr299.tck.tests.context.passivating;
import javax.context.Dependent;
+import javax.context.SessionScoped;
import javax.inject.Produces;
@AnotherDeploymentType
class CityProducer
{
@Produces @Dependent public Violation reference = new Violation();
+
+ @Produces @SessionScoped public HelsinkiNonSerializable helsinki = new HelsinkiNonSerializable();
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/HelsinkiNonSerializable.java 2009-03-16 22:13:53 UTC (rev 2053)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+class HelsinkiNonSerializable
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-03-16 22:04:04 UTC (rev 2052)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-03-16 22:13:53 UTC (rev 2053)
@@ -178,5 +178,12 @@
{
assert getCurrentManager().resolveByType(TurkuLocal.class).size() == 1;
}
+
+ @Test(expectedExceptions = IllegalProductException.class, groups = "broken")
+ @SpecAssertion(section = "8.4", id = "cc")
+ public void testNonSerializableProducerFieldDeclaredPassivatingThrowsIllegalProductException()
+ {
+ getCurrentManager().getInstanceByType(HelsinkiNonSerializable.class);
+ }
}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2052 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/lookup/injection/session and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-16 18:04:04 -0400 (Mon, 16 Mar 2009)
New Revision: 2052
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/DeluxeHenHouse.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/Fox.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouse.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouseLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/SessionBeanInjectionTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/session/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/session/beans.xml
Log:
section 4.2 tests
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/DeluxeHenHouse.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/DeluxeHenHouse.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/DeluxeHenHouse.java 2009-03-16 22:04:04 UTC (rev 2052)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.session;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.inject.Production;
+
+@Production
+@Stateful
+public class DeluxeHenHouse /*extends HenHouse */implements HenHouseLocal
+{
+ public Fox getFox()
+ {
+ //return fox;
+ return null;
+ }
+
+ @Remove
+ public void remove()
+ {
+
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/Fox.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/Fox.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/Fox.java 2009-03-16 22:04:04 UTC (rev 2052)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.session;
+
+import java.io.Serializable;
+
+import javax.context.Dependent;
+
+@Dependent
+class Fox implements Serializable
+{
+ public String getName()
+ {
+ return "gavin";
+ }
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouse.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouse.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouse.java 2009-03-16 22:04:04 UTC (rev 2052)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.session;
+
+import javax.inject.Current;
+
+class HenHouse
+{
+ @Current
+ public Fox fox;
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouseLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouseLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/HenHouseLocal.java 2009-03-16 22:04:04 UTC (rev 2052)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.session;
+
+import javax.ejb.Local;
+
+@Local
+public interface HenHouseLocal
+{
+ Fox getFox();
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/SessionBeanInjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/SessionBeanInjectionTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/session/SessionBeanInjectionTest.java 2009-03-16 22:04:04 UTC (rev 2052)
@@ -0,0 +1,36 @@
+package org.jboss.jsr299.tck.tests.lookup.injection.session;
+
+import javax.inject.manager.Bean;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: PRD2
+ */
+@Artifact
+(a)Packaging(PackagingType.EAR)
+public class SessionBeanInjectionTest extends AbstractJSR299Test
+{
+ @Test(groups = "broken")
+ @SpecAssertion(section = "4.2", id = "ab")
+ public void testFieldDeclaredInSessionBeanSuperclassInjected() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ Bean<HenHouseLocal> bean = getCurrentManager().resolveByType(HenHouseLocal.class).iterator().next();
+ HenHouseLocal henHouse = getCurrentManager().getInstance(bean);
+ assert henHouse.getFox() != null;
+ assert henHouse.getFox().getName().equals("gavin");
+ }
+ }.run();
+ }
+}
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/session/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/session/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/injection/session/beans.xml 2009-03-16 22:04:04 UTC (rev 2052)
@@ -0,0 +1,7 @@
+<Beans xmlns="urn:java:ee"
+ xmlns:test="urn:java:org.jboss.jsr299.tck.tests.lookup.injection">
+ <Deploy>
+ <Standard />
+ <Production />
+ </Deploy>
+</Beans>
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2051 - in extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd: helpers and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-03-16 17:35:01 -0400 (Mon, 16 Mar 2009)
New Revision: 2051
Added:
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/TypedModel.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Bar.java
Modified:
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageInfo.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/DataSetter.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/FieldModel.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ParameterModel.java
extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Foo.java
Log:
return types, change in hierarchy etc.
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageInfo.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageInfo.java 2009-03-16 21:17:53 UTC (rev 2050)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageInfo.java 2009-03-16 21:35:01 UTC (rev 2051)
@@ -1,20 +1,42 @@
package org.jboss.webbeans.xsd;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
import org.dom4j.Document;
+import org.jboss.webbeans.xsd.model.TypedModel;
public class PackageInfo
{
private List<String> namespaces;
private Document schema;
private String packageName;
+ private Map<String, Set<String>> typeReferences;
public PackageInfo(String packageName)
{
this.packageName = packageName;
+ typeReferences = new HashMap<String, Set<String>>();
}
+ public void addTypeReferences(Set<TypedModel> references)
+ {
+ for (TypedModel reference : references)
+ {
+ String key = reference.isPrimitive() ? "" : reference.getTypePackage();
+ Set<String> typeNames = typeReferences.get(key);
+ if (typeNames == null)
+ {
+ typeNames = new HashSet<String>();
+ typeReferences.put(reference.getTypePackage(), typeNames);
+ }
+ typeNames.add(reference.getType());
+ }
+ }
+
public List<String> getNamespaces()
{
return namespaces;
@@ -44,5 +66,9 @@
{
this.packageName = packageName;
}
-
+
+ public Map<String, Set<String>> getTypeReferences()
+ {
+ return typeReferences;
+ }
}
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java 2009-03-16 21:17:53 UTC (rev 2050)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java 2009-03-16 21:35:01 UTC (rev 2051)
@@ -64,6 +64,7 @@
List<ClassModel> workingSet = new ArrayList<ClassModel>();
// Iterates over the classes compiled, creates a model of the classes and
// add them to a working set
+
for (Element element : roundEnv.getRootElements())
{
workingSet.add(inspectClass(element));
@@ -87,8 +88,9 @@
private ClassModel inspectClass(Element element)
{
TypeElement typeElement = (TypeElement) element;
+
ClassModel classModel = new ClassModel();
-
+
// If the class has superclass's, scan them recursively
if (typeElement.getSuperclass().getKind() != TypeKind.NONE)
{
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/DataSetter.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/DataSetter.java 2009-03-16 21:17:53 UTC (rev 2050)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/DataSetter.java 2009-03-16 21:35:01 UTC (rev 2051)
@@ -28,11 +28,13 @@
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
+import javax.lang.model.type.TypeKind;
import org.jboss.webbeans.xsd.model.ClassModel;
import org.jboss.webbeans.xsd.model.FieldModel;
import org.jboss.webbeans.xsd.model.MethodModel;
import org.jboss.webbeans.xsd.model.ParameterModel;
+import org.jboss.webbeans.xsd.model.TypedModel;
/**
* Helper for examining classes and members and populating the model
@@ -84,8 +86,14 @@
}
String name = element.getSimpleName().toString();
String type = element.asType().toString();
+ boolean primitive = element.asType().getKind().isPrimitive();
Map<String, Set<String>> annotations = getAnnotations(element);
- classModel.addField(new FieldModel(name, type, annotations));
+ FieldModel field = new FieldModel();
+ field.setName(name);
+ field.setType(type);
+ field.setPrimitive(primitive);
+ field.setAnnotations(annotations);
+ classModel.addField(field);
}
/**
@@ -103,16 +111,27 @@
ExecutableElement executableElement = (ExecutableElement) element;
String name = element.getSimpleName().toString();
- String returnType = executableElement.getReturnType().toString();
- Map<String, Set<String>> annotations = getAnnotations(element);
- MethodModel method = new MethodModel(name, returnType, annotations);
+
+ TypedModel returnType = new TypedModel();
+ returnType.setType(executableElement.getReturnType().toString());
+ returnType.setPrimitive(executableElement.getReturnType().getKind().isPrimitive() || executableElement.getReturnType().getKind() == TypeKind.VOID);
+
+ MethodModel method = new MethodModel();
+ method.setName(name);
+ method.setAnnotations(getAnnotations(executableElement));
+ method.setReturnType(returnType);
for (VariableElement parameterElement : executableElement.getParameters())
{
String paramName = parameterElement.getSimpleName().toString();
String paramType = parameterElement.asType().toString();
- Map<String, Set<String>> paramAnnotations = getAnnotations(element);
- ParameterModel parameter = new ParameterModel(paramName, paramType, paramAnnotations);
+ boolean paramPrimitive = parameterElement.asType().getKind().isPrimitive();
+ Map<String, Set<String>> paramAnnotations = getAnnotations(parameterElement);
+ ParameterModel parameter = new ParameterModel();
+ parameter.setName(paramName);
+ parameter.setType(paramType);
+ parameter.setPrimitive(paramPrimitive);
+ parameter.setAnnotations(paramAnnotations);
method.addParameter(parameter);
}
// OK, cheating a little with a common model for methods and constructors
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java 2009-03-16 21:17:53 UTC (rev 2050)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java 2009-03-16 21:35:01 UTC (rev 2051)
@@ -27,6 +27,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.Map.Entry;
import javax.annotation.processing.Filer;
import javax.tools.StandardLocation;
@@ -222,7 +223,11 @@
}
packageInfoMap.put(packageName, packageInfo);
}
- updateClassInSchema(classModel, packageInfo.getSchema());
+ updateClassInSchema(classModel, packageInfo);
+ System.out.println("-------------");
+ for (Entry<String, Set<String>> e : packageInfo.getTypeReferences().entrySet()) {
+ System.out.println(e.getKey() + "=>" + e.getValue());
+ }
}
}
@@ -239,11 +244,12 @@
/**
* Updates a schema with XSD from a file model
*
- * @param schema The schema
+ * @param packageInfo The schema
* @param classModel The class model
*/
- private void updateClassInSchema(ClassModel classModel, Document schema)
+ private void updateClassInSchema(ClassModel classModel, PackageInfo packageInfo)
{
+ Document schema = packageInfo.getSchema();
Node oldClassModel = schema.selectSingleNode("//" + classModel.getSimpleName());
if (oldClassModel != null)
{
@@ -252,6 +258,7 @@
}
// Create a new one
schema.getRootElement().addElement(classModel.getSimpleName());
+ packageInfo.addTypeReferences(classModel.getTypeReferences());
}
/**
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java 2009-03-16 21:17:53 UTC (rev 2050)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java 2009-03-16 21:35:01 UTC (rev 2051)
@@ -41,13 +41,6 @@
private List<MethodModel> constructors = new ArrayList<MethodModel>();
/**
- * Creates a new class model
- */
- public ClassModel()
- {
- }
-
- /**
* Adds a field to the class model
*
* @param fieldModel The field to add
@@ -110,28 +103,6 @@
}
/**
- * Gets the package of the file
- *
- * @return The package
- */
- public String getPackage()
- {
- int lastDot = name.lastIndexOf(".");
- return lastDot < 0 ? name : name.substring(0, lastDot);
- }
-
- /**
- * Gets the simple name of the class
- *
- * @return The simple name
- */
- public String getSimpleName()
- {
- int lastDot = name.lastIndexOf(".");
- return lastDot < 0 ? name : name.substring(lastDot + 1);
- }
-
- /**
* Gets the merged hierarchy of available constructors. Returns the
* constructors of this class since constructors aren't inherited
*
@@ -196,29 +167,41 @@
return mergedMethods;
}
- public Set<String> getReferencedTypes()
+ public Set<TypedModel> getTypeReferences()
{
- Set<String> types = new HashSet<String>();
+ Set<TypedModel> typeReferences = new HashSet<TypedModel>();
for (FieldModel field : getMergedFields())
{
- types.add(field.getType());
+ typeReferences.add(field);
}
for (MethodModel method : getMergedMethods())
{
- types.add(method.getReturnType());
+ typeReferences.add(method.getReturnType());
for (ParameterModel parameter : method.getParameters())
{
- types.add(parameter.getType());
+ typeReferences.add(parameter);
}
}
for (MethodModel constructor : getMergedConstructors())
{
for (ParameterModel parameter : constructor.getParameters())
{
- types.add(parameter.getType());
+ typeReferences.add(parameter);
}
}
- return types;
+ return typeReferences;
}
+ public String getPackage()
+ {
+ int lastDot = name.lastIndexOf(".");
+ return lastDot < 0 ? "nopak" : name.substring(0, lastDot);
+ }
+
+ public String getSimpleName()
+ {
+ int lastDot = name.lastIndexOf(".");
+ return lastDot < 0 ? name : name.substring(lastDot + 1);
+ }
+
}
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/FieldModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/FieldModel.java 2009-03-16 21:17:53 UTC (rev 2050)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/FieldModel.java 2009-03-16 21:35:01 UTC (rev 2051)
@@ -17,9 +17,6 @@
package org.jboss.webbeans.xsd.model;
-import java.util.Map;
-import java.util.Set;
-
/**
* A model of a field
*
@@ -28,19 +25,7 @@
*/
public class FieldModel extends NamedModel
{
- protected String type;
- public FieldModel(String name, String type, Map<String, Set<String>> annotations)
- {
- super(name, annotations);
- this.type = type;
- }
-
- public String getType()
- {
- return type;
- }
-
@Override
public boolean equals(Object other)
{
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java 2009-03-16 21:17:53 UTC (rev 2050)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java 2009-03-16 21:35:01 UTC (rev 2051)
@@ -19,8 +19,6 @@
import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
-import java.util.Set;
/**
* The model of a method
@@ -30,18 +28,17 @@
*/
public class MethodModel extends NamedModel
{
- private String returnType;
+ private TypedModel returnType;
private List<ParameterModel> parameters = new ArrayList<ParameterModel>();
- public MethodModel(String name, String returnType, Map<String, Set<String>> annotations)
+ public TypedModel getReturnType()
{
- super(name, annotations);
- this.returnType = returnType;
+ return returnType;
}
- public void addParameter(ParameterModel parameter)
+ public void setReturnType(TypedModel returnType)
{
- parameters.add(parameter);
+ this.returnType = returnType;
}
public List<ParameterModel> getParameters()
@@ -49,10 +46,15 @@
return parameters;
}
- public String getReturnType()
+ public void setParameters(List<ParameterModel> parameters)
{
- return returnType;
+ this.parameters = parameters;
}
+
+ public void addParameter(ParameterModel parameter)
+ {
+ parameters.add(parameter);
+ }
@Override
public boolean equals(Object other)
@@ -71,7 +73,7 @@
public String toString()
{
String annotationString = (annotations.isEmpty()) ? "" : "@" + annotations + ": ";
- return "\n " + annotationString + returnType + " " + name + "(" + (parameters.isEmpty() ? "" : parameters) + ")";
+ return "\n " + annotationString + returnType.getType() + " " + name + "(" + (parameters.isEmpty() ? "" : parameters) + ")";
}
}
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java 2009-03-16 21:17:53 UTC (rev 2050)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java 2009-03-16 21:35:01 UTC (rev 2051)
@@ -27,21 +27,11 @@
* @author Nicklas Karlsson
*
*/
-public class NamedModel
+public class NamedModel extends TypedModel
{
protected String name;
protected Map<String, Set<String>> annotations = new HashMap<String, Set<String>>();
- public NamedModel()
- {
- }
-
- public NamedModel(String name, Map<String, Set<String>> annotations)
- {
- this.name = name;
- this.annotations.putAll(annotations);
- }
-
public String getName()
{
return name;
@@ -61,4 +51,17 @@
{
this.annotations = annotations;
}
+
+ @Override
+ public boolean equals(Object other)
+ {
+ return name.equals(other);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return name.hashCode();
+ }
+
}
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ParameterModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ParameterModel.java 2009-03-16 21:17:53 UTC (rev 2050)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/ParameterModel.java 2009-03-16 21:35:01 UTC (rev 2051)
@@ -17,8 +17,6 @@
package org.jboss.webbeans.xsd.model;
-import java.util.Map;
-import java.util.Set;
/**
* The model of a method or constrcutor parameter
@@ -28,16 +26,11 @@
*/
public class ParameterModel extends FieldModel
{
-
- public ParameterModel(String name, String type, Map<String, Set<String>> annotations)
- {
- super(name, type, annotations);
- }
@Override
public boolean equals(Object other)
{
- ParameterModel otherModel = (ParameterModel) other;
+ TypedModel otherModel = (TypedModel) other;
return type.equals(otherModel.getType());
}
Added: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/TypedModel.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/TypedModel.java (rev 0)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/model/TypedModel.java 2009-03-16 21:35:01 UTC (rev 2051)
@@ -0,0 +1,56 @@
+package org.jboss.webbeans.xsd.model;
+
+public class TypedModel
+{
+ protected String type;
+ protected boolean primitive;
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public boolean isPrimitive()
+ {
+ return primitive;
+ }
+
+ public void setPrimitive(boolean primitive)
+ {
+ this.primitive = primitive;
+ }
+
+ public String getTypePackage()
+ {
+ if (primitive)
+ {
+ return "";
+ }
+ int lastDot = type.lastIndexOf(".");
+ return lastDot < 0 ? "nopak" : type.substring(0, lastDot);
+ }
+
+ public String getTypeSimpleName()
+ {
+ int lastDot = type.lastIndexOf(".");
+ return lastDot < 0 ? type : type.substring(lastDot + 1);
+ }
+
+ @Override
+ public boolean equals(Object other)
+ {
+ return type.equals(other);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return type.hashCode();
+ }
+
+}
Added: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Bar.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Bar.java (rev 0)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Bar.java 2009-03-16 21:35:01 UTC (rev 2051)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.xsd.test;
+
+public class Bar
+{
+
+}
Modified: extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Foo.java
===================================================================
--- extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Foo.java 2009-03-16 21:17:53 UTC (rev 2050)
+++ extensions/trunk/xsd/src/main/java/org/jboss/webbeans/xsd/test/Foo.java 2009-03-16 21:35:01 UTC (rev 2051)
@@ -8,6 +8,8 @@
{
@Current
public String foo;
+ public int poo;
+ public Bar bar;
@Initializer
public Foo(String foo)
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2050 - in ri/trunk/impl/src: main/java/org/jboss/webbeans/introspector/jlr and 4 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-16 17:17:53 -0400 (Mon, 16 Mar 2009)
New Revision: 2050
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ConstructorSignature.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/MethodSignature.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/parser/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/parser/AnotherDeploymentType.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java
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/parser/user-defined-beans.xml
Removed:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/XmlParserImplTest.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedAnnotation.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedConstructor.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedField.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMethod.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedParameter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
Log:
fix parser test i/c and add methods to access members by signature
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java 2009-03-16 19:15:19 UTC (rev 2049)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -19,7 +19,6 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
-import java.util.List;
import java.util.Set;
/**
@@ -106,7 +105,7 @@
* @param parameterTypes the parameters of the constructor
* @return the matching constructor, or null if not defined
*/
- public AnnotatedConstructor<T> getDeclaredConstructor(List<AnnotatedClass<?>> parameterTypes);
+ public AnnotatedConstructor<T> getDeclaredConstructor(ConstructorSignature signature);
/**
* Gets all methods annotated with annotationType
@@ -141,12 +140,11 @@
* Get a method by name
*
* @param <M> the expected return type
- * @param methodName the name of the method
+ * @param signature the name of the method
* @param expectedReturnType the expected return type
- * @param parameterTypes the parameter types of the method
* @return the method, or null if it doesn't exist
*/
- public <M> AnnotatedMethod<M> getDeclaredMethod(String methodName, AnnotatedClass<M> expectedReturnType, AnnotatedClass<?>... parameterTypes);
+ public <M> AnnotatedMethod<M> getDeclaredMethod(MethodSignature signature, AnnotatedClass<M> expectedReturnType);
// TODO Replace with AnnotatedMethod variant
@Deprecated
@@ -187,5 +185,9 @@
public boolean isParameterizedType();
public boolean isAbstract();
+
+ public <S> S cast(Object object);
+
+ public <U> AnnotatedClass<? extends U> asSubclass(AnnotatedClass<U> clazz);
}
\ No newline at end of file
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java 2009-03-16 19:15:19 UTC (rev 2049)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -62,5 +62,7 @@
* @return An abstraction of the declaring class
*/
public AnnotatedType<T> getDeclaringClass();
+
+ public ConstructorSignature getSignature();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2009-03-16 19:15:19 UTC (rev 2049)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -111,5 +111,7 @@
public boolean isEquivalent(Method method);
public Method getAnnotatedMethod();
+
+ public MethodSignature getSignature();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java 2009-03-16 19:15:19 UTC (rev 2049)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -17,9 +17,6 @@
package org.jboss.webbeans.introspector;
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
import javax.inject.manager.Manager;
@@ -42,5 +39,4 @@
public AnnotatedMember<?, ?> getDeclaringMember();
- public AnnotatedParameter<T> wrap(Set<Annotation> annotations);
}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ConstructorSignature.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ConstructorSignature.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ConstructorSignature.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.introspector;
+
+
+public interface ConstructorSignature
+{
+
+ public String[] getParameterTypes();
+
+}
\ No newline at end of file
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ConstructorSignature.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedAnnotation.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedAnnotation.java 2009-03-16 19:15:19 UTC (rev 2049)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedAnnotation.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -35,9 +35,4 @@
return delegate().getMembers();
}
- public AnnotatedAnnotation<T> wrap(Set<Annotation> annotations)
- {
- throw new UnsupportedOperationException();
- }
-
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java 2009-03-16 19:15:19 UTC (rev 2049)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -18,7 +18,6 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
-import java.util.List;
import java.util.Set;
public abstract class ForwardingAnnotatedClass<T> extends ForwardingAnnotatedType<T> implements AnnotatedClass<T>
@@ -118,14 +117,26 @@
return delegate().getDeclaredField(fieldName, expectedType);
}
- public <M> AnnotatedMethod<M> getDeclaredMethod(String methodName, AnnotatedClass<M> expectedReturnType, AnnotatedClass<?>... parameterTypes)
+ public <M> AnnotatedMethod<M> getDeclaredMethod(MethodSignature signature, AnnotatedClass<M> expectedReturnType)
{
- return delegate().getDeclaredMethod(methodName, expectedReturnType, parameterTypes);
+ return delegate().getDeclaredMethod(signature, expectedReturnType);
}
- public AnnotatedConstructor<T> getDeclaredConstructor(List<AnnotatedClass<?>> parameterTypes)
+ public AnnotatedConstructor<T> getDeclaredConstructor(ConstructorSignature signature)
{
- return delegate().getDeclaredConstructor(parameterTypes);
+ return delegate().getDeclaredConstructor(signature);
}
+ public <U> AnnotatedClass<? extends U> asSubclass(AnnotatedClass<U> clazz)
+ {
+ return delegate().asSubclass(clazz);
+ }
+
+ public <S> S cast(Object object)
+ {
+ return delegate().<S>cast(object);
+ }
+
+
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedConstructor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedConstructor.java 2009-03-16 19:15:19 UTC (rev 2049)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedConstructor.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -20,7 +20,6 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
-import java.util.Set;
public abstract class ForwardingAnnotatedConstructor<T> extends ForwardingAnnotatedMember<T, Constructor<T>> implements AnnotatedConstructor<T>
{
@@ -47,12 +46,11 @@
{
return delegate().newInstance(parameters);
}
-
- public AnnotatedConstructor<T> wrap(Set<Annotation> annotations)
+
+ public ConstructorSignature getSignature()
{
- throw new UnsupportedOperationException();
+ return delegate().getSignature();
}
-
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedField.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedField.java 2009-03-16 19:15:19 UTC (rev 2049)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedField.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -16,9 +16,7 @@
*/
package org.jboss.webbeans.introspector;
-import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
-import java.util.Set;
public abstract class ForwardingAnnotatedField<T> extends ForwardingAnnotatedMember<T, Field> implements AnnotatedField<T>
{
@@ -59,12 +57,6 @@
public boolean isTransient()
{
return delegate().isTransient();
- }
-
- public AnnotatedField<T> wrap(Set<Annotation> annotations)
- {
- throw new UnsupportedOperationException();
- }
-
+ }
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMethod.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMethod.java 2009-03-16 19:15:19 UTC (rev 2049)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMethod.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -20,7 +20,6 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;
-import java.util.Set;
public abstract class ForwardingAnnotatedMethod<T> extends ForwardingAnnotatedMember<T, Method> implements AnnotatedMethod<T>
{
@@ -73,9 +72,9 @@
return delegate().isEquivalent(method);
}
- public AnnotatedMethod<T> wrap(Set<Annotation> annotations)
+ public MethodSignature getSignature()
{
- throw new UnsupportedOperationException();
+ return delegate().getSignature();
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedParameter.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedParameter.java 2009-03-16 19:15:19 UTC (rev 2049)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedParameter.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -16,9 +16,6 @@
*/
package org.jboss.webbeans.introspector;
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
import javax.inject.manager.Manager;
public abstract class ForwardingAnnotatedParameter<T> extends ForwardingAnnotatedItem<T, Object> implements AnnotatedParameter<T>
@@ -35,11 +32,6 @@
public T getValue(Manager manager)
{
return delegate().getValue(manager);
- }
-
- public AnnotatedParameter<T> wrap(Set<Annotation> annotations)
- {
- throw new UnsupportedOperationException();
- }
+ }
}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/MethodSignature.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/MethodSignature.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/MethodSignature.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.introspector;
+
+
+public interface MethodSignature
+{
+
+ public String getMethodName();
+
+ public String[] getParameterTypes();
+
+}
\ No newline at end of file
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/MethodSignature.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-03-16 19:15:19 UTC (rev 2049)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -35,6 +35,8 @@
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.introspector.ConstructorSignature;
+import org.jboss.webbeans.introspector.MethodSignature;
import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.Strings;
@@ -212,6 +214,8 @@
}
}
+
+
// The set of abstracted fields
private final Set<AnnotatedField<?>> fields;
// The map from annotation type to abstracted field with annotation
@@ -221,6 +225,7 @@
// The set of abstracted fields
private final Set<AnnotatedField<?>> declaredFields;
+ private final Map<String, AnnotatedField<?>> declaredFieldsByName;
// The map from annotation type to abstracted field with annotation
private final AnnotatedFieldMap declaredAnnotatedFields;
// The map from annotation type to abstracted field with meta-annotation
@@ -228,6 +233,7 @@
// The set of abstracted methods
private final Set<AnnotatedMethod<?>> methods;
+ private final Map<MethodSignature, AnnotatedMethod<?>> declaredMethodsBySignature;
// The map from annotation type to abstracted method with annotation
private final AnnotatedMethodMap annotatedMethods;
// The map from annotation type to method with a parameter with annotation
@@ -242,6 +248,7 @@
// The set of abstracted constructors
private final Set<AnnotatedConstructor<T>> constructors;
+ private final Map<ConstructorSignature, AnnotatedConstructor<?>> declaredConstructorsBySignature;
// The map from annotation type to abstracted constructor with annotation
private final AnnotatedConstructorMap annotatedConstructors;
// The map from class list to abstracted constructor
@@ -267,6 +274,7 @@
this.annotatedFields = new AnnotatedFieldMap();
this.metaAnnotatedFields = new AnnotatedFieldMap();
this.declaredFields = new HashSet<AnnotatedField<?>>();
+ this.declaredFieldsByName = new HashMap<String, AnnotatedField<?>>();
this.declaredAnnotatedFields = new AnnotatedFieldMap();
this.declaredMetaAnnotatedFields = new AnnotatedFieldMap();
this._nonStaticMemberClass = Reflections.isNonMemberInnerClass(rawType);
@@ -284,6 +292,7 @@
if (c == rawType)
{
this.declaredFields.add(annotatedField);
+ this.declaredFieldsByName.put(annotatedField.getName(), annotatedField);
}
for (Annotation annotation : annotatedField.getAnnotationsAsSet())
{
@@ -308,6 +317,7 @@
this.constructors = new HashSet<AnnotatedConstructor<T>>();
this.constructorsByArgumentMap = new ConstructorsByArgumentMap();
this.annotatedConstructors = new AnnotatedConstructorMap();
+ this.declaredConstructorsBySignature = new HashMap<ConstructorSignature, AnnotatedConstructor<?>>();
for (Constructor<?> constructor : rawType.getDeclaredConstructors())
{
@SuppressWarnings("unchecked")
@@ -320,6 +330,8 @@
this.constructors.add(annotatedConstructor);
this.constructorsByArgumentMap.put(Arrays.asList(constructor.getParameterTypes()), annotatedConstructor);
+ this.declaredConstructorsBySignature.put(annotatedConstructor.getSignature(), annotatedConstructor);
+
for (Annotation annotation : annotatedConstructor.getAnnotationsAsSet())
{
if (!annotatedConstructors.containsKey(annotation.annotationType()))
@@ -336,6 +348,7 @@
this.declaredMethods = new HashSet<AnnotatedMethod<?>>();
this.declaredAnnotatedMethods = new AnnotatedMethodMap();
this.declaredMethodsByAnnotatedParameters = new AnnotatedMethodMap();
+ this.declaredMethodsBySignature = new HashMap<MethodSignature, AnnotatedMethod<?>>();
for (Class<?> c = rawType; c != Object.class && c != null; c = c.getSuperclass())
{
for (Method method : c.getDeclaredMethods())
@@ -350,6 +363,7 @@
if (c == rawType)
{
this.declaredMethods.add(annotatedMethod);
+ this.declaredMethodsBySignature.put(annotatedMethod.getSignature(), annotatedMethod);
}
for (Annotation annotation : annotatedMethod.getAnnotationsAsSet())
{
@@ -413,7 +427,7 @@
public <F> AnnotatedField<F> getDeclaredField(String fieldName, AnnotatedClass<F> expectedType)
{
- throw new UnsupportedOperationException();
+ return (AnnotatedField<F>) declaredFieldsByName.get(fieldName);
}
public Set<AnnotatedField<?>> getDeclaredAnnotatedFields(Class<? extends Annotation> annotationType)
@@ -433,9 +447,9 @@
return Collections.unmodifiableSet(constructors);
}
- public AnnotatedConstructor<T> getDeclaredConstructor(List<AnnotatedClass<?>> parameterTypes)
+ public AnnotatedConstructor<T> getDeclaredConstructor(ConstructorSignature signature)
{
- throw new UnsupportedOperationException();
+ return (AnnotatedConstructor<T>) declaredConstructorsBySignature.get(signature);
}
/**
@@ -560,9 +574,10 @@
return null;
}
- public <M> AnnotatedMethod<M> getDeclaredMethod(String methodName, AnnotatedClass<M> expectedReturnType, AnnotatedClass<?>... parameterTypes)
+ @SuppressWarnings("unchecked")
+ public <M> AnnotatedMethod<M> getDeclaredMethod(MethodSignature signature, AnnotatedClass<M> expectedReturnType)
{
- throw new UnsupportedOperationException();
+ return (AnnotatedMethod<M>) declaredMethodsBySignature.get(signature);
}
/**
@@ -581,4 +596,16 @@
return toString;
}
+ @SuppressWarnings("unchecked")
+ public <U> AnnotatedClass<? extends U> asSubclass(AnnotatedClass<U> clazz)
+ {
+ return (AnnotatedClass<? extends U>) this;
+ }
+
+ @SuppressWarnings("unchecked")
+ public T cast(Object object)
+ {
+ return (T) object;
+ }
+
}
\ No newline at end of file
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-03-16 19:15:19 UTC (rev 2049)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -24,13 +24,13 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import java.util.Set;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedConstructor;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.introspector.ConstructorSignature;
import org.jboss.webbeans.util.Names;
/**
@@ -55,6 +55,8 @@
// The declaring class abstraction
private final AnnotatedType<T> declaringClass;
+
+ private final ConstructorSignature signature;
// Cached string representation
private String toString;
@@ -80,6 +82,7 @@
this.parameters = new ArrayList<AnnotatedParameter<?>>();
annotatedParameters = new AnnotatedParameterMap();
+
for (int i = 0; i < constructor.getParameterTypes().length; i++)
{
if (constructor.getParameterAnnotations()[i].length > 0)
@@ -107,6 +110,7 @@
}
}
}
+ this.signature = new ConstructorSignatureImpl(this);
}
/**
@@ -233,9 +237,9 @@
return toString;
}
- public AnnotatedConstructor<T> wrap(Set<Annotation> annotations)
+ public ConstructorSignature getSignature()
{
- throw new UnsupportedOperationException();
+ return signature;
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2009-03-16 19:15:19 UTC (rev 2049)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -30,6 +30,7 @@
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.introspector.MethodSignature;
import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
@@ -63,6 +64,8 @@
// Cached string representation
private String toString;
+ private final MethodSignature signature;
+
public static <T> AnnotatedMethodImpl<T> of(Method method, AnnotatedType<?> declaringClass)
{
return new AnnotatedMethodImpl<T>(method, declaringClass);
@@ -86,6 +89,7 @@
this.declaringClass = declaringClass;
this.parameters = new ArrayList<AnnotatedParameter<?>>();
this.annotatedParameters = new AnnotatedParameterMap();
+
for (int i = 0; i < method.getParameterTypes().length; i++)
{
if (method.getParameterAnnotations()[i].length > 0)
@@ -120,6 +124,7 @@
{
this.propertyName = propertyName;
}
+ this.signature = new MethodSignatureImpl(this);
}
public Method getAnnotatedMethod()
@@ -209,4 +214,9 @@
return toString;
}
+ public MethodSignature getSignature()
+ {
+ return signature;
+ }
+
}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -0,0 +1,49 @@
+package org.jboss.webbeans.introspector.jlr;
+
+import java.util.Arrays;
+
+import org.jboss.webbeans.introspector.AnnotatedConstructor;
+import org.jboss.webbeans.introspector.ConstructorSignature;
+import org.jboss.webbeans.introspector.MethodSignature;
+
+public class ConstructorSignatureImpl implements ConstructorSignature
+{
+
+ private final String[] parameterTypes;
+
+ public ConstructorSignatureImpl(AnnotatedConstructor<?> method)
+ {
+ this.parameterTypes = new String[method.getParameters().size()];
+ for (int i = 0; i < method.getParameters().size(); i++)
+ {
+ parameterTypes[i] = method.getParameters().get(i).getRawType().getName();
+ }
+
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof ConstructorSignatureImpl)
+ {
+ MethodSignature that = (MethodSignature) obj;
+ return Arrays.equals(this.getParameterTypes(), that.getParameterTypes());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return getParameterTypes().hashCode();
+ }
+
+ public String[] getParameterTypes()
+ {
+ return parameterTypes;
+ }
+
+}
\ No newline at end of file
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -0,0 +1,58 @@
+package org.jboss.webbeans.introspector.jlr;
+
+import java.util.Arrays;
+
+import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.MethodSignature;
+
+public class MethodSignatureImpl implements MethodSignature
+{
+
+ private final String methodName;
+ private final String[] parameterTypes;
+
+ public MethodSignatureImpl(AnnotatedMethod<?> method)
+ {
+ this.methodName = method.getName();
+ this.parameterTypes = new String[method.getParameters().size()];
+ for (int i = 0; i < method.getParameters().size(); i++)
+ {
+ parameterTypes[i] = method.getParameters().get(i).getRawType().getName();
+ }
+
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof MethodSignatureImpl)
+ {
+ MethodSignature that = (MethodSignature) obj;
+ return this.getMethodName().equals(that.getMethodName()) && Arrays.equals(this.getParameterTypes(), that.getParameterTypes());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int hashCode = 17;
+ hashCode += getMethodName().hashCode() * 5;
+ hashCode += getParameterTypes().hashCode() * 7;
+ return hashCode;
+ }
+
+ public String getMethodName()
+ {
+ return methodName;
+ }
+
+ public String[] getParameterTypes()
+ {
+ return parameterTypes;
+ }
+
+}
\ No newline at end of file
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/XmlParserImplTest.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/XmlParserImplTest.java 2009-03-16 19:15:19 UTC (rev 2049)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/XmlParserImplTest.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -1,55 +0,0 @@
-package org.jboss.webbeans.test.unit.xml;
-
-import java.lang.reflect.AnnotatedElement;
-import java.net.URL;
-import java.util.HashSet;
-import java.util.Set;
-
-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;
-
-
-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/impl/src/test/java/org/jboss/webbeans/test/unit/xml/parser/AnotherDeploymentType.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/parser/AnotherDeploymentType.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/parser/AnotherDeploymentType.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -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
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/parser/AnotherDeploymentType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java (from rev 2044, ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/XmlParserImplTest.java)
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java 2009-03-16 21:17:53 UTC (rev 2050)
@@ -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>
+*/
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/parser/user-defined-beans.xml
===================================================================
--- ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/parser/user-defined-beans.xml (rev 0)
+++ ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/parser/user-defined-beans.xml 2009-03-16 21:17:53 UTC (rev 2050)
@@ -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
Property changes on: ri/trunk/impl/src/test/resources/org/jboss/webbeans/test/unit/xml/parser/user-defined-beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2049 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-03-16 15:15:19 -0400 (Mon, 16 Mar 2009)
New Revision: 2049
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Dog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/DogRemote.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Pitbull.java
Log:
New test and mappings for some EJB bean definition tests.
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Dog.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Dog.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Dog.java 2009-03-16 19:15:19 UTC (rev 2049)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+public class Dog
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Dog.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/DogRemote.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/DogRemote.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/DogRemote.java 2009-03-16 19:15:19 UTC (rev 2049)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface DogRemote
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/DogRemote.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-03-16 18:30:10 UTC (rev 2048)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-03-16 19:15:19 UTC (rev 2049)
@@ -79,7 +79,9 @@
}
@Test(groups = { "enterpriseBeans" })
- @SpecAssertion(section = "3.3.3", id = "a")
+ @SpecAssertions( {
+ @SpecAssertion(section = "3.3.3", id = "a"),
+ @SpecAssertion(section = "3.3.4", id = "c") } )
public void testBeanTypesAreLocalInterfacesWithoutWildcardTypesOrTypeVariablesWithSuperInterfaces()
{
Bean<DogLocal> dogBean = getCurrentManager().resolveByType(DogLocal.class).iterator().next();
@@ -87,16 +89,24 @@
assert dogBean.getTypes().contains(PitbullLocal.class);
}
- @Test(groups = { "enterpriseBeans", "stub" })
+ /**
+ * If the EJB has a bean class local view and the bean class is not a
+ * parameterized type, the set of bean types contains the bean class and all
+ * superclasses.
+ */
+ @Test(groups = { "enterpriseBeans", "broken" })
@SpecAssertion(section = "3.3.3", id = "b")
- public void testEnterpriseBeanWithLocalViewAndParameterizedTypeIncludesBeanClassAndSuperclassesInBeanTypes()
+ public void testEnterpriseBeanWithLocalViewAndNotParameterizedTypeHasClassAndSuperclassesAsBeanTypes()
{
- assert false;
+ //TODO We need a 3.1 compliant container for this test
+ Bean<DogLocal> dogBean = getCurrentManager().resolveByType(DogLocal.class).iterator().next();
+ assert dogBean.getTypes().contains(Pitbull.class);
}
@Test(groups = "enterpriseBeans")
@SpecAssertions({
@SpecAssertion(section = "3.3.3", id = "c"),
+ @SpecAssertion(section = "3.3.4", id = "a"),
@SpecAssertion(section = "2.2", id = "l")
})
public void testObjectIsInAPITypes()
@@ -105,11 +115,12 @@
assert getCurrentManager().resolveByType(GiraffeLocal.class).iterator().next().getTypes().contains(Object.class);
}
- @Test(groups = { "enterpriseBeans", "stub" })
+ @Test(groups = { "enterpriseBeans" })
@SpecAssertion(section = "3.3.3", id = "d")
public void testRemoteInterfacesAreNotInAPITypes()
{
- assert false;
+ Bean<DogLocal> dogBean = getCurrentManager().resolveByType(DogLocal.class).iterator().next();
+ assert !dogBean.getTypes().contains(DogRemote.class);
}
@Test(groups = "enterpriseBeans")
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Pitbull.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Pitbull.java 2009-03-16 18:30:10 UTC (rev 2048)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Pitbull.java 2009-03-16 19:15:19 UTC (rev 2049)
@@ -8,7 +8,7 @@
@Stateful
@ApplicationScoped
@Named
-class Pitbull implements PitbullLocal, DogLocal
+class Pitbull extends Dog implements PitbullLocal, DogLocal, DogRemote
{
public static boolean destructorCalled = false;
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2048 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-03-16 14:30:10 -0400 (Mon, 16 Mar 2009)
New Revision: 2048
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/DogLocal.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/GiraffeLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Pitbull.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PitbullLocal.java
Log:
A few more EJB tests.
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/DogLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/DogLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/DogLocal.java 2009-03-16 18:30:10 UTC (rev 2048)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+
+import javax.ejb.Local;
+
+@Local
+public interface DogLocal
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/DogLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-03-16 17:57:18 UTC (rev 2047)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-03-16 18:30:10 UTC (rev 2048)
@@ -1,5 +1,7 @@
package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+import javax.inject.manager.Bean;
+
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -45,12 +47,11 @@
assert false;
}
- @Test(groups = { "enterpriseBeans", "stub" })
+ @Test(groups = { "enterpriseBeans" })
@SpecAssertion(section = "3.3.2", id = "a")
public void testAnnotatedEnterpriseBean()
{
- // TODO: dupe?
- assert false;
+ assert getCurrentManager().resolveByType(GiraffeLocal.class).size() > 0;
}
@Test(groups = { "enterpriseBeans", "webbeansxml", "stub" })
@@ -77,11 +78,13 @@
assert false;
}
- @Test(groups = { "enterpriseBeans", "stub" })
+ @Test(groups = { "enterpriseBeans" })
@SpecAssertion(section = "3.3.3", id = "a")
public void testBeanTypesAreLocalInterfacesWithoutWildcardTypesOrTypeVariablesWithSuperInterfaces()
{
- assert false;
+ Bean<DogLocal> dogBean = getCurrentManager().resolveByType(DogLocal.class).iterator().next();
+ assert dogBean.getTypes().contains(DogLocal.class);
+ assert dogBean.getTypes().contains(PitbullLocal.class);
}
@Test(groups = { "enterpriseBeans", "stub" })
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/GiraffeLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/GiraffeLocal.java 2009-03-16 17:57:18 UTC (rev 2047)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/GiraffeLocal.java 2009-03-16 18:30:10 UTC (rev 2048)
@@ -1,5 +1,8 @@
package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+import javax.ejb.Local;
+
+@Local
public interface GiraffeLocal
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Pitbull.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Pitbull.java 2009-03-16 17:57:18 UTC (rev 2047)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/Pitbull.java 2009-03-16 18:30:10 UTC (rev 2048)
@@ -8,7 +8,7 @@
@Stateful
@ApplicationScoped
@Named
-class Pitbull implements PitbullLocal
+class Pitbull implements PitbullLocal, DogLocal
{
public static boolean destructorCalled = false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PitbullLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PitbullLocal.java 2009-03-16 17:57:18 UTC (rev 2047)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/PitbullLocal.java 2009-03-16 18:30:10 UTC (rev 2048)
@@ -1,5 +1,8 @@
package org.jboss.jsr299.tck.tests.implementation.enterprise.definition;
+import javax.ejb.Local;
+
+@Local
public interface PitbullLocal
{
15 years, 10 months