From e1fe2b7cc9bfd8c3e2567d7f6622e2bff5040061 Mon Sep 17 00:00:00 2001 From: Scott M Stark Date: Tue, 27 Feb 2024 01:29:15 -0600 Subject: [PATCH] Remove the web tck tests Signed-off-by: Scott M Stark --- dist-build/artifact-install.pom | 2 +- dist-build/jboss-runner.pom | 11 +- dist-build/libs/pom.xml | 78 - dist-build/libs/readme.txt | 8 - .../libs/src/main/assembly/assembly.xml | 20 - dist-build/pom.xml | 5 - dist-build/porting-package/pom.xml | 124 - dist-build/porting-package/readme.txt | 9 - .../src/main/assembly/assembly.xml | 23 - dist-build/src/main/assembly/assembly.xml | 26 +- doc/reference/pom.xml | 4 +- .../cdi-tck-reference-guide-docinfo.xml | 6 +- .../src/main/asciidoc/installation.asciidoc | 8 +- .../src/main/asciidoc/introduction.asciidoc | 5 +- .../src/main/asciidoc/sigtest.asciidoc | 2 +- pom.xml | 4 +- web/pom.xml | 545 - .../ejb/AbstractInterceptor.java | 34 - .../aroundConstruct/ejb/AlphaBinding.java | 34 - .../ejb/AlphaInterceptor1.java | 21 - .../ejb/AlphaInterceptor2.java | 21 - .../ejb/BeanOverridingTypeLevelBinding.java | 35 - ...thConstructorLevelAndTypeLevelBinding.java | 35 - .../ejb/BeanWithConstructorLevelBinding.java | 34 - .../ejb/BeanWithTypeLevelBinding.java | 34 - .../aroundConstruct/ejb/BravoBinding.java | 33 - .../aroundConstruct/ejb/BravoInterceptor.java | 21 - ...essionBeanConstructorInterceptionTest.java | 87 - .../bindings/resolution/ejb/BallBinding.java | 40 - .../resolution/ejb/BallBindingLiteral.java | 47 - .../resolution/ejb/BasketBinding.java | 39 - .../resolution/ejb/BasketBindingLiteral.java | 46 - .../ejb/ComplicatedInterceptor.java | 47 - .../ejb/ComplicatedLifecycleInterceptor.java | 45 - ...priseInterceptorBindingResolutionTest.java | 141 - .../resolution/ejb/LoggedBinding.java | 35 - .../resolution/ejb/LoggedService.java | 23 - .../resolution/ejb/MessageBinding.java | 35 - .../resolution/ejb/MessageService.java | 49 - .../resolution/ejb/MonitorService.java | 26 - .../bindings/resolution/ejb/PingBinding.java | 37 - .../bindings/resolution/ejb/PongBinding.java | 37 - .../resolution/ejb/RemoteMessageService.java | 27 - .../resolution/ejb/RemoteService.java | 21 - .../bindings/resolution/ejb/Service.java | 20 - .../resolution/ejb/ServiceStereotype.java | 34 - .../resolution/ejb/TransactionalBinding.java | 35 - .../aroundInvoke/bindings/ejb/Binding.java | 31 - .../aroundInvoke/bindings/ejb/Foo.java | 34 - .../bindings/ejb/Interceptor1.java | 33 - .../bindings/ejb/Interceptor2.java | 33 - .../aroundInvoke/bindings/ejb/MiddleFoo.java | 28 - .../bindings/ejb/MiddleInterceptor1.java | 28 - ...essionBeanAroundInvokeInterceptorTest.java | 79 - .../aroundInvoke/bindings/ejb/SuperFoo.java | 28 - .../bindings/ejb/SuperInterceptor1.java | 28 - .../bindings/ejb/SuperInterceptor2.java | 28 - .../ee/AroundInvokeAccessInterceptorTest.java | 65 - .../tests/contract/aroundInvoke/ee/Bar.java | 43 - .../tests/contract/aroundInvoke/ee/Baz.java | 40 - .../aroundInvoke/ee/BazInterceptor.java | 39 - .../tests/contract/aroundInvoke/ee/Foo.java | 42 - .../aroundInvoke/ee/FooInterceptor.java | 39 - .../contract/aroundInvoke/ee/Printer.java | 34 - .../ee/PrinterSecurityInterceptor.java | 48 - .../contract/aroundInvoke/ee/Student.java | 32 - .../tests/contract/aroundInvoke/ee/Toner.java | 31 - .../tests/contract/aroundTimeout/Alarm.java | 50 - .../AlarmSecurityInterceptor.java | 45 - .../AroundTimeoutInterceptorTest.java | 88 - .../tests/contract/aroundTimeout/Bell.java | 32 - .../tests/contract/aroundTimeout/Student.java | 32 - .../contract/aroundTimeout/TestData.java | 23 - .../aroundTimeout/TimeoutInterceptor.java | 43 - .../contract/aroundTimeout/TimingBean.java | 53 - .../AroundTimeoutOrderInterceptorTest.java | 72 - .../aroundTimeout/bindings/Binding.java | 31 - .../aroundTimeout/bindings/Interceptor1.java | 33 - .../aroundTimeout/bindings/Interceptor2.java | 33 - .../bindings/MiddleInterceptor1.java | 28 - .../bindings/MiddleTimingBean.java | 28 - .../bindings/SuperInterceptor1.java | 28 - .../bindings/SuperInterceptor2.java | 28 - .../bindings/SuperTimingBean.java | 28 - .../aroundTimeout/bindings/TimingBean.java | 49 - .../environment/AroundInvokeInterceptor1.java | 35 - .../environment/AroundInvokeInterceptor2.java | 30 - .../AroundInvokeThreadInterceptor.java | 30 - .../AroundTimeoutThreadInterceptor.java | 36 - .../interceptorLifeCycle/environment/Bar.java | 54 - .../interceptorLifeCycle/environment/Foo.java | 37 - .../InterceptorEnvironmentTest.java | 70 - .../environment/TestEndObserver.java | 33 - .../environment/jndi/Animal.java | 18 - .../environment/jndi/Bar.java | 48 - .../environment/jndi/BarServlet.java | 56 - .../environment/jndi/Cat.java | 24 - .../environment/jndi/Dog.java | 24 - .../environment/jndi/Foo.java | 48 - .../environment/jndi/FooServlet.java | 56 - .../jndi/InterceptorEnvironmentJNDITest.java | 139 - .../environment/jndi/MyBinding.java | 32 - .../environment/jndi/MyInterceptor.java | 72 - .../environment/jndi/ejb/Animal.java | 18 - .../environment/jndi/ejb/Bar.java | 48 - .../environment/jndi/ejb/BarServlet.java | 58 - .../environment/jndi/ejb/Cat.java | 24 - .../environment/jndi/ejb/Dog.java | 24 - .../environment/jndi/ejb/Foo.java | 48 - .../environment/jndi/ejb/FooServlet.java | 58 - ...rceptorEnvironmentJNDISessionBeanTest.java | 132 - .../environment/jndi/ejb/MyBinding.java | 32 - .../environment/jndi/ejb/MyInterceptor.java | 72 - .../bindings/ejb/Airborne.java | 31 - .../bindings/ejb/AirborneInterceptor.java | 57 - .../bindings/ejb/DestructionInterceptor.java | 61 - .../bindings/ejb/Destructive.java | 31 - .../lifecycleCallback/bindings/ejb/Foo.java | 20 - .../bindings/ejb/Missile.java | 24 - .../bindings/ejb/Rocket.java | 49 - ...eanLifecycleInterceptorDefinitionTest.java | 91 - .../ejb/SuperDestructionInterceptor.java | 54 - .../bindings/ejb/Weapon.java | 40 - .../lifecycleCallback/ejb/Animal.java | 31 - .../ejb/AnimalInterceptor.java | 68 - .../contract/lifecycleCallback/ejb/Bar.java | 20 - .../contract/lifecycleCallback/ejb/Cat.java | 67 - .../lifecycleCallback/ejb/CatInterceptor.java | 56 - .../ejb/LifecycleCallbackInterceptorTest.java | 58 - .../jboss/cdi/tck/jaxrs/JaxRsActivator.java | 27 - .../tck/selenium/ChromeDevtoolsDriver.java | 554 - .../jboss/cdi/tck/selenium/DriverPool.java | 91 - .../cdi/tck/selenium/ExtendedWebDriver.java | 104 - .../org/jboss/cdi/tck/selenium/WebPage.java | 471 - .../tck/shrinkwrap/ee/DummySessionBean.java | 29 - .../ee/EnterpriseArchiveBuilder.java | 155 - .../tck/shrinkwrap/ee/WebArchiveBuilder.java | 146 - .../enterprise/DisabledEjbInterface.java | 21 - .../alternative/enterprise/EjbInterface.java | 21 - .../alternative/enterprise/EnabledEjb.java | 25 - .../alternative/enterprise/NotEnabledEjb.java | 25 - .../SessionBeanAlternativeTest.java | 41 - .../resource/DatabaseProduction.java | 36 - .../enterprise/resource/DatabaseTest.java | 36 - .../resource/EnabledResourceProducer.java | 31 - .../resource/NotEnabledResourceProducer.java | 31 - .../ResourceAlternativeAvailabilityTest.java | 73 - .../EnterpriseSelectedAlternative01Test.java | 78 - .../EnterpriseSelectedAlternative02Test.java | 94 - .../EnterpriseSelectedAlternative03Test.java | 133 - .../enterprise/EnterpriseService.java | 30 - .../selection/enterprise/PojoService.java | 26 - .../SelectedAlternativeTestUtil.java | 38 - .../selection/enterprise/Service.java | 20 - .../resource/BravoResourceProducer.java | 32 - .../resource/CharlieResourceProducer.java | 32 - .../resource/DeltaResourceProducer.java | 31 - .../selection/resource/ProductionReady.java | 43 - .../resource/ResourceAlternative01Test.java | 86 - .../resource/ResourceAlternative04Test.java | 89 - ...sourceAlternativeExplicitPriorityTest.java | 71 - .../selection/resource/ResourceProducer.java | 28 - .../ActivateRequestContextinEETest.java | 58 - .../tests/context/activation/TestServlet.java | 44 - .../application/ApplicationContextTest.java | 125 - .../application/ApplicationResource.java | 39 - .../application/IntrospectApplication.java | 35 - .../tck/tests/context/application/Result.java | 47 - .../application/SimpleApplicationBean.java | 25 - .../tests/context/application/TestFilter.java | 49 - .../application/TestHttpSessionListener.java | 36 - .../context/application/TestServlet.java | 74 - .../TestServletContextListener.java | 36 - .../TestServletRequestListener.java | 37 - .../ApplicationContextAsyncListenerTest.java | 98 - .../async/AsyncRequestProcessor.java | 74 - .../application/async/AsyncServlet.java | 88 - .../application/async/FailingServlet.java | 38 - .../async/SimpleApplicationBean.java | 29 - .../async/SimpleAsyncListener.java | 113 - .../context/application/async/StatusBean.java | 76 - .../application/async/StatusServlet.java | 47 - .../ApplicationContextDestructionTest.java | 110 - .../context/application/destroy/Bar.java | 32 - .../application/destroy/BarInfoServlet.java | 56 - .../context/application/destroy/Foo.java | 47 - .../application/destroy/FooInitServlet.java | 45 - .../ApplicationContextDisposerTest.java | 65 - .../context/application/disposer/Edible.java | 36 - .../context/application/disposer/Forest.java | 51 - .../application/disposer/Mushroom.java | 36 - .../application/disposer/Mushroomer.java | 51 - .../ejb/ApplicationContextSharedTest.java | 127 - .../context/application/ejb/BarBean.java | 61 - .../tests/context/application/ejb/FMS.java | 29 - .../context/application/ejb/FMSModelIII.java | 101 - .../context/application/ejb/FooBean.java | 49 - .../context/application/ejb/FooRemote.java | 23 - .../ejb/SimpleApplicationBean.java | 25 - .../ApplicationScopeEventMultiWarTest.java | 106 - .../event/ApplicationScopeEventTest.java | 60 - .../context/application/event/Collector.java | 49 - .../context/application/event/Helper.java | 36 - .../context/application/event/Observer1.java | 45 - .../context/application/event/Observer2.java | 32 - .../context/application/event/Observer3.java | 32 - .../application/event/ObserverNames.java | 21 - .../application/event/PingServlet.java | 41 - .../application/postconstruct/Action.java | 50 - .../postconstruct/EagerSingleton.java | 53 - ...gerSingletonPostConstructCallbackTest.java | 50 - .../application/postconstruct/Service.java | 30 - .../application/postconstruct/SimpleBean.java | 50 - .../SimpleBeanPostConstructCallbackTest.java | 50 - .../ApplicationContextPreDestroyTest.java | 58 - .../context/application/predestroy/Bar.java | 35 - .../context/application/predestroy/Foo.java | 39 - .../AbstractConversationTest.java | 119 - .../conversation/BuiltInConversation.java | 66 - .../ClientConversationContextTest.java | 409 - .../tck/tests/context/conversation/Cloud.java | 84 - .../context/conversation/CloudController.java | 32 - .../ConversationContextObserver.java | 49 - .../ConversationStatusServlet.java | 72 - .../ConversationTestPhaseListener.java | 69 - .../tests/context/conversation/Cumulus.java | 97 - ...datingSessionDestroysConversationTest.java | 68 - ...versationPropagatedByFacesContextTest.java | 186 - .../ManualCidPropagationTest.java | 71 - .../context/conversation/OutermostFilter.java | 64 - .../tck/tests/context/conversation/Storm.java | 60 - .../determination/AsyncFooServlet.java | 76 - .../determination/AsyncRequestProcessor.java | 75 - .../conversation/determination/BarFilter.java | 63 - .../determination/BazRequestListener.java | 51 - .../ConversationDeterminationTest.java | 95 - .../conversation/determination/Duck.java | 25 - .../determination/FailingServlet.java | 38 - .../determination/FooServlet.java | 71 - .../determination/QuxAsyncListener.java | 66 - .../determination/StatusBean.java | 65 - .../determination/StatusServlet.java | 47 - .../determination/TestResult.java | 60 - .../event/ApplicationScopedObserver.java | 55 - .../event/ConversationScopedBean.java | 34 - .../event/ConversationScopedObserver.java | 39 - ...RunningConversationLifecycleEventTest.java | 102 - .../context/conversation/event/Servlet.java | 63 - ...ansientConversationLifecycleEventTest.java | 76 - .../notattached/ConversationScopedBean.java | 29 - ...AssociatedWithCurrentRequestEventTest.java | 70 - .../event/notattached/ObservingBean.java | 44 - .../event/notattached/TestServlet.java | 59 - .../filter/ConversationFilterTest.java | 181 - .../context/conversation/filter/Dummy.java | 27 - .../filter/IntrospectServlet.java | 102 - .../conversation/filter/OuterFilter.java | 56 - .../context/conversation/filter/State.java | 42 - .../context/conversation/filter/Tester.java | 42 - .../context/conversation/inactive/Bar.java | 35 - .../conversation/inactive/FooBean.java | 52 - .../inactive/InactiveConversationTest.java | 72 - .../context/conversation/servlet/Message.java | 47 - .../context/conversation/servlet/Servlet.java | 96 - .../servlet/ServletConversationTest.java | 285 - .../ejb/DependentContextEjbTest.java | 77 - .../tck/tests/context/dependent/ejb/Farm.java | 38 - .../context/dependent/ejb/FarmLocal.java | 20 - .../tck/tests/context/dependent/ejb/Fox.java | 88 - .../tests/context/dependent/ejb/FoxLocal.java | 25 - .../tests/context/dependent/ejb/FoxRun.java | 56 - .../context/dependent/ejb/FoxRunLocal.java | 24 - .../tests/context/dependent/ejb/Horse.java | 33 - .../tests/context/dependent/ejb/House.java | 39 - .../context/dependent/ejb/HouseLocal.java | 23 - .../tck/tests/context/dependent/ejb/Room.java | 37 - .../context/dependent/ejb/RoomLocal.java | 23 - .../tests/context/dependent/ejb/Stable.java | 38 - .../tests/context/dependent/ejb/Table.java | 33 - .../context/dependent/ejb/TableLocal.java | 23 - .../context/jms/AbstractMessageListener.java | 66 - .../cdi/tck/tests/context/jms/LogStore.java | 70 - .../tck/tests/context/jms/LoggerService.java | 47 - .../jms/MessageDrivenBeanContextTest.java | 111 - .../context/jms/QueueMessageDrivenBean.java | 20 - .../context/jms/SimpleMessageProducer.java | 108 - .../context/jms/TopicMessageDrivenBean.java | 20 - ...seBeanWithNonPassivatingDecoratorTest.java | 47 - .../enterprise/MaarianHaminaLocal_Broken.java | 21 - .../enterprise/MaarianhaminaDecorator.java | 26 - .../enterprise/Maarianhamina_Broken.java | 26 - .../enterprise/field/BrokenDecorator.java | 30 - .../decorator/enterprise/field/District.java | 24 - ...ssivatingInjectedFieldInDecoratorTest.java | 47 - .../enterprise/field/EspooLocal_Broken.java | 21 - .../enterprise/field/Espoo_Broken.java | 26 - .../broken/enterprise/Cup_Broken.java | 27 - .../passivating/broken/enterprise/Foo.java | 18 - ...ionCapableEjbWithPassivatingScopeTest.java | 55 - .../broken/enterprise/field/District.java | 25 - .../enterprise/field/EspooLocal_Broken.java | 21 - .../broken/enterprise/field/Espoo_Broken.java | 30 - ...ctedIntoPassivatingEnterpriseBeanTest.java | 47 - .../interceptor/enterprise/Digital.java | 34 - .../enterprise/DigitalInterceptor.java | 29 - ...BeanWithNonPassivatingInterceptorTest.java | 47 - .../interceptor/enterprise/Telephone.java | 28 - .../enterprise/field/BrokenInterceptor.java | 32 - .../enterprise/field/District.java | 24 - ...ivatingInjectedFieldInInterceptorTest.java | 46 - .../enterprise/field/EspooLocal_Broken.java | 21 - .../enterprise/field/Espoo_Broken.java | 28 - .../producer/field/enterprise/British.java | 32 - .../ConstructorInjectionCorralBroken.java | 37 - .../producer/field/enterprise/Corral.java | 22 - .../broken/producer/field/enterprise/Cow.java | 18 - .../field/enterprise/CowProducer.java | 24 - ...terpriseBeanWithIllegalDependencyTest.java | 67 - .../FieldInjectionCorralBroken.java | 31 - .../SetterInjectionCorralBroken.java | 33 - .../producer/method/enterprise/British.java | 38 - .../ConstructorInjectionCorralBroken.java | 37 - .../producer/method/enterprise/Cow.java | 18 - .../method/enterprise/CowProducer.java | 28 - ...terpriseBeanWithIllegalDependencyTest.java | 75 - .../FieldInjectionCorralBroken.java | 30 - .../producer/method/enterprise/Herd.java | 20 - ...ducerMethodParamInjectionCorralBroken.java | 34 - .../producer/method/enterprise/Ranch.java | 22 - .../SetterInjectionCorralBroken.java | 33 - .../resource/persistence/Another.java | 33 - .../DataSourcePassivationDependencyTest.java | 79 - .../persistence/DataSourceProducer.java | 30 - .../dependency/resource/persistence/Pool.java | 49 - .../resource/persistence/Profile.java | 58 - .../ResourcePassivationDependencyTest.java | 73 - .../persistence/ResourceProducer.java | 36 - .../ResourcePassivationDependencyTest.java | 73 - .../dependency/resource/remote/Worker.java | 51 - .../resource/remote/ejb/FooBean.java | 38 - .../resource/remote/ejb/FooRemote.java | 23 - .../dependency/sessionbean/Chef.java | 47 - .../dependency/sessionbean/Hammer.java | 35 - .../SessionBeanPassivationDependencyTest.java | 86 - .../dependency/sessionbean/Spoon.java | 26 - .../dependency/sessionbean/Worker.java | 47 - .../passivating/enterprise/Digital.java | 34 - .../enterprise/DigitalInterceptor.java | 29 - .../NonPassivationCapableSessionBeanTest.java | 54 - .../passivating/enterprise/Telephone.java | 36 - .../passivating/enterprise/TelephoneLine.java | 20 - .../enterprise/invalid/Digital.java | 34 - .../invalid/DigitalInterceptor.java | 31 - .../enterprise/invalid/Elephant.java | 27 - .../enterprise/invalid/ElephantLocal.java | 22 - .../invalid/StatefulSessionBeanTest.java | 53 - .../StatefulSessionBeanXmlDescriptorTest.java | 55 - .../enterprise/invalid/Telephone.java | 36 - .../enterprise/invalid/TelephoneLine.java | 23 - .../passivating/enterprise/valid/Digital.java | 34 - .../enterprise/valid/DigitalInterceptor.java | 31 - .../enterprise/valid/Elephant.java | 27 - .../enterprise/valid/ElephantLocal.java | 20 - .../valid/StatefulSessionBeanTest.java | 50 - .../StatefulSessionBeanXmlDescriptorTest.java | 52 - .../enterprise/valid/Telephone.java | 36 - .../enterprise/valid/TelephoneLine.java | 23 - .../request/ContextDestructionObserver.java | 32 - .../context/request/IntrospectFilter.java | 72 - .../context/request/IntrospectServlet.java | 58 - .../context/request/RequestContextTest.java | 102 - .../context/request/SimpleRequestBean.java | 28 - .../tck/tests/context/request/TestFilter.java | 66 - .../tests/context/request/TestServlet.java | 65 - .../request/TestServletRequestListener.java | 65 - .../request/async/AsyncRequestProcessor.java | 74 - .../context/request/async/AsyncServlet.java | 88 - .../context/request/async/FailingServlet.java | 38 - .../RequestContextAsyncListenerTest.java | 112 - .../request/async/SimpleAsyncListener.java | 107 - .../request/async/SimpleRequestBean.java | 37 - .../context/request/async/StatusBean.java | 76 - .../context/request/async/StatusServlet.java | 47 - .../tests/context/request/ejb/BarBean.java | 59 - .../request/ejb/EJBRequestContextTest.java | 144 - .../tck/tests/context/request/ejb/FMS.java | 28 - .../context/request/ejb/FMSModelIII.java | 99 - .../tests/context/request/ejb/FooBean.java | 57 - .../tests/context/request/ejb/FooRemote.java | 25 - .../context/request/ejb/FooRequestBean.java | 42 - .../request/ejb/SimpleRequestBean.java | 50 - .../context/request/event/ObservingBean.java | 59 - .../request/event/RequestScopeEventTest.java | 73 - .../tests/context/request/event/Servlet.java | 42 - .../async/ApplicationScopedObserver.java | 39 - .../request/event/async/AsyncService.java | 43 - .../request/event/async/InfoServlet.java | 55 - .../async/RequestScopeEventAsyncTest.java | 83 - .../event/async/RequestScopedObserver.java | 35 - .../event/jms/AbstractMessageListener.java | 66 - .../event/jms/ApplicationScopedObserver.java | 39 - .../RequestScopeEventMessageDeliveryTest.java | 103 - .../event/jms/RequestScopedObserver.java | 35 - .../event/jms/SimpleMessageProducer.java | 75 - .../event/jms/TopicMessageDrivenBean.java | 20 - .../remote/ApplicationScopedObserver.java | 39 - .../context/request/event/remote/FooBean.java | 47 - .../request/event/remote/FooRemote.java | 25 - .../remote/RequestScopeEventRemoteTest.java | 65 - .../event/remote/RequestScopedObserver.java | 33 - .../timeout/ApplicationScopedObserver.java | 62 - .../request/event/timeout/InfoServlet.java | 73 - .../timeout/RequestScopeEventTimeoutTest.java | 79 - .../event/timeout/RequestScopedObserver.java | 33 - .../request/event/timeout/TimeoutService.java | 46 - .../tck/tests/context/request/jaxrs/Foo.java | 47 - .../context/request/jaxrs/FooResource.java | 36 - .../context/request/jaxrs/InfoServlet.java | 42 - .../context/request/jaxrs/ObservingBean.java | 51 - .../request/jaxrs/RequestContextTest.java | 75 - .../context/request/postconstruct/Action.java | 40 - .../request/postconstruct/EagerSingleton.java | 53 - .../EagerSingletonInfoServlet.java | 52 - ...gerSingletonPostConstructCallbackTest.java | 68 - .../postconstruct/RequestContextObserver.java | 47 - .../request/postconstruct/SimpleBean.java | 49 - .../SimpleBeanPostConstructCallbackTest.java | 68 - .../postconstruct/SimpleInfoServlet.java | 61 - .../context/session/IntrospectFilter.java | 54 - .../IntrospectHttpSessionListener.java | 43 - .../context/session/IntrospectServlet.java | 73 - .../IntrospectServletRequestListener.java | 47 - .../context/session/SessionContextTest.java | 161 - .../context/session/SimpleSessionBean.java | 40 - .../tck/tests/context/session/TestFilter.java | 69 - .../tests/context/session/TestServlet.java | 69 - .../session/async/AsyncRequestProcessor.java | 74 - .../context/session/async/AsyncServlet.java | 88 - .../context/session/async/FailingServlet.java | 38 - .../SessionContextAsyncListenerTest.java | 110 - .../session/async/SimpleAsyncListener.java | 106 - .../session/async/SimpleSessionBean.java | 40 - .../context/session/async/StatusBean.java | 76 - .../context/session/async/StatusServlet.java | 47 - .../context/session/event/ObservingBean.java | 56 - .../tests/context/session/event/Servlet.java | 53 - .../session/event/SessionScopeEventTest.java | 89 - .../session/event/SessionScopedBean.java | 33 - .../session/listener/IntrospectServlet.java | 73 - ...SessionContextHttpSessionListenerTest.java | 86 - ...sionContextServletRequestListenerTest.java | 61 - .../session/listener/SimpleSessionBean.java | 45 - .../listener/TestHttpSessionListener.java | 62 - .../listener/TestServletRequestListener.java | 65 - .../listener/shutdown/InfoServlet.java | 56 - .../listener/shutdown/InitServlet.java | 47 - .../SessionContextListenerShutdownTest.java | 112 - .../shutdown/SessionScopedTestFlagClient.java | 48 - .../session/listener/shutdown/TestFlag.java | 32 - .../shutdown/TestHttpSessionListener.java | 60 - ...uiltinHttpServletRequestDecoratorTest.java | 89 - .../request/HttpServletRequestDecorator1.java | 44 - .../request/HttpServletRequestDecorator2.java | 49 - .../BuiltinServletContextDecoratorTest.java | 80 - .../ServletContextDecorator1.java | 42 - .../ServletContextDecorator2.java | 42 - .../BuiltinHttpSessionDecoratorTest.java | 85 - .../http/session/HttpSessionDecorator1.java | 49 - .../http/session/HttpSessionDecorator2.java | 49 - .../http/session/HttpSessionObserver.java | 45 - .../builtin/http/session/SessionListener.java | 41 - .../BuiltinPrincipalDecoratorTest.java | 74 - .../builtin/principal/PrincipalDecorator.java | 37 - .../builtin/principal/PrincipalInjector.java | 40 - .../BuiltinUserTransactionDecoratorTest.java | 59 - .../builtin/transaction/SessionBean.java | 33 - .../transaction/UserTransactionDecorator.java | 38 - .../definition/lifecycle/BankAccount.java | 24 - .../definition/lifecycle/BankServlet.java | 63 - .../definition/lifecycle/ChargeDecorator.java | 64 - ...ecoratorInstanceIsDependentObjectTest.java | 84 - .../definition/lifecycle/DurableAccount.java | 40 - .../lifecycle/ShortTermAccount.java | 37 - .../ejb/EJBDecoratorInvocationTest.java | 64 - .../tests/decorators/invocation/ejb/Pig.java | 23 - .../decorators/invocation/ejb/PigSty.java | 29 - .../invocation/ejb/PigStyDecorator.java | 43 - .../decorators/invocation/ejb/PigStyImpl.java | 44 - .../decorators/invocation/enterprise/Bar.java | 31 - .../invocation/enterprise/BarBusiness.java | 25 - .../enterprise/BarBusinessDecorator.java | 38 - .../invocation/enterprise/Business.java | 29 - .../invocation/enterprise/BusinessBase.java | 35 - .../EnterpriseDecoratorInvocationTest.java | 110 - .../decorators/invocation/enterprise/Foo.java | 40 - .../invocation/enterprise/FooBinding.java | 31 - .../invocation/enterprise/FooBusiness.java | 27 - .../enterprise/FooBusinessDecorator1.java | 39 - .../enterprise/FooBusinessDecorator2.java | 39 - .../invocation/enterprise/FooInterceptor.java | 32 - .../ordering/global/AbstractDecorator.java | 33 - .../decorators/ordering/global/Decorated.java | 21 - .../ordering/global/DecoratedImpl.java | 27 - .../decorators/ordering/global/DummyDao.java | 27 - .../EnterpriseDecoratorOrderingTest.java | 143 - .../global/GlobalDecoratorOrderingTest.java | 95 - .../global/GloballyEnabledDecorator1.java | 22 - .../global/GloballyEnabledDecorator2.java | 22 - .../global/GloballyEnabledDecorator3.java | 22 - .../global/GloballyEnabledDecorator4.java | 22 - .../global/GloballyEnabledDecorator5.java | 22 - .../ordering/global/LegacyDecorator1.java | 20 - .../ordering/global/LegacyDecorator2.java | 20 - .../ordering/global/LegacyDecorator3.java | 20 - .../global/WebApplicationGlobalDecorator.java | 23 - .../ejb/RestrictedSessionBeanTest.java | 50 - .../bean/broken/restricted/ejb/RockBean.java | 29 - .../bean/types/enterprise/Animal.java | 19 - .../bean/types/enterprise/Bird.java | 19 - .../bean/types/enterprise/Cobra.java | 22 - .../bean/types/enterprise/Creature.java | 20 - .../bean/types/enterprise/CreatureLocal.java | 20 - .../types/enterprise/LegendaryCreature.java | 22 - .../bean/types/enterprise/LegendaryLocal.java | 20 - .../bean/types/enterprise/LoginAction.java | 20 - .../types/enterprise/LoginActionBean.java | 20 - .../bean/types/enterprise/Mammal.java | 22 - .../bean/types/enterprise/Mock.java | 36 - .../types/enterprise/MockLoginActionBean.java | 21 - .../bean/types/enterprise/Reptile.java | 18 - .../enterprise/SessionBeanTypesTest.java | 113 - .../bean/types/enterprise/Snake.java | 17 - .../bean/types/enterprise/Tiger.java | 22 - .../bean/types/enterprise/Vulture.java | 22 - .../bean/types/enterprise/illegal/Animal.java | 19 - .../enterprise/illegal/AnimalHolder.java | 18 - .../illegal/BeanTypesWithIllegalTypeTest.java | 59 - .../bean/types/enterprise/illegal/Bird.java | 19 - .../bean/types/enterprise/illegal/Eagle.java | 21 - .../types/enterprise/illegal/Produced.java | 42 - .../qualifier/enterprise/BorderCollie.java | 21 - .../enterprise/BorderCollieLocal.java | 21 - .../enterprise/EnglishBorderCollie.java | 21 - .../enterprise/EnglishBorderCollieLocal.java | 21 - .../EnterpriseQualifierDefinitionTest.java | 70 - .../qualifier/enterprise/FamousCat.java | 21 - .../qualifier/enterprise/FamousCatLocal.java | 21 - .../qualifier/enterprise/Hairless.java | 36 - .../qualifier/enterprise/HairlessCat.java | 19 - .../enterprise/HairlessQualifier.java | 20 - .../qualifier/enterprise/Hairy.java | 36 - .../qualifier/enterprise/HairyQualifier.java | 29 - .../qualifier/enterprise/LongHairedDog.java | 19 - .../qualifier/enterprise/Skinny.java | 34 - .../enterprise/SkinnyHairlessCat.java | 22 - .../enterprise/SkinnyHairlessCatLocal.java | 21 - .../qualifier/enterprise/SkinnyQualifier.java | 20 - .../enterprise/TameSkinnyHairlessCat.java | 21 - .../TameSkinnyHairlessCatLocal.java | 21 - .../ejb/SessionBeanTooManyScopesTest.java | 45 - ...ssionBeanWithTooManyScopeTypes_Broken.java | 24 - ...ionBeanProducerFieldTooManyScopesTest.java | 45 - ...ucerFieldWithTooManyScopeTypes_Broken.java | 28 - .../ejb/producer/field/Word.java | 32 - ...onBeanProducerMethodTooManyScopesTest.java | 45 - ...cerMethodWithTooManyScopeTypes_Broken.java | 30 - .../ejb/producer/method/Word.java | 32 - .../scope/enterprise/BengalTiger.java | 21 - .../scope/enterprise/BengalTigerLocal.java | 21 - .../scope/enterprise/BorderCollie.java | 21 - .../scope/enterprise/BorderCollieLocal.java | 21 - .../definition/scope/enterprise/Cat.java | 19 - .../definition/scope/enterprise/Dog.java | 21 - .../scope/enterprise/EnglishBorderCollie.java | 21 - .../enterprise/EnglishBorderCollieLocal.java | 21 - .../EnterpriseScopeDefinitionTest.java | 60 - .../scope/enterprise/FooScoped.java | 33 - .../definition/scope/enterprise/Siamese.java | 21 - .../scope/enterprise/SiameseLocal.java | 21 - .../definition/scope/enterprise/Tiger.java | 18 - .../enterprise/AbstractService.java | 19 - ...seStereotypeAlternativeSpecializeTest.java | 56 - .../EnterpriseStereotypeAlternativeTest.java | 56 - .../alternative/enterprise/Mock.java | 33 - .../alternative/enterprise/MockService.java | 32 - .../alternative/enterprise/RealService.java | 29 - .../alternative/enterprise/Service.java | 21 - .../enterprise/SimpleAlternativeService.java | 28 - .../stereotype/enterprise/Animal.java | 18 - .../enterprise/AnimalStereotype.java | 35 - .../stereotype/enterprise/Barracuda.java | 21 - .../stereotype/enterprise/BarracudaLocal.java | 21 - .../stereotype/enterprise/BorderCollie.java | 21 - .../enterprise/BorderCollieLocal.java | 18 - .../stereotype/enterprise/Chihuahua.java | 26 - .../stereotype/enterprise/ChihuahuaLocal.java | 21 - .../enterprise/EnglishBorderCollie.java | 21 - .../enterprise/EnglishBorderCollieLocal.java | 21 - .../EnterpriseStereotypeDefinitionTest.java | 73 - .../stereotype/enterprise/Fish.java | 19 - .../stereotype/enterprise/FishStereotype.java | 33 - .../stereotype/enterprise/LongHairedDog.java | 19 - .../enterprise/MexicanChihuahua.java | 26 - .../enterprise/MexicanChihuahuaLocal.java | 21 - .../stereotype/enterprise/ShortHairedDog.java | 29 - .../stereotype/enterprise/TameBarracuda.java | 21 - .../enterprise/TameBarracudaLocal.java | 21 - .../interceptor/enterprise/AlphaBinding.java | 33 - .../enterprise/AlphaInterceptor.java | 35 - .../enterprise/AlphaStereotype.java | 32 - ...priseStereotypeInterceptorBindingTest.java | 58 - .../interceptor/enterprise/Foo.java | 24 - .../discovery/enterprise/Alpha.java | 25 - .../discovery/enterprise/AlphaLocal.java | 21 - .../discovery/enterprise/Bravo.java | 25 - .../discovery/enterprise/BravoLocal.java | 21 - .../discovery/enterprise/Charlie.java | 25 - .../discovery/enterprise/CharlieLocal.java | 21 - .../discovery/enterprise/Delta.java | 25 - .../discovery/enterprise/DeltaLocal.java | 21 - .../deployment/discovery/enterprise/Echo.java | 25 - .../discovery/enterprise/EchoLocal.java | 21 - .../EnterpriseBeanDiscoveryTest.java | 186 - .../discovery/enterprise/Foxtrot.java | 25 - .../discovery/enterprise/FoxtrotLocal.java | 21 - .../discovery/enterprise/LegacyBean.java | 25 - .../discovery/enterprise/LegacyExtension.java | 27 - .../deployment/discovery/enterprise/Ping.java | 20 - .../enterprise/VerifyingExtension.java | 35 - .../discovery/enterprise/annotated/Apple.java | 17 - .../enterprise/annotated/AppleTree.java | 40 - .../enterprise/annotated/AppleTreeLocal.java | 26 - ...nterpriseDefaultBeanDiscoveryModeTest.java | 85 - .../enterprise/annotated/TestExtension.java | 52 - .../DefaultBeanDiscoveryModeTest.java | 91 - .../discovery/implicit/DummyBean.java | 27 - .../discovery/implicit/NotDiscoveredBean.java | 39 - .../discovery/implicit/ProducedBean.java | 17 - .../discovery/implicit/TestExtension.java | 44 - .../packaging/bundledLibrary/Bar.java | 29 - .../packaging/bundledLibrary/Baz.java | 32 - .../packaging/bundledLibrary/Foo.java | 33 - .../bundledLibrary/LibraryInEarTest.java | 78 - .../bundledLibrary/LibraryInWarTest.java | 58 - .../LibraryMissingBeansXmlTest.java | 50 - .../packaging/bundledLibrary/Unlucky.java | 18 - .../deployment/packaging/ear/BarBean.java | 29 - .../packaging/ear/BarExtension.java | 30 - .../deployment/packaging/ear/BarWebBean.java | 34 - .../deployment/packaging/ear/FooBean.java | 29 - .../packaging/ear/FooExtension.java | 30 - .../deployment/packaging/ear/FooWebBean.java | 34 - .../ear/MultiWebModuleWithExtensionTest.java | 83 - .../ear/SingleWebModuleWithExtensionTest.java | 75 - .../packaging/ear/modules/AlternativeBar.java | 32 - .../deployment/packaging/ear/modules/Bar.java | 39 - .../packaging/ear/modules/BarInspector.java | 33 - .../deployment/packaging/ear/modules/Baz.java | 39 - .../packaging/ear/modules/Business.java | 26 - .../ear/modules/BusinessOperationEvent.java | 22 - .../BusinessOperationEventInspector.java | 42 - .../BusinessOperationObservedEvent.java | 22 - .../ear/modules/ContainerEventsObserver.java | 105 - .../modules/EnterpriseArchiveModulesTest.java | 206 - .../deployment/packaging/ear/modules/Foo.java | 46 - .../packaging/ear/modules/LegacyService.java | 30 - .../ear/modules/LegacyServiceProducer.java | 37 - .../ear/modules/LoggingDecorator.java | 52 - .../packaging/ear/modules/NonEnterprise.java | 39 - .../deployment/packaging/ear/modules/Qux.java | 39 - .../packaging/ear/modules/Secured.java | 33 - .../ear/modules/SecurityInterceptor.java | 46 - .../packaging/ear/modules/Util.java | 28 - .../tests/deployment/packaging/ejb/Bar.java | 19 - .../packaging/ejb/EJBJarDeploymentTest.java | 69 - .../deployment/packaging/ejb/FooBean.java | 26 - .../deployment/packaging/ejb/FooRemote.java | 23 - .../packaging/ejb/ProcessBeanObserver.java | 33 - .../packaging/installedLibrary/Alpha.java | 21 - .../installedLibrary/AssertBean.java | 94 - .../packaging/installedLibrary/Bravo.java | 21 - .../packaging/installedLibrary/Charlie.java | 21 - .../InstalledLibraryEarTest.java | 90 - .../InstalledLibraryWarTest.java | 68 - .../rar/ResourceAdapterArchiveTest.java | 87 - .../packaging/rar/TestResourceAdapter.java | 128 - .../deployment/packaging/rar/Translator.java | 23 - .../packaging/visibility/American.java | 34 - .../AnnotatedTypeObserverExtension.java | 39 - .../deployment/packaging/visibility/Bar.java | 25 - .../deployment/packaging/visibility/Beer.java | 21 - .../packaging/visibility/BeerCollector.java | 44 - .../packaging/visibility/CraftBeer.java | 24 - .../deployment/packaging/visibility/Foo.java | 21 - .../JarToJarAlphaVisibilityTest.java | 54 - .../JarToJarReverseAlphaVisibilityTest.java | 55 - .../deployment/packaging/visibility/Soda.java | 21 - ...esFromExtensionInAlphaBeanArchiveTest.java | 63 - ...esFromExtensionInBravoBeanArchiveTest.java | 63 - ...oduleFromBeanManagerInBeanLibraryTest.java | 67 - ...eansDescriptorAlternativeLocationTest.java | 51 - .../packaging/war/modules/AlternativeBar.java | 32 - .../deployment/packaging/war/modules/Bar.java | 45 - .../packaging/war/modules/BarInspector.java | 33 - .../deployment/packaging/war/modules/Baz.java | 44 - .../packaging/war/modules/Bazinga.java | 33 - .../packaging/war/modules/Business.java | 26 - .../war/modules/BusinessOperationEvent.java | 22 - .../war/modules/ContainerEventsObserver.java | 96 - .../deployment/packaging/war/modules/Foo.java | 61 - .../packaging/war/modules/LegacyService.java | 28 - .../war/modules/LegacyServiceProducer.java | 37 - .../war/modules/LoggingDecorator.java | 46 - .../deployment/packaging/war/modules/Qux.java | 49 - .../packaging/war/modules/Secured.java | 33 - .../war/modules/SecurityInterceptor.java | 46 - .../war/modules/WebArchiveModulesTest.java | 144 - .../ApplicationShutdownLifecycleTest.java | 132 - .../tck/tests/deployment/shutdown/Bar.java | 44 - .../tck/tests/deployment/shutdown/Baz.java | 39 - .../shutdown/ContextDestructionObserver.java | 47 - .../tck/tests/deployment/shutdown/Foo.java | 35 - .../tests/deployment/shutdown/InfoClient.java | 41 - .../deployment/shutdown/InfoServlet.java | 54 - .../deployment/shutdown/InitServlet.java | 48 - .../LifecycleMonitoringExtension.java | 30 - .../tck/tests/deployment/shutdown/Qux.java | 30 - .../deployment/trimmed/enteprise/Bike.java | 24 - .../deployment/trimmed/enteprise/Car.java | 25 - .../EnterpriseTrimmedBeanArchiveTest.java | 68 - .../trimmed/enteprise/MotorizedVehicle.java | 20 - .../trimmed/enteprise/TestExtension.java | 43 - ...JBObserverMethodNotBusinessMethodTest.java | 51 - .../observer/notBusinessMethod/Terrier.java | 21 - .../TibetanTerrier_Broken.java | 23 - ...bserverMethodRemoteBusinessMethodTest.java | 48 - ...bserverMethodRemoteBusinessMethodTest.java | 47 - .../remoteBusinessMethod/FoxTerrrier.java | 26 - .../remoteBusinessMethod/Terrier.java | 22 - .../remoteBusinessMethod/TibetanTerrier.java | 25 - .../tck/tests/event/observer/context/Foo.java | 17 - .../event/observer/context/FooObserver.java | 80 - .../ObserverMethodInvocationContextTest.java | 60 - .../tests/event/observer/context/Printer.java | 78 - .../tests/event/observer/context/Student.java | 36 - .../tests/event/observer/context/Toner.java | 25 - .../context/async/AsyncMessageObserver.java | 54 - ...ncObserverMethodInvocationContextTest.java | 87 - .../event/observer/context/async/Counter.java | 33 - .../event/observer/context/async/Message.java | 17 - ...ContextPropagationInAsyncObserverTest.java | 68 - .../context/async/enterprise/Printer.java | 28 - .../context/async/enterprise/Student.java | 43 - .../context/async/enterprise/Teacher.java | 41 - .../context/async/enterprise/Text.java | 28 - .../observer/context/enterprise/Foo.java | 17 - .../context/enterprise/FooObserver.java | 95 - .../context/enterprise/ObserverLocal.java | 30 - .../observer/context/enterprise/Printer.java | 78 - ...anObserverMethodInvocationContextTest.java | 60 - .../observer/context/enterprise/Student.java | 36 - .../observer/context/enterprise/Toner.java | 25 - .../context/enterprise/staticMethod/Foo.java | 17 - .../enterprise/staticMethod/FooObserver.java | 92 - .../enterprise/staticMethod/Printer.java | 78 - ...icObserverMethodInvocationContextTest.java | 60 - .../enterprise/staticMethod/Student.java | 36 - .../enterprise/staticMethod/Toner.java | 25 - .../observer/inheritance/enterprise/Egg.java | 22 - .../EnterpriseObserverInheritanceTest.java | 67 - .../inheritance/enterprise/EventPayload.java | 29 - .../inheritance/enterprise/Farmer.java | 28 - .../inheritance/enterprise/FarmerLocal.java | 25 - .../enterprise/IndirectStockWatcher.java | 26 - .../enterprise/IndirectStockWatcherLocal.java | 19 - .../enterprise/IntermediateStockWatcher.java | 22 - .../inheritance/enterprise/LazyFarmer.java | 25 - .../enterprise/LazyFarmerLocal.java | 19 - .../inheritance/enterprise/StockPrice.java | 22 - .../inheritance/enterprise/StockWatcher.java | 28 - .../enterprise/StockWatcherLocal.java | 24 - .../contextLifecycleEvent/ee/InfoServlet.java | 43 - ...extLifecycleEventObserverOrderingTest.java | 63 - .../ee/RequestContextLifecycleObserver.java | 70 - .../transactional/AbstractObserver.java | 29 - .../transactional/OnlineAccountService.java | 94 - .../PhisherAccountTransactionObserver.java | 108 - .../ReceiverAccountTransactionObserver.java | 103 - .../SenderAccountTransactionObserver.java | 98 - .../TransactionalPriorityObserverTest.java | 121 - .../priority/transactional/TxFailure.java | 19 - .../priority/transactional/TxWithdrawal.java | 29 - .../observer/resolve/enterprise/EJBEvent.java | 20 - .../resolve/enterprise/LocalInterface.java | 21 - .../resolve/enterprise/NoInterfaceSLSB.java | 27 - .../ResolveEnterpriseEventObserverTest.java | 46 - .../observer/resolve/enterprise/Spitz.java | 32 - .../transactional/AccountService.java | 94 - .../AccountTransactionObserver.java | 101 - .../event/observer/transactional/Failure.java | 19 - .../TransactionalObserverTest.java | 155 - .../observer/transactional/Withdrawal.java | 29 - .../CustomTransactionalObserverTest.java | 84 - .../transactional/custom/Giraffe.java | 18 - .../custom/GiraffeCustomObserver.java | 85 - .../transactional/custom/GiraffeObserver.java | 53 - .../transactional/custom/GiraffeService.java | 44 - .../custom/ObserverExtension.java | 33 - .../transactional/roolback/EjbTestBean.java | 47 - .../observer/transactional/roolback/Foo.java | 17 - .../roolback/FooTransactionalObserver.java | 45 - .../TransactionalObserverRollbackTest.java | 62 - .../metadata/ejb/AlternativeMetadataTest.java | 60 - .../alternative/metadata/ejb/Pasta.java | 22 - .../metadata/ejb/PastaWrapper.java | 39 - .../ejb/ProcessAnnotatedTypeObserver.java | 25 - .../ejb/EnterpriseWithAnnotationsTest.java | 91 - .../annotated/delivery/ejb/Hawk.java | 31 - .../ejb/CreateBeanAttributesTest.java | 185 - .../beanManager/beanAttributes/ejb/Dam.java | 31 - .../beanManager/beanAttributes/ejb/Lake.java | 54 - .../beanAttributes/ejb/LakeLocal.java | 23 - .../extensions/container/event/Cheese.java | 20 - .../container/event/ContainerEventTest.java | 183 - .../tests/extensions/container/event/Cow.java | 22 - .../extensions/container/event/CowLocal.java | 21 - .../extensions/container/event/Farm.java | 27 - .../extensions/container/event/Food.java | 23 - .../extensions/container/event/Milk.java | 20 - .../event/ProcessAnnotatedTypeObserver.java | 66 - .../container/event/ProcessBeanObserver.java | 86 - .../event/ProcessInjectionTargetObserver.java | 66 - .../extensions/container/event/Sheep.java | 25 - .../container/event/SheepInterceptor.java | 24 - .../container/event/SheepLocal.java | 21 - .../extensions/container/event/Tame.java | 34 - .../event/jms/ContainerEventTest.java | 105 - .../jms/ProcessInjectionTargetObserver.java | 32 - .../event/jms/QueueMessageDrivenBean.java | 37 - .../extensions/container/event/jms/Sheep.java | 21 - .../extensions/interceptors/FullMarathon.java | 25 - .../extensions/interceptors/Incremented.java | 25 - .../interceptors/IncrementingInterceptor.java | 40 - .../interceptors/InterceptorExtension.java | 102 - .../InterceptorExtensionTest.java | 108 - .../interceptors/LifecycleInterceptor.java | 53 - .../extensions/interceptors/Marathon.java | 31 - .../extensions/interceptors/NumberSource.java | 27 - .../extensions/interceptors/Suffixed.java | 26 - .../interceptors/SuffixingInterceptor.java | 39 - .../extensions/interceptors/WordSource.java | 33 - ...erLifeCycleEventRuntimeInvocationTest.java | 605 - .../lifecycle/events/SimpleAnnotation.java | 22 - .../lifecycle/events/SimpleBean.java | 40 - .../lifecycle/events/TestExtension.java | 193 - ...erLifeCycleEventRuntimeInvocationTest.java | 650 - .../lifecycle/events/ejb/SessionBean.java | 24 - .../events/ejb/SimpleAnnotation.java | 22 - .../lifecycle/events/ejb/SimpleBean.java | 40 - .../lifecycle/events/ejb/TestExtension.java | 203 - ...sBeanAttributesNotFiredForBuiltinBean.java | 51 - .../ProcessBeanAttributesObserver.java | 69 - .../processBeanAttributes/ejb/Delta.java | 33 - .../ejb/VerifyValuesTest.java | 162 - .../ejb/VerifyingExtension.java | 85 - .../ee/ProcessInjectionPointFiredTest.java | 112 - .../processInjectionPoint/ee/TestFilter.java | 46 - .../ee/TestListener.java | 36 - .../processInjectionPoint/ee/TestServlet.java | 30 - .../ee/VerifyingExtension.java | 159 - .../ContainerEventTest.java | 110 - .../CustomInjectionTarget.java | 62 - .../processInjectionTarget/Farm.java | 20 - .../processInjectionTarget/Fence.java | 40 - .../FenceInterceptor.java | 43 - .../ProcessInjectionTargetObserver.java | 157 - .../processInjectionTarget/Sheep.java | 23 - .../TagLibraryListener.java | 50 - .../processInjectionTarget/TestFilter.java | 60 - .../processInjectionTarget/TestListener.java | 45 - .../processInjectionTarget/TestServlet.java | 82 - .../TestTagHandler.java | 47 - .../extensions/processBean/ejb/Elephant.java | 21 - .../processBean/ejb/ElephantLocal.java | 21 - .../ejb/ProcessSessionBeanObserver.java | 85 - .../ejb/ProcessSessionBeanTest.java | 73 - .../producer/remote/ProducerProcessor.java | 54 - .../producer/remote/RemoteProducerTest.java | 62 - .../producer/remote/ServiceBean.java | 26 - .../producer/remote/ServiceProducer.java | 26 - .../producer/remote/ServiceRemote.java | 23 - .../AnotherBeanClassToRegister.java | 26 - ...notherManualBeanRegistrationExtension.java | 46 - .../registration/BeanClassToRegister.java | 28 - ...gistrationByExtensionInEarLibraryTest.java | 74 - ...rationByExtensionInNonBeanArchiveTest.java | 66 - ...gistrationByExtensionInWarLibraryTest.java | 64 - .../tests/extensions/registration/Beanie.java | 24 - .../extensions/registration/BeanieType.java | 29 - .../registration/BeanieTypeLiteral.java | 19 - .../registration/DummyObserverExtension.java | 28 - .../registration/EarExtensionsCheck.java | 22 - .../ManualBeanRegistrationExtension.java | 47 - .../TwoBeansOneClassExtension.java | 70 - .../registration/TwoBeansOneClassTest.java | 64 - ...eredByExtensionFromNonBeanLibraryTest.java | 70 - .../WarDummyObserverExtension.java | 28 - .../builtin/BuiltInBeansTest.java | 75 - .../builtin/MockLoginModule.java | 65 - .../builtin/PrincipalInjectedBean.java | 69 - .../builtin/PrincipalInjectedBeanLocal.java | 33 - .../builtin/UserTransactionInjectedBean.java | 38 - .../UserTransactionInjectedBeanLocal.java | 28 - .../ContainerManagedTransactionBean.java | 38 - .../UserTransactionInvalidInjectionTest.java | 53 - .../ee/BuiltinMetadataEEBeanTest.java | 62 - .../builtin/metadata/ee/Counter.java | 30 - .../metadata/ee/InterceptorBinding.java | 29 - .../metadata/ee/ServletInterceptor.java | 44 - .../builtin/metadata/ee/TestServlet.java | 38 - .../metadata/session/BakeryProduct.java | 22 - .../session/BakeryProductDecorator.java | 55 - .../builtin/metadata/session/Bread.java | 24 - .../BuiltinMetadataSessionBeanTest.java | 90 - .../builtin/metadata/session/Frozen.java | 36 - .../builtin/metadata/session/Yoghurt.java | 35 - .../metadata/session/YoghurtInterceptor.java | 54 - .../builtin/servlet/LowercaseConverter.java | 78 - .../servlet/LowercaseConverterServlet.java | 49 - .../ServletContainerBuiltinBeanTest.java | 93 - .../enterprise/methodOnSessionBean/Apple.java | 18 - .../methodOnSessionBean/AppleTree.java | 31 - .../methodOnSessionBean/AppleTreeLocal.java | 23 - .../DisposalMethodOnSessionBeanTest.java | 49 - .../broken/enterprise/remoteMethod/Foo.java | 18 - .../enterprise/remoteMethod/FooDisposal.java | 30 - .../remoteMethod/FooDisposalRemote.java | 23 - .../RemoteBusinessDisposalMethodTest.java | 46 - .../observes/async/BrokenFoodProducer.java | 32 - .../DisposerMethodWithAsyncObservesTest.java | 43 - .../broken/observes/async/Food.java | 17 - .../definition/inheritance/ejb/Chicken.java | 40 - .../definition/inheritance/ejb/Code.java | 33 - .../inheritance/ejb/CzechChicken.java | 30 - .../ejb/DisposerMethodInheritanceTest.java | 67 - .../definition/inheritance/ejb/Egg.java | 32 - .../definition/inheritance/ejb/Guru.java | 34 - .../inheritance/ejb/Programmer.java | 40 - .../definition/inheritance/ejb/Sumavanka.java | 36 - .../genericStateless/DingoLocal_Broken.java | 21 - .../broken/genericStateless/Dingo_Broken.java | 26 - .../GenericStatelessSessionBeanTest.java | 44 - .../Husky_Broken.java | 23 - .../SingletonWithConversationScopeTest.java | 44 - .../Greyhound_Broken.java | 23 - .../SingletonWithRequestScopeTest.java | 44 - .../IrishTerrier_Broken.java | 30 - .../SingletonWithSessionScopeTest.java | 43 - .../BulldogLocal_Broken.java | 21 - .../statelessDecorator/Bulldog_Broken.java | 31 - .../broken/statelessDecorator/Colie.java | 19 - ...atorAnnotatedStatelessSessionBeanTest.java | 44 - .../broken/statelessDecorator/Dog.java | 18 - .../DalmatianLocal_Broken.java | 21 - .../Dalmatian_Broken.java | 26 - ...ptorAnnotatedStatelessSessionBeanTest.java | 44 - .../DachshundLocal_Broken.java | 21 - .../Dachshund_Broken.java | 23 - .../StatelessWithApplicationScopeTest.java | 44 - .../BoxerLocal_Broken.java | 21 - .../Boxer_Broken.java | 23 - .../StatelessWithConversationScopeTest.java | 44 - .../BeagleLocal_Broken.java | 21 - .../Beagle_Broken.java | 23 - .../StatelessWithRequestScopeTest.java | 44 - .../BullmastiffLocal_Broken.java | 21 - .../Bullmastiff_Broken.java | 23 - .../StatelessWithSessionScopeTest.java | 44 - .../enterprise/definition/Ape.java | 22 - .../enterprise/definition/ApeLocal.java | 21 - .../enterprise/definition/Dog.java | 18 - .../enterprise/definition/DogLocal.java | 21 - .../enterprise/definition/Elephant.java | 18 - .../enterprise/definition/ElephantLocal.java | 18 - .../EnterpriseBeanDefinitionTest.java | 156 - .../definition/EnterpriseBeanViaXmlTest.java | 61 - .../definition/ExplicitConstructor.java | 28 - .../ExplicitConstructorSessionBean.java | 50 - .../enterprise/definition/Giraffe.java | 21 - .../enterprise/definition/GiraffeLocal.java | 21 - .../enterprise/definition/Labrador.java | 22 - .../enterprise/definition/Laika.java | 22 - .../enterprise/definition/Lion.java | 23 - .../enterprise/definition/LionLocal.java | 21 - .../enterprise/definition/Monkey.java | 25 - .../enterprise/definition/MonkeyLocal.java | 21 - .../NoParamConstructorSessionBean.java | 36 - .../enterprise/definition/Pitbull.java | 34 - .../enterprise/definition/PitbullLocal.java | 21 - .../enterprise/definition/Polar.java | 35 - .../enterprise/definition/PolarBear.java | 22 - .../enterprise/definition/PolarBearLocal.java | 21 - .../enterprise/definition/Retriever.java | 25 - .../enterprise/definition/SimpleBean.java | 18 - .../enterprise/definition/Tame.java | 36 - .../enterprise/definition/remote/Bar.java | 18 - .../enterprise/definition/remote/Collie.java | 22 - .../definition/remote/DogLocal.java | 21 - .../definition/remote/DogRemote.java | 21 - .../definition/remote/DoggieRemote.java | 20 - .../enterprise/definition/remote/Foo.java | 18 - .../enterprise/definition/remote/Pitbull.java | 28 - .../RemoteInterfaceNotInAPITypesTest.java | 61 - .../definition/remote/SuperBar.java | 18 - .../enterprise/definition/remote/Tame.java | 36 - .../enterprise/lifecycle/AlteStadt.java | 27 - .../lifecycle/DirectOrderProcessor.java | 21 - .../lifecycle/DirectOrderProcessorLocal.java | 21 - .../EnterpriseBeanLifecycleTest.java | 215 - .../enterprise/lifecycle/FrankfurtAmMain.java | 65 - .../lifecycle/GeschichtslosStadt.java | 21 - .../enterprise/lifecycle/Giessen.java | 24 - .../enterprise/lifecycle/GrossStadt.java | 37 - .../enterprise/lifecycle/GutenbergMuseum.java | 18 - .../enterprise/lifecycle/Heidelburg.java | 56 - .../enterprise/lifecycle/Important.java | 41 - .../lifecycle/IndirectOrderProcessor.java | 21 - .../lifecycle/IntermediateOrderProcessor.java | 18 - .../enterprise/lifecycle/Kassel.java | 57 - .../enterprise/lifecycle/KleinStadt.java | 32 - .../lifecycle/LandgraffenSchloss.java | 37 - .../enterprise/lifecycle/Mainz.java | 47 - .../enterprise/lifecycle/Marburg.java | 29 - .../enterprise/lifecycle/NeueStadt.java | 21 - .../enterprise/lifecycle/OrderProcessor.java | 38 - .../lifecycle/OrderProcessorLocal.java | 21 - .../enterprise/lifecycle/RoemerPassage.java | 22 - .../enterprise/lifecycle/Schloss.java | 23 - .../enterprise/lifecycle/SchoeneStadt.java | 21 - .../enterprise/lifecycle/UniStadt.java | 21 - .../remove/DependentSessionBean.java | 46 - .../remove/DependentSessionInterface.java | 26 - .../EnterpriseBeanRemoveMethodTest.java | 73 - .../remove/SessionScopedSessionBean.java | 29 - .../remove/SessionScopedSessionInterface.java | 23 - .../enterprise/remove/StateKeeper.java | 45 - .../initializer/ejb/AndalusianChicken.java | 34 - .../ejb/EjbInitializerMethodTest.java | 45 - .../initializer/ejb/LocalChicken.java | 23 - .../enterprise/nonstatic/FooLocal_Broken.java | 21 - .../enterprise/nonstatic/Foo_Broken.java | 24 - .../NonStaticFieldOfSessionBeanTest.java | 43 - .../broken/enterprise/nonstatic/Number.java | 32 - .../field/definition/enterprise/Chicken.java | 27 - .../definition/enterprise/ChickenLocal.java | 21 - .../field/definition/enterprise/Egg.java | 32 - ...EnterpriseProducerFieldDefinitionTest.java | 45 - .../field/definition/enterprise/Foo.java | 36 - .../broken/enterprise/nonbusiness/Foo.java | 18 - .../enterprise/nonbusiness/FooProducer.java | 25 - .../nonbusiness/FooProducerLocal.java | 21 - .../ProducerMethodNotBusinessMethodTest.java | 46 - .../broken/enterprise/remoteMethod/Foo.java | 18 - .../enterprise/remoteMethod/FooProducer.java | 26 - .../remoteMethod/FooProducerRemote.java | 23 - .../RemoteBusinessProducerMethodTest.java | 46 - .../enterprise/AndalusianChicken.java | 23 - .../enterprise/AndalusianChickenLocal.java | 21 - .../method/definition/enterprise/Apple.java | 26 - .../definition/enterprise/AppleTree.java | 26 - .../definition/enterprise/AppleTreeLocal.java | 21 - .../method/definition/enterprise/Chicken.java | 28 - .../definition/enterprise/ChickenLocal.java | 21 - .../method/definition/enterprise/Egg.java | 27 - ...nterpriseProducerMethodDefinitionTest.java | 62 - .../enterprise/GrannySmithAppleTree.java | 21 - .../definition/enterprise/LightYellow.java | 34 - .../enterprise/LightYellowPearTree.java | 27 - .../enterprise/LightYellowPearTreeLocal.java | 21 - .../method/definition/enterprise/Pear.java | 26 - .../definition/enterprise/PearTree.java | 26 - .../definition/enterprise/PearTreeLocal.java | 21 - .../definition/enterprise/YellowPearTree.java | 21 - .../method/definition/enterprise/Yummy.java | 36 - ...iseBeanNotDiscoveredAsManagedBeanTest.java | 46 - .../definition/ee/EnterpriseBeanObserver.java | 35 - .../definition/ee/MockEnterpriseBean.java | 30 - .../simple/definition/ee/MockServlet.java | 46 - .../ee/MockServletContextListener.java | 29 - .../ee/MockServletRequestListener.java | 29 - .../simple/definition/ee/MockUIComponent.java | 227 - .../ee/components/IntrospectServlet.java | 139 - .../ee/components/JavaEEComponentsTest.java | 93 - .../simple/ee/components/Ping.java | 42 - .../simple/ee/components/Tame.java | 41 - .../simple/ee/components/Wild.java | 41 - .../simple/resource/broken/name/Another.java | 33 - .../name/ResourceDefinitionWithNameTest.java | 49 - .../broken/name/ResourceProducer.java | 31 - .../simple/resource/broken/type/Another.java | 33 - ...sourceDefinitionWithDifferentTypeTest.java | 49 - .../broken/type/ResourceProducer.java | 28 - .../simple/resource/broken/type/ejb/Bean.java | 21 - .../resource/broken/type/ejb/BeanRemote.java | 20 - .../simple/resource/broken/type/ejb/Lazy.java | 34 - ...sourceDefinitionWithDifferentTypeTest.java | 49 - .../broken/type/ejb/ResourceProducer.java | 27 - .../resource/broken/type/env/Greeting.java | 33 - ...sourceDefinitionWithDifferentTypeTest.java | 55 - .../broken/type/env/ResourceProducer.java | 27 - .../type/persistence/context/Database.java | 33 - ...sourceDefinitionWithDifferentTypeTest.java | 48 - .../persistence/context/ResourceProducer.java | 30 - .../type/persistence/unit/Database.java | 33 - ...sourceDefinitionWithDifferentTypeTest.java | 48 - .../persistence/unit/ResourceProducer.java | 30 - .../simple/resource/ejb/AnotherInterface.java | 17 - .../simple/resource/ejb/Bean.java | 63 - .../simple/resource/ejb/BeanRemote.java | 29 - .../simple/resource/ejb/EjbInjectionTest.java | 79 - .../simple/resource/ejb/Lazy.java | 36 - .../simple/resource/ejb/ManagedBean.java | 31 - .../simple/resource/ejb/Monitor.java | 35 - .../simple/resource/ejb/ResourceProducer.java | 27 - .../resource/ejb/staticProducer/Bean.java | 24 - .../EjbInjectionStaticProducerFieldTest.java | 48 - .../resource/ejb/staticProducer/Lazy.java | 34 - .../ejb/staticProducer/ManagedBean.java | 28 - .../ejb/staticProducer/ResourceProducer.java | 26 - .../resource/env/BooleanResourceProducer.java | 26 - .../simple/resource/env/EnvInjectionTest.java | 92 - .../simple/resource/env/Greeting.java | 36 - .../simple/resource/env/GreetingBean.java | 28 - .../simple/resource/env/ResourceProducer.java | 26 - .../EnvInjectionStaticProducerFieldTest.java | 58 - .../resource/env/staticProducer/Greeting.java | 33 - .../env/staticProducer/GreetingBean.java | 28 - .../env/staticProducer/ResourceProducer.java | 26 - .../resource/persistenceContext/Database.java | 36 - .../persistenceContext/ManagedBean.java | 41 - .../PersistenceContextInjectionTest.java | 117 - .../persistenceContext/ResourceProducer.java | 48 - .../persistenceContext/ServiceBean.java | 28 - .../persistenceContext/ServiceBeanImpl.java | 54 - .../staticProducer/Database.java | 33 - .../staticProducer/ManagedBean.java | 41 - ...tenceInjectionStaticProducerFieldTest.java | 64 - .../staticProducer/ResourceProducer.java | 48 - .../staticProducer/ServiceBean.java | 28 - .../staticProducer/ServiceBeanImpl.java | 54 - .../simple/resource/resource/Another.java | 36 - .../resource/InjectionOfResourceTest.java | 83 - .../simple/resource/resource/ManagedBean.java | 31 - .../resource/resource/ResourceProducer.java | 27 - .../resource/staticProducer/Another.java | 33 - ...tionOfResourceStaticProducerFieldTest.java | 47 - .../resource/staticProducer/ManagedBean.java | 31 - .../staticProducer/ResourceProducer.java | 27 - .../inheritance/initializer/AppleEjb.java | 30 - .../tests/inheritance/initializer/Cheap.java | 32 - .../tests/inheritance/initializer/Citrus.java | 19 - .../inheritance/initializer/CitrusEjb.java | 22 - .../inheritance/initializer/Expensive.java | 32 - .../inheritance/initializer/FirstLevel.java | 32 - .../tests/inheritance/initializer/Fruit.java | 33 - .../inheritance/initializer/FruitEjb.java | 35 - .../InitializerMethodInheritanceTest.java | 85 - .../tests/inheritance/initializer/Lemon.java | 28 - .../tests/inheritance/initializer/Orange.java | 19 - .../inheritance/initializer/OrangeEjb.java | 22 - .../initializer/PriceProducer.java | 30 - .../inheritance/initializer/SecondLevel.java | 32 - .../specialization/enterprise/Animal.java | 18 - .../specialization/enterprise/Building.java | 31 - .../enterprise/BuildingLocal.java | 24 - .../EnterpriseBeanSpecializationTest.java | 95 - .../enterprise/FarmEquipment.java | 21 - .../specialization/enterprise/Farmer.java | 28 - .../enterprise/FarmerLocal.java | 21 - .../specialization/enterprise/Landowner.java | 36 - .../specialization/enterprise/Lazy.java | 34 - .../specialization/enterprise/LazyFarmer.java | 29 - .../enterprise/LazyFarmerLocal.java | 21 - .../specialization/enterprise/Office.java | 28 - .../enterprise/OfficeLocal.java | 23 - .../enterprise/TractorLocal.java | 21 - .../specialization/enterprise/Waste.java | 29 - .../specialization/enterprise/Yard.java | 23 - .../enterprise/YardInterface.java | 21 - .../DirectlyExtendsSimpleBeanTest.java | 44 - .../extend/managedbean/FarmEquipment.java | 21 - .../extend/managedbean/TractorLocal.java | 21 - .../extend/managedbean/Tractor_Broken.java | 23 - .../extend/nothing/CowLocal_Broken.java | 21 - .../broken/extend/nothing/Cow_Broken.java | 23 - .../nothing/DirectlyExtendsNothingTest.java | 44 - .../extend/sessionbean/LoginAction.java | 20 - .../extend/sessionbean/LoginActionBean.java | 20 - .../broken/extend/sessionbean/Mock.java | 33 - .../sessionbean/MockLoginActionBean.java | 23 - ...ializingSessionBeanWithClientViewTest.java | 51 - .../broken/name/FarmYard_Broken.java | 25 - .../enterprise/broken/name/SameNameTest.java | 44 - .../enterprise/broken/name/Yard.java | 23 - .../enterprise/broken/name/YardInterface.java | 21 - .../enterprise/broken/twobeans/Farmer.java | 25 - .../broken/twobeans/FarmerInterface.java | 20 - .../broken/twobeans/FishFarmer_Broken.java | 22 - .../enterprise/broken/twobeans/Landowner.java | 33 - .../broken/twobeans/SheepFarmer_Broken.java | 22 - .../TwoBeansSpecializeTheSameBeanTest.java | 43 - ...priseProducerMethodSpecializationTest.java | 94 - .../producer/method/enterprise/Expensive.java | 36 - .../method/enterprise/JewelryShop.java | 31 - .../producer/method/enterprise/Necklace.java | 23 - .../producer/method/enterprise/Product.java | 31 - .../producer/method/enterprise/Shop.java | 30 - .../producer/method/enterprise/Sparkly.java | 36 - .../broken/extendejb/FarmEquipment.java | 23 - .../broken/extendejb/FarmEquipmentLocal.java | 21 - ...ializingBeanExtendsEnterpriseBeanTest.java | 44 - .../broken/extendejb/Tractor_Broken.java | 23 - .../FinalClassMethodLevelInterceptorTest.java | 56 - .../FinalMethodClassLevelInterceptorTest.java | 58 - .../ee/FinalMethodClassLevelMissile.java | 28 - .../ee/FinalMethodClassLevelMissileLocal.java | 21 - ...FinalMethodMethodLevelInterceptorTest.java | 55 - .../ee/FinalMethodMethodLevelMissile.java | 25 - .../FinalMethodMethodLevelMissileLocal.java | 21 - .../finalClassInterceptor/ee/FooBinding.java | 31 - .../ee/MissileInterceptor.java | 32 - .../enterprise/interceptorOrder/Airborne.java | 32 - .../enterprise/interceptorOrder/Missile.java | 37 - .../interceptorOrder/MissileInterceptor.java | 35 - .../interceptorOrder/MissileLocal.java | 21 - .../interceptorOrder/RadarInterceptor.java | 33 - .../SessionBeanInterceptorOrderTest.java | 58 - ...geDrivenBeanInterceptorInvocationTest.java | 84 - .../enterprise/jms/MessageDrivenMissile.java | 31 - .../definition/enterprise/jms/Missile.java | 31 - .../enterprise/jms/MissileInterceptor.java | 63 - .../enterprise/jms/SimpleMessageProducer.java | 108 - .../nonContextualReference/Airborne.java | 32 - .../nonContextualReference/Anchor.java | 23 - .../AnchorInterceptor.java | 33 - .../nonContextualReference/Cruiser.java | 37 - .../nonContextualReference/Missile.java | 23 - .../MissileInterceptor.java | 33 - .../nonContextualReference/MissileLocal.java | 21 - ...ceptorOnNonContextualEjbReferenceTest.java | 52 - .../nonContextualReference/Ship.java | 20 - .../nonContextualReference/Waterborne.java | 32 - .../simpleInterception/Airborne.java | 32 - .../simpleInterception/Missile.java | 23 - .../MissileInterceptor.java | 38 - .../simpleInterception/MissileLocal.java | 21 - .../enterprise/simpleInterception/Rocket.java | 24 - .../SessionBeanInterceptorDefinitionTest.java | 64 - .../definition/inheritance_ee/Cactus.java | 25 - .../definition/inheritance_ee/Culinary.java | 32 - .../definition/inheritance_ee/European.java | 32 - .../definition/inheritance_ee/Flower.java | 26 - .../inheritance_ee/ForgetMeNot.java | 21 - .../definition/inheritance_ee/Grass.java | 21 - .../inheritance_ee/GuardedBySquirrel.java | 33 - .../inheritance_ee/GuardedByWoodpecker.java | 31 - .../InterceptorBindingInheritanceTest.java | 110 - .../definition/inheritance_ee/Opuncia.java | 22 - .../definition/inheritance_ee/Ping.java | 20 - .../definition/inheritance_ee/Plant.java | 31 - .../definition/inheritance_ee/PongPlant.java | 23 - .../definition/inheritance_ee/Shrub.java | 22 - .../inheritance_ee/SquirrelInterceptor.java | 34 - .../definition/inheritance_ee/Tree.java | 24 - .../inheritance_ee/WaterChestnut.java | 22 - .../inheritance_ee/WoodForgetMeNot.java | 22 - .../inheritance_ee/WoodpeckerInterceptor.java | 35 - .../lifecycle/enterprise/order/Airborne.java | 31 - .../enterprise/order/AnotherInterceptor.java | 44 - ...iseLifecycleInterceptorDefinitionTest.java | 75 - .../lifecycle/enterprise/order/Missile.java | 40 - .../enterprise/order/MissileInterceptor.java | 49 - .../lifecycle/enterprise/order/Weapon.java | 34 - .../ejb/InterceptorInvocationTest.java | 68 - .../tck/tests/interceptors/ejb/Timing.java | 42 - .../ordering/global/AbstractInterceptor.java | 30 - .../interceptors/ordering/global/Dao.java | 25 - .../ordering/global/DummyDao.java | 27 - .../EnterpriseInterceptorOrderingTest.java | 141 - .../global/GlobalInterceptorOrderingTest.java | 100 - .../global/GloballyEnabledInterceptor1.java | 25 - .../global/GloballyEnabledInterceptor2.java | 25 - .../global/GloballyEnabledInterceptor3.java | 25 - .../global/GloballyEnabledInterceptor4.java | 25 - .../global/GloballyEnabledInterceptor5.java | 25 - .../ordering/global/LegacyInterceptor1.java | 23 - .../ordering/global/LegacyInterceptor2.java | 23 - .../ordering/global/LegacyInterceptor3.java | 23 - .../interceptors/ordering/global/Service.java | 25 - .../ordering/global/Transactional.java | 35 - .../WebApplicationGlobalInterceptor1.java | 25 - .../lookup/clientProxy/incontainer/Car.java | 32 - .../incontainer/ClientProxyTest.java | 54 - .../clientProxy/incontainer/Garage.java | 27 - .../clientProxy/incontainer/TestServlet.java | 46 - .../integration/ClientProxyTest.java | 84 - .../lookup/clientProxy/integration/Fox.java | 25 - .../lookup/clientProxy/integration/Tuna.java | 25 - .../clientProxy/integration/TunedTuna.java | 23 - .../broken/ambiguous/ear/Animal.java | 17 - .../resolution/broken/ambiguous/ear/Bar.java | 24 - .../resolution/broken/ambiguous/ear/Cat.java | 20 - .../resolution/broken/ambiguous/ear/Dog.java | 20 - ...uleSessionBeanAmbiguousDependencyTest.java | 64 - .../IntegrationWithUnifiedELTest.java | 68 - .../tests/lookup/el/integration/Sheep.java | 31 - .../tests/lookup/injection/InjectionTest.java | 96 - .../lookup/injection/MegaPoorHenHouse.java | 21 - .../tests/lookup/injection/PoorHenHouse.java | 23 - .../lookup/injection/ejb/DeluxeHenHouse.java | 62 - .../tests/lookup/injection/ejb/HenHouse.java | 53 - .../lookup/injection/ejb/SessionBean.java | 24 - .../injection/enterprise/DeluxeHenHouse.java | 23 - .../enterprise/DeluxeHenHouseLocal.java | 21 - .../lookup/injection/enterprise/Farm.java | 47 - .../injection/enterprise/FarmInterceptor.java | 39 - .../injection/enterprise/FarmLocal.java | 23 - .../lookup/injection/enterprise/Fox.java | 27 - .../lookup/injection/enterprise/HenHouse.java | 25 - .../enterprise/InjectedSessionBean.java | 38 - .../enterprise/InjectedSessionBeanLocal.java | 23 - .../enterprise/MegaPoorHenHouse.java | 40 - .../enterprise/MegaPoorHenHouseLocal.java | 25 - .../injection/enterprise/PoorHenHouse.java | 31 - .../SessionBeanInjectionOrderingTest.java | 56 - .../enterprise/SessionBeanInjectionTest.java | 84 - .../lookup/injection/enterprise/Sheep.java | 21 - .../enterprise/SuperInjectedSessionBean.java | 25 - .../injection/enterprise/chain/Bar.java | 34 - .../injection/enterprise/chain/Baz.java | 42 - .../injection/enterprise/chain/Foo.java | 34 - .../injection/enterprise/chain/Qux.java | 36 - .../chain/SessionBeanInjectionChainTest.java | 62 - .../non/contextual/ContainerEventTest.java | 196 - ...CreationalContextForNonContextualTest.java | 40 - .../lookup/injection/non/contextual/Farm.java | 39 - ...jectionIntoNonContextualComponentTest.java | 184 - .../ProcessAnnotatedTypeObserver.java | 97 - .../injection/non/contextual/SessionBean.java | 24 - .../injection/non/contextual/Sheep.java | 21 - .../non/contextual/TagLibraryListener.java | 37 - .../injection/non/contextual/TestFilter.java | 115 - .../non/contextual/TestListener.java | 37 - .../injection/non/contextual/TestServlet.java | 157 - .../non/contextual/TestTagHandler.java | 47 - ...jectionIntoNonContextualComponentTest.java | 46 - .../contextual/broken/ambiguous/Animal.java | 19 - .../non/contextual/broken/ambiguous/Cow.java | 19 - .../broken/ambiguous/TestServlet.java | 28 - .../broken/unsatisfied/TestServlet.java | 31 - ...jectionIntoNonContextualComponentTest.java | 46 - .../PersistenceResourceInjectionTest.java | 48 - .../injection/persistence/Persistor.java | 44 - .../persistence/SpecialPersistor.java | 55 - .../broken/not/bean/InjectionPointTest.java | 44 - .../broken/not/bean/TestServlet_Broken.java | 26 - .../injectionpoint/non/contextual/Bar.java | 33 - .../injectionpoint/non/contextual/Baz.java | 33 - .../injectionpoint/non/contextual/Foo.java | 35 - .../NonContextualInjectionPointTest.java | 67 - .../manager/jndi/JndiBeanManagerInjected.java | 34 - .../lookup/manager/jndi/ManagerTest.java | 47 - .../lookup/manager/jndi/ManagerTestEar.java | 48 - .../AfterDeploymentValidationObserver.java | 35 - .../lookup/manager/provider/init/Alpha.java | 21 - .../lookup/manager/provider/init/Bar.java | 18 - .../lookup/manager/provider/init/Baz.java | 18 - .../lookup/manager/provider/init/Bravo.java | 21 - .../provider/init/CDIProviderInitTest.java | 107 - .../lookup/manager/provider/init/Charlie.java | 21 - .../lookup/manager/provider/init/Foo.java | 18 - .../lookup/manager/provider/init/Marker.java | 18 - .../provider/init/MarkerObtainerBda1.java | 26 - .../provider/init/MarkerObtainerBda2.java | 26 - .../provider/init/MarkerObtainerNonBda.java | 31 - .../provider/init/MarkerObtainerWar.java | 26 - ...nBdaAfterDeploymentValidationObserver.java | 35 - .../manager/provider/runtime/Alpha.java | 31 - .../provider/runtime/AlphaLocator.java | 34 - .../manager/provider/runtime/Bravo.java | 37 - .../provider/runtime/BravoLocator.java | 37 - .../manager/provider/runtime/BravoMarker.java | 35 - .../runtime/CDIProviderRuntimeTest.java | 101 - .../manager/provider/runtime/Powerful.java | 33 - .../provider/runtime/PowerfulLiteral.java | 28 - .../lookup/modules/AlternativeEjbFoo.java | 29 - .../tests/lookup/modules/AlternativeFoo.java | 29 - .../cdi/tck/tests/lookup/modules/Bar.java | 22 - .../tck/tests/lookup/modules/CashEjbFoo.java | 32 - .../cdi/tck/tests/lookup/modules/CashFoo.java | 28 - .../cdi/tck/tests/lookup/modules/EjbFoo.java | 26 - .../tck/tests/lookup/modules/EjbFooLocal.java | 21 - ...anagedBeanInjectionAvailability02Test.java | 62 - ...dManagedBeanInjectionAvailabilityTest.java | 69 - ...ducerFieldInjectionAvailability02Test.java | 56 - ...roducerFieldInjectionAvailabilityTest.java | 67 - ...ucerMethodInjectionAvailability02Test.java | 56 - ...oducerMethodInjectionAvailabilityTest.java | 66 - ...essionBeanInjectionAvailability02Test.java | 54 - ...dSessionBeanInjectionAvailabilityTest.java | 67 - .../tck/tests/lookup/modules/Enterprise.java | 34 - .../cdi/tck/tests/lookup/modules/Foo.java | 20 - .../lookup/modules/FooFieldProducer.java | 25 - .../lookup/modules/FooMethodProducer.java | 27 - .../InterModuleELResolution02Test.java | 46 - .../modules/InterModuleELResolutionTest.java | 63 - .../modules/InterModuleLookup02Test.java | 48 - .../lookup/modules/InterModuleLookupTest.java | 62 - .../tck/tests/lookup/modules/ManagedFoo.java | 28 - .../tests/lookup/modules/PaymentEjbFoo.java | 30 - .../tck/tests/lookup/modules/PaymentFoo.java | 26 - .../tck/tests/lookup/modules/ProducedFoo.java | 33 - ...anagedBeanInjectionAvailability02Test.java | 54 - ...eManagedBeanInjectionAvailabilityTest.java | 72 - ...essionBeanInjectionAvailability02Test.java | 56 - ...eSessionBeanInjectionAvailabilityTest.java | 73 - ...alizedBeanInjectionNotAvailable02Test.java | 76 - ...cializedBeanInjectionNotAvailableTest.java | 88 - ...ucerMethodInjectionNotAvailable02Test.java | 58 - ...oducerMethodInjectionNotAvailableTest.java | 72 - .../SpecializingFooMethodProducer.java | 30 - .../tck/tests/lookup/modules/Standard.java | 34 - .../cdi/tck/tests/lookup/modules/WebBar.java | 34 - .../lookup/modules/WebFooELResolver.java | 39 - .../tests/lookup/modules/WebFooLookup.java | 30 - .../tests/lookup/modules/WebPaymentBar.java | 35 - .../lookup/modules/WebPaymentEjbBar.java | 35 - .../lookup/modules/broken/BrokenBar.java | 20 - .../lookup/modules/broken/BrokenFoo.java | 20 - .../modules/broken/BrokenProducedFoo.java | 26 - .../lookup/modules/broken/BrokenWebBar.java | 29 - .../lookup/modules/broken/DisabledEjbFoo.java | 28 - .../broken/DisabledFooFieldProducer.java | 27 - .../broken/DisabledFooMethodProducer.java | 29 - ...roducerFieldInjectionNotAvailableTest.java | 60 - ...oducerMethodInjectionNotAvailableTest.java | 60 - ...dSessionBeanInjectionNotAvailableTest.java | 63 - .../lookup/modules/broken/EjbFooLocal.java | 21 - .../lookup/modules/interceptors/Animal.java | 18 - .../lookup/modules/interceptors/Bar.java | 26 - .../modules/interceptors/BarBinding.java | 32 - .../modules/interceptors/BarInterceptor.java | 44 - .../interceptors/BarSuperInterceptor.java | 29 - .../lookup/modules/interceptors/Cat.java | 24 - .../lookup/modules/interceptors/Checker.java | 54 - .../lookup/modules/interceptors/Cow.java | 26 - .../lookup/modules/interceptors/Dog.java | 27 - .../InterceptorModularityTest.java | 100 - .../lookup/modules/specialization/Alpha.java | 22 - .../lookup/modules/specialization/Bravo.java | 22 - .../modules/specialization/Charlie.java | 22 - .../modules/specialization/Connector.java | 30 - .../modules/specialization/Handler.java | 26 - .../specialization/LowercaseHandler.java | 28 - .../SpecializationModularity01Test.java | 78 - .../SpecializationModularity02Test.java | 77 - .../SpecializationModularity03Test.java | 74 - .../SpecializationModularity04Test.java | 83 - .../SpecializationModularity05Test.java | 75 - .../SpecializationModularity06Test.java | 79 - .../SpecializationModularity07Test.java | 77 - .../specialization/UppercaseHandler.java | 28 - .../AlternativeSpecializedFactory.java | 25 - .../specialization/alternative/Factory.java | 43 - .../alternative/FactoryEvent.java | 18 - .../alternative/InjectedBean1.java | 37 - .../alternative/InjectedBean2.java | 37 - .../specialization/alternative/Product.java | 20 - .../alternative/Specialization01Test.java | 89 - .../alternative/Specialization02Test.java | 93 - .../alternative/Specialization03Test.java | 92 - .../alternative/Specialization04Test.java | 89 - .../alternative/Specialization05Test.java | 89 - .../alternative/Specialization06Test.java | 81 - .../interceptor/ejb/Capercaillie.java | 23 - .../interceptor/ejb/CapercaillieLocal.java | 21 - .../ejb/EnterpriseResolutionByTypeTest.java | 50 - .../interceptor/ejb/ScottishBirdLocal.java | 23 - .../tck/tests/vetoed/enterprise/Elephant.java | 23 - .../vetoed/enterprise/ElephantLocal.java | 23 - .../enterprise/EnterpriseVetoedTest.java | 81 - .../tck/tests/vetoed/enterprise/Gecko.java | 26 - .../vetoed/enterprise/ModifyingExtension.java | 41 - .../vetoed/enterprise/VerifyingExtension.java | 35 - .../vetoed/enterprise/aquarium/Piranha.java | 21 - .../enterprise/aquarium/package-info.java | 19 - .../resources/META-INF/test-unit.properties | 23 - .../tests/alternative/enterprise/beans.xml | 8 - .../tests/context/application/SimplePage.html | 11 - .../cdi/tck/tests/context/application/web.xml | 51 - .../tests/context/conversation/builtin.xhtml | 21 - .../tests/context/conversation/cloud.xhtml | 18 - .../tests/context/conversation/clouds.xhtml | 15 - .../tests/context/conversation/cumulus.xhtml | 54 - .../tests/context/conversation/error.xhtml | 15 - .../context/conversation/faces-config.xml | 12 - .../tck/tests/context/conversation/home.xhtml | 14 - .../context/conversation/lightening.xhtml | 16 - .../tck/tests/context/conversation/rain.xhtml | 19 - .../context/conversation/servlet/message.html | 15 - .../context/conversation/storm-ajax.xhtml | 26 - .../tests/context/conversation/storm.xhtml | 19 - .../tests/context/conversation/thunder.xhtml | 17 - .../tck/tests/context/conversation/web.xml | 47 - .../cdi/tck/tests/context/dependent/beans.xml | 10 - .../beans.xml | 7 - .../beans.xml | 7 - .../beans.xml | 7 - .../beans.xml | 7 - .../beans.xml | 7 - .../beans.xml | 7 - .../beans.xml | 7 - .../enterprise/invalid/ejb-jar.xml | 17 - .../passivating/enterprise/valid/ejb-jar.xml | 17 - .../tck/tests/context/request/SimplePage.html | 11 - .../cdi/tck/tests/context/request/web.xml | 42 - .../tck/tests/context/session/SimplePage.html | 11 - .../cdi/tck/tests/decorators/custom/beans.xml | 7 - .../inject/delegateConstructor/beans.xml | 7 - .../definition/inject/delegateField/beans.xml | 7 - .../delegateInitializerMethod/beans.xml | 7 - .../decorators/invocation/observer/beans.xml | 7 - .../invocation/producer/method/beans.xml | 7 - .../tck/tests/decorators/resolution/beans.xml | 17 - .../tck/tests/definition/stereotype/beans.xml | 3 - .../stereotype/inheritance/beans.xml | 5 - .../jboss/cdi/tck/tests/deployment/beans.xml | 3 - .../tck/tests/deployment/trimmed/beans.xml | 6 - .../deployment/trimmed/enteprise/beans.xml | 6 - .../observer/registerUsingEvent/beans.xml | 3 - .../extensions/container/event/ejb-jar.xml | 17 - .../processInjectionPoint/ee/faces-config.xml | 7 - .../processInjectionTarget/TestLibrary.tld | 16 - .../processInjectionTarget/faces-config.xml | 13 - .../processInjectionTarget/index.jsp | 9 - .../interceptorNotListedInBeansXml/beans.xml | 7 - .../enterprise/definition/ejb-jar.xml | 20 - .../producer/method/lifecycle/beans.xml | 3 - .../implementation/simple/lifecycle/beans.xml | 3 - .../simple/resource/env/beans.xml | 3 - .../simple/resource/env/web.xml | 29 - .../resource/persistenceContext/beans.xml | 3 - .../persistenceContext/persistence.xml | 9 - .../simple/resource/resource/beans.xml | 2 - .../tests/inheritance/realization/beans.xml | 3 - .../simple/broken/names/beans.xml | 3 - .../simple/broken/noextend1/beans.xml | 3 - .../simple/broken/noextend2/beans.xml | 3 - .../simple/broken/noextend3/beans.xml | 3 - .../simple/broken/two/beans.xml | 3 - .../interceptors/definition/custom/beans.xml | 7 - .../enterprise/interceptorOrder/beans.xml | 7 - .../nonContextualReference/beans.xml | 8 - .../beans.xml | 7 - .../lookup/clientProxy/incontainer/web.xml | 20 - .../lookup/el/integration/JSFTestPage.xhtml | 11 - .../lookup/el/integration/JSPTestPage.jsp | 8 - .../lookup/el/integration/faces-config.xml | 5 - .../tck/tests/lookup/el/integration/web.xml | 17 - .../non/contextual/ManagedBeanTestPage.xhtml | 12 - .../injection/non/contextual/TagPage.jsp | 4 - .../injection/non/contextual/TestLibrary.tld | 17 - .../non/contextual/Translator_schema1.xsd | 19 - .../lookup/injection/non/contextual/web.xml | 40 - .../lookup/injection/non/contextual/web2.xml | 53 - .../injectionpoint/broken/not/bean/web.xml | 19 - .../typesafe/resolution/decorator/beans.xml | 7 - .../tck/tests/se/discovery/trimmed/beans.xml | 6 - web/src/main/resources/tck-audit-cdi.xml | 12181 ---------------- web/src/main/resources/tck-audit-int.xml | 1088 -- web/src/main/resources/tck-audit-mb.xml | 235 - web/src/main/resources/tck-tests.xml | 51 - .../cdi/tck/test/ExclusionListsTest.java | 67 - .../cdi/tck/test/porting/DummyBeans.java | 37 - .../cdi/tck/test/porting/DummyContexts.java | 47 - .../tck/test/porting/DummyContextuals.java | 25 - .../test/porting/DummyCreationalContexts.java | 25 - .../jboss/cdi/tck/test/porting/DummyEL.java | 40 - .../ejb/EjbJarDescriptorBuilderTest.java | 105 - .../shrinkwrap/descriptors/ejb/Input.java | 113 - .../resources/META-INF/cdi-tck.properties | 9 - web/src/test/resources/xsd/ejb-jar_3_1.xsd | 3247 ---- web/src/test/resources/xsd/javaee_6.xsd | 2422 --- .../xsd/javaee_web_services_client_1_3.xsd | 737 - web/src/test/resources/xsd/xml.xsd | 287 - 1595 files changed, 31 insertions(+), 89771 deletions(-) delete mode 100644 dist-build/libs/pom.xml delete mode 100644 dist-build/libs/readme.txt delete mode 100644 dist-build/libs/src/main/assembly/assembly.xml delete mode 100644 dist-build/porting-package/pom.xml delete mode 100644 dist-build/porting-package/readme.txt delete mode 100644 dist-build/porting-package/src/main/assembly/assembly.xml delete mode 100644 web/pom.xml delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AbstractInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AlphaBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AlphaInterceptor1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AlphaInterceptor2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanOverridingTypeLevelBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanWithConstructorLevelAndTypeLevelBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanWithConstructorLevelBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanWithTypeLevelBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BravoBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BravoInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/SessionBeanConstructorInterceptionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BallBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BallBindingLiteral.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BasketBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BasketBindingLiteral.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/ComplicatedInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/ComplicatedLifecycleInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/EnterpriseInterceptorBindingResolutionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/LoggedBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/LoggedService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/MessageBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/MessageService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/MonitorService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/PingBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/PongBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/RemoteMessageService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/RemoteService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/Service.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/ServiceStereotype.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/TransactionalBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Binding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Interceptor1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Interceptor2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/MiddleFoo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/MiddleInterceptor1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SessionBeanAroundInvokeInterceptorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SuperFoo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SuperInterceptor1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SuperInterceptor2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/AroundInvokeAccessInterceptorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Baz.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/BazInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/FooInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Printer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/PrinterSecurityInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Student.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Toner.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/Alarm.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/AlarmSecurityInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/AroundTimeoutInterceptorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/Bell.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/Student.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/TestData.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/TimeoutInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/TimingBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/AroundTimeoutOrderInterceptorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/Binding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/Interceptor1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/Interceptor2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/MiddleInterceptor1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/MiddleTimingBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/SuperInterceptor1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/SuperInterceptor2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/SuperTimingBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/TimingBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundInvokeInterceptor1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundInvokeInterceptor2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundInvokeThreadInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundTimeoutThreadInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/InterceptorEnvironmentTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/TestEndObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Animal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/BarServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Cat.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Dog.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/FooServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/InterceptorEnvironmentJNDITest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/MyBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/MyInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Animal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/BarServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Cat.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Dog.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/FooServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/InterceptorEnvironmentJNDISessionBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/MyBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/MyInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Airborne.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/AirborneInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/DestructionInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Destructive.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Missile.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Rocket.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/SessionBeanLifecycleInterceptorDefinitionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/SuperDestructionInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Weapon.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/Animal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/AnimalInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/Cat.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/CatInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/LifecycleCallbackInterceptorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/jaxrs/JaxRsActivator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/selenium/ChromeDevtoolsDriver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/selenium/DriverPool.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/selenium/ExtendedWebDriver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/selenium/WebPage.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/shrinkwrap/ee/DummySessionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/shrinkwrap/ee/EnterpriseArchiveBuilder.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/shrinkwrap/ee/WebArchiveBuilder.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/DisabledEjbInterface.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/EjbInterface.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/EnabledEjb.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/NotEnabledEjb.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/SessionBeanAlternativeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/DatabaseProduction.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/DatabaseTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/EnabledResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/NotEnabledResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/ResourceAlternativeAvailabilityTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseSelectedAlternative01Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseSelectedAlternative02Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseSelectedAlternative03Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/PojoService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/SelectedAlternativeTestUtil.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/Service.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/BravoResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/CharlieResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/DeltaResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ProductionReady.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceAlternative01Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceAlternative04Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceAlternativeExplicitPriorityTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/activation/ActivateRequestContextinEETest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/activation/TestServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/ApplicationContextTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/ApplicationResource.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/IntrospectApplication.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/Result.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/SimpleApplicationBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestFilter.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestHttpSessionListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestServletContextListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestServletRequestListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/ApplicationContextAsyncListenerTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/AsyncRequestProcessor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/AsyncServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/FailingServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/SimpleApplicationBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/SimpleAsyncListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/StatusBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/StatusServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/ApplicationContextDestructionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/BarInfoServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/FooInitServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/ApplicationContextDisposerTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Edible.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Forest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Mushroom.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Mushroomer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/ApplicationContextSharedTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/BarBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FMS.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FMSModelIII.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FooBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FooRemote.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/SimpleApplicationBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/ApplicationScopeEventMultiWarTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/ApplicationScopeEventTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Collector.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Helper.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Observer1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Observer2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Observer3.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/ObserverNames.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/PingServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/Action.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/EagerSingleton.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/EagerSingletonPostConstructCallbackTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/Service.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/SimpleBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/SimpleBeanPostConstructCallbackTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/predestroy/ApplicationContextPreDestroyTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/predestroy/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/application/predestroy/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/AbstractConversationTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/BuiltInConversation.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ClientConversationContextTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/Cloud.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/CloudController.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ConversationContextObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ConversationStatusServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ConversationTestPhaseListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/Cumulus.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/InvalidatingSessionDestroysConversationTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/LongRunningConversationPropagatedByFacesContextTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ManualCidPropagationTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/OutermostFilter.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/Storm.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/AsyncFooServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/AsyncRequestProcessor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/BarFilter.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/BazRequestListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/ConversationDeterminationTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/Duck.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/FailingServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/FooServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/QuxAsyncListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/StatusBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/StatusServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/TestResult.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/ApplicationScopedObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/ConversationScopedBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/ConversationScopedObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/LongRunningConversationLifecycleEventTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/Servlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/TransientConversationLifecycleEventTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/ConversationScopedBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/DestroyConversationNotAssociatedWithCurrentRequestEventTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/ObservingBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/TestServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/ConversationFilterTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/Dummy.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/IntrospectServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/OuterFilter.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/State.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/Tester.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/inactive/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/inactive/FooBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/inactive/InactiveConversationTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/servlet/Message.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/servlet/Servlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/servlet/ServletConversationTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/DependentContextEjbTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Farm.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FarmLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Fox.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FoxLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FoxRun.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FoxRunLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Horse.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/House.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/HouseLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Room.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/RoomLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Stable.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Table.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/TableLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/jms/AbstractMessageListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/jms/LogStore.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/jms/LoggerService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/jms/MessageDrivenBeanContextTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/jms/QueueMessageDrivenBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/jms/SimpleMessageProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/jms/TopicMessageDrivenBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/EnterpriseBeanWithNonPassivatingDecoratorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/MaarianHaminaLocal_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/MaarianhaminaDecorator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/Maarianhamina_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/BrokenDecorator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/District.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/EnterpriseBeanWithNonPassivatingInjectedFieldInDecoratorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/EspooLocal_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/Espoo_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/Cup_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/NonPassivationCapableEjbWithPassivatingScopeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/District.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/EspooLocal_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/Espoo_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/Digital.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/DigitalInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/EnterpriseBeanWithNonPassivatingInterceptorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/Telephone.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/BrokenInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/District.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/EnterpriseBeanWithNonPassivatingInjectedFieldInInterceptorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/EspooLocal_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/Espoo_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/British.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/ConstructorInjectionCorralBroken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/Corral.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/Cow.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/CowProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/EnterpriseBeanWithIllegalDependencyTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/FieldInjectionCorralBroken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/SetterInjectionCorralBroken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/British.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/ConstructorInjectionCorralBroken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/Cow.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/CowProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/EnterpriseBeanWithIllegalDependencyTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/FieldInjectionCorralBroken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/Herd.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/ProducerMethodParamInjectionCorralBroken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/Ranch.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/SetterInjectionCorralBroken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/Another.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/DataSourcePassivationDependencyTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/DataSourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/Pool.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/Profile.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/ResourcePassivationDependencyTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/ResourcePassivationDependencyTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/Worker.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/ejb/FooBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/ejb/FooRemote.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Chef.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Hammer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/SessionBeanPassivationDependencyTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Spoon.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Worker.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/Digital.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/DigitalInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/NonPassivationCapableSessionBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/Telephone.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/TelephoneLine.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/Digital.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/DigitalInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/Elephant.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/ElephantLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/StatefulSessionBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/StatefulSessionBeanXmlDescriptorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/Telephone.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/TelephoneLine.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/Digital.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/DigitalInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/Elephant.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/ElephantLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/StatefulSessionBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/StatefulSessionBeanXmlDescriptorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/Telephone.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/TelephoneLine.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/ContextDestructionObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/IntrospectFilter.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/IntrospectServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/RequestContextTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/SimpleRequestBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/TestFilter.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/TestServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/TestServletRequestListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/AsyncRequestProcessor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/AsyncServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/FailingServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/RequestContextAsyncListenerTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/SimpleAsyncListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/SimpleRequestBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/StatusBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/StatusServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/BarBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/EJBRequestContextTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FMS.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FMSModelIII.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FooBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FooRemote.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FooRequestBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/SimpleRequestBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/ObservingBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/RequestScopeEventTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/Servlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/ApplicationScopedObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/AsyncService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/InfoServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/RequestScopeEventAsyncTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/RequestScopedObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/AbstractMessageListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/ApplicationScopedObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/RequestScopeEventMessageDeliveryTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/RequestScopedObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/SimpleMessageProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/TopicMessageDrivenBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/ApplicationScopedObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/FooBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/FooRemote.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/RequestScopeEventRemoteTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/RequestScopedObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/ApplicationScopedObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/InfoServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/RequestScopeEventTimeoutTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/RequestScopedObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/TimeoutService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/FooResource.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/InfoServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/ObservingBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/RequestContextTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/Action.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/EagerSingleton.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/EagerSingletonInfoServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/EagerSingletonPostConstructCallbackTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/RequestContextObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/SimpleBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/SimpleBeanPostConstructCallbackTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/SimpleInfoServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectFilter.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectHttpSessionListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectServletRequestListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/SessionContextTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/SimpleSessionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/TestFilter.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/TestServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/AsyncRequestProcessor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/AsyncServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/FailingServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/SessionContextAsyncListenerTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/SimpleAsyncListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/SimpleSessionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/StatusBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/StatusServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/ObservingBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/Servlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/SessionScopeEventTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/SessionScopedBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/IntrospectServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/SessionContextHttpSessionListenerTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/SessionContextServletRequestListenerTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/SimpleSessionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/TestHttpSessionListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/TestServletRequestListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/InfoServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/InitServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/SessionContextListenerShutdownTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/SessionScopedTestFlagClient.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/TestFlag.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/TestHttpSessionListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/request/BuiltinHttpServletRequestDecoratorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/request/HttpServletRequestDecorator1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/request/HttpServletRequestDecorator2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/servletcontext/BuiltinServletContextDecoratorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/servletcontext/ServletContextDecorator1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/servletcontext/ServletContextDecorator2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/BuiltinHttpSessionDecoratorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/HttpSessionDecorator1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/HttpSessionDecorator2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/HttpSessionObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/SessionListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/principal/BuiltinPrincipalDecoratorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/principal/PrincipalDecorator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/principal/PrincipalInjector.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/transaction/BuiltinUserTransactionDecoratorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/transaction/SessionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/transaction/UserTransactionDecorator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/BankAccount.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/BankServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/ChargeDecorator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/DecoratorInstanceIsDependentObjectTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/DurableAccount.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/ShortTermAccount.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/EJBDecoratorInvocationTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/Pig.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/PigSty.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/PigStyDecorator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/PigStyImpl.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/BarBusiness.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/BarBusinessDecorator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/Business.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/BusinessBase.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/EnterpriseDecoratorInvocationTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBusiness.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBusinessDecorator1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBusinessDecorator2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/AbstractDecorator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/Decorated.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/DecoratedImpl.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/DummyDao.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/EnterpriseDecoratorOrderingTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GlobalDecoratorOrderingTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator3.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator4.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator5.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/LegacyDecorator1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/LegacyDecorator2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/LegacyDecorator3.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/WebApplicationGlobalDecorator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/broken/restricted/ejb/RestrictedSessionBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/broken/restricted/ejb/RockBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Animal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Bird.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Cobra.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Creature.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/CreatureLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LegendaryCreature.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LegendaryLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LoginAction.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LoginActionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Mammal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Mock.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/MockLoginActionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Reptile.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/SessionBeanTypesTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Snake.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Tiger.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Vulture.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Animal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/AnimalHolder.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/BeanTypesWithIllegalTypeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Bird.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Eagle.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Produced.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/BorderCollie.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/BorderCollieLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/EnglishBorderCollie.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/EnglishBorderCollieLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/EnterpriseQualifierDefinitionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/FamousCat.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/FamousCatLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/Hairless.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/HairlessCat.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/HairlessQualifier.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/Hairy.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/HairyQualifier.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/LongHairedDog.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/Skinny.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/SkinnyHairlessCat.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/SkinnyHairlessCatLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/SkinnyQualifier.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/TameSkinnyHairlessCat.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/TameSkinnyHairlessCatLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/SessionBeanTooManyScopesTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/SessionBeanWithTooManyScopeTypes_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/field/SessionBeanProducerFieldTooManyScopesTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/field/SessionBeanProducerFieldWithTooManyScopeTypes_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/field/Word.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/method/SessionBeanProducerMethodTooManyScopesTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/method/SessionBeanProducerMethodWithTooManyScopeTypes_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/method/Word.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BengalTiger.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BengalTigerLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BorderCollie.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BorderCollieLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Cat.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Dog.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/EnglishBorderCollie.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/EnglishBorderCollieLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/EnterpriseScopeDefinitionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/FooScoped.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Siamese.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/SiameseLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Tiger.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/AbstractService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/EnterpriseStereotypeAlternativeSpecializeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/EnterpriseStereotypeAlternativeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/Mock.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/MockService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/RealService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/Service.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/SimpleAlternativeService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Animal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/AnimalStereotype.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Barracuda.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/BarracudaLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/BorderCollie.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/BorderCollieLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Chihuahua.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/ChihuahuaLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/EnglishBorderCollie.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/EnglishBorderCollieLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Fish.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/FishStereotype.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/LongHairedDog.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/MexicanChihuahua.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/MexicanChihuahuaLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/ShortHairedDog.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/TameBarracuda.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/TameBarracudaLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/AlphaBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/AlphaInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/AlphaStereotype.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/EnterpriseStereotypeInterceptorBindingTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Alpha.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/AlphaLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Bravo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/BravoLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Charlie.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/CharlieLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Delta.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/DeltaLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Echo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/EchoLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/EnterpriseBeanDiscoveryTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Foxtrot.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/FoxtrotLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/LegacyBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/LegacyExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Ping.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/VerifyingExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/Apple.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/AppleTree.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/AppleTreeLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/EnterpriseDefaultBeanDiscoveryModeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/TestExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/DefaultBeanDiscoveryModeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/DummyBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/NotDiscoveredBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/ProducedBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/TestExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Baz.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/LibraryInEarTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/LibraryInWarTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/LibraryMissingBeansXmlTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Unlucky.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/BarBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/BarExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/BarWebBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/FooBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/FooExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/FooWebBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/MultiWebModuleWithExtensionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/SingleWebModuleWithExtensionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/AlternativeBar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BarInspector.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Baz.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Business.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BusinessOperationEvent.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BusinessOperationEventInspector.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BusinessOperationObservedEvent.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/ContainerEventsObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/EnterpriseArchiveModulesTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/LegacyService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/LegacyServiceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/LoggingDecorator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/NonEnterprise.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Qux.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Secured.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/SecurityInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Util.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/EJBJarDeploymentTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/FooBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/FooRemote.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/ProcessBeanObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/Alpha.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/AssertBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/Bravo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/Charlie.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/InstalledLibraryEarTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/InstalledLibraryWarTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/rar/ResourceAdapterArchiveTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/rar/TestResourceAdapter.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/rar/Translator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/American.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/AnnotatedTypeObserverExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Beer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/BeerCollector.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/CraftBeer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/JarToJarAlphaVisibilityTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/JarToJarReverseAlphaVisibilityTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Soda.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/VisibilityOfAnnotatedTypesFromExtensionInAlphaBeanArchiveTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/VisibilityOfAnnotatedTypesFromExtensionInBravoBeanArchiveTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/VisibilityOfBeanInWebModuleFromBeanManagerInBeanLibraryTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/BeansDescriptorAlternativeLocationTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/AlternativeBar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/BarInspector.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Baz.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Bazinga.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Business.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/BusinessOperationEvent.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/ContainerEventsObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/LegacyService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/LegacyServiceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/LoggingDecorator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Qux.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Secured.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/SecurityInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/WebArchiveModulesTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/ApplicationShutdownLifecycleTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Baz.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/ContextDestructionObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/InfoClient.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/InfoServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/InitServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/LifecycleMonitoringExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Qux.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/Bike.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/Car.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/EnterpriseTrimmedBeanArchiveTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/MotorizedVehicle.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/TestExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/notBusinessMethod/EJBObserverMethodNotBusinessMethodTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/notBusinessMethod/Terrier.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/EJBAsyncObserverMethodRemoteBusinessMethodTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/EJBObserverMethodRemoteBusinessMethodTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/FoxTerrrier.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/Terrier.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/TibetanTerrier.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/FooObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/ObserverMethodInvocationContextTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Printer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Student.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Toner.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/AsyncMessageObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/AsyncObserverMethodInvocationContextTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/Counter.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/Message.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/EnterpriseSecurityContextPropagationInAsyncObserverTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Printer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Student.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Teacher.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Text.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/FooObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/ObserverLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Printer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/SessionBeanObserverMethodInvocationContextTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Student.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Toner.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/FooObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Printer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/SessionBeanStaticObserverMethodInvocationContextTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Student.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Toner.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/Egg.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/EnterpriseObserverInheritanceTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/EventPayload.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/Farmer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/FarmerLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/IndirectStockWatcher.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/IndirectStockWatcherLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/IntermediateStockWatcher.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/LazyFarmer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/LazyFarmerLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/StockPrice.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/StockWatcher.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/StockWatcherLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/contextLifecycleEvent/ee/InfoServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/contextLifecycleEvent/ee/RequestContextLifecycleEventObserverOrderingTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/contextLifecycleEvent/ee/RequestContextLifecycleObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/AbstractObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/OnlineAccountService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/PhisherAccountTransactionObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/ReceiverAccountTransactionObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/SenderAccountTransactionObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/TransactionalPriorityObserverTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/TxFailure.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/TxWithdrawal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/EJBEvent.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/LocalInterface.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/NoInterfaceSLSB.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/ResolveEnterpriseEventObserverTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/Spitz.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/AccountService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/AccountTransactionObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/Failure.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/TransactionalObserverTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/Withdrawal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/CustomTransactionalObserverTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/Giraffe.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/GiraffeCustomObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/GiraffeObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/GiraffeService.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/ObserverExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/EjbTestBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/FooTransactionalObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/TransactionalObserverRollbackTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/AlternativeMetadataTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/Pasta.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/PastaWrapper.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/ProcessAnnotatedTypeObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/annotated/delivery/ejb/EnterpriseWithAnnotationsTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/annotated/delivery/ejb/Hawk.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/CreateBeanAttributesTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/Dam.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/Lake.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/LakeLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Cheese.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ContainerEventTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Cow.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/CowLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Farm.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Food.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Milk.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessAnnotatedTypeObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessBeanObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessInjectionTargetObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Sheep.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/SheepInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/SheepLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Tame.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/ContainerEventTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/ProcessInjectionTargetObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/QueueMessageDrivenBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/Sheep.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/FullMarathon.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/Incremented.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/IncrementingInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/InterceptorExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/InterceptorExtensionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/LifecycleInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/Marathon.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/NumberSource.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/Suffixed.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/SuffixingInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/WordSource.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ContainerLifeCycleEventRuntimeInvocationTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/SimpleAnnotation.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/SimpleBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/TestExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/ContainerLifeCycleEventRuntimeInvocationTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/SessionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/SimpleAnnotation.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/SimpleBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/TestExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/builtin/ProcessBeanAttributesNotFiredForBuiltinBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/builtin/ProcessBeanAttributesObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/ejb/Delta.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/ejb/VerifyValuesTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/ejb/VerifyingExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/ProcessInjectionPointFiredTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/TestFilter.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/TestListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/TestServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/VerifyingExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/ContainerEventTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/CustomInjectionTarget.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/Farm.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/Fence.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/FenceInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/ProcessInjectionTargetObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/Sheep.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TagLibraryListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestFilter.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestTagHandler.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/Elephant.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/ElephantLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/ProcessSessionBeanObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/ProcessSessionBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ProducerProcessor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/RemoteProducerTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ServiceBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ServiceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ServiceRemote.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/AnotherBeanClassToRegister.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/AnotherManualBeanRegistrationExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanClassToRegister.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanRegistrationByExtensionInEarLibraryTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanRegistrationByExtensionInNonBeanArchiveTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanRegistrationByExtensionInWarLibraryTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/Beanie.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanieType.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanieTypeLiteral.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/DummyObserverExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/EarExtensionsCheck.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/ManualBeanRegistrationExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/TwoBeansOneClassExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/TwoBeansOneClassTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/VisibilityOfBeanRegisteredByExtensionFromNonBeanLibraryTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/WarDummyObserverExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/BuiltInBeansTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/MockLoginModule.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/PrincipalInjectedBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/PrincipalInjectedBeanLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/UserTransactionInjectedBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/UserTransactionInjectedBeanLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/broken/transaction/ContainerManagedTransactionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/broken/transaction/UserTransactionInvalidInjectionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/BuiltinMetadataEEBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/Counter.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/InterceptorBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/ServletInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/TestServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/BakeryProduct.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/BakeryProductDecorator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/Bread.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/BuiltinMetadataSessionBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/Frozen.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/Yoghurt.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/YoghurtInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/servlet/LowercaseConverter.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/servlet/LowercaseConverterServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/servlet/ServletContainerBuiltinBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/Apple.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/AppleTree.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/AppleTreeLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/DisposalMethodOnSessionBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/FooDisposal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/FooDisposalRemote.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/RemoteBusinessDisposalMethodTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/observes/async/BrokenFoodProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/observes/async/DisposerMethodWithAsyncObservesTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/observes/async/Food.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Chicken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Code.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/CzechChicken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/DisposerMethodInheritanceTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Egg.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Guru.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Programmer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Sumavanka.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/genericStateless/DingoLocal_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/genericStateless/Dingo_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/genericStateless/GenericStatelessSessionBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithConversationScope/Husky_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithConversationScope/SingletonWithConversationScopeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/Greyhound_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/SingletonWithRequestScopeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/IrishTerrier_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/SingletonWithSessionScopeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/BulldogLocal_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/Bulldog_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/Colie.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/DecoratorAnnotatedStatelessSessionBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/Dog.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessInterceptor/DalmatianLocal_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessInterceptor/Dalmatian_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessInterceptor/InterceptorAnnotatedStatelessSessionBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/DachshundLocal_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/Dachshund_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/StatelessWithApplicationScopeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/BoxerLocal_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/Boxer_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/StatelessWithConversationScopeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/BeagleLocal_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/Beagle_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/StatelessWithRequestScopeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/BullmastiffLocal_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/Bullmastiff_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/StatelessWithSessionScopeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Ape.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ApeLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Dog.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/DogLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Elephant.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ElephantLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ExplicitConstructor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ExplicitConstructorSessionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Giraffe.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/GiraffeLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Labrador.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Laika.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Lion.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/LionLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Monkey.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/MonkeyLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/NoParamConstructorSessionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Pitbull.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/PitbullLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Polar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/PolarBear.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/PolarBearLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Retriever.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/SimpleBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Tame.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Collie.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/DogLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/DogRemote.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/DoggieRemote.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Pitbull.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/RemoteInterfaceNotInAPITypesTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/SuperBar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Tame.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/AlteStadt.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessorLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/FrankfurtAmMain.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/GeschichtslosStadt.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Giessen.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/GrossStadt.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/GutenbergMuseum.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Heidelburg.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Important.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/IndirectOrderProcessor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/IntermediateOrderProcessor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Kassel.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/LandgraffenSchloss.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Mainz.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Marburg.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/NeueStadt.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/OrderProcessor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/OrderProcessorLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/RoemerPassage.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Schloss.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/SchoeneStadt.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/UniStadt.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/DependentSessionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/SessionScopedSessionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/SessionScopedSessionInterface.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/StateKeeper.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/initializer/ejb/AndalusianChicken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/initializer/ejb/EjbInitializerMethodTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/initializer/ejb/LocalChicken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/FooLocal_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/Foo_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/NonStaticFieldOfSessionBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/Number.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/Chicken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/ChickenLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/Egg.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/EnterpriseProducerFieldDefinitionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/FooProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/FooProducerLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/ProducerMethodNotBusinessMethodTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/FooProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/FooProducerRemote.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/RemoteBusinessProducerMethodTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChicken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChickenLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Apple.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AppleTree.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AppleTreeLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Chicken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/ChickenLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Egg.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/EnterpriseProducerMethodDefinitionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/GrannySmithAppleTree.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/LightYellow.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/LightYellowPearTree.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/LightYellowPearTreeLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Pear.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/PearTree.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/PearTreeLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/YellowPearTree.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Yummy.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/EnterpriseBeanNotDiscoveredAsManagedBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/EnterpriseBeanObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockEnterpriseBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockServletContextListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockServletRequestListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockUIComponent.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/IntrospectServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/JavaEEComponentsTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/Ping.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/Tame.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/Wild.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/name/Another.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/name/ResourceDefinitionWithNameTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/name/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/Another.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ResourceDefinitionWithDifferentTypeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/Bean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/BeanRemote.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/Lazy.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/ResourceDefinitionWithDifferentTypeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/env/Greeting.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/env/ResourceDefinitionWithDifferentTypeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/env/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/context/Database.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/context/ResourceDefinitionWithDifferentTypeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/context/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/unit/Database.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/unit/ResourceDefinitionWithDifferentTypeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/unit/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/AnotherInterface.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/Bean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/BeanRemote.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/EjbInjectionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/Lazy.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/ManagedBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/Monitor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/Bean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/EjbInjectionStaticProducerFieldTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/Lazy.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/ManagedBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/BooleanResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/EnvInjectionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/Greeting.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/GreetingBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/EnvInjectionStaticProducerFieldTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/Greeting.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/GreetingBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/Database.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ManagedBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ServiceBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ServiceBeanImpl.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/Database.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ManagedBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/PersistenceInjectionStaticProducerFieldTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ServiceBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ServiceBeanImpl.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/Another.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/InjectionOfResourceTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/ManagedBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/Another.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/InjectionOfResourceStaticProducerFieldTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/ManagedBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/ResourceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/AppleEjb.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Cheap.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Citrus.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/CitrusEjb.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Expensive.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/FirstLevel.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Fruit.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/FruitEjb.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/InitializerMethodInheritanceTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Lemon.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Orange.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/OrangeEjb.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/PriceProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/SecondLevel.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Animal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Building.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/BuildingLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/FarmEquipment.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Farmer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/FarmerLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Landowner.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Lazy.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/LazyFarmer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/LazyFarmerLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Office.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/OfficeLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/TractorLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Waste.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Yard.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/YardInterface.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/DirectlyExtendsSimpleBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/FarmEquipment.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/TractorLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/Tractor_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/nothing/CowLocal_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/nothing/Cow_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/nothing/DirectlyExtendsNothingTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/LoginAction.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/LoginActionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/Mock.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/MockLoginActionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/SessionBeanSpecializingSessionBeanWithClientViewTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/FarmYard_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/SameNameTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/Yard.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/YardInterface.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/Farmer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/FarmerInterface.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/FishFarmer_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/Landowner.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/SheepFarmer_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/TwoBeansSpecializeTheSameBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/EnterpriseProducerMethodSpecializationTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Expensive.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/JewelryShop.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Necklace.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Product.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Shop.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Sparkly.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/FarmEquipment.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/FarmEquipmentLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/SpecializingBeanExtendsEnterpriseBeanTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/Tractor_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalClassMethodLevelInterceptorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodClassLevelInterceptorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodClassLevelMissile.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodClassLevelMissileLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodMethodLevelInterceptorTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodMethodLevelMissile.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodMethodLevelMissileLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FooBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/MissileInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/Airborne.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/Missile.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/MissileInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/MissileLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/RadarInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/SessionBeanInterceptorOrderTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/MessageDrivenBeanInterceptorInvocationTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/MessageDrivenMissile.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/Missile.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/MissileInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/SimpleMessageProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Airborne.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Anchor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/AnchorInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Cruiser.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Missile.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/MissileInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/MissileLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/SessionBeanInterceptorOnNonContextualEjbReferenceTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Ship.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Waterborne.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/Airborne.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/Missile.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/MissileInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/MissileLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/Rocket.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/SessionBeanInterceptorDefinitionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Cactus.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Culinary.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/European.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Flower.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/ForgetMeNot.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Grass.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/GuardedBySquirrel.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/GuardedByWoodpecker.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/InterceptorBindingInheritanceTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Opuncia.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Ping.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Plant.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/PongPlant.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Shrub.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/SquirrelInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Tree.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/WaterChestnut.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/WoodForgetMeNot.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/WoodpeckerInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/Airborne.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/AnotherInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/EnterpriseLifecycleInterceptorDefinitionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/Missile.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/MissileInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/Weapon.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ejb/InterceptorInvocationTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ejb/Timing.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/AbstractInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/Dao.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/DummyDao.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/EnterpriseInterceptorOrderingTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GlobalInterceptorOrderingTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor3.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor4.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor5.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/LegacyInterceptor1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/LegacyInterceptor2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/LegacyInterceptor3.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/Service.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/Transactional.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/WebApplicationGlobalInterceptor1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/Car.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/ClientProxyTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/Garage.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/TestServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/ClientProxyTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/Fox.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/Tuna.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/TunedTuna.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Animal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Cat.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Dog.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/MultiModuleSessionBeanAmbiguousDependencyTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/el/integration/IntegrationWithUnifiedELTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/el/integration/Sheep.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/InjectionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/MegaPoorHenHouse.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/PoorHenHouse.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/ejb/DeluxeHenHouse.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/ejb/HenHouse.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/ejb/SessionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/DeluxeHenHouse.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/DeluxeHenHouseLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/Farm.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/FarmInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/FarmLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/Fox.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/HenHouse.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/InjectedSessionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/InjectedSessionBeanLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/MegaPoorHenHouse.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/MegaPoorHenHouseLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/PoorHenHouse.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/SessionBeanInjectionOrderingTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/SessionBeanInjectionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/Sheep.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/SuperInjectedSessionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Baz.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Qux.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/SessionBeanInjectionChainTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/ContainerEventTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/CreationalContextForNonContextualTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/Farm.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/InjectionIntoNonContextualComponentTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/ProcessAnnotatedTypeObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/SessionBean.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/Sheep.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TagLibraryListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestFilter.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestListener.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestTagHandler.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/AmbiguousInjectionIntoNonContextualComponentTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/Animal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/Cow.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/TestServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/unsatisfied/TestServlet.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/unsatisfied/UnsatisfiedInjectionIntoNonContextualComponentTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/persistence/PersistenceResourceInjectionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/persistence/Persistor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/persistence/SpecialPersistor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/broken/not/bean/TestServlet_Broken.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/Baz.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/NonContextualInjectionPointTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/jndi/JndiBeanManagerInjected.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/jndi/ManagerTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/jndi/ManagerTestEar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/AfterDeploymentValidationObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Alpha.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Baz.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Bravo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/CDIProviderInitTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Charlie.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Marker.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerBda1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerBda2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerNonBda.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerWar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/NonBdaAfterDeploymentValidationObserver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/Alpha.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/AlphaLocator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/Bravo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/BravoLocator.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/BravoMarker.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/CDIProviderRuntimeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/Powerful.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/PowerfulLiteral.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/AlternativeEjbFoo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/AlternativeFoo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/CashEjbFoo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/CashFoo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EjbFoo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EjbFooLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledManagedBeanInjectionAvailability02Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledManagedBeanInjectionAvailabilityTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerFieldInjectionAvailability02Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerFieldInjectionAvailabilityTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerMethodInjectionAvailability02Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerMethodInjectionAvailabilityTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledSessionBeanInjectionAvailability02Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledSessionBeanInjectionAvailabilityTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Enterprise.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Foo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/FooFieldProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/FooMethodProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleELResolution02Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleELResolutionTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleLookup02Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleLookupTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/ManagedFoo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/PaymentEjbFoo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/PaymentFoo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/ProducedFoo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeManagedBeanInjectionAvailability02Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeManagedBeanInjectionAvailabilityTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeSessionBeanInjectionAvailability02Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeSessionBeanInjectionAvailabilityTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedBeanInjectionNotAvailable02Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedBeanInjectionNotAvailableTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedProducerMethodInjectionNotAvailable02Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedProducerMethodInjectionNotAvailableTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializingFooMethodProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Standard.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebBar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebFooELResolver.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebFooLookup.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebPaymentBar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebPaymentEjbBar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenBar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenFoo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenProducedFoo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenWebBar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledEjbFoo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledFooFieldProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledFooMethodProducer.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledProducerFieldInjectionNotAvailableTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledProducerMethodInjectionNotAvailableTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledSessionBeanInjectionNotAvailableTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/EjbFooLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Animal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Bar.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/BarBinding.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/BarInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/BarSuperInterceptor.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Cat.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Checker.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Cow.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Dog.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/InterceptorModularityTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Alpha.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Bravo.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Charlie.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Connector.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Handler.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/LowercaseHandler.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity01Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity02Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity03Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity04Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity05Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity06Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity07Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/UppercaseHandler.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/AlternativeSpecializedFactory.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Factory.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/FactoryEvent.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/InjectedBean1.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/InjectedBean2.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Product.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization01Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization02Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization03Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization04Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization05Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization06Test.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/Capercaillie.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/CapercaillieLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/EnterpriseResolutionByTypeTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/ScottishBirdLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/Elephant.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/ElephantLocal.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/EnterpriseVetoedTest.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/Gecko.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/ModifyingExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/VerifyingExtension.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/aquarium/Piranha.java delete mode 100644 web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/aquarium/package-info.java delete mode 100644 web/src/main/resources/META-INF/test-unit.properties delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/alternative/enterprise/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/application/SimplePage.html delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/application/web.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/builtin.xhtml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/cloud.xhtml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/clouds.xhtml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/cumulus.xhtml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/error.xhtml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/faces-config.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/home.xhtml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/lightening.xhtml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/rain.xhtml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/servlet/message.html delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/storm-ajax.xhtml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/storm.xhtml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/thunder.xhtml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/web.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/dependent/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInitializerMethod/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingBeanConstructorParameterInInterceptor/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingConstructorFieldInDecorator/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingInitializerInDecorator/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingInitializerParameterInInterceptor/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/interceptorWithNonPassivatingBeanConstructorParameter/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/ejb-jar.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/ejb-jar.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/request/SimplePage.html delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/request/web.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/context/session/SimplePage.html delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/decorators/custom/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/decorators/definition/inject/delegateConstructor/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/decorators/definition/inject/delegateField/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/decorators/definition/inject/delegateInitializerMethod/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/decorators/invocation/observer/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/decorators/invocation/producer/method/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/decorators/resolution/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/definition/stereotype/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/definition/stereotype/inheritance/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/deployment/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/deployment/trimmed/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/event/observer/registerUsingEvent/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/extensions/container/event/ejb-jar.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/faces-config.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestLibrary.tld delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/faces-config.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/index.jsp delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/full/interceptors/definition/interceptorNotListedInBeansXml/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ejb-jar.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/implementation/producer/method/lifecycle/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/lifecycle/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/env/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/env/web.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/persistence.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/realization/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/names/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/noextend1/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/noextend2/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/noextend3/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/two/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/custom/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/web.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/JSFTestPage.xhtml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/JSPTestPage.jsp delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/faces-config.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/web.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/ManagedBeanTestPage.xhtml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TagPage.jsp delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestLibrary.tld delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/Translator_schema1.xsd delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/web.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/web2.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injectionpoint/broken/not/bean/web.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/decorator/beans.xml delete mode 100644 web/src/main/resources/org/jboss/cdi/tck/tests/se/discovery/trimmed/beans.xml delete mode 100644 web/src/main/resources/tck-audit-cdi.xml delete mode 100644 web/src/main/resources/tck-audit-int.xml delete mode 100644 web/src/main/resources/tck-audit-mb.xml delete mode 100644 web/src/main/resources/tck-tests.xml delete mode 100644 web/src/test/java/org/jboss/cdi/tck/test/ExclusionListsTest.java delete mode 100644 web/src/test/java/org/jboss/cdi/tck/test/porting/DummyBeans.java delete mode 100644 web/src/test/java/org/jboss/cdi/tck/test/porting/DummyContexts.java delete mode 100644 web/src/test/java/org/jboss/cdi/tck/test/porting/DummyContextuals.java delete mode 100644 web/src/test/java/org/jboss/cdi/tck/test/porting/DummyCreationalContexts.java delete mode 100644 web/src/test/java/org/jboss/cdi/tck/test/porting/DummyEL.java delete mode 100644 web/src/test/java/org/jboss/cdi/tck/test/shrinkwrap/descriptors/ejb/EjbJarDescriptorBuilderTest.java delete mode 100644 web/src/test/java/org/jboss/cdi/tck/test/shrinkwrap/descriptors/ejb/Input.java delete mode 100644 web/src/test/resources/META-INF/cdi-tck.properties delete mode 100644 web/src/test/resources/xsd/ejb-jar_3_1.xsd delete mode 100644 web/src/test/resources/xsd/javaee_6.xsd delete mode 100644 web/src/test/resources/xsd/javaee_web_services_client_1_3.xsd delete mode 100644 web/src/test/resources/xsd/xml.xsd diff --git a/dist-build/artifact-install.pom b/dist-build/artifact-install.pom index ec7bd4a268..a17a6673ce 100644 --- a/dist-build/artifact-install.pom +++ b/dist-build/artifact-install.pom @@ -25,7 +25,7 @@ maven-install-plugin - 3.0.0-M1 + 3.1.1 install-tck-parent diff --git a/dist-build/jboss-runner.pom b/dist-build/jboss-runner.pom index 664d392363..fbdb310715 100644 --- a/dist-build/jboss-runner.pom +++ b/dist-build/jboss-runner.pom @@ -20,8 +20,6 @@ http://weld.cdi-spec.org - - 2.50.0 ${project.version} @@ -230,7 +228,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.12.1 -proc:none @@ -324,10 +322,7 @@ - src/test/resources - - - src/test/weld-embedded + src/main/resources @@ -339,6 +334,7 @@ integration,javaee-full,se weld + weld-embedded-arquillian.xml target/dependency/lib @@ -417,6 +413,7 @@ se,arquillian weld-se + weld-se-arquillian.xml target diff --git a/dist-build/libs/pom.xml b/dist-build/libs/pom.xml deleted file mode 100644 index 972b482dbb..0000000000 --- a/dist-build/libs/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ - - 4.0.0 - - jakarta.enterprise - cdi-tck-parent - 4.1.0-SNAPSHOT - ../../pom.xml - - - jakarta.enterprise - cdi-tck-dist-libs - pom - CDI TCK Distribution - Libraries - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - - dist - package - - single - - - - src/main/assembly/assembly.xml - - ${project.build.finalName} - - - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - package - - copy-dependencies - - - jakarta.enterprise - true - true - - - - - - - - - - jakarta.enterprise - cdi-tck-api - ${project.version} - - - jakarta.enterprise - cdi-tck-core-impl - ${project.version} - - - - \ No newline at end of file diff --git a/dist-build/libs/readme.txt b/dist-build/libs/readme.txt deleted file mode 100644 index c2e96c986c..0000000000 --- a/dist-build/libs/readme.txt +++ /dev/null @@ -1,8 +0,0 @@ -CDI TCK - Libraries -=================== - -Run the build to copy all CDI TCK dependencies into /target/dependency dir. - -Specify the version of CDI TCK explicitly. - -> mvn clean package -Dcdi.tck.version=4.0.1 \ No newline at end of file diff --git a/dist-build/libs/src/main/assembly/assembly.xml b/dist-build/libs/src/main/assembly/assembly.xml deleted file mode 100644 index 8533d97e6d..0000000000 --- a/dist-build/libs/src/main/assembly/assembly.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - dist - / - - zip - - - - - false - - **/target/** - - / - - - - \ No newline at end of file diff --git a/dist-build/pom.xml b/dist-build/pom.xml index b10e302a0a..9665ed06f3 100644 --- a/dist-build/pom.xml +++ b/dist-build/pom.xml @@ -12,11 +12,6 @@ pom CDI TCK Distribution - - porting-package - libs - - jakarta.enterprise diff --git a/dist-build/porting-package/pom.xml b/dist-build/porting-package/pom.xml deleted file mode 100644 index 5a1c156e5e..0000000000 --- a/dist-build/porting-package/pom.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - 4.0.0 - - jakarta.enterprise - cdi-tck-parent - 4.1.0-SNAPSHOT - ../../pom.xml - - - cdi-tck-dist-porting-package - pom - CDI TCK Distribution - Weld Porting Package - - - - org.jboss.weld - weld-porting-package-tck - ${weld.version} - true - compile - - - org.jboss.weld - weld-porting-package-tck - ${weld.version} - true - compile - test-jar - sources - - - - - org.jboss.weld - weld-inject-tck-runner - ${weld.version} - true - compile - test-jar - - - org.jboss.weld - weld-inject-tck-runner - ${weld.version} - true - compile - test-jar - test-sources - - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - - dist - package - - single - - - - src/main/assembly/assembly.xml - - ${project.build.finalName} - - - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - org.apache.maven.plugins - maven-dependency-plugin - 3.6.1 - - - copy-jboss-tck-runner - process-resources - - unpack - - - - - org.jboss.weld - weld-jboss-runner-tck - ${weld.version} - dist - zip - true - - - - - - copy-dependencies - package - - copy-dependencies - - - jakarta.enterprise - true - true - - - - - - - - diff --git a/dist-build/porting-package/readme.txt b/dist-build/porting-package/readme.txt deleted file mode 100644 index 124e41bca1..0000000000 --- a/dist-build/porting-package/readme.txt +++ /dev/null @@ -1,9 +0,0 @@ -Weld Porting Package - Libraries -================================ - -Run the build to copy all Weld Porting Package dependencies into /target/dependency dir. - -Specify the version of Weld and CDI TCK explicitly. - -> mvn clean package -Dweld.version=5.0.0.SP1 -Dcdi.tck.version=4.0.1 - diff --git a/dist-build/porting-package/src/main/assembly/assembly.xml b/dist-build/porting-package/src/main/assembly/assembly.xml deleted file mode 100644 index 0e8b9d2233..0000000000 --- a/dist-build/porting-package/src/main/assembly/assembly.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - dist - / - - zip - - - - - ${project.build.directory}/dependency - / - - - false - - **/target/** - - /porting-package-lib - - - diff --git a/dist-build/src/main/assembly/assembly.xml b/dist-build/src/main/assembly/assembly.xml index 0a7f6f9cf8..8a8fd3af5b 100644 --- a/dist-build/src/main/assembly/assembly.xml +++ b/dist-build/src/main/assembly/assembly.xml @@ -26,6 +26,18 @@ pom.xml true + + src/main/resources/weld-embedded-arquillian.xml + weld/jboss-tck-runner/src/main/resources + weld-embedded-arquillian.xml + false + + + src/main/resources/weld-se-arquillian.xml + weld/jboss-tck-runner/src/main/resources + weld-se-arquillian.xml + false + @@ -68,20 +80,6 @@ false true - - - jakarta.enterprise:cdi-tck-dist-porting-package - - false - /weld - false - true - - - jboss-tck-runner/pom.xml - - - jakarta.enterprise:cdi-tck-reference-guide:zip diff --git a/doc/reference/pom.xml b/doc/reference/pom.xml index 7f80f71644..7d90f15c68 100644 --- a/doc/reference/pom.xml +++ b/doc/reference/pom.xml @@ -19,6 +19,7 @@ 3.0.0 2.3.13 cdi-tck-reference-guide.pdf + 4 4.1 @@ -42,6 +43,7 @@ cdi-tck-reference-guide.asciidoc + ${revmajor} ${revnumber} ${project.build.sourceDirectory} coderay @@ -49,7 +51,7 @@ ${arquillian.version} ${testng.version} ${weld.version} - 33 + 31 7.0.x Jakarta EE 11 diff --git a/doc/reference/src/main/asciidoc/cdi-tck-reference-guide-docinfo.xml b/doc/reference/src/main/asciidoc/cdi-tck-reference-guide-docinfo.xml index 7dac4d6e1c..18023a0878 100644 --- a/doc/reference/src/main/asciidoc/cdi-tck-reference-guide-docinfo.xml +++ b/doc/reference/src/main/asciidoc/cdi-tck-reference-guide-docinfo.xml @@ -55,7 +55,7 @@ vim:et:ts=3:sw=3:tw=120 http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - 2012-2021 Red Hat Inc., and individual contributors listed as authors. + 2012-2024 Red Hat Inc., and individual contributors listed as authors. @@ -64,8 +64,8 @@ vim:et:ts=3:sw=3:tw=120 SMS - 4.0 - 2020-07-30 + 4.1 + 2024-02-26 AS SMS diff --git a/doc/reference/src/main/asciidoc/installation.asciidoc b/doc/reference/src/main/asciidoc/installation.asciidoc index fc3b7e9bef..c5c0e55518 100644 --- a/doc/reference/src/main/asciidoc/installation.asciidoc +++ b/doc/reference/src/main/asciidoc/installation.asciidoc @@ -14,18 +14,16 @@ You can also download the current source code from link:$$https://github.com/ecl Executing the TCK requires a {jakartaee-version} or better runtime environment (i.e., application server), to which the test artifacts are deployed and the individual tests are invoked. The TCK does not depend on any particular Jakarta EE implementation. -A Jakarta Contexts and Dependency Injection for compatible implementation project is named Weld. The release stream for Jakarta CDI {revnumber} is named _{revmajor}.x_. You can obtain the latest release from the link:$$http://weld.cdi-spec.org/download/$$[download page] on the Weld website. +A Jakarta Contexts and Dependency Injection compatible implementation project is named Weld. The release stream for Jakarta CDI {revnumber} TCK is named _{revnumber}.x_. You can obtain the latest release from the link:$$http://weld.cdi-spec.org/download/$$[download page] on the Weld website. [NOTE] ==== -Weld is not required for running the CDI TCK, but it can be used as a reference for familiarizing yourself with the TCK before testing your own CDI implementation. - - +Weld is not required for running the CDI TCK, but it can be used as a reference for familiarizing yourself with the TCK before testing your own CDI implementation. ==== -Naturally, to execute Java programs, you must have a Java SE runtime environment. The TCK requires Java SE 17 or better, which you can obtain from the link:$$http://www.oracle.com/technetwork/java/index.html$$[Java Software] website. +Naturally, to execute Java programs, you must have a Java SE runtime environment. The TCK requires Java SE 17 or better, which you can obtain from the link:$$https://adoptium.net/temurin/releases/$$[Eclipse Temurin] website. === The TCK Environment diff --git a/doc/reference/src/main/asciidoc/introduction.asciidoc b/doc/reference/src/main/asciidoc/introduction.asciidoc index f69c12f1ca..696ae356ad 100644 --- a/doc/reference/src/main/asciidoc/introduction.asciidoc +++ b/doc/reference/src/main/asciidoc/introduction.asciidoc @@ -249,7 +249,7 @@ This section lists the applicable requirements and specifications for the CDI TC * *Testing platform* - The CDI TCK requires version {arquillian-version} of the Arquillian (http://arquillian.org). The TCK test suite is based on TestNG {testng-version}(http://testng.org). . -* *Porting Package* - An implementation of SPIs that are required for the test suite to run the in-container tests and at times extend the CDI 4.0 API to provide extra information to the TCK. +* *Porting Package* - An implementation of SPIs that are required for the test suite to run the in-container tests and at times extend the CDI {revnumber} API to provide extra information to the TCK. * *TCK Audit Tool* - An itemization of the assertions in the specification documents which are cross-referenced by the individual tests. Describes how well the TCK covers the specification. @@ -313,7 +313,7 @@ CDI supports {jakartaee-version}, {jakartaee-version} Web Profile, Embeddable Ja [[libraries]] -=== Libraries for Jakarta Contexts and Dependency Injection Version {revnumber} +=== Packages for Jakarta Contexts and Dependency Injection Version {revnumber} The following is the list of packages that constitute the required class libraries for Jakarta Contexts and Dependency Injection Version {revnumber}: @@ -329,6 +329,7 @@ Jakarta Contexts and Dependency Injection Version {revnumber}: * jakarta.enterprise.inject.se * jakarta.enterprise.inject.spi * jakarta.enterprise.inject.spi.configurator +* jakarta.enterprise.invoke * jakarta.enterprise.lang.model * jakarta.enterprise.lang.model.declarations * jakarta.enterprise.lang.model.types diff --git a/doc/reference/src/main/asciidoc/sigtest.asciidoc b/doc/reference/src/main/asciidoc/sigtest.asciidoc index 1aea31708b..fd786ee77e 100644 --- a/doc/reference/src/main/asciidoc/sigtest.asciidoc +++ b/doc/reference/src/main/asciidoc/sigtest.asciidoc @@ -187,7 +187,7 @@ https://github.com/jakartaee/cdi-tck/blob/master/impl/src/main/resources/sigtest CDI TCK Signature test validation of CDI dependent API jars - 6.0.0.Alpha2 + 6.0.0.Beta1 diff --git a/pom.xml b/pom.xml index 0edec3c446..0cdfa750cf 100644 --- a/pom.xml +++ b/pom.xml @@ -115,11 +115,9 @@ 1.8.0.Final 1.0.2.Final 3.1 - 2.50.0 - 4.7.2 2.9.1 - 6.0.0.Alpha1 + 6.0.0.Beta1 diff --git a/web/pom.xml b/web/pom.xml deleted file mode 100644 index 900c44dbca..0000000000 --- a/web/pom.xml +++ /dev/null @@ -1,545 +0,0 @@ - - - - cdi-tck-parent - jakarta.enterprise - 4.1.0-SNAPSHOT - - 4.0.0 - cdi-tck-web-impl - CDI Web TCK Test Suite - - CDI Web TCK tests - - - 11 - 11 - - - 3.2.0-M1 - 3.1.0 - - 2.0.1 - 2.2.0-M1 - 6.0.0 - - 3.1.0 - - - 3.1.0 - 2.0.1 - - - 4.0.1 - 2.1.0 - - - 3.0.0 - - - - - - jakarta.servlet - jakarta.servlet-api - ${servlet.api.version} - - - - jakarta.servlet.jsp - jakarta.servlet.jsp-api - ${jsp.api.version} - - - - jakarta.transaction - jakarta.transaction-api - ${jta.api.version} - - - - - jakarta.faces - jakarta.faces-api - ${jsf.api.version} - - - - jakarta.persistence - jakarta.persistence-api - ${jpa.api.version} - - - - jakarta.ws.rs - jakarta.ws.rs-api - ${jaxrs.api.version} - - - - jakarta.jms - jakarta.jms-api - ${jms.api.version} - - - - jakarta.resource - jakarta.resource-api - ${jca.api.version} - - - - jakarta.ejb - jakarta.ejb-api - ${ejb.api.version} - - - - jakarta.enterprise - cdi-tck-core-impl - ${project.version} - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - - - - jakarta.enterprise - cdi-tck-api - - - - jakarta.enterprise - cdi-tck-ext-lib - - - - org.jboss.arquillian.testng - arquillian-testng-container - - - - org.jboss.arquillian.container - container-se-api - - - - org.jboss.shrinkwrap.descriptors - shrinkwrap-descriptors-impl-javaee - - - - org.testng - testng - - - - jakarta.interceptor - jakarta.interceptor-api - - - - jakarta.annotation - jakarta.annotation-api - - - - jakarta.inject - jakarta.inject-api - - - - jakarta.el - jakarta.el-api - - - - commons-httpclient - commons-httpclient - - - - org.seleniumhq.selenium - selenium-java - - - - org.seleniumhq.selenium - selenium-chrome-driver - - - - io.github.bonigarcia - webdrivermanager - - - - net.sourceforge.htmlunit - htmlunit - - - - commons-lang - commons-lang - 2.6 - test - - - - org.xmlunit - xmlunit-core - ${xmlunit.version} - test - - - - - install - - - - org.apache.maven.plugins - maven-dependency-plugin - - - - copy - - - - - jakarta.annotation - jakarta.annotation-api - - - ${project.build.directory}/endorsed - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - package - - attach-artifact - - - - - ${basedir}/src/main/resources/tck-tests.xml - xml - suite - - - ${basedir}/src/main/resources/tck-audit-mb.xml - xml - audit-mb - - - ${basedir}/src/main/resources/tck-audit-cdi.xml - xml - audit-cdi - - - ${basedir}/src/main/resources/tck-audit-int.xml - xml - audit-int - - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - org.jboss.cdi.tck.test.porting.DummyBeans - org.jboss.cdi.tck.test.porting.DummyContexts - org.jboss.cdi.tck.test.porting.DummyContextuals - org.jboss.cdi.tck.test.porting.DummyCreationalContexts - org.jboss.cdi.tck.test.porting.DummyEL - - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar-no-fork - - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.codehaus.mojo - exec-maven-plugin - [1.1.1,) - - java - - - - - - - - - - - - - - - - - tck-audit - - - !skipTckAudit - - - - - org.jboss.test-audit - jboss-test-audit-api - ${jboss.test.audit.version} - - - org.jboss.test-audit - jboss-test-audit-impl - ${jboss.test.audit.version} - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - - ${basedir}/../target/ - ${project.build.directory}/endorsed - - - -AauditXml=${basedir}/src/main/resources/tck-audit-cdi.xml,${basedir}/src/main/resources/tck-audit-mb.xml,${basedir}/src/main/resources/tck-audit-int.xml - - - -proc:none - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-report-artifacts - package - - attach-artifact - - - - - ../target/coverage-cdi.html - html - coverage-cdi - - - ../target/coverage-mb.html - html - coverage-mb - - - ../target/coverage-interceptors.html - html - coverage-interceptors - - - - - - add-source - generate-sources - - add-source - - - - target/generated-sources/audit - - - - - - - org.codehaus.mojo - exec-maven-plugin - - - generate-sources - - java - - - org.jboss.test.audit.generate.SectionsClassGenerator - - - ${basedir}/src/main/resources/tck-audit-cdi.xml - - org.jboss.cdi.tck - - ${basedir}/target/generated-sources/audit - - - - - interceptors-sections - generate-sources - - java - - - org.jboss.test.audit.generate.SectionsClassGenerator - - - ${basedir}/src/main/resources/tck-audit-int.xml - - org.jboss.cdi.tck - - ${basedir}/target/generated-sources/audit - InterceptorsSections - - - - - - - - - - - - - - signature-generation - - - signature - - - - - 8 - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack - generate-sources - - unpack - - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - ${cdi.api.version} - jar - false - ${project.build.directory}/cdi-api - **/*.class,**/*.xml - - - **/*.java - **/*.properties - - - - - - jakarta.tck - sigtest-maven-plugin - - - - generate - - - - - ${project.build.directory}/cdi-api - - jakarta.decorator, - jakarta.enterprise.context, - jakarta.enterprise.context.control, - jakarta.enterprise.context.spi, - jakarta.enterprise.event, - jakarta.enterprise.inject, - jakarta.enterprise.inject.literal, - jakarta.enterprise.inject.se, - jakarta.enterprise.inject.spi, - jakarta.enterprise.inject.spi.configurator, - jakarta.enterprise.util - - false - ${project.build.directory}/cdi-api-jdk${jdk.major.version}.sig - - - - - - - - - jdk9+ - - [9,) - - - - com.sun.xml.ws - jaxws-rt - 3.0.0-M3 - - - - - - diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AbstractInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AbstractInterceptor.java deleted file mode 100644 index a88de619b0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AbstractInterceptor.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.aroundConstruct.ejb; - -import java.io.Serializable; - -import jakarta.interceptor.AroundConstruct; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -public abstract class AbstractInterceptor implements Serializable { - - @AroundConstruct - public void intercept(InvocationContext ctx) { - ActionSequence.addAction(getClass().getSimpleName()); - try { - ctx.proceed(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AlphaBinding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AlphaBinding.java deleted file mode 100644 index 7ce0478c91..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AlphaBinding.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.aroundConstruct.ejb; - -import static java.lang.annotation.ElementType.CONSTRUCTOR; -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.interceptor.InterceptorBinding; - -@InterceptorBinding -@Inherited -@Target({ TYPE, METHOD, CONSTRUCTOR }) -@Retention(RUNTIME) -public @interface AlphaBinding { - - int value(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AlphaInterceptor1.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AlphaInterceptor1.java deleted file mode 100644 index e632f96e4c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AlphaInterceptor1.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.aroundConstruct.ejb; - -import jakarta.interceptor.Interceptor; - -@Interceptor -@AlphaBinding(1) -public class AlphaInterceptor1 extends AbstractInterceptor { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AlphaInterceptor2.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AlphaInterceptor2.java deleted file mode 100644 index 2dcaa1c230..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/AlphaInterceptor2.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.aroundConstruct.ejb; - -import jakarta.interceptor.Interceptor; - -@Interceptor -@AlphaBinding(2) -public class AlphaInterceptor2 extends AbstractInterceptor { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanOverridingTypeLevelBinding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanOverridingTypeLevelBinding.java deleted file mode 100644 index 9254160698..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanOverridingTypeLevelBinding.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.aroundConstruct.ejb; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -import org.jboss.cdi.tck.util.ActionSequence; - -@AlphaBinding(1) -@Stateful -public class BeanOverridingTypeLevelBinding { - - // for proxies - public BeanOverridingTypeLevelBinding() { - } - - @Inject - @AlphaBinding(2) - public BeanOverridingTypeLevelBinding(BeanManager manager) { - ActionSequence.addAction(BeanOverridingTypeLevelBinding.class.getSimpleName()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanWithConstructorLevelAndTypeLevelBinding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanWithConstructorLevelAndTypeLevelBinding.java deleted file mode 100644 index e9dd9d4eeb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanWithConstructorLevelAndTypeLevelBinding.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.aroundConstruct.ejb; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -import org.jboss.cdi.tck.util.ActionSequence; - -@AlphaBinding(1) -@Stateful -public class BeanWithConstructorLevelAndTypeLevelBinding { - - // for proxies - public BeanWithConstructorLevelAndTypeLevelBinding() { - } - - @Inject - @BravoBinding - public BeanWithConstructorLevelAndTypeLevelBinding(BeanManager manager) { - ActionSequence.addAction(BeanWithConstructorLevelAndTypeLevelBinding.class.getSimpleName()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanWithConstructorLevelBinding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanWithConstructorLevelBinding.java deleted file mode 100644 index 6ec6643fc9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanWithConstructorLevelBinding.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.aroundConstruct.ejb; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Stateful -public class BeanWithConstructorLevelBinding { - - // for proxies - public BeanWithConstructorLevelBinding() { - } - - @Inject - @AlphaBinding(2) - public BeanWithConstructorLevelBinding(BeanManager manager) { - ActionSequence.addAction(BeanWithConstructorLevelBinding.class.getSimpleName()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanWithTypeLevelBinding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanWithTypeLevelBinding.java deleted file mode 100644 index a798d85ef3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BeanWithTypeLevelBinding.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.aroundConstruct.ejb; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -import org.jboss.cdi.tck.util.ActionSequence; - -@AlphaBinding(1) -@Stateful -public class BeanWithTypeLevelBinding { - - // for proxies - public BeanWithTypeLevelBinding() { - } - - @Inject - public BeanWithTypeLevelBinding(BeanManager manager) { - ActionSequence.addAction(BeanWithTypeLevelBinding.class.getSimpleName()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BravoBinding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BravoBinding.java deleted file mode 100644 index 87bd6bf4a9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BravoBinding.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.aroundConstruct.ejb; - -import static java.lang.annotation.ElementType.CONSTRUCTOR; -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.interceptor.InterceptorBinding; - -@InterceptorBinding -@Inherited -@Target({ TYPE, METHOD, CONSTRUCTOR }) -@Retention(RUNTIME) -public @interface BravoBinding { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BravoInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BravoInterceptor.java deleted file mode 100644 index 908d82f497..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/BravoInterceptor.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.aroundConstruct.ejb; - -import jakarta.interceptor.Interceptor; - -@Interceptor -@BravoBinding -public class BravoInterceptor extends AbstractInterceptor { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/SessionBeanConstructorInterceptionTest.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/SessionBeanConstructorInterceptionTest.java deleted file mode 100644 index 78a02e4cd8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/aroundConstruct/ejb/SessionBeanConstructorInterceptionTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.aroundConstruct.ejb; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.BINDING_INT_TO_COMPONENT; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.INT_BINDING_TYPES; -import static org.jboss.cdi.tck.util.ActionSequence.assertSequenceDataEquals; - -import jakarta.enterprise.inject.Instance; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - *

- * This test was originally part of the Weld test suite. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "interceptors", version = "1.2") -public class SessionBeanConstructorInterceptionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(SessionBeanConstructorInterceptionTest.class) - .withBeansXml( - new BeansXml().interceptors(AlphaInterceptor1.class, AlphaInterceptor2.class, BravoInterceptor.class)) - .build(); - } - - @Test(groups = INTEGRATION, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = INT_BINDING_TYPES, id = "a") - @SpecAssertion(section = INT_BINDING_TYPES, id = "b") - public void testConstructorLevelBinding(Instance instance) { - ActionSequence.reset(); - instance.get(); - assertSequenceDataEquals(AlphaInterceptor2.class, BeanWithConstructorLevelBinding.class); - } - - @Test(groups = INTEGRATION, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = INT_BINDING_TYPES, id = "a") - @SpecAssertion(section = INT_BINDING_TYPES, id = "b") - public void testTypeLevelBinding(Instance instance) { - ActionSequence.reset(); - instance.get(); - assertSequenceDataEquals(AlphaInterceptor1.class, BeanWithTypeLevelBinding.class); - } - - @Test(groups = INTEGRATION, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = BINDING_INT_TO_COMPONENT, id = "c") - public void testTypeLevelAndConstructorLevelBinding(Instance instance) { - ActionSequence.reset(); - instance.get(); - assertSequenceDataEquals(AlphaInterceptor1.class, BravoInterceptor.class, - BeanWithConstructorLevelAndTypeLevelBinding.class); - } - - @Test(groups = INTEGRATION, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = BINDING_INT_TO_COMPONENT, id = "da") - public void testOverridingTypeLevelBinding(Instance instance) { - ActionSequence.reset(); - instance.get(); - assertSequenceDataEquals(AlphaInterceptor2.class, BeanOverridingTypeLevelBinding.class); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BallBinding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BallBinding.java deleted file mode 100644 index 614146f8af..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BallBinding.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.util.Nonbinding; -import jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Inherited -@Documented -@InterceptorBinding -public @interface BallBinding { - - boolean requiresBall() default false; - - @Nonbinding - boolean requiresPlayer() default false; - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BallBindingLiteral.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BallBindingLiteral.java deleted file mode 100644 index fb3f0079ac..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BallBindingLiteral.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -import jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Named; - -/** - * Annotation literal for {@link Named} - */ -@SuppressWarnings("all") -public class BallBindingLiteral extends AnnotationLiteral implements BallBinding { - - public static final BallBinding INSTANCE = new BallBindingLiteral(false, false); - - private boolean requiresBall; - - private boolean requiresPlayer; - - public BallBindingLiteral(boolean requiresBall, boolean requiresPlayer) { - super(); - this.requiresBall = requiresBall; - this.requiresPlayer = requiresPlayer; - } - - @Override - public boolean requiresBall() { - return requiresBall; - } - - @Override - public boolean requiresPlayer() { - return requiresPlayer; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BasketBinding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BasketBinding.java deleted file mode 100644 index 4f8ce7f625..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BasketBinding.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.util.Nonbinding; -import jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE }) -@Retention(RUNTIME) -@Inherited -@Documented -@InterceptorBinding -public @interface BasketBinding { - - boolean requiresBall() default false; - - @Nonbinding - boolean requiresPlayer() default false; - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BasketBindingLiteral.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BasketBindingLiteral.java deleted file mode 100644 index 3277b84e4f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/BasketBindingLiteral.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -import jakarta.enterprise.util.AnnotationLiteral; - -/** - * Annotation literal for {@link BasketBinding} - */ -@SuppressWarnings("all") -public class BasketBindingLiteral extends AnnotationLiteral implements BasketBinding { - - public static final BasketBinding INSTANCE = new BasketBindingLiteral(false, false); - - private boolean requiresBall; - - private boolean requiresPlayer; - - public BasketBindingLiteral(boolean requiresBall, boolean requiresPlayer) { - super(); - this.requiresBall = requiresBall; - this.requiresPlayer = requiresPlayer; - } - - @Override - public boolean requiresBall() { - return requiresBall; - } - - @Override - public boolean requiresPlayer() { - return requiresPlayer; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/ComplicatedInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/ComplicatedInterceptor.java deleted file mode 100644 index 1a5b2cc4c7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/ComplicatedInterceptor.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.AroundTimeout; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@Interceptor -@TransactionalBinding -@LoggedBinding -@MessageBinding -@PingBinding -@PongBinding -@BallBinding(requiresBall = true) -public class ComplicatedInterceptor { - - public static boolean intercepted = false; - - @AroundInvoke - public Object intercept(InvocationContext ctx) throws Exception { - intercepted = true; - return ctx.proceed(); - } - - @AroundTimeout - public Object timeout(InvocationContext ctx) throws Exception { - intercepted = true; - return ctx.proceed(); - } - - public static void reset() { - intercepted = false; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/ComplicatedLifecycleInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/ComplicatedLifecycleInterceptor.java deleted file mode 100644 index 6097edc64c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/ComplicatedLifecycleInterceptor.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@Interceptor -@TransactionalBinding -@LoggedBinding -@MessageBinding -@BasketBinding(requiresBall = true) -public class ComplicatedLifecycleInterceptor { - - public static boolean preDestroyCalled = false; - public static boolean postConstructCalled = false; - - @PreDestroy - public void preDestroy(InvocationContext ctx) { - preDestroyCalled = true; - } - - @PostConstruct - public void postConstruct(InvocationContext ctx) { - postConstructCalled = true; - } - - public static void reset() { - preDestroyCalled = false; - postConstructCalled = false; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/EnterpriseInterceptorBindingResolutionTest.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/EnterpriseInterceptorBindingResolutionTest.java deleted file mode 100644 index 8b60eea6b3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/EnterpriseInterceptorBindingResolutionTest.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.BINDING_INT_TO_COMPONENT; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.INT_RESOLUTION; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.concurrent.TimeUnit; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.InterceptionType; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.Timer; -import org.jboss.cdi.tck.util.Timer.StopCondition; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Interceptor resolution test. - * - * @author Martin Kouba - */ -@Test(groups = JAVAEE_FULL) -@SpecVersion(spec = "interceptors", version = "1.2") -public class EnterpriseInterceptorBindingResolutionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(EnterpriseInterceptorBindingResolutionTest.class) - .withBeansXml(new BeansXml().interceptors(ComplicatedInterceptor.class, ComplicatedLifecycleInterceptor.class)) - .build(); - } - - @SuppressWarnings("serial") - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = BINDING_INT_TO_COMPONENT, id = "e") - @SpecAssertion(section = INT_RESOLUTION, id = "ca") - @SpecAssertion(section = INT_RESOLUTION, id = "da") - @SpecAssertion(section = INT_RESOLUTION, id = "db") - @SpecAssertion(section = INT_RESOLUTION, id = "dc") - public void testBusinessMethodInterceptorBindings(MessageService messageService, MonitorService monitorService) { - - // Test interceptor is resolved (note non-binding member of BallBinding) - assertEquals( - getCurrentManager().resolveInterceptors(InterceptionType.AROUND_INVOKE, - new MessageBinding.Literal(), - new LoggedBinding.Literal(), - new TransactionalBinding.Literal(), - new PingBinding.Literal(), - new PongBinding.Literal(), - new BallBindingLiteral(true, true)).size(), - 1); - - // Test the set of interceptor bindings - assertNotNull(messageService); - ComplicatedInterceptor.reset(); - messageService.ping(); - assertTrue(ComplicatedInterceptor.intercepted); - - assertNotNull(monitorService); - ComplicatedInterceptor.reset(); - monitorService.ping(); - assertFalse(ComplicatedInterceptor.intercepted); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = INT_RESOLUTION, id = "cb") - public void testTimeoutMethodInterceptorBindings(MessageService messageService) throws Exception { - - assertNotNull(messageService); - ComplicatedInterceptor.reset(); - messageService.start(); - // Timeout is async - StopCondition condition = new StopCondition() { - public boolean isSatisfied() { - return ComplicatedInterceptor.intercepted; - } - }; - Timer timer = new Timer().setDelay(3, TimeUnit.SECONDS).addStopCondition(condition).start(); - assertTrue(timer.isStopConditionsSatisfiedBeforeTimeout() || condition.isSatisfied()); - } - - @SuppressWarnings("serial") - @Test - @SpecAssertion(section = INT_RESOLUTION, id = "b") - public void testLifecycleInterceptorBindings() throws Exception { - - // Test interceptor is resolved (note non-binding member of BallBinding) - assertEquals( - getCurrentManager().resolveInterceptors(InterceptionType.POST_CONSTRUCT, - new MessageBinding.Literal(), - new LoggedBinding.Literal(), - new TransactionalBinding.Literal(), - new BasketBindingLiteral(true, true)).size(), - 1); - assertEquals( - getCurrentManager().resolveInterceptors(InterceptionType.PRE_DESTROY, new MessageBinding.Literal(), - new LoggedBinding.Literal(), - new TransactionalBinding.Literal(), - new BasketBindingLiteral(true, true)).size(), - 1); - - // Test the set of interceptor bindings - ComplicatedLifecycleInterceptor.reset(); - - Bean bean = getUniqueBean(RemoteMessageService.class); - CreationalContext ctx = getCurrentManager().createCreationalContext(bean); - RemoteMessageService remoteMessageService = bean.create(ctx); - remoteMessageService.ping(); - bean.destroy(remoteMessageService, ctx); - - assertTrue(ComplicatedLifecycleInterceptor.postConstructCalled); - assertTrue(ComplicatedLifecycleInterceptor.preDestroyCalled); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/LoggedBinding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/LoggedBinding.java deleted file mode 100644 index 7861b6053b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/LoggedBinding.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.util.AnnotationLiteral; -import jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE }) -@Retention(RUNTIME) -@Inherited -@Documented -@InterceptorBinding -public @interface LoggedBinding { - class Literal extends AnnotationLiteral implements LoggedBinding { - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/LoggedService.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/LoggedService.java deleted file mode 100644 index 662fa82418..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/LoggedService.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -import jakarta.ejb.Stateless; - -@LoggedBinding -@Stateless -public class LoggedService extends Service { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/MessageBinding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/MessageBinding.java deleted file mode 100644 index 9192b8b21f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/MessageBinding.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.util.AnnotationLiteral; -import jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE }) -@Retention(RUNTIME) -@Inherited -@Documented -@InterceptorBinding -public @interface MessageBinding { - class Literal extends AnnotationLiteral implements MessageBinding { - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/MessageService.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/MessageService.java deleted file mode 100644 index 87a72fc875..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/MessageService.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -import jakarta.annotation.Resource; -import jakarta.ejb.Stateless; -import jakarta.ejb.Timeout; -import jakarta.ejb.Timer; -import jakarta.ejb.TimerService; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@MessageBinding -@Stateless -public class MessageService extends LoggedService { - - private static final SimpleLogger logger = new SimpleLogger(MessageService.class); - - @Resource - private TimerService timerService; - - @PingBinding - public void ping() { - } - - public void start() { - timerService.createTimer(100, "test"); - logger.log("Timer created"); - } - - @PingBinding - @Timeout - public void onTimeout(Timer timer) { - logger.log("Timeouted"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/MonitorService.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/MonitorService.java deleted file mode 100644 index 188d6de822..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/MonitorService.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -import jakarta.ejb.Stateless; - -@Stateless -public class MonitorService extends LoggedService { - - @PingBinding - public void ping() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/PingBinding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/PingBinding.java deleted file mode 100644 index 6fb538a993..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/PingBinding.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.util.AnnotationLiteral; -import jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@PongBinding -@Inherited -@Documented -@InterceptorBinding -public @interface PingBinding { - class Literal extends AnnotationLiteral implements PingBinding { - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/PongBinding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/PongBinding.java deleted file mode 100644 index 9216d44e88..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/PongBinding.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.util.AnnotationLiteral; -import jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@BallBinding(requiresBall = true, requiresPlayer = true) -@Inherited -@Documented -@InterceptorBinding -public @interface PongBinding { - class Literal extends AnnotationLiteral implements PongBinding { - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/RemoteMessageService.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/RemoteMessageService.java deleted file mode 100644 index 8b5d19500e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/RemoteMessageService.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -import jakarta.ejb.Stateful; - -@MessageBinding -@BasketBinding(requiresBall = true) -@Stateful -public class RemoteMessageService extends RemoteService { - - public void ping() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/RemoteService.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/RemoteService.java deleted file mode 100644 index ffbce75a92..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/RemoteService.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -@LoggedBinding -@ServiceStereotype -public class RemoteService { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/Service.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/Service.java deleted file mode 100644 index a161a29761..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/Service.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -@ServiceStereotype -public class Service { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/ServiceStereotype.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/ServiceStereotype.java deleted file mode 100644 index 07fb473f54..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/ServiceStereotype.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.inject.Stereotype; - -@Stereotype -@TransactionalBinding -@Inherited -@Target({ TYPE, METHOD, FIELD }) -@Retention(RUNTIME) -public @interface ServiceStereotype { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/TransactionalBinding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/TransactionalBinding.java deleted file mode 100644 index 7aeefe2503..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/bindings/resolution/ejb/TransactionalBinding.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.bindings.resolution.ejb; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.util.AnnotationLiteral; -import jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE }) -@Retention(RUNTIME) -@Inherited -@Documented -@InterceptorBinding -public @interface TransactionalBinding { - class Literal extends AnnotationLiteral implements TransactionalBinding { - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Binding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Binding.java deleted file mode 100644 index ee9f20098a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Binding.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.bindings.ejb; - -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 jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Documented -@InterceptorBinding -public @interface Binding { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Foo.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Foo.java deleted file mode 100644 index 0e0d276bfe..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Foo.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.bindings.ejb; - -import jakarta.ejb.Stateless; -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Binding -@Stateless -public class Foo extends MiddleFoo { - - public void ping() { - } - - @AroundInvoke - public Object intercept2(InvocationContext ctx) throws Exception { - ActionSequence.addAction(Foo.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Interceptor1.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Interceptor1.java deleted file mode 100644 index e2717349e6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Interceptor1.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.bindings.ejb; - -import jakarta.annotation.Priority; -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Interceptor -@Priority(1001) -@Binding -public class Interceptor1 extends MiddleInterceptor1 { - - @AroundInvoke - public Object intercept2(InvocationContext ctx) throws Exception { - ActionSequence.addAction(Interceptor1.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Interceptor2.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Interceptor2.java deleted file mode 100644 index 869435185f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/Interceptor2.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.bindings.ejb; - -import jakarta.annotation.Priority; -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Interceptor -@Priority(1002) -@Binding -public class Interceptor2 extends SuperInterceptor2 { - - @AroundInvoke - public Object intercept1(InvocationContext ctx) throws Exception { - ActionSequence.addAction(Interceptor2.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/MiddleFoo.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/MiddleFoo.java deleted file mode 100644 index 63f838861f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/MiddleFoo.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.bindings.ejb; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class MiddleFoo extends SuperFoo { - - @AroundInvoke - public Object intercept1(InvocationContext ctx) throws Exception { - ActionSequence.addAction(MiddleFoo.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/MiddleInterceptor1.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/MiddleInterceptor1.java deleted file mode 100644 index e5010764e7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/MiddleInterceptor1.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.bindings.ejb; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class MiddleInterceptor1 extends SuperInterceptor1 { - - @AroundInvoke - public Object intercept1(InvocationContext ctx) throws Exception { - ActionSequence.addAction(MiddleInterceptor1.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SessionBeanAroundInvokeInterceptorTest.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SessionBeanAroundInvokeInterceptorTest.java deleted file mode 100644 index 7375c3cd81..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SessionBeanAroundInvokeInterceptorTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.bindings.ejb; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.BUSINESS_METHOD_INTERCEPTOR_METHODS; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.DEF_OF_INTERCEPTOR_CLASSES_AND_INTERCEPTOR_METHODS; -import static org.jboss.cdi.tck.util.ActionSequence.assertSequenceDataEquals; -import static org.testng.Assert.assertTrue; - -import java.util.List; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Matus Abaffy - */ -@SpecVersion(spec = "interceptors", version = "1.2") -public class SessionBeanAroundInvokeInterceptorTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(SessionBeanAroundInvokeInterceptorTest.class).build(); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, groups = JAVAEE_FULL) - @SpecAssertion(section = DEF_OF_INTERCEPTOR_CLASSES_AND_INTERCEPTOR_METHODS, id = "aa") - @SpecAssertion(section = BUSINESS_METHOD_INTERCEPTOR_METHODS, id = "a") - @SpecAssertion(section = BUSINESS_METHOD_INTERCEPTOR_METHODS, id = "b") - @SpecAssertion(section = BUSINESS_METHOD_INTERCEPTOR_METHODS, id = "ca") - public void testBusinessMethodIntercepted(Foo foo) throws Exception { - ActionSequence.reset(); - foo.ping(); - - List classes = ActionSequence.getSequenceData(); - // target class and its superclasses - assertTrue(classes.contains(SuperFoo.class.getSimpleName()), - "Around-invoke method of the target class's superclass not invoked."); - assertTrue(classes.contains(MiddleFoo.class.getSimpleName()), - "Around-invoke method of the target class's superclass not invoked."); - assertTrue(classes.contains(Foo.class.getSimpleName()), - "Around-invoke method of the target class not invoked."); - - // interceptor classes and their superclasses - assertTrue(classes.contains(SuperInterceptor1.class.getSimpleName()), - "Around-invoke method of the interceptor class's superclass not invoked."); - assertTrue(classes.contains(MiddleInterceptor1.class.getSimpleName()), - "Around-invoke method of the interceptor class's superclass not invoked."); - assertTrue(classes.contains(Interceptor1.class.getSimpleName()), - "Around-invoke method of the interceptor class not invoked."); - - assertTrue(classes.contains(SuperInterceptor2.class.getSimpleName()), - "Around-invoke method of the interceptor class's superclass not invoked."); - assertTrue(classes.contains(Interceptor2.class.getSimpleName()), - "Around-invoke method of the interceptor class not invoked."); - - assertSequenceDataEquals(SuperInterceptor1.class, MiddleInterceptor1.class, Interceptor1.class, - SuperInterceptor2.class, Interceptor2.class, SuperFoo.class, MiddleFoo.class, Foo.class); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SuperFoo.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SuperFoo.java deleted file mode 100644 index affb80d60b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SuperFoo.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.bindings.ejb; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class SuperFoo { - - @AroundInvoke - public Object intercept0(InvocationContext ctx) throws Exception { - ActionSequence.addAction(SuperFoo.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SuperInterceptor1.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SuperInterceptor1.java deleted file mode 100644 index 0407f2a95a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SuperInterceptor1.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.bindings.ejb; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class SuperInterceptor1 { - - @AroundInvoke - public Object intercept0(InvocationContext ctx) throws Exception { - ActionSequence.addAction(SuperInterceptor1.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SuperInterceptor2.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SuperInterceptor2.java deleted file mode 100644 index 285406f176..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/bindings/ejb/SuperInterceptor2.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.bindings.ejb; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class SuperInterceptor2 { - - @AroundInvoke - public Object intercept0(InvocationContext ctx) throws Exception { - ActionSequence.addAction(SuperInterceptor2.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/AroundInvokeAccessInterceptorTest.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/AroundInvokeAccessInterceptorTest.java deleted file mode 100644 index e840bc8e02..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/AroundInvokeAccessInterceptorTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.ee; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.TestGroups.SECURITY; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.BUSINESS_METHOD_INTERCEPTOR_METHODS; -import static org.testng.Assert.assertTrue; - -import jakarta.transaction.UserTransaction; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "interceptors", version = "1.2") -public class AroundInvokeAccessInterceptorTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(AroundInvokeAccessInterceptorTest.class) - .withBeansXml(new BeansXml(BeanDiscoveryMode.ALL)) - .build(); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, groups = { JAVAEE_FULL, SECURITY }) - @SpecAssertion(section = BUSINESS_METHOD_INTERCEPTOR_METHODS, id = "e") - @SpecAssertion(section = BUSINESS_METHOD_INTERCEPTOR_METHODS, id = "fb") - public void testSecurityContext(Student student) throws Exception { - student.printArticle(); - assertTrue(PrinterSecurityInterceptor.securityContextOK); - assertTrue(Toner.calledFromInterceptor); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, groups = JAVAEE_FULL) - @SpecAssertion(section = BUSINESS_METHOD_INTERCEPTOR_METHODS, id = "fa") - public void testTransactionContext(Foo foo, UserTransaction ut) throws Exception { - ut.begin(); - - foo.invoke(); - // checks are done in FooInterceptor and BazInterceptor - assertTrue(FooInterceptor.called); - assertTrue(BazInterceptor.called); - - ut.commit(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Bar.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Bar.java deleted file mode 100644 index e8f7f6b055..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Bar.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.ee; - -import jakarta.annotation.Resource; -import jakarta.ejb.Stateless; -import jakarta.ejb.TransactionAttribute; -import jakarta.ejb.TransactionAttributeType; -import jakarta.inject.Inject; -import jakarta.transaction.TransactionSynchronizationRegistry; - -@Stateless -public class Bar { - - @Resource - private TransactionSynchronizationRegistry tsr; - - @Inject - private Baz baz; - - private static Object key; - - public static Object getKey() { - return key; - } - - @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) - public void invoke() throws Exception { - key = tsr.getTransactionKey(); - baz.ping(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Baz.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Baz.java deleted file mode 100644 index cc0573829b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Baz.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.ee; - -import static org.testng.Assert.assertEquals; - -import javax.naming.InitialContext; - -import jakarta.interceptor.Interceptors; -import jakarta.transaction.TransactionSynchronizationRegistry; - -import org.testng.Assert; - -public class Baz { - - private static Object key; - - public static Object getKey() { - return key; - } - - @Interceptors(BazInterceptor.class) - void ping() throws Exception { - TransactionSynchronizationRegistry tsr = (TransactionSynchronizationRegistry) InitialContext - .doLookup("java:comp/TransactionSynchronizationRegistry"); - key = tsr.getTransactionKey(); - Assert.assertEquals(key, Bar.getKey()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/BazInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/BazInterceptor.java deleted file mode 100644 index 40593f7644..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/BazInterceptor.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.ee; - -import static org.testng.Assert.assertEquals; - -import javax.naming.InitialContext; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; -import jakarta.transaction.TransactionSynchronizationRegistry; - -public class BazInterceptor { - - static boolean called = false; - - @AroundInvoke - public Object intercept(InvocationContext ic) throws Exception { - Object obj = ic.proceed(); - TransactionSynchronizationRegistry tsr = (TransactionSynchronizationRegistry) InitialContext - .doLookup("java:comp/TransactionSynchronizationRegistry"); - assertEquals(tsr.getTransactionKey(), Baz.getKey(), - "Around-invoke method invocation did NOT occur within the same transaction context as the method on which it is interposing"); - - called = true; - return obj; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Foo.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Foo.java deleted file mode 100644 index 888cceee1e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Foo.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.ee; - -import jakarta.annotation.Resource; -import jakarta.ejb.EJB; -import jakarta.ejb.Stateless; -import jakarta.interceptor.Interceptors; -import jakarta.transaction.TransactionSynchronizationRegistry; - -@Stateless -public class Foo { - - @Resource - private TransactionSynchronizationRegistry tsr; - - @EJB - private Bar bar; - - private static Object key; - - public static Object getKey() { - return key; - } - - @Interceptors(FooInterceptor.class) - public void invoke() throws Exception { - key = tsr.getTransactionKey(); - bar.invoke(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/FooInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/FooInterceptor.java deleted file mode 100644 index 7f8578925c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/FooInterceptor.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.ee; - -import static org.testng.Assert.assertEquals; - -import javax.naming.InitialContext; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; -import jakarta.transaction.TransactionSynchronizationRegistry; - -public class FooInterceptor { - - static boolean called = false; - - @AroundInvoke - public Object intercept(InvocationContext ic) throws Exception { - Object obj = ic.proceed(); - TransactionSynchronizationRegistry tsr = (TransactionSynchronizationRegistry) InitialContext - .doLookup("java:comp/TransactionSynchronizationRegistry"); - assertEquals(tsr.getTransactionKey(), Foo.getKey(), - "Around-invoke method invocation did NOT occur within the same transaction context as the method on which it is interposing"); - - called = true; - return obj; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Printer.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Printer.java deleted file mode 100644 index 39b26fddaf..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Printer.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.ee; - -import jakarta.annotation.security.RolesAllowed; -import jakarta.annotation.security.RunAs; -import jakarta.ejb.EJB; -import jakarta.ejb.Stateless; -import jakarta.interceptor.Interceptors; - -@Stateless -@Interceptors(PrinterSecurityInterceptor.class) -@RunAs("printer") -@RolesAllowed("student") -public class Printer { - - @EJB - private Toner toner; - - public void print() { - toner.spill(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/PrinterSecurityInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/PrinterSecurityInterceptor.java deleted file mode 100644 index 469b98daed..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/PrinterSecurityInterceptor.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.ee; - -import static org.testng.AssertJUnit.assertTrue; - -import jakarta.annotation.Resource; -import jakarta.annotation.security.DeclareRoles; -import jakarta.ejb.EJB; -import jakarta.ejb.SessionContext; -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -@DeclareRoles(value = { "student", "printer" }) -public class PrinterSecurityInterceptor { - - public static boolean securityContextOK = false; - - @Resource - private SessionContext sc; - - @EJB - private Toner toner; - - @AroundInvoke - public Object intercept(InvocationContext ic) throws Exception { - Object obj = ic.proceed(); - - assertTrue(this.sc.isCallerInRole("student")); - assertTrue(!this.sc.isCallerInRole("printer")); - securityContextOK = true; - - toner.callFromInterceptor(); - - return obj; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Student.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Student.java deleted file mode 100644 index 65718249eb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Student.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.ee; - -import jakarta.annotation.security.PermitAll; -import jakarta.annotation.security.RunAs; -import jakarta.ejb.EJB; -import jakarta.ejb.Stateful; - -@Stateful -@RunAs("student") -@PermitAll -public class Student { - - @EJB - private Printer printer; - - public void printArticle() { - printer.print(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Toner.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Toner.java deleted file mode 100644 index 7e347e3db6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundInvoke/ee/Toner.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.ee; - -import jakarta.annotation.security.RolesAllowed; -import jakarta.ejb.Stateless; - -@Stateless -@RolesAllowed("printer") -public class Toner { - - public static boolean calledFromInterceptor = false; - - public void spill() { - } - - public void callFromInterceptor() { - calledFromInterceptor = true; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/Alarm.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/Alarm.java deleted file mode 100644 index 8b4bf70fef..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/Alarm.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout; - -import static org.testng.Assert.assertTrue; - -import java.util.concurrent.atomic.AtomicLong; - -import jakarta.annotation.Resource; -import jakarta.annotation.security.RolesAllowed; -import jakarta.annotation.security.RunAs; -import jakarta.ejb.SessionContext; -import jakarta.ejb.Stateless; -import jakarta.ejb.Timeout; -import jakarta.ejb.Timer; -import jakarta.interceptor.Interceptors; - -@Stateless -@Interceptors(AlarmSecurityInterceptor.class) -@RunAs("alarm") -@RolesAllowed("student") -public class Alarm { - - public static AtomicLong timeoutAt = null; - - @Resource - private SessionContext ctx; - - public void createTimer() { - ctx.getTimerService().createTimer(1l, null); - } - - @Timeout - public void timeout(Timer timer) { - timeoutAt = new AtomicLong(System.currentTimeMillis()); - assertTrue(!this.ctx.isCallerInRole("student")); - assertTrue(!this.ctx.isCallerInRole("alarm")); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/AlarmSecurityInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/AlarmSecurityInterceptor.java deleted file mode 100644 index f59a099b43..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/AlarmSecurityInterceptor.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout; - -import static org.testng.Assert.assertTrue; - -import jakarta.annotation.Resource; -import jakarta.ejb.EJB; -import jakarta.ejb.SessionContext; -import jakarta.interceptor.AroundTimeout; -import jakarta.interceptor.InvocationContext; - -public class AlarmSecurityInterceptor { - - @EJB - private Bell bell; - - @Resource - private SessionContext sc; - - @AroundTimeout - public Object interceptTimeout(InvocationContext ic) throws Exception { - Object obj = ic.proceed(); - - // Since a timeout callback method is an internal method of the bean class, it has no client security context - assertTrue(!this.sc.isCallerInRole("student")); - assertTrue(!this.sc.isCallerInRole("alarm")); - - TestData.securityContextOk.set(true); - bell.callFromInterceptor(); - return obj; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/AroundTimeoutInterceptorTest.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/AroundTimeoutInterceptorTest.java deleted file mode 100644 index 7a247a1b43..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/AroundTimeoutInterceptorTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.TestGroups.SECURITY; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.TIMEOUT_METHOD_INT_METHODS; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.AssertJUnit.assertTrue; - -import java.util.concurrent.TimeUnit; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.Timer; -import org.jboss.cdi.tck.util.Timer.StopCondition; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Matus Abaffy - */ -@SpecVersion(spec = "interceptors", version = "1.2") -public class AroundTimeoutInterceptorTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(AroundTimeoutInterceptorTest.class).build(); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, groups = JAVAEE_FULL) - @SpecAssertion(section = TIMEOUT_METHOD_INT_METHODS, id = "f") - @SpecAssertion(section = TIMEOUT_METHOD_INT_METHODS, id = "ea") - public void testInvocationContextGetTimer(TimingBean timingBean) throws Exception { - timingBean.createTimer(); - new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - @Override - public boolean isSatisfied() { - return TimingBean.timeoutAt != null; - } - }).start(); - - assertNotNull(TimingBean.timeoutAt); - assertTrue(TimeoutInterceptor.timerOK); - assertEquals(TimeoutInterceptor.key, TimingBean.key, - "Around-timeout method invocation did NOT occur within the same transaction context as the timeout method on which it is interposing"); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, groups = { JAVAEE_FULL, SECURITY }) - @SpecAssertion(section = TIMEOUT_METHOD_INT_METHODS, id = "d") - @SpecAssertion(section = TIMEOUT_METHOD_INT_METHODS, id = "eb") - public void testSecurityContext(Student student) throws Exception { - student.sleep(); - new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - @Override - public boolean isSatisfied() { - return Alarm.timeoutAt != null; - } - }).start(); - assertNotNull(Alarm.timeoutAt.get()); - - new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - @Override - public boolean isSatisfied() { - return TestData.preDestroyed.get(); - } - }).start(); - - assertTrue(TestData.securityContextOk.get()); - assertTrue(TestData.calledFromInterceptor.get()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/Bell.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/Bell.java deleted file mode 100644 index ef1435cf80..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/Bell.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout; - -import jakarta.annotation.PreDestroy; -import jakarta.annotation.security.RolesAllowed; -import jakarta.ejb.Stateless; - -@Stateless -@RolesAllowed("alarm") -public class Bell { - - public void callFromInterceptor() { - TestData.calledFromInterceptor.set(true); - } - - @PreDestroy - public void preDestroy() { - TestData.preDestroyed.set(true); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/Student.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/Student.java deleted file mode 100644 index 939378002f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/Student.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout; - -import jakarta.annotation.security.PermitAll; -import jakarta.annotation.security.RunAs; -import jakarta.ejb.EJB; -import jakarta.ejb.Stateless; - -@Stateless -@RunAs("student") -@PermitAll -public class Student { - - @EJB - private Alarm alarm; - - public void sleep() { - alarm.createTimer(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/TestData.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/TestData.java deleted file mode 100644 index 714010b81a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/TestData.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout; - -import java.util.concurrent.atomic.AtomicBoolean; - -public class TestData { - - public static final AtomicBoolean preDestroyed = new AtomicBoolean(false); - public static final AtomicBoolean securityContextOk = new AtomicBoolean(false); - public static final AtomicBoolean calledFromInterceptor = new AtomicBoolean(false); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/TimeoutInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/TimeoutInterceptor.java deleted file mode 100644 index eba79153f8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/TimeoutInterceptor.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout; - -import javax.naming.InitialContext; - -import jakarta.ejb.Timer; -import jakarta.interceptor.AroundTimeout; -import jakarta.interceptor.InvocationContext; -import jakarta.transaction.TransactionSynchronizationRegistry; - -public class TimeoutInterceptor { - - static boolean timerOK = false; - static Object key; - - @AroundTimeout - public Object interceptTimeout(InvocationContext ctx) throws Exception { - if (((String) ((Timer) ctx.getTimer()).getInfo()).equals("some info")) { - timerOK = true; - } - TransactionSynchronizationRegistry tsr; - try { - tsr = (TransactionSynchronizationRegistry) InitialContext.doLookup("java:comp/TransactionSynchronizationRegistry"); - } catch (Exception e) { - throw new RuntimeException(e); - } - key = tsr.getTransactionKey(); - - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/TimingBean.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/TimingBean.java deleted file mode 100644 index 0a09c5bb76..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/TimingBean.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout; - -import static org.testng.Assert.assertNotNull; - -import jakarta.annotation.Resource; -import jakarta.ejb.SessionContext; -import jakarta.ejb.Stateless; -import jakarta.ejb.Timeout; -import jakarta.ejb.Timer; -import jakarta.ejb.TransactionAttribute; -import jakarta.ejb.TransactionAttributeType; -import jakarta.interceptor.Interceptors; -import jakarta.transaction.TransactionSynchronizationRegistry; - -@Interceptors(TimeoutInterceptor.class) -@Stateless -public class TimingBean { - - public static Long timeoutAt = null; - - static Object key; - - @Resource - private TransactionSynchronizationRegistry tsr; - - @Resource - private SessionContext ctx; - - public void createTimer() { - ctx.getTimerService().createTimer(1l, "some info"); - } - - @Timeout - @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) - public void timeout(Timer timer) { - timeoutAt = System.currentTimeMillis(); - key = tsr.getTransactionKey(); - assertNotNull(key); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/AroundTimeoutOrderInterceptorTest.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/AroundTimeoutOrderInterceptorTest.java deleted file mode 100644 index 77e4ce7fe4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/AroundTimeoutOrderInterceptorTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout.bindings; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.INT_ORDERING_RULES; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.INVOCATIONCONTEXT; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.TIMEOUT_METHOD_INT_METHODS; -import static org.testng.Assert.assertNotNull; - -import java.util.concurrent.TimeUnit; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.cdi.tck.util.Timer; -import org.jboss.cdi.tck.util.Timer.StopCondition; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Matus Abaffy - */ -@SpecVersion(spec = "interceptors", version = "1.2") -public class AroundTimeoutOrderInterceptorTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(AroundTimeoutOrderInterceptorTest.class).build(); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, groups = JAVAEE_FULL) - @SpecAssertion(section = INVOCATIONCONTEXT, id = "hb") - @SpecAssertion(section = TIMEOUT_METHOD_INT_METHODS, id = "ba") - @SpecAssertion(section = TIMEOUT_METHOD_INT_METHODS, id = "bb") - @SpecAssertion(section = INT_ORDERING_RULES, id = "h") - @SpecAssertion(section = INT_ORDERING_RULES, id = "i") - public void testTimeoutMethodIntercepted(TimingBean timing) throws Exception { - ActionSequence.reset(); - - timing.createTimer(); - new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - @Override - public boolean isSatisfied() { - return TimingBean.timeoutAt != null; - } - }).start(); - - assertNotNull(TimingBean.timeoutAt); - - ActionSequence.assertSequenceDataContainsAll(SuperInterceptor1.class, MiddleInterceptor1.class, Interceptor1.class, - SuperInterceptor2.class, Interceptor2.class, SuperTimingBean.class, MiddleTimingBean.class, TimingBean.class); - - ActionSequence.assertSequenceDataEquals(SuperInterceptor1.class, MiddleInterceptor1.class, Interceptor1.class, - SuperInterceptor2.class, Interceptor2.class, SuperTimingBean.class, MiddleTimingBean.class, TimingBean.class); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/Binding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/Binding.java deleted file mode 100644 index d6b556f5c7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/Binding.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout.bindings; - -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 jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Documented -@InterceptorBinding -public @interface Binding { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/Interceptor1.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/Interceptor1.java deleted file mode 100644 index 06067180c5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/Interceptor1.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout.bindings; - -import jakarta.annotation.Priority; -import jakarta.interceptor.AroundTimeout; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Interceptor -@Priority(1001) -@Binding -public class Interceptor1 extends MiddleInterceptor1 { - - @AroundTimeout - public Object interceptTimeout2(InvocationContext ctx) throws Exception { - ActionSequence.addAction(Interceptor1.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/Interceptor2.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/Interceptor2.java deleted file mode 100644 index f7c21332cb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/Interceptor2.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout.bindings; - -import jakarta.annotation.Priority; -import jakarta.interceptor.AroundTimeout; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Interceptor -@Priority(1002) -@Binding -public class Interceptor2 extends SuperInterceptor2 { - - @AroundTimeout - public Object interceptTimeout1(InvocationContext ctx) throws Exception { - ActionSequence.addAction(Interceptor2.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/MiddleInterceptor1.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/MiddleInterceptor1.java deleted file mode 100644 index 0f3776319e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/MiddleInterceptor1.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout.bindings; - -import jakarta.interceptor.AroundTimeout; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class MiddleInterceptor1 extends SuperInterceptor1 { - - @AroundTimeout - public Object interceptTimeout1(InvocationContext ctx) throws Exception { - ActionSequence.addAction(MiddleInterceptor1.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/MiddleTimingBean.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/MiddleTimingBean.java deleted file mode 100644 index 475d21ebe9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/MiddleTimingBean.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout.bindings; - -import jakarta.interceptor.AroundTimeout; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class MiddleTimingBean extends SuperTimingBean { - - @AroundTimeout - public Object interceptTimeout1(InvocationContext ctx) throws Exception { - ActionSequence.addAction(MiddleTimingBean.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/SuperInterceptor1.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/SuperInterceptor1.java deleted file mode 100644 index 2d4682a102..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/SuperInterceptor1.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout.bindings; - -import jakarta.interceptor.AroundTimeout; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class SuperInterceptor1 { - - @AroundTimeout - public Object interceptTimeout0(InvocationContext ctx) throws Exception { - ActionSequence.addAction(SuperInterceptor1.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/SuperInterceptor2.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/SuperInterceptor2.java deleted file mode 100644 index 6404f5fe20..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/SuperInterceptor2.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout.bindings; - -import jakarta.interceptor.AroundTimeout; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class SuperInterceptor2 { - - @AroundTimeout - public Object interceptTimeout0(InvocationContext ctx) throws Exception { - ActionSequence.addAction(SuperInterceptor2.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/SuperTimingBean.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/SuperTimingBean.java deleted file mode 100644 index 2bce252c4e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/SuperTimingBean.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout.bindings; - -import jakarta.interceptor.AroundTimeout; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class SuperTimingBean { - - @AroundTimeout - public Object interceptTimeout0(InvocationContext ctx) throws Exception { - ActionSequence.addAction(SuperTimingBean.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/TimingBean.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/TimingBean.java deleted file mode 100644 index 22d409c240..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/aroundTimeout/bindings/TimingBean.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.aroundTimeout.bindings; - -import jakarta.annotation.Resource; -import jakarta.ejb.SessionContext; -import jakarta.ejb.Stateless; -import jakarta.ejb.Timeout; -import jakarta.ejb.Timer; -import jakarta.interceptor.AroundTimeout; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Binding -@Stateless -public class TimingBean extends MiddleTimingBean { - - public static Long timeoutAt = null; - - @Resource - private SessionContext ctx; - - public void createTimer() { - ctx.getTimerService().createTimer(1l, null); - } - - @Timeout - public void timeout(Timer timer) { - timeoutAt = System.currentTimeMillis(); - } - - @AroundTimeout - public Object interceptTimeout2(InvocationContext ctx) throws Exception { - ActionSequence.addAction(TimingBean.class.getSimpleName()); - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundInvokeInterceptor1.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundInvokeInterceptor1.java deleted file mode 100644 index 90a2900ae2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundInvokeInterceptor1.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment; - -import static org.testng.Assert.assertEquals; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -public class AroundInvokeInterceptor1 { - - @AroundInvoke - public Object intercept(InvocationContext ctx) throws Exception { - Object[] params = ctx.getParameters(); - int input = (Integer) params[0]; - assertEquals(input, 5); - - params[0] = 2 * input; - ctx.setParameters(params); - int i = (Integer) ctx.proceed(); - assertEquals(i, 13); - return i * 3; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundInvokeInterceptor2.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundInvokeInterceptor2.java deleted file mode 100644 index cc354147d1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundInvokeInterceptor2.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment; - -import static org.testng.Assert.assertEquals; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -public class AroundInvokeInterceptor2 { - - @AroundInvoke - public Object intercept(InvocationContext ctx) throws Exception { - Object[] params = ctx.getParameters(); - int input = (Integer) params[0]; - assertEquals(input, 10); - return input + 3; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundInvokeThreadInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundInvokeThreadInterceptor.java deleted file mode 100644 index f460f7fb8b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundInvokeThreadInterceptor.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment; - -import static org.testng.Assert.assertEquals; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -public class AroundInvokeThreadInterceptor { - - @AroundInvoke - public Object intercept(InvocationContext ctx) throws Exception { - Thread.currentThread().setName("abc"); - int i = (Integer) ctx.proceed(); - assertEquals(Thread.currentThread().getName(), "def"); - return i + 1; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundTimeoutThreadInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundTimeoutThreadInterceptor.java deleted file mode 100644 index 1c2af7b250..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/AroundTimeoutThreadInterceptor.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment; - -import static org.testng.Assert.assertEquals; - -import java.util.concurrent.atomic.AtomicBoolean; - -import jakarta.interceptor.AroundTimeout; -import jakarta.interceptor.InvocationContext; - -public class AroundTimeoutThreadInterceptor { - - public static AtomicBoolean threadOK = new AtomicBoolean(false); - - @AroundTimeout - public Object intercept(InvocationContext ctx) throws Exception { - Thread.currentThread().setName("abc"); - ctx.proceed(); - assertEquals(Thread.currentThread().getName(), "def"); - threadOK.set(true); - return null; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/Bar.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/Bar.java deleted file mode 100644 index 475294ced7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/Bar.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment; - -import static org.testng.Assert.assertEquals; - -import java.util.concurrent.atomic.AtomicLong; - -import jakarta.annotation.Resource; -import jakarta.ejb.SessionContext; -import jakarta.ejb.Stateless; -import jakarta.ejb.Timeout; -import jakarta.ejb.Timer; -import jakarta.interceptor.Interceptors; - -@Stateless -@Interceptors(AroundTimeoutThreadInterceptor.class) -public class Bar { - - @Interceptors(AroundInvokeThreadInterceptor.class) - public int ping() { - assertEquals(Thread.currentThread().getName(), "abc"); - Thread.currentThread().setName("def"); - return 1; - } - - public static AtomicLong timeoutAt = null; - - @Resource - private SessionContext ctx; - - public void createTimer() { - ctx.getTimerService().createTimer(1l, null); - } - - @Timeout - public void timeout(Timer timer) { - assertEquals(Thread.currentThread().getName(), "abc"); - Thread.currentThread().setName("def"); - timeoutAt = new AtomicLong(System.currentTimeMillis()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/Foo.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/Foo.java deleted file mode 100644 index c7ee4b06ba..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/Foo.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment; - -import jakarta.enterprise.context.Dependent; -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptors; -import jakarta.interceptor.InvocationContext; - -@Dependent -public class Foo { - - public static boolean called = false; - - @Interceptors({ AroundInvokeInterceptor1.class, AroundInvokeInterceptor2.class }) - public int count(int input) { - called = true; - return 0; - } - - @AroundInvoke - private Object intercept(InvocationContext ctx) throws Exception { - called = true; - return ((Integer) ctx.proceed()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/InterceptorEnvironmentTest.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/InterceptorEnvironmentTest.java deleted file mode 100644 index 9e4c22df5f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/InterceptorEnvironmentTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.INTERCEPTOR_ENVIRONMENT; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.concurrent.TimeUnit; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.Timer; -import org.jboss.cdi.tck.util.Timer.StopCondition; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Matus Abaffy - */ -@SpecVersion(spec = "interceptors", version = "1.2") -public class InterceptorEnvironmentTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(InterceptorEnvironmentTest.class).build(); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, groups = JAVAEE_FULL) - @SpecAssertion(section = INTERCEPTOR_ENVIRONMENT, id = "b") - public void testSameThread(Bar bar) throws InterruptedException { - assertEquals(bar.ping(), 2); - - bar.createTimer(); - new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - @Override - public boolean isSatisfied() { - return TestEndObserver.toBeDestroyed.get(); - } - }).start(); - assertNotNull(Bar.timeoutAt); - assertTrue(AroundTimeoutThreadInterceptor.threadOK.get()); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = INTERCEPTOR_ENVIRONMENT, id = "c") - public void testInvocationContext(Foo foo) { - final int input = 5; - final int result = ((2 * input) + 3) * 3; - assertEquals(foo.count(input), result); - assertFalse(Foo.called); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/TestEndObserver.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/TestEndObserver.java deleted file mode 100644 index e045596a5c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/TestEndObserver.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment; - -import java.util.concurrent.atomic.AtomicBoolean; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.event.Observes; - -@Dependent -public class TestEndObserver { - - public static AtomicBoolean toBeDestroyed = new AtomicBoolean(); - - public void observesAppShutdown(@Observes @Destroyed(ApplicationScoped.class) Object event) { - if (event != null) { - toBeDestroyed.set(true); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Animal.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Animal.java deleted file mode 100644 index 326c642381..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Animal.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi; - -public interface Animal { - String getName(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Bar.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Bar.java deleted file mode 100644 index 7dc4e48ea9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Bar.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi; - -import javax.naming.InitialContext; -import javax.naming.NamingException; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; - -@MyBinding -@Dependent -public class Bar { - - @Resource(name = "greeting") - private String greeting; - - private Animal animal; - - public String getGreeting() { - return greeting; - } - - public Animal getAnimal() { - return animal; - } - - @PostConstruct - private void init() { - try { - this.animal = (Animal) InitialContext.doLookup("java:module/Animal"); - } catch (NamingException e) { - throw new RuntimeException(e); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/BarServlet.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/BarServlet.java deleted file mode 100644 index 2e04d84def..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/BarServlet.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi; - -import java.io.IOException; - -import jakarta.enterprise.inject.Instance; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@SuppressWarnings("serial") -@WebServlet(urlPatterns = "/bar") -public class BarServlet extends HttpServlet { - - private Bar bar; - - @Inject - Instance barInstance; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.setContentType("text/plain"); - String get = req.getParameter("get"); - if (get.equals("init")) { - MyInterceptor.reset(); - this.bar = barInstance.get(); - // fail if interceptor was not called - resp.setStatus(MyInterceptor.isInterceptorCalled() ? 200 : 500); - } else if (get.equals("name")) { - resp.getWriter().write(bar.getAnimal().getName()); - } else if (get.equals("intName")) { - resp.getWriter().write(MyInterceptor.getAnimal().getName()); - } else if (get.equals("greeting")) { - resp.getWriter().write(bar.getGreeting()); - } else if (get.equals("intGreeting")) { - resp.getWriter().write(MyInterceptor.getGreeting()); - } else { - resp.setStatus(404); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Cat.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Cat.java deleted file mode 100644 index 3d3e451282..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Cat.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi; - -import jakarta.ejb.Stateful; - -@Stateful(name = "Animal") -public class Cat implements Animal { - @Override - public String getName() { - return "Cat"; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Dog.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Dog.java deleted file mode 100644 index b1eaaba655..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Dog.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi; - -import jakarta.ejb.Stateful; - -@Stateful(name = "Animal") -public class Dog implements Animal { - @Override - public String getName() { - return "Dog"; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Foo.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Foo.java deleted file mode 100644 index 027cd0feef..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/Foo.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi; - -import javax.naming.InitialContext; -import javax.naming.NamingException; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; - -@MyBinding -@Dependent -public class Foo { - - @Resource(name = "greeting") - private String greeting; - - private Animal animal; - - public String getGreeting() { - return greeting; - } - - public Animal getAnimal() { - return animal; - } - - @PostConstruct - private void init() { - try { - this.animal = (Animal) InitialContext.doLookup("java:module/Animal"); - } catch (NamingException e) { - throw new RuntimeException(e); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/FooServlet.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/FooServlet.java deleted file mode 100644 index 4b428a9927..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/FooServlet.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi; - -import java.io.IOException; - -import jakarta.enterprise.inject.Instance; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@SuppressWarnings("serial") -@WebServlet(urlPatterns = "/foo") -public class FooServlet extends HttpServlet { - - private Foo foo; - - @Inject - Instance fooInstance; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.setContentType("text/plain"); - String get = req.getParameter("get"); - if (get.equals("init")) { - MyInterceptor.reset(); - this.foo = fooInstance.get(); - // fail if interceptor was not called - resp.setStatus(MyInterceptor.isInterceptorCalled() ? 200 : 500); - } else if (get.equals("name")) { - resp.getWriter().write(foo.getAnimal().getName()); - } else if (get.equals("intName")) { - resp.getWriter().write(MyInterceptor.getAnimal().getName()); - } else if (get.equals("greeting")) { - resp.getWriter().write(foo.getGreeting()); - } else if (get.equals("intGreeting")) { - resp.getWriter().write(MyInterceptor.getGreeting()); - } else { - resp.setStatus(404); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/InterceptorEnvironmentJNDITest.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/InterceptorEnvironmentJNDITest.java deleted file mode 100644 index 913c7b6e48..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/InterceptorEnvironmentJNDITest.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.INTERCEPTOR_ENVIRONMENT; -import static org.testng.Assert.assertEquals; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.application6.ApplicationDescriptor; -import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * @author Matus Abaffy - */ -@RunAsClient -@SpecVersion(spec = "interceptors", version = "1.2") -public class InterceptorEnvironmentJNDITest extends AbstractTest { - - private static final String GREETING = "greeting"; - private static final String JAVA_LANG_STRING = "java.lang.String"; - - private static final String HELLO = "Hello"; - private static final String BYE = "Bye"; - - private static final String FOO_GET = "foo?get="; - private static final String BAR_GET = "bar?get="; - - @Deployment(testable = false) - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder() - .notTestArchive() - .withClasses(MyBinding.class, MyInterceptor.class, Animal.class) - .noDefaultWebModule().build(); - - StringAsset applicationXml = new StringAsset(Descriptors.create(ApplicationDescriptor.class) - .version(EnterpriseArchiveBuilder.DEFAULT_APP_VERSION).applicationName("Test").createModule() - .ejb(EnterpriseArchiveBuilder.DEFAULT_EJB_MODULE_NAME).up().createModule().getOrCreateWeb().webUri("test1.war") - .contextRoot("/test1").up().up().createModule().getOrCreateWeb().webUri("test2.war").contextRoot("/test2").up() - .up().exportAsString()); - enterpriseArchive.setApplicationXML(applicationXml); - - WebArchive fooArchive = new WebArchiveBuilder().notTestArchive().withName("test1.war") - .withClasses(FooServlet.class, Foo.class, Dog.class) - .withWebXml( - Descriptors.create(WebAppDescriptor.class).createEnvEntry().envEntryName(GREETING) - .envEntryType(JAVA_LANG_STRING).envEntryValue(BYE).up()) - .withDefaultEjbModuleDependency() - .build(); - enterpriseArchive.addAsModule(fooArchive); - - WebArchive barArchive = new WebArchiveBuilder().notTestArchive().withName("test2.war") - .withClasses(BarServlet.class, Bar.class, Cat.class) - .withWebXml( - Descriptors.create(WebAppDescriptor.class).createEnvEntry().envEntryName(GREETING) - .envEntryType(JAVA_LANG_STRING).envEntryValue(HELLO).up()) - .withDefaultEjbModuleDependency() - .build(); - enterpriseArchive.addAsModule(barArchive); - - return enterpriseArchive; - } - - @ArquillianResource(FooServlet.class) - URL fooContextPath; - - @ArquillianResource(BarServlet.class) - URL barContextPath; - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = INTERCEPTOR_ENVIRONMENT, id = "a") - public void testInterceptorEnvironment() throws FailingHttpStatusCodeException, MalformedURLException, IOException { - - WebClient webClient = new WebClient(); - - // create an instance of Foo and fail if interceptor was not called - webClient.getPage(fooContextPath + FOO_GET + "init"); - - String fooAnimalName = webClient.getPage(fooContextPath + FOO_GET + "name").getWebResponse().getContentAsString(); - String fooGreeting = webClient.getPage(fooContextPath + FOO_GET + "greeting").getWebResponse().getContentAsString(); - - String fooInterceptorAnimalName = webClient.getPage(fooContextPath + FOO_GET + "intName").getWebResponse() - .getContentAsString(); - String fooInterceptorGreeting = webClient.getPage(fooContextPath + FOO_GET + "intGreeting").getWebResponse() - .getContentAsString(); - - assertEquals(fooInterceptorGreeting, fooGreeting); - assertEquals(fooInterceptorAnimalName, fooAnimalName); - assertEquals(fooGreeting, BYE); - assertEquals(fooAnimalName, "Dog"); - - // create an instance of Bar and fail if interceptor was not called - webClient.getPage(barContextPath + BAR_GET + "init"); - - String barAnimalName = webClient.getPage(barContextPath + BAR_GET + "name").getWebResponse().getContentAsString(); - String barGreeting = webClient.getPage(barContextPath + BAR_GET + "greeting").getWebResponse().getContentAsString(); - - String barInterceptorAnimalName = webClient.getPage(barContextPath + BAR_GET + "intName").getWebResponse() - .getContentAsString(); - String barInterceptorGreeting = webClient.getPage(barContextPath + BAR_GET + "intGreeting").getWebResponse() - .getContentAsString(); - - assertEquals(barInterceptorGreeting, barGreeting); - assertEquals(barInterceptorAnimalName, barAnimalName); - assertEquals(barGreeting, HELLO); - assertEquals(barAnimalName, "Cat"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/MyBinding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/MyBinding.java deleted file mode 100644 index b2d6fc084b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/MyBinding.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE }) -@Retention(RUNTIME) -@Documented -@Inherited -@InterceptorBinding -public @interface MyBinding { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/MyInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/MyInterceptor.java deleted file mode 100644 index 0aab5316c2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/MyInterceptor.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi; - -import javax.naming.InitialContext; -import javax.naming.NamingException; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.Priority; -import jakarta.annotation.Resource; -import jakarta.inject.Inject; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@MyBinding -@Priority(1000) -@Interceptor -public class MyInterceptor { - - private static boolean interceptorCalled = false; - private static String greeting; - private static Animal animal; - - @Resource(name = "greeting") - private void setGreeting(String greeting) { - MyInterceptor.greeting = greeting; - } - - @Inject - private void init() throws NamingException { - MyInterceptor.animal = (Animal) InitialContext.doLookup("java:module/Animal"); - } - - public static void reset() { - greeting = null; - animal = null; - interceptorCalled = false; - } - - public static boolean isInterceptorCalled() { - return interceptorCalled; - } - - public static String getGreeting() { - return greeting; - } - - public static Animal getAnimal() { - return animal; - } - - @PostConstruct - private void intercept(InvocationContext ctx) { - interceptorCalled = true; - try { - ctx.proceed(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Animal.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Animal.java deleted file mode 100644 index f454f7bbde..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Animal.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi.ejb; - -public interface Animal { - String getName(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Bar.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Bar.java deleted file mode 100644 index dc3e8d8b73..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Bar.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi.ejb; - -import javax.naming.InitialContext; -import javax.naming.NamingException; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.Resource; -import jakarta.ejb.Stateless; - -@MyBinding -@Stateless -public class Bar { - - @Resource(name = "greeting") - private String greeting; - - private Animal animal; - - public String getGreeting() { - return greeting; - } - - public Animal getAnimal() { - return animal; - } - - @PostConstruct - private void init() { - try { - this.animal = (Animal) InitialContext.doLookup("java:module/Animal"); - } catch (NamingException e) { - throw new RuntimeException(e); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/BarServlet.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/BarServlet.java deleted file mode 100644 index 694c0f9c8e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/BarServlet.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi.ejb; - -import java.io.IOException; - -import jakarta.enterprise.inject.Instance; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@SuppressWarnings("serial") -@WebServlet(urlPatterns = "/bar") -public class BarServlet extends HttpServlet { - - private Bar bar; - - @Inject - Instance barInstance; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.setContentType("text/plain"); - String get = req.getParameter("get"); - if (get.equals("init")) { - MyInterceptor.reset(); - this.bar = barInstance.get(); - // initialize the SLSB - bar.getAnimal(); - // fail if interceptor was not called - resp.setStatus(MyInterceptor.isInterceptorCalled() ? 200 : 500); - } else if (get.equals("name")) { - resp.getWriter().write(bar.getAnimal().getName()); - } else if (get.equals("intName")) { - resp.getWriter().write(MyInterceptor.getAnimal().getName()); - } else if (get.equals("greeting")) { - resp.getWriter().write("" + bar.getGreeting()); - } else if (get.equals("intGreeting")) { - resp.getWriter().write("" + MyInterceptor.getGreeting()); - } else { - resp.setStatus(404); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Cat.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Cat.java deleted file mode 100644 index b15caae28a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Cat.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi.ejb; - -import jakarta.ejb.Stateful; - -@Stateful(name = "Animal") -public class Cat implements Animal { - @Override - public String getName() { - return "Cat"; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Dog.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Dog.java deleted file mode 100644 index 47d2b708f5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Dog.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi.ejb; - -import jakarta.ejb.Stateful; - -@Stateful(name = "Animal") -public class Dog implements Animal { - @Override - public String getName() { - return "Dog"; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Foo.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Foo.java deleted file mode 100644 index 02623479cb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/Foo.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi.ejb; - -import javax.naming.InitialContext; -import javax.naming.NamingException; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.Resource; -import jakarta.ejb.Stateless; - -@MyBinding -@Stateless -public class Foo { - - @Resource(name = "greeting") - private String greeting; - - private Animal animal; - - public String getGreeting() { - return greeting; - } - - public Animal getAnimal() { - return animal; - } - - @PostConstruct - private void init() { - try { - this.animal = (Animal) InitialContext.doLookup("java:module/Animal"); - } catch (NamingException e) { - throw new RuntimeException(e); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/FooServlet.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/FooServlet.java deleted file mode 100644 index a63ebe515a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/FooServlet.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi.ejb; - -import java.io.IOException; - -import jakarta.enterprise.inject.Instance; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@SuppressWarnings("serial") -@WebServlet(urlPatterns = "/foo") -public class FooServlet extends HttpServlet { - - private Foo foo; - - @Inject - Instance fooInstance; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.setContentType("text/plain"); - String get = req.getParameter("get"); - if (get.equals("init")) { - MyInterceptor.reset(); - foo = fooInstance.get(); - // initialize the SLSB - foo.getAnimal(); - // fail if interceptor was not called - resp.setStatus(MyInterceptor.isInterceptorCalled() ? 200 : 500); - } else if (get.equals("name")) { - resp.getWriter().write(foo.getAnimal().getName()); - } else if (get.equals("intName")) { - resp.getWriter().write(MyInterceptor.getAnimal().getName()); - } else if (get.equals("greeting")) { - resp.getWriter().write("" + foo.getGreeting()); - } else if (get.equals("intGreeting")) { - resp.getWriter().write("" + MyInterceptor.getGreeting()); - } else { - resp.setStatus(404); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/InterceptorEnvironmentJNDISessionBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/InterceptorEnvironmentJNDISessionBeanTest.java deleted file mode 100644 index 77ded7190d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/InterceptorEnvironmentJNDISessionBeanTest.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi.ejb; - -import static org.testng.Assert.assertEquals; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.TestGroups; -import org.jboss.cdi.tck.interceptors.InterceptorsSections; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * @author Matus Abaffy - */ -@RunAsClient -@SpecVersion(spec = "interceptors", version = "1.2") -public class InterceptorEnvironmentJNDISessionBeanTest extends AbstractTest { - - private static final String GREETING = "greeting"; - private static final String JAVA_LANG_STRING = "java.lang.String"; - - private static final String HELLO = "Hello"; - private static final String BYE = "Bye"; - - private static final String FOO_GET = "foo?get="; - private static final String BAR_GET = "bar?get="; - - @Deployment(testable = false) - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder() - .notTestArchive() - .withClasses(MyBinding.class, MyInterceptor.class, Animal.class) - .noDefaultWebModule().build(); - - WebArchive fooArchive = new WebArchiveBuilder() - .notTestArchive() - .withClasses(FooServlet.class, Foo.class, Dog.class) - .withWebXml( - Descriptors.create(WebAppDescriptor.class).createEnvEntry().envEntryName(GREETING) - .envEntryType(JAVA_LANG_STRING).envEntryValue(BYE).up()) - .withDefaultEjbModuleDependency() - .build(); - enterpriseArchive.addAsModule(fooArchive); - - WebArchive barArchive = new WebArchiveBuilder() - .notTestArchive() - .withClasses(BarServlet.class, Bar.class, Cat.class) - .withWebXml( - Descriptors.create(WebAppDescriptor.class).createEnvEntry().envEntryName(GREETING) - .envEntryType(JAVA_LANG_STRING).envEntryValue(HELLO).up()) - .withDefaultEjbModuleDependency() - .build(); - enterpriseArchive.addAsModule(barArchive); - - return enterpriseArchive; - } - - @ArquillianResource(FooServlet.class) - URL fooContextPath; - - @ArquillianResource(BarServlet.class) - URL barContextPath; - - @Test(groups = TestGroups.JAVAEE_FULL) - @SpecAssertion(section = InterceptorsSections.INTERCEPTOR_ENVIRONMENT, id = "a") - public void testInterceptorEnvironment() throws FailingHttpStatusCodeException, MalformedURLException, IOException { - - WebClient webClient = new WebClient(); - - // create an instance of Foo and fail if interceptor was not called - webClient.getPage(fooContextPath + FOO_GET + "init"); - - String fooAnimalName = webClient.getPage(fooContextPath + FOO_GET + "name").getWebResponse().getContentAsString(); - String fooGreeting = webClient.getPage(fooContextPath + FOO_GET + "greeting").getWebResponse().getContentAsString(); - - String fooInterceptorAnimalName = webClient.getPage(fooContextPath + FOO_GET + "intName").getWebResponse() - .getContentAsString(); - String fooInterceptorGreeting = webClient.getPage(fooContextPath + FOO_GET + "intGreeting").getWebResponse() - .getContentAsString(); - - assertEquals(fooInterceptorAnimalName, fooAnimalName); - assertEquals(fooInterceptorGreeting, fooGreeting); - assertEquals(fooGreeting, BYE); - assertEquals(fooAnimalName, "Dog"); - - // create an instance of Bar and fail if interceptor was not called - webClient.getPage(barContextPath + BAR_GET + "init"); - - String barAnimalName = webClient.getPage(barContextPath + BAR_GET + "name").getWebResponse().getContentAsString(); - String barGreeting = webClient.getPage(barContextPath + BAR_GET + "greeting").getWebResponse().getContentAsString(); - - String barInterceptorAnimalName = webClient.getPage(barContextPath + BAR_GET + "intName").getWebResponse() - .getContentAsString(); - String barInterceptorGreeting = webClient.getPage(barContextPath + BAR_GET + "intGreeting").getWebResponse() - .getContentAsString(); - - assertEquals(barInterceptorAnimalName, barAnimalName); - assertEquals(barInterceptorGreeting, barGreeting); - assertEquals(barGreeting, HELLO); - assertEquals(barAnimalName, "Cat"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/MyBinding.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/MyBinding.java deleted file mode 100644 index 1db5be305f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/MyBinding.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi.ejb; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE }) -@Retention(RUNTIME) -@Documented -@Inherited -@InterceptorBinding -public @interface MyBinding { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/MyInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/MyInterceptor.java deleted file mode 100644 index 0bc1f7160f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/interceptorLifeCycle/environment/jndi/ejb/MyInterceptor.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.interceptorLifeCycle.environment.jndi.ejb; - -import javax.naming.InitialContext; -import javax.naming.NamingException; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.Priority; -import jakarta.annotation.Resource; -import jakarta.inject.Inject; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@MyBinding -@Priority(1000) -@Interceptor -public class MyInterceptor { - - private static boolean interceptorCalled = false; - private static String greeting; - private static Animal animal; - - @Resource(name = "greeting") - private void setGreeting(String greeting) { - MyInterceptor.greeting = greeting; - } - - @Inject - private void init() throws NamingException { - MyInterceptor.animal = (Animal) InitialContext.doLookup("java:module/Animal"); - } - - public static void reset() { - greeting = null; - animal = null; - interceptorCalled = false; - } - - public static boolean isInterceptorCalled() { - return interceptorCalled; - } - - public static String getGreeting() { - return greeting; - } - - public static Animal getAnimal() { - return animal; - } - - @PostConstruct - private void intercept(InvocationContext ctx) { - interceptorCalled = true; - try { - ctx.proceed(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Airborne.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Airborne.java deleted file mode 100644 index 6456b0bb9e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Airborne.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.bindings.ejb; - -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 jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE }) -@Retention(RUNTIME) -@Documented -@InterceptorBinding -public @interface Airborne { - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/AirborneInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/AirborneInterceptor.java deleted file mode 100644 index c31bae46b0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/AirborneInterceptor.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.bindings.ejb; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.interceptor.AroundConstruct; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Airborne -@Interceptor -public class AirborneInterceptor { - - @PreDestroy - public void preDestroy(InvocationContext ctx) { - ActionSequence.addAction("preDestroy", AirborneInterceptor.class.getSimpleName()); - try { - ctx.proceed(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - - @PostConstruct - public void postConstruct(InvocationContext ctx) { - ActionSequence.addAction("postConstruct", AirborneInterceptor.class.getSimpleName()); - try { - ctx.proceed(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - - @AroundConstruct - public void aroundConstruct(InvocationContext ctx) { - ActionSequence.addAction("aroundConstruct", AirborneInterceptor.class.getSimpleName()); - try { - ctx.proceed(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/DestructionInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/DestructionInterceptor.java deleted file mode 100644 index 4417406a59..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/DestructionInterceptor.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.bindings.ejb; - -import static org.testng.Assert.assertNotNull; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.interceptor.AroundConstruct; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Destructive -@Interceptor -public class DestructionInterceptor extends SuperDestructionInterceptor { - - @PreDestroy - public void preDestroy(InvocationContext ctx) { - ActionSequence.addAction("preDestroy", DestructionInterceptor.class.getSimpleName()); - try { - ctx.proceed(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - - @PostConstruct - public void postConstruct(InvocationContext ctx) { - Rocket target = (Rocket) ctx.getTarget(); - assertNotNull(target.getFoo()); - ActionSequence.addAction("postConstruct", DestructionInterceptor.class.getSimpleName()); - try { - ctx.proceed(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - - @AroundConstruct - public void aroundConstruct(InvocationContext ctx) { - ActionSequence.addAction("aroundConstruct", DestructionInterceptor.class.getSimpleName()); - try { - ctx.proceed(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Destructive.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Destructive.java deleted file mode 100644 index aff8560bcc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Destructive.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.bindings.ejb; - -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 jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE }) -@Retention(RUNTIME) -@Documented -@InterceptorBinding -public @interface Destructive { - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Foo.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Foo.java deleted file mode 100644 index 28aa8d7c23..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Foo.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.bindings.ejb; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Foo { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Missile.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Missile.java deleted file mode 100644 index 177b2289b4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Missile.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.bindings.ejb; - -import jakarta.ejb.Stateful; - -@Airborne -@Stateful -public class Missile { - - public void fire() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Rocket.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Rocket.java deleted file mode 100644 index ea8107d6ef..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Rocket.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.bindings.ejb; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.ejb.Stateful; -import jakarta.inject.Inject; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Destructive -@Airborne -@Stateful -public class Rocket extends Weapon { - - @Inject - private Foo foo; - - public Foo getFoo() { - return foo; - } - - public void fire() { - } - - @PostConstruct - public void postConstruct() { - ActionSequence.addAction("postConstruct", Rocket.class.getSimpleName()); - } - - @PreDestroy - public void preDestroy() { - ActionSequence.addAction("preDestroy", Rocket.class.getSimpleName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/SessionBeanLifecycleInterceptorDefinitionTest.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/SessionBeanLifecycleInterceptorDefinitionTest.java deleted file mode 100644 index dd47d85142..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/SessionBeanLifecycleInterceptorDefinitionTest.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.bindings.ejb; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.INT_METHODS_FOR_LIFECYCLE_EVENT_CALLBACKS; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.INT_ORDERING_RULES; -import static org.testng.Assert.assertEquals; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "interceptors", version = "1.2") -public class SessionBeanLifecycleInterceptorDefinitionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(SessionBeanLifecycleInterceptorDefinitionTest.class) - .withBeansXml(new BeansXml().interceptors(AirborneInterceptor.class, DestructionInterceptor.class)) - .build(); - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = INT_METHODS_FOR_LIFECYCLE_EVENT_CALLBACKS, id = "b") - @SpecAssertion(section = INT_METHODS_FOR_LIFECYCLE_EVENT_CALLBACKS, id = "c") - public void testLifecycleInterception() { - - ActionSequence.reset(); - - Bean bean = getUniqueBean(Missile.class); - CreationalContext ctx = getCurrentManager().createCreationalContext(bean); - Missile missile = bean.create(ctx); - missile.fire(); - bean.destroy(missile, ctx); - - assertEquals(ActionSequence.getSequenceSize("postConstruct"), 1); - assertEquals(ActionSequence.getSequenceData("postConstruct").get(0), AirborneInterceptor.class.getSimpleName()); - assertEquals(ActionSequence.getSequenceSize("preDestroy"), 1); - assertEquals(ActionSequence.getSequenceData("preDestroy").get(0), AirborneInterceptor.class.getSimpleName()); - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = INT_METHODS_FOR_LIFECYCLE_EVENT_CALLBACKS, id = "ea") - @SpecAssertion(section = INT_METHODS_FOR_LIFECYCLE_EVENT_CALLBACKS, id = "eb") - @SpecAssertion(section = INT_METHODS_FOR_LIFECYCLE_EVENT_CALLBACKS, id = "i") - @SpecAssertion(section = INT_ORDERING_RULES, id = "i") - public void testMultipleLifecycleInterceptors() { - - ActionSequence.reset(); - - Bean bean = getUniqueBean(Rocket.class); - CreationalContext ctx = getCurrentManager().createCreationalContext(bean); - Rocket rocket = bean.create(ctx); - rocket.fire(); - bean.destroy(rocket, ctx); - - ActionSequence postConstruct = ActionSequence.getSequence("postConstruct"); - postConstruct.assertDataEquals(AirborneInterceptor.class, SuperDestructionInterceptor.class, - DestructionInterceptor.class, Weapon.class, Rocket.class); - - ActionSequence preDestroy = ActionSequence.getSequence("preDestroy"); - preDestroy.assertDataEquals(AirborneInterceptor.class, SuperDestructionInterceptor.class, DestructionInterceptor.class, - Weapon.class, Rocket.class); - - ActionSequence aroundConstruct = ActionSequence.getSequence("aroundConstruct"); - aroundConstruct.assertDataEquals(AirborneInterceptor.class, SuperDestructionInterceptor.class, - DestructionInterceptor.class); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/SuperDestructionInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/SuperDestructionInterceptor.java deleted file mode 100644 index 8e1c96f5d5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/SuperDestructionInterceptor.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.bindings.ejb; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.interceptor.AroundConstruct; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class SuperDestructionInterceptor { - - @PreDestroy - public void preDestroyS(InvocationContext ctx) { - ActionSequence.addAction("preDestroy", SuperDestructionInterceptor.class.getSimpleName()); - try { - ctx.proceed(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - - @PostConstruct - public void postConstructS(InvocationContext ctx) { - ActionSequence.addAction("postConstruct", SuperDestructionInterceptor.class.getSimpleName()); - try { - ctx.proceed(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - - @AroundConstruct - public void aroundConstructS(InvocationContext ctx) { - ActionSequence.addAction("aroundConstruct", SuperDestructionInterceptor.class.getSimpleName()); - try { - ctx.proceed(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Weapon.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Weapon.java deleted file mode 100644 index 5d1668313d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/bindings/ejb/Weapon.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.bindings.ejb; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.Dependent; - -import org.jboss.cdi.tck.util.ActionSequence; - -/** - * @author Martin Kouba - * - */ -@Dependent -public class Weapon { - - @PostConstruct - public void postConstructWeapon() { - ActionSequence.addAction("postConstruct", Weapon.class.getSimpleName()); - } - - @PreDestroy - public void preDestroyWeapon() { - ActionSequence.addAction("preDestroy", Weapon.class.getSimpleName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/Animal.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/Animal.java deleted file mode 100644 index 1e98d6b8b5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/Animal.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.ejb; - -import jakarta.inject.Inject; - -public abstract class Animal { - - @Inject - protected Bar bar; - - void foo() { - } - - public Bar getBar() { - return bar; - } - - public abstract String getAnimalType(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/AnimalInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/AnimalInterceptor.java deleted file mode 100644 index ea113b1af9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/AnimalInterceptor.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.ejb; - -import static org.testng.Assert.assertNotNull; - -import java.util.HashSet; -import java.util.Set; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -public class AnimalInterceptor { - private static Set postConstructInterceptorCalledFor = new HashSet(); - private static Set preDestroyInterceptorCalledFor = new HashSet(); - - @PostConstruct - public void postConstruct(InvocationContext ctx) { - Animal target = (Animal) ctx.getTarget(); - assertNotNull(target.getBar()); - postConstructInterceptorCalledFor.add((target).getAnimalType()); - try { - ctx.proceed(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - @AroundInvoke - public Object intercept(InvocationContext ctx) throws Exception { - if (ctx.getMethod().getName().equals("echo")) { - return ctx.proceed() + ctx.getParameters()[0].toString(); - } else { - return ctx.proceed(); - } - } - - @PreDestroy - public void preDestroy(InvocationContext ctx) { - preDestroyInterceptorCalledFor.add(((Animal) ctx.getTarget()).getAnimalType()); - try { - ctx.proceed(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public static boolean isPostConstructInterceptorCalled(String animalType) { - return postConstructInterceptorCalledFor.contains(animalType); - } - - public static boolean isPreDestroyInterceptorCalled(String animalType) { - return preDestroyInterceptorCalledFor.contains(animalType); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/Bar.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/Bar.java deleted file mode 100644 index 267f50f600..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/Bar.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.ejb; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Bar { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/Cat.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/Cat.java deleted file mode 100644 index a1bb8ac88e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/Cat.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.ejb; - -import static org.testng.Assert.assertNotNull; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.annotation.Resource; -import jakarta.ejb.Stateful; -import jakarta.ejb.TransactionAttribute; -import jakarta.ejb.TransactionAttributeType; -import jakarta.interceptor.Interceptors; -import jakarta.transaction.TransactionSynchronizationRegistry; - -@Stateful -@Interceptors(CatInterceptor.class) -public class Cat extends Animal { - - @Resource - private TransactionSynchronizationRegistry tsr; - - private static Object postConstructContext; - private static Object preDestroyContext; - - public static Object getPostConstructContext() { - return postConstructContext; - } - - public static Object getPreDestroyContext() { - return preDestroyContext; - } - - @PostConstruct - @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) - private void init() { - postConstructContext = tsr.getTransactionKey(); - assertNotNull(postConstructContext); - } - - @PreDestroy - @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) - private void die() { - preDestroyContext = tsr.getTransactionKey(); - assertNotNull(preDestroyContext); - } - - @Override - public void foo() { - } - - @Override - public String getAnimalType() { - return "Cat"; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/CatInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/CatInterceptor.java deleted file mode 100644 index db27519d29..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/CatInterceptor.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.ejb; - -import static org.testng.Assert.assertEquals; - -import javax.naming.InitialContext; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.interceptor.InvocationContext; -import jakarta.transaction.TransactionSynchronizationRegistry; - -public class CatInterceptor { - - static boolean pcCalled = false; - static boolean pdCalled = false; - - private TransactionSynchronizationRegistry tsr; - - @PostConstruct - void intercept2(InvocationContext ic) { - try { - ic.proceed(); - tsr = (TransactionSynchronizationRegistry) InitialContext.doLookup("java:comp/TransactionSynchronizationRegistry"); - } catch (Exception e) { - throw new RuntimeException(e); - } - assertEquals(tsr.getTransactionKey(), Cat.getPostConstructContext(), - "PostConstruct interceptor method invocation did NOT occur within the transaction context determined by the target method"); - pcCalled = true; - } - - @PreDestroy - void intercept3(InvocationContext ic) { - try { - ic.proceed(); - } catch (Throwable t) { - throw new RuntimeException(t); - } - assertEquals(tsr.getTransactionKey(), Cat.getPreDestroyContext(), - "PreDestroy interceptor method invocation did NOT occur within the transaction context determined by the target method"); - pdCalled = true; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/LifecycleCallbackInterceptorTest.java b/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/LifecycleCallbackInterceptorTest.java deleted file mode 100644 index 63b4ce7c26..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/interceptors/tests/contract/lifecycleCallback/ejb/LifecycleCallbackInterceptorTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.interceptors.tests.contract.lifecycleCallback.ejb; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.interceptors.InterceptorsSections.INT_METHODS_FOR_LIFECYCLE_EVENT_CALLBACKS; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "interceptors", version = "1.2") -public class LifecycleCallbackInterceptorTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(LifecycleCallbackInterceptorTest.class) - .build(); - } - - @SuppressWarnings("unchecked") - private void createAndDestroyInstance(Class clazz) { - Bean bean = getUniqueBean(clazz); - CreationalContext ctx = getCurrentManager().createCreationalContext(bean); - T instance = (T) getCurrentManager().getReference(bean, clazz, ctx); - instance.foo(); // invoke method so that the instance is actually created - // destroy the instance - bean.destroy(instance, ctx); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = INT_METHODS_FOR_LIFECYCLE_EVENT_CALLBACKS, id = "h") - public void testLifecycleCallbackInterceptorTransactionContext() { - createAndDestroyInstance(Cat.class); - // checks are done in CatInterceptor - assertTrue(CatInterceptor.pcCalled); - assertTrue(CatInterceptor.pdCalled); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/jaxrs/JaxRsActivator.java b/web/src/main/java/org/jboss/cdi/tck/jaxrs/JaxRsActivator.java deleted file mode 100644 index 6694eba350..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/jaxrs/JaxRsActivator.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.jaxrs; - -import jakarta.ws.rs.ApplicationPath; -import jakarta.ws.rs.core.Application; - -/** - * "no XML" approach to activate JAX-RS application. - * - * @author Martin Kouba - */ -@ApplicationPath("/rest") -public class JaxRsActivator extends Application { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/selenium/ChromeDevtoolsDriver.java b/web/src/main/java/org/jboss/cdi/tck/selenium/ChromeDevtoolsDriver.java deleted file mode 100644 index f72b1173d9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/selenium/ChromeDevtoolsDriver.java +++ /dev/null @@ -1,554 +0,0 @@ -/** - * Copyright Werner Punz - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Original code stemming 100% from me, hence relicense from EPL -package org.jboss.cdi.tck.selenium; - -import java.net.URI; -import java.net.URLDecoder; -import java.nio.charset.StandardCharsets; -import java.util.*; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.function.BiFunction; -import java.util.function.Predicate; -import java.util.function.Supplier; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.stream.Stream; - -import org.apache.commons.io.output.NullOutputStream; -import org.openqa.selenium.*; -import org.openqa.selenium.chrome.ChromeDriver; -import org.openqa.selenium.chrome.ChromeDriverLogLevel; -import org.openqa.selenium.chrome.ChromeDriverService; -import org.openqa.selenium.chrome.ChromeOptions; -import org.openqa.selenium.chromium.ChromiumNetworkConditions; -import org.openqa.selenium.devtools.DevTools; -import org.openqa.selenium.devtools.v108.network.Network; -import org.openqa.selenium.devtools.v108.network.model.Request; -import org.openqa.selenium.devtools.v108.network.model.RequestId; -import org.openqa.selenium.devtools.v108.network.model.ResponseReceived; -import org.openqa.selenium.devtools.v108.network.model.TimeSinceEpoch; -import org.openqa.selenium.html5.LocalStorage; -import org.openqa.selenium.html5.Location; -import org.openqa.selenium.html5.SessionStorage; -import org.openqa.selenium.interactions.Sequence; -import org.openqa.selenium.logging.EventType; -import org.openqa.selenium.mobile.NetworkConnection; -import org.openqa.selenium.print.PrintOptions; -import org.openqa.selenium.remote.*; -import org.openqa.selenium.virtualauthenticator.VirtualAuthenticator; -import org.openqa.selenium.virtualauthenticator.VirtualAuthenticatorOptions; - -import io.github.bonigarcia.wdm.WebDriverManager; - -/** - * Extended driver which we need for getting - * the http response code - * and the http response - * without having to revert to proxy solutions - *

- * We need access top the response body and response - * code from always the last access - *

- * We use the chrome dev tools to access the data but we isolate - * the new functionality in an interface, so other drivers must apply something different - * to get the results - * - * @see also https://medium.com/codex/selenium4-a-peek-into-chrome-devtools-92bca6de55e0 - */ - -class HttpCycleData { - public RequestId requestId; - public Request request; - public ResponseReceived responseReceived; -} - -@SuppressWarnings("unused") -public class ChromeDevtoolsDriver implements ExtendedWebDriver { - - ChromeDriver delegate; - - List cycleData = new CopyOnWriteArrayList<>(); - - String lastGet; - - public ChromeDevtoolsDriver(ChromeOptions options) { - ChromeDriverService chromeDriverService = new ChromeDriverService.Builder().build(); - - chromeDriverService.sendOutputTo(NullOutputStream.NULL_OUTPUT_STREAM); - delegate = new ChromeDriver(chromeDriverService, options); - } - - /** - * initializes the extended functionality - */ - public void postInit() { - DevTools devTools = getDevTools(); - //we store always the last request for further reference - initNetworkListeners(devTools); - initDevTools(devTools); - disableCache(devTools); - } - - private static void disableCache(DevTools devTools) { - devTools.send(Network.setCacheDisabled(true)); - } - - private static void initDevTools(DevTools devTools) { - try { - devTools.createSession(); - devTools.send(Network.clearBrowserCache()); - } catch (TimeoutException ex) { - Logger log = Logger.getLogger(ChromeDevtoolsDriver.class.getName()); - log.warning("Init timeout error, can happen, " + - "if the driver already has been used, can be safely ignore"); - } - devTools.send(Network.enable(Optional.empty(), Optional.empty(), Optional.empty())); - } - - private void initNetworkListeners(DevTools devTools) { - devTools.addListener(Network.requestWillBeSent(), - entry -> { - // the jsf ajax only targets itself - // that way we can filter out resource requests early - if (!entry.getRequest().getUrl().contains(lastGet)) { - return; - } - HttpCycleData data = new HttpCycleData(); - data.requestId = entry.getRequestId(); - data.request = entry.getRequest(); - cycleData.add(data); - }); - devTools.addListener(Network.responseReceived(), entry -> { - RequestId requestId = entry.getRequestId(); - //only in case of a match we add response to request - //so we only cover our ajax cycle and the original get - Optional found = cycleData.stream() - .filter(item -> item.requestId.toJson().equals(requestId.toJson())).findFirst(); - found.ifPresent(httpCycleData -> httpCycleData.responseReceived = entry); - }); - } - - public Capabilities getCapabilities() { - return delegate.getCapabilities(); - } - - public void setFileDetector(FileDetector detector) { - delegate.setFileDetector(detector); - } - - public void onLogEvent(EventType kind) { - delegate.onLogEvent(kind); - } - - public void register(Predicate whenThisMatches, Supplier useTheseCredentials) { - delegate.register(whenThisMatches, useTheseCredentials); - } - - public LocalStorage getLocalStorage() { - return delegate.getLocalStorage(); - } - - public SessionStorage getSessionStorage() { - return delegate.getSessionStorage(); - } - - public Location location() { - return delegate.location(); - } - - public void setLocation(Location location) { - delegate.setLocation(location); - } - - public NetworkConnection.ConnectionType getNetworkConnection() { - return delegate.getNetworkConnection(); - } - - public NetworkConnection.ConnectionType setNetworkConnection(NetworkConnection.ConnectionType type) { - return delegate.setNetworkConnection(type); - } - - public void launchApp(String id) { - delegate.launchApp(id); - } - - public Map executeCdpCommand(String commandName, Map parameters) { - return delegate.executeCdpCommand(commandName, parameters); - } - - public Optional maybeGetDevTools() { - return delegate.maybeGetDevTools(); - } - - public List> getCastSinks() { - return delegate.getCastSinks(); - } - - public String getCastIssueMessage() { - return delegate.getCastIssueMessage(); - } - - public void selectCastSink(String deviceName) { - delegate.selectCastSink(deviceName); - } - - public void startDesktopMirroring(String deviceName) { - delegate.startDesktopMirroring(deviceName); - } - - public void startTabMirroring(String deviceName) { - delegate.startTabMirroring(deviceName); - } - - public void stopCasting(String deviceName) { - delegate.stopCasting(deviceName); - } - - public void setPermission(String name, String value) { - delegate.setPermission(name, value); - } - - public ChromiumNetworkConditions getNetworkConditions() { - return delegate.getNetworkConditions(); - } - - public void setNetworkConditions(ChromiumNetworkConditions networkConditions) { - delegate.setNetworkConditions(networkConditions); - } - - public void deleteNetworkConditions() { - delegate.deleteNetworkConditions(); - } - - public SessionId getSessionId() { - return delegate.getSessionId(); - } - - public ErrorHandler getErrorHandler() { - return delegate.getErrorHandler(); - } - - public void setErrorHandler(ErrorHandler handler) { - delegate.setErrorHandler(handler); - } - - public CommandExecutor getCommandExecutor() { - return delegate.getCommandExecutor(); - } - - public void get(String url) { - lastGet = url; - delegate.get(url); - } - - public String getTitle() { - return delegate.getTitle(); - } - - public String getCurrentUrl() { - return delegate.getCurrentUrl(); - } - - public X getScreenshotAs(OutputType outputType) throws WebDriverException { - return delegate.getScreenshotAs(outputType); - } - - public Pdf print(PrintOptions printOptions) throws WebDriverException { - return delegate.print(printOptions); - } - - public WebElement findElement(By locator) { - return delegate.findElement(locator); - } - - public List findElements(By locator) { - return delegate.findElements(locator); - } - - public List findElements(SearchContext context, BiFunction findCommand, - By locator) { - return delegate.findElements(context, findCommand, locator); - } - - public String getPageSource() { - return delegate.getPageSource(); - } - - public String getPageText() { - String head = delegate.findElement(By.tagName("head")).getAttribute("innerText").replaceAll("[\\s\\n ]", " "); - String body = delegate.findElement(By.tagName("body")).getAttribute("innerText").replaceAll("[\\s\\n ]", " "); - return head + " " + body; - } - - public String getPageTextReduced() { - String head = delegate.findElement(By.tagName("head")).getAttribute("innerText"); - String body = delegate.findElement(By.tagName("body")).getAttribute("innerText"); - //handle blanks and nbsps - return (head + " " + body).replaceAll("[\\s\\u00A0]+", " "); - } - - /** - * resets the current tab and gives it a clean slate - * that way we do not have to build up the entire tab again - */ - public void reset() { - DevTools devTools = delegate.getDevTools(); - devTools.clearListeners(); - devTools.send(Network.clearBrowserCookies()); // just to be sure w clear out all cookies - devTools.disconnectSession(); //This kills off the existing session - - cycleData.clear(); - lastGet = null; - } - - /** - * closes the current tab for good, this has been problematic - * when the last or only tab was closes for recycling - * apparently we run into dev tools timeouts then - * hence reset now is the preferred way to recycle tabs instead - * of using close - */ - public void close() { - reset(); - delegate.close(); - } - - /** - * quits the driver entirely - */ - public void quit() { - delegate.quit(); - } - - public Set getWindowHandles() { - return delegate.getWindowHandles(); - } - - public String getWindowHandle() { - return delegate.getWindowHandle(); - } - - public Object executeScript(String script, Object... args) { - return delegate.executeScript(script, args); - } - - public Object executeAsyncScript(String script, Object... args) { - return delegate.executeAsyncScript(script, args); - } - - public TargetLocator switchTo() { - return delegate.switchTo(); - } - - public Navigation navigate() { - return delegate.navigate(); - } - - public Options manage() { - return delegate.manage(); - } - - public void setLogLevel(Level level) { - delegate.setLogLevel(level); - } - - public void perform(Collection actions) { - delegate.perform(actions); - } - - public void resetInputState() { - delegate.resetInputState(); - } - - public VirtualAuthenticator addVirtualAuthenticator(VirtualAuthenticatorOptions options) { - return delegate.addVirtualAuthenticator(options); - } - - public void removeVirtualAuthenticator(VirtualAuthenticator authenticator) { - delegate.removeVirtualAuthenticator(authenticator); - } - - public FileDetector getFileDetector() { - return delegate.getFileDetector(); - } - - public ScriptKey pin(String script) { - return delegate.pin(script); - } - - public void unpin(ScriptKey key) { - delegate.unpin(key); - } - - public Set getPinnedScripts() { - return delegate.getPinnedScripts(); - } - - public Object executeScript(ScriptKey key, Object... args) { - return delegate.executeScript(key, args); - } - - public void register(Supplier alwaysUseTheseCredentials) { - delegate.register(alwaysUseTheseCredentials); - } - - public DevTools getDevTools() { - return delegate.getDevTools(); - } - - @Override - public int getResponseStatus() { - try { - HttpCycleData data = getLastGetData(); - if (data == null) { - return -1; - } - if (data.responseReceived == null) { - return -1; - } - return data.responseReceived.getResponse().getStatus(); - } catch (java.util.NoSuchElementException ex) { - return -1; - } - } - - @Override - public String getResponseBody() { - HttpCycleData data = getLastGetData(); - return delegate.getDevTools().send(Network.getResponseBody(data.requestId)).getBody(); - } - - public String getRequestData() { - HttpCycleData data = getLastGetData(); - return data.request.getPostData().orElse(""); - } - - public String[] getRequestDataAsArray() { - String requestData = getRequestData(); - String[] splitData = requestData.split("&"); - return Stream.of(splitData) - .map((String keyVal) -> URLDecoder.decode(keyVal, StandardCharsets.UTF_8)) - .toArray(String[]::new); - } - - private HttpCycleData getLastGetData() { - sortResponses(); - - return cycleData.stream().filter(item -> item.request.getUrl().contains(lastGet)) - // missing last api - .reduce((item1, item2) -> item2).orElse(null); - } - - private void sortResponses() { - //we sort by response timestamps, with items with no response being first - //last response always being the one at the bottom - cycleData.sort((o1, o2) -> { - if (o1.responseReceived == null) { - return -1; - } - if (o2.responseReceived == null) { - return 1; - } - return Long.compare(o1.responseReceived.getTimestamp().toJson().longValue(), - o2.responseReceived.getTimestamp().toJson().longValue()); - }); - } - - public void printProcessedResponses() { - sortResponses(); - - cycleData.stream().filter(item -> item.responseReceived != null) - // missing last api - .forEach(item -> { - System.out.println("Url: " + item.request.getUrl()); - System.out.println("RequestId: " + item.requestId.toJson()); - Optional responseTime = item.responseReceived.getResponse().getResponseTime(); - System.out.println("ResponseTime: " + responseTime.orElse(new TimeSinceEpoch(-1))); - System.out.println("ResponseStatus: " + item.responseReceived.getResponse().getStatus()); - }); - } - - public ChromeDriver getDelegate() { - return delegate; - } - - @Override - public JavascriptExecutor getJSExecutor() { - return delegate; - } - - /* - * we only want the cdp version warning once, now matter how - * often the driver is called - * if not wanted at all the selenium webdriver version must match the browser version - */ - static AtomicBoolean firstLog = new AtomicBoolean(Boolean.TRUE); - - public static ExtendedWebDriver stdInit() { - Locale.setDefault(new Locale("en", "US")); - WebDriverManager.chromedriver().setup(); - initCDPVersionMessageFilter(); - - ChromeOptions options = new ChromeOptions(); - - // we can turn on a visual browser by - // adding chromedriver.headless = false to our properties - // default is headless = true - if (System.getProperty("chromedriver.headless") == null || - "true".equals(System.getProperty("chromedriver.headless"))) { - options.addArguments("--headless"); - } - options.addArguments("--no-sandbox"); - options.addArguments("--disable-web-security"); - options.addArguments("--allow-insecure-localhost"); - options.addArguments("--remote-allow-origins=*"); - options.addArguments("--ignore-urlfetcher-cert-requests"); - options.addArguments("--auto-open-devtools-for-tabs"); - options.addArguments("--disable-gpu"); - Map prefs = new HashMap<>(); - prefs.put("intl.accept_languages", "en"); - options.setExperimentalOption("prefs", prefs); - options.addArguments("--lang=en"); - - options.setLogLevel(ChromeDriverLogLevel.OFF); - - ExtendedWebDriver driver = new ChromeDevtoolsDriver(options); - driver.manage().timeouts().implicitlyWait(WebPage.STD_TIMEOUT); - driver.manage().timeouts().pageLoadTimeout(WebPage.STD_TIMEOUT); - driver.manage().timeouts().scriptTimeout(WebPage.STD_TIMEOUT); - - return driver; - } - - private static void initCDPVersionMessageFilter() { - Logger logger = Logger.getLogger("org.openqa.selenium.devtools.CdpVersionFinder"); - - logger.setFilter(record -> { - //report the match warning only once, this suffices - boolean isMatchWarning = record.getMessage().contains("Unable to find an exact match for CDP version"); - if (isMatchWarning && !firstLog.get()) { - return false; - } - if (isMatchWarning) { - firstLog.set(false); - } - return true; - }); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/selenium/DriverPool.java b/web/src/main/java/org/jboss/cdi/tck/selenium/DriverPool.java deleted file mode 100644 index 9e56e9c047..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/selenium/DriverPool.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Copyright Werner Punz - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Original code stemming 100% from me, hence relicense from EPL -package org.jboss.cdi.tck.selenium; - -import java.util.concurrent.ConcurrentLinkedQueue; - -/** - * a helper class providing pool management for our drivers - * Note, the pool itself is thread safe (and must be), the drivers are not! - */ -@SuppressWarnings("unused") -public class DriverPool { - - ConcurrentLinkedQueue allDrivers = new ConcurrentLinkedQueue<>(); - ConcurrentLinkedQueue availableDrivers = new ConcurrentLinkedQueue<>(); - - /** - * creates or activates a new driver instance - * - * @return a new or recycled driver instance - */ - public synchronized ExtendedWebDriver getOrNewInstance() { - //synchronized to avoid get race conditions.... there is a non synchonzed part between the check and remove - //to make this easy we simply synchronize the get to fix it - ExtendedWebDriver webDriver = (availableDrivers.size() > 0) ? availableDrivers.remove() : null; - if (webDriver == null) { - webDriver = ChromeDevtoolsDriver.stdInit(); - allDrivers.add(webDriver); - } - - webDriver.postInit(); - return webDriver; - } - - /** - * resets a driver and keeps it in the pool for recycling - * - * @param driver - */ - public void returnInstance(ExtendedWebDriver driver) { - driver.reset(); - availableDrivers.add(driver); - } - - /** - * closes a driver but keeps it in the pool - * - * @param driver - */ - public void returnAndCloseInstance(ExtendedWebDriver driver) { - driver.close(); - availableDrivers.add(driver); - } - - /** - * quits a driver and removes it from the pool - * - * @param driver - */ - public void quitInstance(ExtendedWebDriver driver) { - driver.quit(); - allDrivers.remove(driver); - } - - public void removeInstance(ExtendedWebDriver driver) { - allDrivers.remove(driver); - } - - /** - * cleans up the pool - */ - public void quitAll() { - allDrivers.stream().forEach(webDriver -> webDriver.quit()); - allDrivers.clear(); - availableDrivers.clear(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/selenium/ExtendedWebDriver.java b/web/src/main/java/org/jboss/cdi/tck/selenium/ExtendedWebDriver.java deleted file mode 100644 index f36f8cc512..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/selenium/ExtendedWebDriver.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Copyright Werner Punz - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Original code stemming 100% from me, hence relicense from EPL - -package org.jboss.cdi.tck.selenium; - -import org.openqa.selenium.JavascriptExecutor; -import org.openqa.selenium.WebDriver; - -/** - * an extended web driver interface which takes the response into consideration - * selenium does not have an official api but several webdrivers - * allow access to the data via various means - * - * Another possibility would have been a proxy, but I could not find any properly - * working proxy for selenium - */ -public interface ExtendedWebDriver extends WebDriver { - - /** - * gets the response status of the last response (of the last triggered request against get) - * - * @return - */ - int getResponseStatus(); - - /** - * gets the last response as body - * - * @return - */ - String getResponseBody(); - - /** - * @return the request post data as string - */ - public String getRequestData(); - - /** - * postinit call for tests - */ - void postInit(); - - /** - * gets the internal webdriver delegate - * - * @return - */ - WebDriver getDelegate(); - - /** - * returns a reference to the Selenium JS Executor of this webdriver - * - * @return - */ - JavascriptExecutor getJSExecutor(); - - /** - * @return the innerText of the Page - */ - String getPageText(); - - /** - * returns the innerText of the page in a blank reduced state (more than one blank is reduced to one - * invisible blanks like nbsp are replaced by normal blanks) - * - * @return - */ - String getPageTextReduced(); - - /** - * debugging helper which allows to look into the processed response data - */ - void printProcessedResponses(); - - /** - * quits the driver engine - */ - void quit(); - - /** - * closes the current tab - */ - void close(); - - /** - * resets the current page to its initial stage before the page load - * without dropping the engine or closing it - */ - void reset(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/selenium/WebPage.java b/web/src/main/java/org/jboss/cdi/tck/selenium/WebPage.java deleted file mode 100644 index ef15c8160c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/selenium/WebPage.java +++ /dev/null @@ -1,471 +0,0 @@ -/** - * Copyright Werner Punz - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Original code stemming 100% from me, hence relicense from EPL -package org.jboss.cdi.tck.selenium; - -import java.time.Duration; -import java.util.List; -import java.util.Set; -import java.util.function.Function; - -import org.openqa.selenium.*; -import org.openqa.selenium.support.ui.ExpectedCondition; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.WebDriverWait; - -/** - * Mimics the html unit webpage - */ -public class WebPage { - - public static final Duration STD_TIMEOUT = Duration.ofMillis(8000); - public static final Duration LONG_TIMEOUT = Duration.ofMillis(16000); - - protected ExtendedWebDriver webDriver; - - public WebPage(ExtendedWebDriver webDriver) { - this.webDriver = webDriver; - } - - public ExtendedWebDriver getWebDriver() { - return webDriver; - } - - public void setWebDriver(ExtendedWebDriver webDriver) { - this.webDriver = webDriver; - } - - /** - * implemented helper to wait for the background javascript - * - * @param timeout the standard timeout to wait in case the condition is not executed - */ - public void waitForBackgroundJavascript(Duration timeout) { - this.waitForBackgroundJavascript(timeout, Duration.ZERO); - } - - /** - * This method fixes following issue: While we wait for javascripts - * we cannot be entirely sure, that the execution has fully terminated. - * The problem is asynchronous code, which opens execution windows. - * HTML Unit does not have the problem, because it never executes the code - * in a separate process and has full track of the execution "windows" - * - * There is no way to fix this, given the asynchronous nature of the Selenium drivers. - * The best bet is simply to give the possibility of another wait delay, - * after the supposed execution end, and also use waitForCondition with a dom - * check wherever possible (aka dom changes happen) - * - * @param timeout the timeout until the wait is terminated max - * @param delayAfterExcecution this introduces a second delay after the determined - * end of exeuction point. - */ - public void waitForBackgroundJavascript(Duration timeout, Duration delayAfterExcecution) { - synchronized (webDriver) { - WebDriverWait wait = new WebDriverWait(webDriver, timeout); - double rand = Math.random(); - @SuppressWarnings("UnnecessaryLabelJS") - final String identifier = "__insert__:" + rand; - webDriver.manage().timeouts().scriptTimeout(timeout); - // We use a trick here, javascript is cooperative multitasking - // we defer into a time when the script is executed - // and then execute a small invisible script adding an element - // At the time the element gets added, we are either at an end of execution - // phase or in an execution pause (timeouts maybe pending etc...) - try { - webDriver.getJSExecutor().executeAsyncScript( - "let [resolve] = arguments; setTimeout(function() { var insert__ = document.createElement('div');" + - "insert__.id = '" + identifier + "';" + - "insert__.innerHTML = 'done';" + - "document.body.append(insert__); resolve()}, 50);"); - - wait.until(ExpectedConditions.numberOfElementsToBeMoreThan(By.id(identifier), 0)); - // problem is here, if we are in a code pause phase (aka timeout is pending but not executed) - // we are still not at the end of the code. For those cases a simple wait on top might fix the issue - // we cannot determine the end of the execution here anymore. - if (!delayAfterExcecution.isZero()) { - wait(delayAfterExcecution); - } - } finally { - webDriver.getJSExecutor() - .executeScript("document.body.removeChild(document.getElementById('" + identifier + "'));"); - } - } - } - - /** - * waits for a certain condition is met, until a timeout is hit. - * In case of exceeding the condition, a runtime exception is thrown! - * - * @param isTrue the condition lambda to check - * @param timeout timeout duration - */ - public void waitForCondition(Function isTrue, Duration timeout) { - synchronized (webDriver) { - WebDriverWait wait = new WebDriverWait(webDriver, timeout); - wait.until(isTrue); - } - } - - /** - * The same as before, but with the long default timeout of LONG_TIMEOUT (16000ms) - * - * @param isTrue condition lambda - */ - public void waitForCondition(Function isTrue) { - synchronized (webDriver) { - WebDriverWait wait = new WebDriverWait(webDriver, LONG_TIMEOUT); - wait.until(isTrue); - } - } - - /** - * Wait for a certain period of time - * - * @param timeout the timeout to wait (note due to the asynchronous nature - * of the web drivers, any code running on the browser itself - * will proceed (aka javascript) - * only the client operations are stalled. - */ - public void wait(Duration timeout) { - synchronized (webDriver) { - try { - webDriver.wait(timeout.toMillis()); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - } - } - - /** - * waits until no more running requests are present - * in case of exceeding our STD_TIMEOUT, a runtime exception is thrown - */ - public void waitForCurrentRequestEnd() { - waitForCondition(webDriver1 -> webDriver.getResponseStatus() != -1, STD_TIMEOUT); - } - - /** - * wait for the current request to be ended, with a timeout of "timeout" - * - * @param timeout the timeout for the waiting, if it is exceeded a timeout exception is thrown - */ - public void waitForCurrentRequestEnd(Duration timeout) { - waitForCondition(webDriver1 -> webDriver.getResponseStatus() != -1, timeout); - } - - /** - * wait until the current Ajax request targeting the same page - * has stopped and then tests for blocking running scripts - * still running. - * A small initial delay cannot hurt either - */ - public void waitReqJs() { - this.waitReqJs(STD_TIMEOUT); - } - - /** - * same as before but with a dedicated timeout - * - * @param timeout the timeout duration after that the wait is cancelled - * and an exception is thrown - */ - public void waitReqJs(Duration timeout) { - // We stall the connection between browser and client for 200ms to make sure everything - // is done (usually a request takes between 6 and 20ms), but - // Note, if you have long-running request, I recommend to wait for a condition instead - this.wait(Duration.ofMillis(200)); - - // just in case the request takes longer, we also check the request queue for the current request to end - waitForCurrentRequestEnd(timeout); - - // we stall the tests at another 100ms simply to make sure everything has been properly executed - // this reduces the chance to fall into an execution window significantly, but does not eliminate it entirely - waitForBackgroundJavascript(timeout, Duration.ofMillis(100)); - } - - /** - * waits for backgrounds processes on the browser to complete - * - * @param timeOut the timeout duration until the wait can proceed before being interupopted - */ - public void waitForPageToLoad(Duration timeOut) { - ExpectedCondition expectation = driver -> webDriver.getJSExecutor() - .executeScript("return document.readyState").equals("complete"); - synchronized (webDriver) { - WebDriverWait wait = new WebDriverWait(webDriver, timeOut); - wait.until(expectation); - } - } - - /** - * wait until the page load is finished - */ - public void waitForPageToLoad() { - waitForPageToLoad(STD_TIMEOUT); - } - - /** - * conditional waiter and checker which checks whether the page text is present - * we add our own waiter internally, because pageSource always delivers - * - * @param text to check - * @return true in case of found false in case of found after our standard timeout is reached - */ - public boolean isInPageText(String text) { - try { - //values are not returned by getPageText - String values = getInputValues(); - - waitForCondition(webDriver1 -> (webDriver.getPageText() + values).contains(text), STD_TIMEOUT); - return true; - } catch (TimeoutException ex) { - //timeout is wanted in this case and should result in a false - return false; - } - } - - public boolean isInPageTextReduced(String text) { - try { - String values = getInputValues(); - waitForCondition(webDriver1 -> (webDriver.getPageTextReduced() + values.replaceAll("\\s+", " ")).contains(text), - STD_TIMEOUT); - return true; - } catch (TimeoutException ex) { - //timeout is wanted in this case and should result in a false - return false; - } - } - - public boolean matchesPageText(String regexp) { - try { - waitForCondition(webDriver1 -> webDriver.getPageText().matches(regexp), STD_TIMEOUT); - return true; - } catch (TimeoutException ex) { - //timeout is wanted in this case and should result in a false - return false; - } - } - - /** - * adds the reduced page text functionality to the regexp match - * - * @param regexp - * @return - */ - public boolean matchesPageTextReduced(String regexp) { - try { - waitForCondition(webDriver1 -> webDriver.getPageTextReduced().matches(regexp), STD_TIMEOUT); - return true; - } catch (TimeoutException ex) { - //timeout is wanted in this case and should result in a false - return false; - } - } - - /** - * conditional waiter and checker which checks whether a text is not in the page - * we add our own waiter internally, because pageSource always delivers - * - * @param text to check - * @return true in case of found false in case of found after our standard timeout is reached - */ - public boolean isNotInPageText(String text) { - try { - String values = getInputValues(); - waitForCondition(webDriver1 -> !(webDriver.getPageText() + values).contains(text), STD_TIMEOUT); - return true; - } catch (TimeoutException ex) { - //timeout is wanted in this case and should result in a false - return false; - } - } - - /** - * conditional waiter and checker which checks whether a text is in the page - * we add our own waiter internally, because pageSource always delivers - * this version of isInPage checks explicitly the full markup not only the text - * - * @param text to check - * @return true in case of found false in case of found after our standard timeout is reached - */ - public boolean isInPage(String text) { - try { - String values = getInputValues(); - waitForCondition(webDriver1 -> (webDriver.getPageSource() + values).contains(text), STD_TIMEOUT); - return true; - } catch (TimeoutException ex) { - //timeout is wanted in this case and should result in a false - return false; - } - } - - /** - * conditional waiter and checker which checks whether a text is not in the page - * we add our own waiter internally, because pageSource always delivers - * we need to add two different condition checkers herte because - * a timeout automatically throws internally an error which is mapped to false - * We therefore cannot simply wait for the condition either being met or timeout - * with one method - * - * @param text to check - * @return true in case of found false in case of found after our standard timeout is reached - */ - public boolean isNotInPage(String text) { - try { - String values = getInputValues(); - waitForCondition(webDriver1 -> !(webDriver.getPageSource() + values).contains(text), STD_TIMEOUT); - return true; - } catch (TimeoutException ex) { - //timeout is wanted in this case and should result in a false - return false; - } - } - - /** - * conditional waiter and checker which checks whether a text is in the page - * we add our own waiter internally, because pageSource always delivers - * we need to add two different condition checkers herte because - * a timeout automatically throws internally an error which is mapped to false - * We therefore cannot simply wait for the condition either being met or timeout - * with one method - * - * @param text to check - * @return true in case of found false in case of found after our standard timeout is reached - */ - public boolean isInPage(String text, boolean allowExceptions) { - try { - String values = getInputValues(); - waitForCondition(webDriver1 -> (webDriver.getPageSource() + values).contains(text), STD_TIMEOUT); - return true; - } catch (TimeoutException exception) { - if (allowExceptions) { - throw exception; - } - exception.printStackTrace(); - return false; - } - } - - /** - * is condition reached or not reached after until a STD_TIMEOUT is reached - * if the timeout is exceeded the condition is not met - * - * @param isTrue the isTrue condition lambda - * @return true if it is met until STD_TIMEOUT, otherwise false - */ - public boolean isCondition(Function isTrue) { - try { - waitForCondition(isTrue, STD_TIMEOUT); - return true; - } catch (TimeoutException ex) { - //timeout is wanted in this case and should result in a false - return false; - } - } - - public WebElement findElement(By by) { - return webDriver.findElement(by); - } - - public List findElements(By by) { - return webDriver.findElements(by); - } - - public int getResponseStatus() { - return webDriver.getResponseStatus(); - } - - public String getResponseBody() { - return webDriver.getResponseBody(); - } - - public String getRequestData() { - return webDriver.getRequestData(); - } - - public void postInit() { - webDriver.postInit(); - } - - public JavascriptExecutor getJSExecutor() { - return webDriver.getJSExecutor(); - } - - public void printProcessedResponses() { - webDriver.printProcessedResponses(); - } - - public void get(String url) { - webDriver.get(url); - } - - public String getCurrentUrl() { - return webDriver.getCurrentUrl(); - } - - public String getTitle() { - return webDriver.getTitle(); - } - - public String getPageSource() { - return webDriver.getPageSource(); - } - - public void close() { - webDriver.close(); - } - - public void quit() { - webDriver.quit(); - } - - public Set getWindowHandles() { - return webDriver.getWindowHandles(); - } - - public String getWindowHandle() { - return webDriver.getWindowHandle(); - } - - public WebDriver.TargetLocator switchTo() { - return webDriver.switchTo(); - } - - public WebDriver.Navigation navigate() { - return webDriver.navigate(); - } - - public WebDriver.Options manage() { - return webDriver.manage(); - } - - /** - * Convenience method to get all anchor elmements - * - * @return a list of a hrefs as WebElements - */ - public List getAnchors() { - return webDriver.findElements(By.cssSelector("a[href]")); - } - - private String getInputValues() { - return webDriver.findElements(By.cssSelector("input, textarea, select")) - .stream() - .map(webElement -> webElement.getAttribute("value")) - .reduce("", (str1, str2) -> str1 + " " + str2); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/shrinkwrap/ee/DummySessionBean.java b/web/src/main/java/org/jboss/cdi/tck/shrinkwrap/ee/DummySessionBean.java deleted file mode 100644 index 4e9a343216..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/shrinkwrap/ee/DummySessionBean.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.shrinkwrap.ee; - -import jakarta.ejb.Stateless; - -/** - * Dummy session bean used to make every EJB module true EJB module (JBoss AS7 sub-deployment). - * - * See also Test EAR deploys on AS7, but test config can't be - * found or War classes cannot see EJB classes threads. - * - * @author Martin Kouba - */ -@Stateless(name = "org.jboss.cdi.tck.shrinkwrap.DummySessionBean") -public class DummySessionBean { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/shrinkwrap/ee/EnterpriseArchiveBuilder.java b/web/src/main/java/org/jboss/cdi/tck/shrinkwrap/ee/EnterpriseArchiveBuilder.java deleted file mode 100644 index 4181c2f69e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/shrinkwrap/ee/EnterpriseArchiveBuilder.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.shrinkwrap.ee; - -import org.jboss.cdi.tck.TestGroups; -import org.jboss.cdi.tck.shrinkwrap.ArchiveBuilder; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.spec.se.manifest.ManifestDescriptor; - -/** - * ShrinkWrap {@link EnterpriseArchive} builder for CDI TCK Arquillian test. This builder is intended to provide basic - * functionality covering common TCK needs. Use shrinkwrap API to adapt archive to advanced scenarios. - *

- * Test classes are added to EJB module. - *

- *

Default and custom web module

- *

- * The default web module is defined in order to build portable EE archive - it has to contain Class-Path entry in the - * MANIFEST.MF to state module dependency (see Class Loading Requirements in Java EE spec). Custom web module is not supported - * directly however its possible to build such module with shrinkwrap API and add it to final enterprise archive. It is - * necessary to omit default web module using {@link #noDefaultWebModule()} as long as custom web module is used since - * arquillian cannot handle in-container test packaged as EAR with multiple web modules at the moment (cannot determine which - * web module to enrich). - *

- *

application.xml

- *

- * The application.xml descriptor is not supported as it is no longer required (Java EE 5, Java EE 6). Use - * shrinkwrap API to add custom application.xml descriptor. - *

- *

Use case

- *

- * Use enterprise archive in TCK tests only while: - *

- *
    - *
  • explicitly testing EAR structure
  • - *
  • testing Java EE full profile (e.g. EJB timer service, MDBs)
  • - *
- *

- * Tests that use {@link EnterpriseArchiveBuilder} must belong to {@link TestGroups#JAVAEE_FULL} group. - *

- * - * @author Martin Kouba - */ -public class EnterpriseArchiveBuilder extends ArchiveBuilder { - - public static final String DEFAULT_APP_VERSION = "6"; - - public static final String DEFAULT_EAR_NAME = "test.ear"; - - public static final String DEFAULT_EJB_MODULE_NAME = "test-ejb.jar"; - - private boolean hasDefaultWebModule = true; - - private String ejbModuleName = null; - - /** - * Do not add default web module. - * - * @return self - */ - public EnterpriseArchiveBuilder noDefaultWebModule() { - this.hasDefaultWebModule = false; - return self(); - } - - public EnterpriseArchiveBuilder withEjbModuleName(String ejbModuleName) { - this.ejbModuleName = ejbModuleName; - return self(); - } - - @Override - public EnterpriseArchiveBuilder self() { - return this; - } - - @Override - protected EnterpriseArchive buildInternal() { - - EnterpriseArchive enterpriseArchive = null; - - if (getName() == null) { - // Let arquillian generate archive name in order to avoid reload issues in AS7 (AS7-1638) - // enterpriseArchive = ShrinkWrap.create(EnterpriseArchive.class, DEFAULT_EAR_NAME); - String hash = getSha1OfTestClass(); - if (hash != null) { - enterpriseArchive = ShrinkWrap.create(EnterpriseArchive.class, hash + ".ear"); - } else { - enterpriseArchive = ShrinkWrap.create(EnterpriseArchive.class); - } - } else { - enterpriseArchive = ShrinkWrap.create(EnterpriseArchive.class, getName()); - } - - // EJB module - contains test package - JavaArchive ejbArchive = null; - - if (ejbModuleName == null) { - ejbArchive = ShrinkWrap.create(JavaArchive.class, DEFAULT_EJB_MODULE_NAME); - } else { - ejbArchive = ShrinkWrap.create(JavaArchive.class, ejbModuleName); - } - - // CDITCK-56 - ejbArchive.addClass(DummySessionBean.class); - - processPackages(ejbArchive); - processClasses(ejbArchive); - processManifestResources(ejbArchive); - processResources(ejbArchive); - processLibraries(enterpriseArchive); - - // Deployment descriptors - if (includeBeansXml) { - ejbArchive.addAsManifestResource(getBeansDescriptorAsset(), getBeansDescriptorTarget()); - } - - if (persistenceDescriptor != null) { - ejbArchive.addAsManifestResource(new StringAsset(persistenceDescriptor.exportAsString()), "persistence.xml"); - } - - if (ejbJarDescriptor != null) { - ejbArchive.addAsManifestResource(new StringAsset(ejbJarDescriptor.exportAsString()), "ejb-jar.xml"); - } else if (ejbJarXml != null) { - ejbArchive.addAsManifestResource(ejbJarXml.getSource(), ejbJarXml.getTarget()); - } - - enterpriseArchive.addAsModule(ejbArchive); - - // Default web module - if (this.hasDefaultWebModule) { - - WebArchive webArchive = ShrinkWrap.create(WebArchive.class).setManifest( - new StringAsset(Descriptors.create(ManifestDescriptor.class) - .addToClassPath(getName() != null ? getName() : DEFAULT_EJB_MODULE_NAME).exportAsString())); - enterpriseArchive.addAsModule(webArchive); - } - return enterpriseArchive; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/shrinkwrap/ee/WebArchiveBuilder.java b/web/src/main/java/org/jboss/cdi/tck/shrinkwrap/ee/WebArchiveBuilder.java deleted file mode 100644 index 2eec2dadc1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/shrinkwrap/ee/WebArchiveBuilder.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.shrinkwrap.ee; - -import org.jboss.cdi.tck.shrinkwrap.ArchiveBuilder; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.spec.se.manifest.ManifestDescriptor; -import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; -import org.jboss.shrinkwrap.descriptor.api.webcommon30.WebAppVersionType; - -/** - * ShrinkWrap {@link WebArchive} builder for CDI TCK Arquillian test. This builder is intended to provide basic functionality - * covering common TCK needs. Use shrinkwrap API to adapt archive to advanced scenarios. - * - * @author Martin Kouba - */ -public class WebArchiveBuilder extends ArchiveBuilder { - - public static final String DEFAULT_WAR_NAME = "test.war"; - - private boolean hasDefaultEjbModuleDependency = false; - - private String beansDescriptorTargetBase = null; - - /** - * Add default EJB module dependency to manifest. Useful when building custom web module of enterprise archive. - * - * @return self - * @see EnterpriseArchiveBuilder#DEFAULT_EJB_MODULE_NAME - */ - public WebArchiveBuilder withDefaultEjbModuleDependency() { - this.hasDefaultEjbModuleDependency = true; - return this; - } - - /** - *

- * Set the beans.xml descriptor target path base. - *

- * By default the target base is null and the beans.xml descriptor is placed in WEB-INF dir. However CDI 1.1 - * allows an alternative location: WEB-INF/classes/META-INF. - * - * @param beansDescriptorTargetBase - * @return self - */ - public WebArchiveBuilder withBeansDescriptorTargetBase(String beansDescriptorTargetBase) { - this.beansDescriptorTargetBase = beansDescriptorTargetBase; - return this; - } - - @Override - public WebArchiveBuilder self() { - return this; - } - - @Override - protected WebArchive buildInternal() { - - WebArchive webArchive = null; - - if (getName() == null) { - // Let arquillian generate archive name in order to avoid reload issues in AS7 (AS7-1638) - // webArchive = ShrinkWrap.create(WebArchive.class, DEFAULT_WAR_NAME); - String hash = getSha1OfTestClass(); - if (hash != null) { - webArchive = ShrinkWrap.create(WebArchive.class, hash + ".war"); - } else { - webArchive = ShrinkWrap.create(WebArchive.class); - } - } else { - webArchive = ShrinkWrap.create(WebArchive.class, getName()); - } - - processPackages(webArchive); - processClasses(webArchive); - processLibraries(webArchive); - processManifestResources(webArchive); - processResources(webArchive); - - // Deployment descriptors - if (includeBeansXml) { - webArchive.addAsWebInfResource(getBeansDescriptorAsset(), - buildBeansDescriptorTargetPath(getBeansDescriptorTarget())); - } - - if (webXmlDescriptor != null) { - webArchive.setWebXML(new StringAsset(webXmlDescriptor.exportAsString())); - } else if (webXml != null) { - webArchive.setWebXML(webXml.getSource()); - } else { - webArchive.setWebXML(new StringAsset(Descriptors.create(WebAppDescriptor.class).version(WebAppVersionType._3_0) - .exportAsString())); - } - - if (persistenceDescriptor != null) { - webArchive.addAsResource(new StringAsset(persistenceDescriptor.exportAsString()), "META-INF/persistence.xml"); - } - - if (ejbJarDescriptor != null) { - webArchive.addAsWebInfResource(new StringAsset(ejbJarDescriptor.exportAsString()), "ejb-jar.xml"); - } else if (ejbJarXml != null) { - webArchive.addAsWebInfResource(ejbJarXml.getSource(), ejbJarXml.getTarget()); - } - - // Web resources - if (webResources != null) { - for (ResourceDescriptor resource : webResources) { - if (resource.getTarget() == null) { - webArchive.addAsWebResource(resource.getSource()); - } else { - webArchive.addAsWebResource(resource.getSource(), resource.getTarget()); - } - } - } - - // Default EJB module dependency - if (this.hasDefaultEjbModuleDependency) { - webArchive.setManifest(new StringAsset(Descriptors.create(ManifestDescriptor.class) - .addToClassPath(EnterpriseArchiveBuilder.DEFAULT_EJB_MODULE_NAME).exportAsString())); - } - return webArchive; - } - - private String buildBeansDescriptorTargetPath(String descriptorName) { - - if (beansDescriptorTargetBase == null) - return descriptorName; - - return beansDescriptorTargetBase + descriptorName; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/DisabledEjbInterface.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/DisabledEjbInterface.java deleted file mode 100644 index cdbc98b639..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/DisabledEjbInterface.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface DisabledEjbInterface { - String hello(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/EjbInterface.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/EjbInterface.java deleted file mode 100644 index abdbc96331..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/EjbInterface.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface EjbInterface { - String hello(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/EnabledEjb.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/EnabledEjb.java deleted file mode 100644 index 6cfa1d7bdb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/EnabledEjb.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.enterprise; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.inject.Alternative; - -@Stateless -@Alternative -public class EnabledEjb implements EjbInterface { - public String hello() { - return "Hello world!"; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/NotEnabledEjb.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/NotEnabledEjb.java deleted file mode 100644 index 30c44efd6e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/NotEnabledEjb.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.enterprise; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.inject.Alternative; - -@Stateless -@Alternative -public class NotEnabledEjb implements DisabledEjbInterface { - public String hello() { - return "Hi!"; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/SessionBeanAlternativeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/SessionBeanAlternativeTest.java deleted file mode 100644 index 85058778e0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/SessionBeanAlternativeTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_SELECTED_ALTERNATIVES_BEAN_ARCHIVE_EE; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionBeanAlternativeTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SessionBeanAlternativeTest.class).withBeansXml("beans.xml").build(); - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_BEAN_ARCHIVE_EE, id = "bb") - public void testEnabledPolicyAvailable() { - assert getBeans(EjbInterface.class).size() == 1; - assert getBeans(EjbInterface.class).iterator().next().getTypes().contains(EjbInterface.class); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/DatabaseProduction.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/DatabaseProduction.java deleted file mode 100644 index d93606c2cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/DatabaseProduction.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.enterprise.resource; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface DatabaseProduction { - class Literal extends AnnotationLiteral implements DatabaseProduction { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/DatabaseTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/DatabaseTest.java deleted file mode 100644 index 655841507f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/DatabaseTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.enterprise.resource; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface DatabaseTest { - class Literal extends AnnotationLiteral implements DatabaseTest { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/EnabledResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/EnabledResourceProducer.java deleted file mode 100644 index f80bdf1141..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/EnabledResourceProducer.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.enterprise.resource; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Alternative; -import jakarta.enterprise.inject.Produces; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; - -@Alternative -@Dependent -public class EnabledResourceProducer { - - @Produces - @DatabaseTest - @PersistenceContext - EntityManager persistenceContext; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/NotEnabledResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/NotEnabledResourceProducer.java deleted file mode 100644 index ad880babb1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/NotEnabledResourceProducer.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.enterprise.resource; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Alternative; -import jakarta.enterprise.inject.Produces; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; - -@Alternative -@Dependent -public class NotEnabledResourceProducer { - - @Produces - @DatabaseProduction - @PersistenceContext - EntityManager persistenceContext; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/ResourceAlternativeAvailabilityTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/ResourceAlternativeAvailabilityTest.java deleted file mode 100644 index 5728eefd1e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/enterprise/resource/ResourceAlternativeAvailabilityTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.enterprise.resource; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.PERSISTENCE; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_SELECTED_ALTERNATIVES_BEAN_ARCHIVE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import java.util.Set; - -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Inject; -import jakarta.persistence.EntityManager; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class ResourceAlternativeAvailabilityTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(ResourceAlternativeAvailabilityTest.class) - .withBeansXml(new BeansXml().alternatives(EnabledResourceProducer.class)) - .withDefaultPersistenceXml().build(); - } - - @Inject - @DatabaseTest - private EntityManager entityManager; - - @SuppressWarnings("serial") - @Test(groups = PERSISTENCE) - @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_BEAN_ARCHIVE, id = "cc") - public void testResourceAvailability() { - - AnnotationLiteral testLiteral = new DatabaseTest.Literal(); - AnnotationLiteral productionLiteral = new DatabaseProduction.Literal(); - Set> beans = getBeans(EntityManager.class, testLiteral); - assertEquals(beans.size(), 1); - beans = getBeans(EntityManager.class, productionLiteral); - assertEquals(beans.size(), 0); - - assertNotNull(entityManager); - assertNotNull(entityManager.getDelegate()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseSelectedAlternative01Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseSelectedAlternative01Test.java deleted file mode 100644 index a9510b7081..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseSelectedAlternative01Test.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.alternative.selection.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_SELECTED_ALTERNATIVES_APPLICATION_EE; -import static org.jboss.cdi.tck.tests.alternative.selection.SelectedAlternativeTestUtil.createBuilderBase; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.tests.alternative.selection.Alpha; -import org.jboss.cdi.tck.tests.alternative.selection.Bravo; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * The simplest possible scenario - test session bean alternative selected for the entire application, no priority ordering - * during resolution. - * - * WAR deployment with 2 libraries: - *
    - *
  • WEB-INF/classes - alpha - contains {@link EnterpriseService} alternative with priority 1000
  • - *
  • lib 1 - bravo - contains {@link PojoService}
  • - *
- * - * Expected results: - *
    - *
  • {@link EnterpriseService} is available for injection in all bean archives
  • - *
- * - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseSelectedAlternative01Test extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return createBuilderBase().withTestClass(EnterpriseSelectedAlternative01Test.class) - .withClasses(Service.class, EnterpriseService.class, Alpha.class) - .withBeanLibrary(PojoService.class, Bravo.class).build(); - } - - @Inject - Alpha alpha; - - @Inject - Bravo bravo; - - @Test(groups = INTEGRATION) - @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_APPLICATION_EE, id = "ab") - public void testAlternativeSessionBeanSelected() { - assertNotNull(alpha); - assertNotNull(bravo); - - assertEquals(alpha.assertAvailable(Service.class).getId(), EnterpriseService.class.getName()); - assertEquals(bravo.assertAvailable(Service.class).getId(), EnterpriseService.class.getName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseSelectedAlternative02Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseSelectedAlternative02Test.java deleted file mode 100644 index a19c338ccf..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseSelectedAlternative02Test.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.selection.enterprise; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_SELECTED_ALTERNATIVES_APPLICATION_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.tests.alternative.selection.Alpha; -import org.jboss.cdi.tck.tests.alternative.selection.Bravo; -import org.jboss.cdi.tck.tests.alternative.selection.Charlie; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * EAR deployment with 1 library and 1 war: - *
    - *
  • ear lib - contains {@link Service} and a simple service implementation {@link PojoService}
  • - *
  • war - contains {@link EnterpriseService} alternative with priority 1000, should be visible for the war only
  • - *
- * - * Expected results: - *
    - *
  • {@link EnterpriseService} is available for injection in beans in war only
  • - *
- * - * @author Matej Briskar - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseSelectedAlternative02Test extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = SelectedAlternativeTestUtil.createEnterpriseBuilderBase() - // A - default EJB jar - .withTestClassDefinition(EnterpriseSelectedAlternative02Test.class) - // C - lib visible to all - .withBeanLibrary(Bravo.class, Service.class, PojoService.class).noDefaultWebModule().build(); - - // E - not visible for AC - WebArchive bazWebArchive = SelectedAlternativeTestUtil.createBuilderBase().notTestArchive() - .withClasses(Charlie.class, EnterpriseService.class, EnterpriseSelectedAlternative02Test.class) - .withBeanLibrary(Alpha.class).build(); - enterpriseArchive.addAsModule(bazWebArchive); - - return enterpriseArchive; - } - - @Inject - Alpha alpha; - - @Inject - Bravo bravo; - - @Inject - Charlie charlie; - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_APPLICATION_EE, id = "ab") - public void testAlternativeSessionBeanSelected() { - assertNotNull(alpha); - assertNotNull(bravo); - assertNotNull(charlie); - - assertEquals(alpha.assertAvailable(Service.class).getId(), EnterpriseService.class.getName()); - // EnterpriseService is not visible to bravo - assertEquals(bravo.assertAvailable(Service.class).getId(), PojoService.class.getName()); - assertEquals(charlie.assertAvailable(Service.class).getId(), EnterpriseService.class.getName()); - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseSelectedAlternative03Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseSelectedAlternative03Test.java deleted file mode 100644 index 92f56fe48b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseSelectedAlternative03Test.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.selection.enterprise; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_SELECTED_ALTERNATIVES_APPLICATION; -import static org.jboss.cdi.tck.cdi.Sections.UNSATISFIED_AND_AMBIG_DEPENDENCIES; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.alternative.selection.Alpha; -import org.jboss.cdi.tck.tests.alternative.selection.Bar; -import org.jboss.cdi.tck.tests.alternative.selection.BarProducer; -import org.jboss.cdi.tck.tests.alternative.selection.Bravo; -import org.jboss.cdi.tck.tests.alternative.selection.Charlie; -import org.jboss.cdi.tck.tests.alternative.selection.Foo; -import org.jboss.cdi.tck.tests.alternative.selection.Tame.TameLiteral; -import org.jboss.cdi.tck.tests.alternative.selection.TestBean; -import org.jboss.cdi.tck.tests.alternative.selection.Wild.WildLiteral; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * EAR deployment with 2 libraries and 1 war: - *
    - *
  • ear 1.lib - contains {@link Foo} TestBean alternative with priority 1000
  • - * - *
  • war - contains {@link Bar} TestBean alternative with priority 2000, {@link BarProducer} Bar alternative producer method - * and Bar alternative producer - * field with priority 1100 with 2 different annotations .
  • - *
- * - * Expected results: - *
    - *
  • {@link Foo} is available for injection in all beans
  • - *
  • {@link Bar} is available for injection in beans in war only
  • - *
  • when injecting {@link TestBean}, {@link Bar} is preferred if visible
  • - *
  • {@link BarProducer} alternative producer method and alternative producer field are both selected and visible in war - * only.
  • - *
- * - * @author Matej Briskar - * - */ - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseSelectedAlternative03Test extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = SelectedAlternativeTestUtil.createEnterpriseBuilderBase() - // A - default EJB jar - .withTestClassDefinition(EnterpriseSelectedAlternative03Test.class) - // C - lib visible to all - .withBeanLibrary(Foo.class).withBeanLibrary(Bravo.class).noDefaultWebModule().build(); - - // E - not visible for AC - WebArchive bazWebArchive = new WebArchiveBuilder().notTestArchive() - .withClasses(Bar.class, EnterpriseSelectedAlternative03Test.class) - .withBeanLibrary(Alpha.class, Charlie.class, BarProducer.class).build(); - - enterpriseArchive.addAsModule(bazWebArchive); - - return enterpriseArchive; - } - - @Inject - Alpha alpha; - - @Inject - Bravo bravo; - - @Inject - Charlie charlie; - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_APPLICATION, id = "aa") - public void testAlternativeManagedBeanAvailable() { - assertNotNull(alpha); - assertNotNull(bravo); - assertNotNull(charlie); - - alpha.assertAvailable(Bar.class); - alpha.assertAvailable(Foo.class); - bravo.assertAvailable(Foo.class); - charlie.assertAvailable(Bar.class); - charlie.assertAvailable(Foo.class); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = UNSATISFIED_AND_AMBIG_DEPENDENCIES, id = "cb") - public void testDependencyResolvable() { - - assertEquals(alpha.assertAvailable(TestBean.class).getId(), Bar.class.getName()); - // Bar is not available for Bravo - assertEquals(bravo.assertAvailable(TestBean.class).getId(), Foo.class.getName()); - assertEquals(charlie.assertAvailable(TestBean.class).getId(), Bar.class.getName()); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_APPLICATION, id = "ba") - @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_APPLICATION, id = "bb") - public void testAlternativeProducerSelected() { - // Producer field - alpha.assertAvailable(Bar.class, WildLiteral.INSTANCE); - charlie.assertAvailable(Bar.class, WildLiteral.INSTANCE); - // Producer method - alpha.assertAvailable(Bar.class, TameLiteral.INSTANCE); - charlie.assertAvailable(Bar.class, TameLiteral.INSTANCE); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseService.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseService.java deleted file mode 100644 index 001756c251..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/EnterpriseService.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.selection.enterprise; - -import jakarta.annotation.Priority; -import jakarta.ejb.Singleton; -import jakarta.enterprise.inject.Alternative; - -@Priority(1000) -@Alternative -@Singleton -public class EnterpriseService implements Service { - - @Override - public String getId() { - return EnterpriseService.class.getName(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/PojoService.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/PojoService.java deleted file mode 100644 index 56b7bf6825..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/PojoService.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.selection.enterprise; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class PojoService implements Service { - - @Override - public String getId() { - return PojoService.class.getName(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/SelectedAlternativeTestUtil.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/SelectedAlternativeTestUtil.java deleted file mode 100644 index 56082916f2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/SelectedAlternativeTestUtil.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.selection.enterprise; - -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.alternative.selection.AssertBean; -import org.jboss.cdi.tck.tests.alternative.selection.Tame; -import org.jboss.cdi.tck.tests.alternative.selection.TestBean; -import org.jboss.cdi.tck.tests.alternative.selection.Wild; - -public class SelectedAlternativeTestUtil { - - public static WebArchiveBuilder createBuilderBase() { - return new WebArchiveBuilder().withLibrary( - org.jboss.cdi.tck.tests.alternative.selection.SelectedAlternativeTestUtil.class, TestBean.class, Wild.class, - Tame.class, - AssertBean.class); - } - - public static EnterpriseArchiveBuilder createEnterpriseBuilderBase() { - return new EnterpriseArchiveBuilder().withLibrary( - org.jboss.cdi.tck.tests.alternative.selection.SelectedAlternativeTestUtil.class, TestBean.class, Wild.class, - Tame.class, AssertBean.class); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/Service.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/Service.java deleted file mode 100644 index 76b43f8974..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/enterprise/Service.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.selection.enterprise; - -public interface Service { - - public String getId(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/BravoResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/BravoResourceProducer.java deleted file mode 100644 index 3bb27bc396..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/BravoResourceProducer.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.selection.resource; - -import jakarta.annotation.Priority; -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Alternative; -import jakarta.enterprise.inject.Produces; - -@Priority(1000) -@Alternative -@Dependent -public class BravoResourceProducer { - - @Produces - @ProductionReady - @Resource(name = "test1") - String test1; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/CharlieResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/CharlieResourceProducer.java deleted file mode 100644 index d828e8adf5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/CharlieResourceProducer.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.selection.resource; - -import jakarta.annotation.Priority; -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Alternative; -import jakarta.enterprise.inject.Produces; - -@Alternative -@Priority(1100) -@Dependent -public class CharlieResourceProducer { - - @Produces - @ProductionReady - @Resource(name = "test2") - String test2; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/DeltaResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/DeltaResourceProducer.java deleted file mode 100644 index 2f935e7f3c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/DeltaResourceProducer.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2023, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.selection.resource; - -import jakarta.annotation.Priority; -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Alternative; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class DeltaResourceProducer { - - @Produces - @ProductionReady - @Resource(name = "test1") - @Alternative - @Priority(1) - String test1; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ProductionReady.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ProductionReady.java deleted file mode 100644 index bf27be67b4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ProductionReady.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.selection.resource; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface ProductionReady { - - @SuppressWarnings("all") - public static class ProductionReadyLiteral extends AnnotationLiteral implements ProductionReady { - - private static final long serialVersionUID = 1L; - - public static final ProductionReady INSTANCE = new ProductionReadyLiteral(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceAlternative01Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceAlternative01Test.java deleted file mode 100644 index 8ed40335ee..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceAlternative01Test.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.alternative.selection.resource; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_SELECTED_ALTERNATIVES_APPLICATION; -import static org.jboss.cdi.tck.tests.alternative.selection.SelectedAlternativeTestUtil.createBuilderBase; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.tests.alternative.selection.Alpha; -import org.jboss.cdi.tck.tests.alternative.selection.Bravo; -import org.jboss.cdi.tck.tests.alternative.selection.Charlie; -import org.jboss.cdi.tck.tests.alternative.selection.resource.ProductionReady.ProductionReadyLiteral; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * The simplest possible scenario - test alternative resource is selected for the entire application, no deselection, no - * priority ordering during resolution. - * - * WAR deployment with 2 libraries: - *
    - *
  • WEB-INF/classes - alpha - does not declare any alternative
  • - *
  • lib 1 - bravo - declares {@link BravoResourceProducer} alternative selected for the app with priority 1000
  • - *
  • lib 2 - charlie - does not declare any alternative
  • - *
- * - * Expected result: {@link BravoResourceProducer} resource is available for injection in all bean archives - * - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ResourceAlternative01Test extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return createBuilderBase() - .withTestClass(ResourceAlternative01Test.class) - .withLibrary(ProductionReady.class) - .withClasses(Alpha.class) - .withBeanLibrary(Bravo.class, BravoResourceProducer.class) - .withBeanLibrary(Charlie.class) - .withWebXml( - Descriptors.create(WebAppDescriptor.class).createEnvEntry().envEntryName("test1") - .envEntryType("java.lang.String").envEntryValue("hello").up()) - .build(); - } - - @Inject - Alpha alpha; - - @Inject - Bravo bravo; - - @Inject - Charlie charlie; - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_APPLICATION, id = "bc") - public void testAlternativeResourceSelected() { - alpha.assertAvailable(String.class, ProductionReadyLiteral.INSTANCE); - bravo.assertAvailable(String.class, ProductionReadyLiteral.INSTANCE); - charlie.assertAvailable(String.class, ProductionReadyLiteral.INSTANCE); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceAlternative04Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceAlternative04Test.java deleted file mode 100644 index 8146435bf3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceAlternative04Test.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.alternative.selection.resource; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.UNSATISFIED_AND_AMBIG_DEPENDENCIES; -import static org.jboss.cdi.tck.tests.alternative.selection.SelectedAlternativeTestUtil.createBuilderBase; -import static org.testng.Assert.assertEquals; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.tests.alternative.selection.Alpha; -import org.jboss.cdi.tck.tests.alternative.selection.Bravo; -import org.jboss.cdi.tck.tests.alternative.selection.Charlie; -import org.jboss.cdi.tck.tests.alternative.selection.resource.ProductionReady.ProductionReadyLiteral; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test resolution of ambiguous dependencies. - * - * WAR deployment with 2 libraries: - *
    - *
  • WEB-INF/classes - alpha - does not declare any alternative, includes {@link ResourceProducer}
  • - *
  • lib 1 - bravo - declares {@link BravoResourceProducer} alternative selected for the app with priority 1000
  • - *
  • lib 2 - charlie - declares {@link CharlieResourceProducer} alternative selected for the app with priority 1100
  • - *
- * - * Expected result: {@link CharlieResourceProducer} resource is available for injection in all bean archives - * - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ResourceAlternative04Test extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return createBuilderBase() - .withTestClass(ResourceAlternative04Test.class) - .withLibrary(ProductionReady.class) - .withClasses(Alpha.class, ResourceProducer.class) - .withBeanLibrary(Bravo.class, BravoResourceProducer.class) - .withBeanLibrary(Charlie.class, CharlieResourceProducer.class) - .withWebXml( - Descriptors.create(WebAppDescriptor.class).createEnvEntry().envEntryName("test1") - .envEntryType("java.lang.String").envEntryValue("hello1").up().createEnvEntry() - .envEntryName("test2").envEntryType("java.lang.String").envEntryValue("hello2").up() - .createEnvEntry().envEntryName("test3").envEntryType("java.lang.String") - .envEntryValue("hello3").up()) - .build(); - } - - @Inject - Alpha alpha; - - @Inject - Bravo bravo; - - @Inject - Charlie charlie; - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = UNSATISFIED_AND_AMBIG_DEPENDENCIES, id = "cb") - public void testAlternativeResourceSelected() { - assertEquals(alpha.assertAvailable(String.class, ProductionReadyLiteral.INSTANCE), "hello2"); - assertEquals(bravo.assertAvailable(String.class, ProductionReadyLiteral.INSTANCE), "hello2"); - assertEquals(charlie.assertAvailable(String.class, ProductionReadyLiteral.INSTANCE), "hello2"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceAlternativeExplicitPriorityTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceAlternativeExplicitPriorityTest.java deleted file mode 100644 index 77a3da68e8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceAlternativeExplicitPriorityTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2023, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.selection.resource; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_SELECTED_ALTERNATIVES_APPLICATION; -import static org.jboss.cdi.tck.tests.alternative.selection.SelectedAlternativeTestUtil.createBuilderBase; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.tests.alternative.selection.Alpha; -import org.jboss.cdi.tck.tests.alternative.selection.Bravo; -import org.jboss.cdi.tck.tests.alternative.selection.Charlie; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Tests that alternative resource can declare {@link jakarta.annotation.Priority} directly on the producer in order - * to globally enable such a bean. - */ -@SpecVersion(spec = "cdi", version = "4.1") -public class ResourceAlternativeExplicitPriorityTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return createBuilderBase() - .withTestClass(ResourceAlternativeExplicitPriorityTest.class) - .withLibrary(ProductionReady.class) - .withClasses(Alpha.class) - .withBeanLibrary(Bravo.class, DeltaResourceProducer.class) - .withBeanLibrary(Charlie.class) - .withWebXml( - Descriptors.create(WebAppDescriptor.class).createEnvEntry().envEntryName("test1") - .envEntryType("java.lang.String").envEntryValue("hello").up()) - .build(); - } - - @Inject - Alpha alpha; - - @Inject - Bravo bravo; - - @Inject - Charlie charlie; - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_APPLICATION, id = "cc") - public void testAlternativeResourceSelected() { - alpha.assertAvailable(String.class, ProductionReady.ProductionReadyLiteral.INSTANCE); - bravo.assertAvailable(String.class, ProductionReady.ProductionReadyLiteral.INSTANCE); - charlie.assertAvailable(String.class, ProductionReady.ProductionReadyLiteral.INSTANCE); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceProducer.java deleted file mode 100644 index 7d9cf4aa9f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/alternative/selection/resource/ResourceProducer.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.alternative.selection.resource; - -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class ResourceProducer { - - @Produces - @ProductionReady - @Resource(name = "test3") - String test3; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/activation/ActivateRequestContextinEETest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/activation/ActivateRequestContextinEETest.java deleted file mode 100644 index 1b16cd3c4c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/activation/ActivateRequestContextinEETest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2016, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.activation; - -import static org.jboss.cdi.tck.cdi.Sections.ACTIVATING_REQUEST_CONTEXT; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.TestGroups; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * @author Tomas Remes - */ -@Test(groups = TestGroups.INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class ActivateRequestContextinEETest extends AbstractTest { - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ActivateRequestContextinEETest.class).build(); - } - - @ArquillianResource - private URL contextPath; - - @Test - @SpecAssertion(section = ACTIVATING_REQUEST_CONTEXT, id = "db") - public void requestContextCannotBeActivatedTwice() throws Exception { - WebClient webClient = new WebClient(); - TextPage results = webClient.getPage(contextPath + "test"); - assertTrue(results.getContent().contains("Activated: false")); - assertTrue(results.getContent().contains("Active: true")); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/activation/TestServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/activation/TestServlet.java deleted file mode 100644 index 3ba228e6b9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/activation/TestServlet.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2016, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.activation; - -import java.io.IOException; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.context.control.RequestContextController; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@WebServlet(name = "TestServlet", urlPatterns = { "/test" }) -public class TestServlet extends HttpServlet { - - @Inject - RequestContextController requestContextController; - - @Inject - BeanManager bm; - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws IOException { - resp.setContentType("text/plain"); - resp.getWriter().write("Activated: " + requestContextController.activate()); - requestContextController.deactivate(); - // requestContext still should be active - resp.getWriter().write("Active: " + bm.getContext(RequestScoped.class).isActive()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ApplicationContextTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ApplicationContextTest.java deleted file mode 100644 index 4b78e2401e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ApplicationContextTest.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.JAX_RS; -import static org.jboss.cdi.tck.cdi.Sections.APPLICATION_CONTEXT_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.jaxrs.JaxRsActivator; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * @author David Allen - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ApplicationContextTest extends AbstractTest { - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ApplicationContextTest.class) - .withClass(JaxRsActivator.class) - .withWebXml("web.xml") - .withWebResource("SimplePage.html").build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "aa") - public void testApplicationScopeActiveDuringServiceMethod() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "TestServlet?test=servlet"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "ab") - public void testApplicationScopeActiveDuringDoFilterMethod() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "SimplePage.html"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "ac") - public void testApplicationScopeActiveDuringServletContextListenerInvocation() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "TestServlet?test=servletContextListener"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "ad") - public void testApplicationScopeActiveDuringHttpSessionListenerInvocation() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "TestServlet?test=httpSessionListener"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "af") - public void testApplicationScopeActiveDuringServletRequestListenerInvocation() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "TestServlet?test=servletRequestListener"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "e") - public void testApplicationContextSharedBetweenServletRequests() throws Exception { - WebClient webClient = new WebClient(); - TextPage firstRequestResult = webClient.getPage(contextPath + "IntrospectApplication"); - assertNotNull(firstRequestResult.getContent()); - assertTrue(Double.parseDouble(firstRequestResult.getContent()) != 0); - // Make a second request and make sure the same context is used - TextPage secondRequestResult = webClient.getPage(contextPath + "IntrospectApplication"); - assertNotNull(secondRequestResult.getContent()); - // should be same random number - assertEquals(Double.parseDouble(secondRequestResult.getContent()), Double.parseDouble(firstRequestResult.getContent())); - } - - /** - * Related to CDITCK-96. - * - * @throws Exception - */ - @Test(groups = { INTEGRATION, JAX_RS }) - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "e") - public void testApplicationContextSharedBetweenJaxRsRequests() throws Exception { - WebClient webClient = new WebClient(); - TextPage firstRequestResult = webClient.getPage(contextPath + "rest/application-id"); - assertNotNull(firstRequestResult.getContent()); - assertTrue(Double.parseDouble(firstRequestResult.getContent()) != 0); - // Make a second request and make sure the same context is used - TextPage secondRequestResult = webClient.getPage(contextPath + "rest/application-id"); - assertNotNull(secondRequestResult.getContent()); - // should be same random number - assertEquals(Double.parseDouble(secondRequestResult.getContent()), Double.parseDouble(firstRequestResult.getContent())); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ApplicationResource.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ApplicationResource.java deleted file mode 100644 index e796262064..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ApplicationResource.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application; - -import jakarta.inject.Inject; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; - -/** - * RESTful web service which returns a value from an application scoped bean. - * - * @author David Allen - * - */ -@Path("/application-id") -public class ApplicationResource { - - @Inject - SimpleApplicationBean simpleApplicationBean; - - @GET - @Produces("text/plain") - public String getValue() { - return Double.toString(simpleApplicationBean.getId()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/IntrospectApplication.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/IntrospectApplication.java deleted file mode 100644 index 1db3c63ee0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/IntrospectApplication.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -public class IntrospectApplication extends HttpServlet { - private static final long serialVersionUID = 1L; - - @Inject - SimpleApplicationBean simpleApplicationBean; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.setContentType("text/text"); - resp.getWriter().print(simpleApplicationBean.getId()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/Result.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/Result.java deleted file mode 100644 index 3cc86d3354..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/Result.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class Result { - private boolean applicationScopeActiveForServletContextListener = false; - private boolean applicationScopeActiveForHttpSessionListener = false; - private boolean applicationScopeActiveForServletRequestListener = false; - - public boolean isApplicationScopeActiveForServletContextListener() { - return applicationScopeActiveForServletContextListener; - } - - public void setApplicationScopeActiveForServletContextListener(boolean applicationScopeActiveForServletContextListener) { - this.applicationScopeActiveForServletContextListener = applicationScopeActiveForServletContextListener; - } - - public boolean isApplicationScopeActiveForHttpSessionListener() { - return applicationScopeActiveForHttpSessionListener; - } - - public void setApplicationScopeActiveForHttpSessionListener(boolean applicationScopeActiveForHttpSessionListener) { - this.applicationScopeActiveForHttpSessionListener = applicationScopeActiveForHttpSessionListener; - } - - public boolean isApplicationScopeActiveForServletRequestListener() { - return applicationScopeActiveForServletRequestListener; - } - - public void setApplicationScopeActiveForServletRequestListener(boolean applicationScopeActiveForServletRequestListener) { - this.applicationScopeActiveForServletRequestListener = applicationScopeActiveForServletRequestListener; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/SimpleApplicationBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/SimpleApplicationBean.java deleted file mode 100644 index b6403f093f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/SimpleApplicationBean.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class SimpleApplicationBean { - private double id = Math.random(); - - public double getId() { - return id; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestFilter.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestFilter.java deleted file mode 100644 index 1d61232715..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestFilter.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application; - -import java.io.IOException; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.Filter; -import jakarta.servlet.FilterChain; -import jakarta.servlet.FilterConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; - -public class TestFilter implements Filter { - @Inject - private BeanManager jsr299Manager; - - public void destroy() { - jsr299Manager = null; - } - - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, - ServletException { - if (!jsr299Manager.getContext(ApplicationScoped.class).isActive()) { - throw new ServletException("Application context is not active"); - } else { - chain.doFilter(request, response); - } - } - - public void init(FilterConfig filterConfig) throws ServletException { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestHttpSessionListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestHttpSessionListener.java deleted file mode 100644 index ef5a552405..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestHttpSessionListener.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpSessionEvent; -import jakarta.servlet.http.HttpSessionListener; - -public class TestHttpSessionListener implements HttpSessionListener { - @Inject - private BeanManager manager; - @Inject - private Result result; - - public void sessionCreated(HttpSessionEvent hsc) { - boolean result = manager.getContext(ApplicationScoped.class).isActive(); - this.result.setApplicationScopeActiveForHttpSessionListener(result); - } - - public void sessionDestroyed(HttpSessionEvent hsc) { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestServlet.java deleted file mode 100644 index 7e6fbb4e7f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestServlet.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application; - -import java.io.IOException; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -/** - * Servlet used to test application context during service method and also for reporting test results of testing the context - * during a method invocation on ServletContextListener, HttpSessionListener and ServlerRequestListener. - * - * @author David Allen - * - */ -public class TestServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - @Inject - private BeanManager jsr299Manager; - @Inject - private Result result; - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - if ("servlet".equals(req.getParameter("test"))) { - if (jsr299Manager.getContext(ApplicationScoped.class).isActive()) { - resp.setStatus(200); - } else { - resp.setStatus(500); - } - } else if ("servletContextListener".equals(req.getParameter("test"))) { - testServletContextListener(req, resp); - } else if ("httpSessionListener".equals(req.getParameter("test"))) { - testHttpSessionListener(req, resp); - } else if ("servletRequestListener".equals(req.getParameter("test"))) { - testServletRequestListener(req, resp); - } else { - resp.setStatus(404); - } - } - - private void testServletContextListener(HttpServletRequest req, HttpServletResponse resp) { - resp.setStatus((result.isApplicationScopeActiveForServletContextListener()) ? 200 : 500); - } - - private void testHttpSessionListener(HttpServletRequest req, HttpServletResponse resp) { - req.getSession().setAttribute("foo", "bar"); - resp.setStatus((result.isApplicationScopeActiveForHttpSessionListener()) ? 200 : 500); - } - - private void testServletRequestListener(HttpServletRequest req, HttpServletResponse resp) { - resp.setStatus((result.isApplicationScopeActiveForServletRequestListener()) ? 200 : 500); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestServletContextListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestServletContextListener.java deleted file mode 100644 index 1289e92eb2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestServletContextListener.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.ServletContextEvent; -import jakarta.servlet.ServletContextListener; - -public class TestServletContextListener implements ServletContextListener { - @Inject - private BeanManager manager; - @Inject - private Result result; - - public void contextDestroyed(ServletContextEvent sce) { - } - - public void contextInitialized(ServletContextEvent sce) { - boolean result = manager.getContext(ApplicationScoped.class).isActive(); - this.result.setApplicationScopeActiveForServletContextListener(result); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestServletRequestListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestServletRequestListener.java deleted file mode 100644 index db42e781d3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/TestServletRequestListener.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.ServletRequestEvent; -import jakarta.servlet.ServletRequestListener; - -public class TestServletRequestListener implements ServletRequestListener { - - @Inject - private BeanManager manager; - @Inject - private Result result; - - public void requestDestroyed(ServletRequestEvent sre) { - } - - public void requestInitialized(ServletRequestEvent sre) { - boolean result = manager.getContext(ApplicationScoped.class).isActive(); - this.result.setApplicationScopeActiveForServletRequestListener(result); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/ApplicationContextAsyncListenerTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/ApplicationContextAsyncListenerTest.java deleted file mode 100644 index 67a4ad67b1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/ApplicationContextAsyncListenerTest.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.async; - -import static org.jboss.cdi.tck.TestGroups.ASYNC_SERVLET; -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.APPLICATION_CONTEXT_EE; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * - * @author Martin Kouba - * @author Tomas Remes - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ApplicationContextAsyncListenerTest extends AbstractTest { - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ApplicationContextAsyncListenerTest.class) - .build(); - } - - @Test(groups = { INTEGRATION, ASYNC_SERVLET }) - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "ae") - public void testApplicationContextActiveOnComplete() throws Exception { - WebClient webClient = new WebClient(); - - // make async request - webClient.getPage(getPath(AsyncServlet.TEST_COMPLETE)); - - // check the status servlet results - TextPage results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onComplete: true")); - } - - @Test(groups = { INTEGRATION, ASYNC_SERVLET }) - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "ae") - public void testApplicationContextActiveOnTimeout() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(getPath(AsyncServlet.TEST_TIMEOUT)); - TextPage results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onTimeout: true")); - } - - @Test(groups = { INTEGRATION, ASYNC_SERVLET }) - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "ae") - public void testApplicationContextActiveOnError() throws Exception { - WebClient webClient = new WebClient(); - webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); - webClient.getPage(getPath(AsyncServlet.TEST_ERROR)); - TextPage results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onError: true")); - } - - @Test(groups = { INTEGRATION, ASYNC_SERVLET }) - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "ae") - public void testApplicationContextActiveOnStartAsync() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(getPath(AsyncServlet.TEST_LOOP)); - TextPage results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onStartAsync: true")); - assertTrue(results.getContent().contains("onComplete: true")); - } - - private String getPath(String test) { - return contextPath + "AsyncServlet?test=" + test; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/AsyncRequestProcessor.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/AsyncRequestProcessor.java deleted file mode 100644 index 79782143d1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/AsyncRequestProcessor.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.async; - -import jakarta.servlet.AsyncContext; - -import org.jboss.cdi.tck.util.SimpleLogger; -import org.jboss.cdi.tck.util.Timer; - -/** - * @author Martin Kouba - */ -public class AsyncRequestProcessor implements Runnable { - - private static final SimpleLogger logger = new SimpleLogger(AsyncRequestProcessor.class); - - private final AsyncContext actx; - - private final long timerValue; - - private final String dispatchPath; - - private final boolean useDispatch; - - public AsyncRequestProcessor(AsyncContext ctx, long timerValue, boolean useDispatch, String dispatchPath) { - super(); - this.actx = ctx; - this.timerValue = timerValue; - this.dispatchPath = dispatchPath; - this.useDispatch = useDispatch; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Runnable#run() - */ - @Override - public void run() { - try { - if (timerValue > 0) { - // Simulate long running operation - Timer.startNew(timerValue); - } - } catch (InterruptedException e) { - throw new IllegalStateException("Interrupted"); - } - - // Dispatch or complete - if (useDispatch) { - if (dispatchPath != null) { - actx.dispatch(dispatchPath); - } else { - actx.dispatch(); - } - } else { - actx.complete(); - } - logger.log("Async processing finished"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/AsyncServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/AsyncServlet.java deleted file mode 100644 index 7cb8b102b3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/AsyncServlet.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.async; - -import java.io.IOException; -import java.util.Arrays; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -import jakarta.inject.Inject; -import jakarta.servlet.AsyncContext; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@WebServlet(name = "AsyncServlet", urlPatterns = { "/AsyncServlet" }, asyncSupported = true) -@SuppressWarnings("serial") -public class AsyncServlet extends HttpServlet { - - public static final String TEST_TIMEOUT = "timeout"; - public static final String TEST_COMPLETE = "complete"; - public static final String TEST_ERROR = "error"; - public static final String TEST_LOOP = "loop"; - private static final String[] VALID_TESTS = new String[] { TEST_TIMEOUT, TEST_COMPLETE, TEST_ERROR, TEST_LOOP }; - - private static final SimpleLogger logger = new SimpleLogger(AsyncServlet.class); - - private static final long TIMEOUT = 200l; - - private static boolean inLoop = false; - - private ExecutorService executorService; - - @Inject - StatusBean statusBean; - - @Override - public void init() throws ServletException { - // Note that executor thread does not use the same CL - executorService = Executors.newSingleThreadExecutor(); - } - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - String test = req.getParameter("test"); - if (!Arrays.asList(VALID_TESTS).contains(test)) { - resp.setStatus(404); - return; - } - - statusBean.reset(); - final AsyncContext actx = req.startAsync(); - actx.addListener(actx.createListener(SimpleAsyncListener.class)); - resp.setContentType("text/plain"); - - if (TEST_TIMEOUT.equals(test)) { - actx.setTimeout(TIMEOUT); - } else if (TEST_COMPLETE.equals(test)) { - executorService.execute(new AsyncRequestProcessor(actx, 50l, false, null)); - } else if (TEST_ERROR.equals(test)) { - executorService.execute(new AsyncRequestProcessor(actx, 50l, true, "/FailingServlet")); - } else if (TEST_LOOP.equals(test)) { - if (inLoop) { - executorService.execute(new AsyncRequestProcessor(actx, 50l, false, null)); - } else { - executorService.execute(new AsyncRequestProcessor(actx, 50l, true, null)); - inLoop = true; - } - } - logger.log("Service finished: {0}", test); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/FailingServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/FailingServlet.java deleted file mode 100644 index 7bc4227449..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/FailingServlet.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.async; - -import java.io.IOException; - -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@SuppressWarnings("serial") -@WebServlet(name = "FailingServlet", urlPatterns = { "/FailingServlet" }, asyncSupported = true) -public class FailingServlet extends HttpServlet { - - private static final SimpleLogger logger = new SimpleLogger(FailingServlet.class); - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - logger.log("Intentional service failure"); - throw new ServletException(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/SimpleApplicationBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/SimpleApplicationBean.java deleted file mode 100644 index ab301bcd46..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/SimpleApplicationBean.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.async; - -import jakarta.enterprise.context.ApplicationScoped; - -/** - * @author Martin Kouba - */ -@ApplicationScoped -public class SimpleApplicationBean { - - public boolean ping() { - return true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/SimpleAsyncListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/SimpleAsyncListener.java deleted file mode 100644 index 96aa6e353a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/SimpleAsyncListener.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.async; - -import java.io.IOException; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.AsyncEvent; -import jakarta.servlet.AsyncListener; - -import org.jboss.cdi.tck.util.SimpleLogger; - -/** - * @author Martin Kouba - * @author Tomas Remes - */ -public class SimpleAsyncListener implements AsyncListener { - - public static Long onStartAsync = null; - public static Long onError = null; - public static Long onTimeout = null; - public static Long onComplete = null; - public static boolean isApplicationContextActive = false; - - private static final SimpleLogger logger = new SimpleLogger(SimpleAsyncListener.class); - - @Inject - SimpleApplicationBean simpleApplicationBean; - - @Inject - BeanManager beanManager; - - @Inject - StatusBean statusBean; - - /* - * (non-Javadoc) - * - * @see jakarta.servlet.AsyncListener#onComplete(jakarta.servlet.AsyncEvent) - */ - @Override - public void onComplete(AsyncEvent event) throws IOException { - logger.log("onComplete"); - - if (!statusBean.isOnTimeout() && !statusBean.isOnError()) { - // Do not check and write info in case of post timeout/error action - statusBean.setOnComplete(checkApplicationContextAvailability()); - } - } - - /* - * (non-Javadoc) - * - * @see jakarta.servlet.AsyncListener#onTimeout(jakarta.servlet.AsyncEvent) - */ - @Override - public void onTimeout(AsyncEvent event) throws IOException { - logger.log("onTimeout"); - statusBean.setOnTimeout(checkApplicationContextAvailability()); - event.getAsyncContext().complete(); - } - - /* - * (non-Javadoc) - * - * @see jakarta.servlet.AsyncListener#onError(jakarta.servlet.AsyncEvent) - */ - @Override - public void onError(AsyncEvent event) throws IOException { - logger.log("onError"); - statusBean.setOnError(checkApplicationContextAvailability()); - event.getAsyncContext().complete(); - } - - /* - * (non-Javadoc) - * - * @see jakarta.servlet.AsyncListener#onStartAsync(jakarta.servlet.AsyncEvent) - */ - @Override - public void onStartAsync(AsyncEvent event) throws IOException { - logger.log("onStartAsync"); - statusBean.setOnStartAsync(checkApplicationContextAvailability()); - } - - private boolean checkApplicationContextAvailability() throws IOException { - try { - statusBean.setApplicationBeanAvailable(simpleApplicationBean.ping()); - isApplicationContextActive = beanManager.getContext(ApplicationScoped.class).isActive(); - } catch (Throwable e) { - logger.log("Problem while checking application scope: " + e.getMessage()); - } - if (!isApplicationContextActive || !statusBean.isApplicationBeanAvailable()) { - return false; - } - return true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/StatusBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/StatusBean.java deleted file mode 100644 index 9ea1eee349..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/StatusBean.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.async; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class StatusBean { - - private boolean onError; - private boolean onComplete; - private boolean onTimeout; - private boolean onStartAsync; - private boolean applicationBeanAvailable; - - public boolean isApplicationBeanAvailable() { - return applicationBeanAvailable; - } - - public void setApplicationBeanAvailable(boolean applicationBeanAvailable) { - this.applicationBeanAvailable = applicationBeanAvailable; - } - - public boolean isOnStartAsync() { - return onStartAsync; - } - - public void setOnStartAsync(boolean onStartAsync) { - this.onStartAsync = onStartAsync; - } - - public boolean isOnComplete() { - return onComplete; - } - - public void setOnComplete(boolean onComplete) { - this.onComplete = onComplete; - } - - public boolean isOnError() { - return onError; - } - - public void setOnError(boolean onError) { - this.onError = onError; - } - - public boolean isOnTimeout() { - return onTimeout; - } - - public void setOnTimeout(boolean onTimeout) { - this.onTimeout = onTimeout; - } - - public void reset() { - this.onComplete = false; - this.onStartAsync = false; - this.onTimeout = false; - this.onError = false; - this.applicationBeanAvailable = false; - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/StatusServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/StatusServlet.java deleted file mode 100644 index cbb5c65cc4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/async/StatusServlet.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.async; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@WebServlet(name = "StatusServlet", urlPatterns = { "/Status" }) -public class StatusServlet extends HttpServlet { - - @Inject - StatusBean statusBean; - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws IOException { - writeInfo(resp); - } - - private void writeInfo(ServletResponse response) throws IOException { - response.getWriter().print(getInfo()); - response.getWriter().flush(); - } - - public String getInfo() { - return String - .format("onStartAsync: %s, onError: %s, onTimeout: %s, onComplete: %s, isSimpleApplicationBeanAvailable: %s", - statusBean.isOnStartAsync(), statusBean.isOnError(), statusBean.isOnTimeout(), - statusBean.isOnComplete(), statusBean.isApplicationBeanAvailable()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/ApplicationContextDestructionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/ApplicationContextDestructionTest.java deleted file mode 100644 index cb4886532c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/ApplicationContextDestructionTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.destroy; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.APPLICATION_CONTEXT_EE; -import static org.testng.Assert.assertEquals; - -import java.net.URL; -import java.net.URLEncoder; - -import org.jboss.arquillian.container.test.api.Deployer; -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.OperateOnDeployment; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.api.InSequence; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.SimpleLogger; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * Test that the application context is destroyed when the application is shut down. - * - * @author Martin Kouba - */ -@RunAsClient -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class ApplicationContextDestructionTest extends AbstractTest { - - private static final String FOO = "foo"; - - private static final String BAR = "bar"; - - @Deployment(name = FOO, managed = false, testable = false) - public static WebArchive createFooTestArchive() { - return new WebArchiveBuilder().notTestArchive().withClasses(Foo.class, FooInitServlet.class, SimpleLogger.class) - .build(); - } - - @Deployment(name = BAR, managed = false, testable = false) - public static WebArchive createBarTestArchive() { - return new WebArchiveBuilder().notTestArchive().withClasses(Bar.class, BarInfoServlet.class, SimpleLogger.class) - .build(); - } - - @ArquillianResource - Deployer deployer; - - /** - * This is not a real test method. - * - * @see #testApplicationContextDestroyed(URL, URL) - */ - @Test - @InSequence(1) - public void deployArchives() { - // In order to use @ArquillianResource URLs we need to deploy both test archives first - deployer.deploy(FOO); - deployer.deploy(BAR); - } - - /** - * Note that this test method depends on (must be run after) {@link #deployArchives()}. - * - * @param fooContext - * @param barContext - * @throws Exception - */ - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "f") - public void testApplicationContextDestroyed(@ArquillianResource @OperateOnDeployment(FOO) URL fooContext, - @ArquillianResource @OperateOnDeployment(BAR) URL barContext) throws Exception { - - // Init foo - set bar archive deployment url - WebClient webClient = new WebClient(); - webClient.getPage(fooContext + "init?url=" + URLEncoder.encode(barContext.toExternalForm(), "UTF-8")); - - // Undeploy foo - deployer.undeploy(FOO); - - // Get bar info - TextPage info = webClient.getPage(barContext + "info?action=get"); - assertEquals(info.getContent(), "true"); - - // Undeploy bar - deployer.undeploy(BAR); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/Bar.java deleted file mode 100644 index bd429f3f34..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/Bar.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.destroy; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class Bar { - - private boolean isFooDestroyed; - - public boolean isFooDestroyed() { - return isFooDestroyed; - } - - public void setFooDestroyed(boolean isFooDestroyed) { - this.isFooDestroyed = isFooDestroyed; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/BarInfoServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/BarInfoServlet.java deleted file mode 100644 index 1c227ff986..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/BarInfoServlet.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.destroy; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@SuppressWarnings("serial") -@WebServlet(urlPatterns = "/info") -public class BarInfoServlet extends HttpServlet { - - private static final SimpleLogger logger = new SimpleLogger(BarInfoServlet.class); - - @Inject - private Bar bar; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - String action = request.getParameter("action"); - - if ("fooDestroyed".equals(action)) { - logger.log("Set test flag to true"); - bar.setFooDestroyed(true); - response.setStatus(HttpServletResponse.SC_OK); - response.setContentType("text/plain"); - response.getWriter().write("" + bar.isFooDestroyed()); - } else if ("get".equals(action)) { - response.setStatus(HttpServletResponse.SC_OK); - response.setContentType("text/plain"); - response.getWriter().write("" + bar.isFooDestroyed()); - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/Foo.java deleted file mode 100644 index 1816e51156..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/Foo.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.destroy; - -import java.net.URL; -import java.net.URLConnection; - -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.ApplicationScoped; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@ApplicationScoped -public class Foo { - - private SimpleLogger logger = new SimpleLogger(Foo.class); - - private String barContext = null; - - public void setBarContext(String barContextUrl) { - this.barContext = barContextUrl; - } - - @PreDestroy - public void destroy() { - try { - URLConnection connection = new URL(barContext + "info" + "?action=fooDestroyed").openConnection(); - connection.getInputStream().close(); - logger.log("Test flag set [{0}]", barContext); - } catch (Exception e) { - logger.log("Cannot set test flag: {0}", e); - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/FooInitServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/FooInitServlet.java deleted file mode 100644 index a188fb7158..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/destroy/FooInitServlet.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.destroy; - -import java.io.IOException; -import java.net.URLDecoder; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@SuppressWarnings("serial") -@WebServlet(urlPatterns = "/init") -public class FooInitServlet extends HttpServlet { - - @Inject - private Foo foo; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - String url = request.getParameter("url"); - - if (url != null) { - foo.setBarContext(URLDecoder.decode(url, "UTF-8")); - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/ApplicationContextDisposerTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/ApplicationContextDisposerTest.java deleted file mode 100644 index 0843d0eab0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/ApplicationContextDisposerTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.disposer; - -import static org.jboss.cdi.tck.cdi.Sections.APPLICATION_CONTEXT_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.SimpleLogger; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ApplicationContextDisposerTest extends AbstractTest { - - private static final SimpleLogger logger = new SimpleLogger(ApplicationContextDisposerTest.class); - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ApplicationContextDisposerTest.class).build(); - } - - @Inject - Forest forest; - - @Test - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "dg") - public void testApplicationContextActiveDuringDispose() { - logger.log("Injected forest: {0}", forest.toString()); - @SuppressWarnings("serial") - Bean bean = getUniqueBean(Mushroom.class, new Edible.Literal()); - CreationalContext ctx = getCurrentManager().createCreationalContext(bean); - Mushroom mushroom = bean.create(ctx); - assertEquals(mushroom.getName(), "Boletus"); - assertFalse(forest.isEmpty()); - bean.destroy(mushroom, ctx); - assertTrue(forest.isEmpty()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Edible.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Edible.java deleted file mode 100644 index 3206fed3db..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Edible.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.disposer; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Edible { - class Literal extends AnnotationLiteral implements Edible { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Forest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Forest.java deleted file mode 100644 index a07600740d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Forest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.disposer; - -import jakarta.enterprise.context.ApplicationScoped; - -import org.jboss.cdi.tck.util.SimpleLogger; - -/** - * @author Martin Kouba - */ -@ApplicationScoped -public class Forest { - - private static final SimpleLogger logger = new SimpleLogger(Forest.class); - - private final long id = System.currentTimeMillis(); - - private boolean empty = false; - - public void setEmpty() { - empty = true; - logger.log("Set empty - {0}", this.toString()); - } - - public boolean isEmpty() { - return empty; - } - - public long getId() { - return id; - } - - @Override - public String toString() { - return "Forest [id=" + id + ", empty=" + empty + "]"; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Mushroom.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Mushroom.java deleted file mode 100644 index 8b23115bb0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Mushroom.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.disposer; - -/** - * @author Martin Kouba - */ -public class Mushroom { - - private String name; - - public Mushroom() { - super(); - } - - public Mushroom(String name) { - this.name = name; - } - - public String getName() { - return name; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Mushroomer.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Mushroomer.java deleted file mode 100644 index ef34eb4fe8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/disposer/Mushroomer.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.disposer; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.Disposes; -import jakarta.enterprise.inject.Produces; - -import org.jboss.cdi.tck.util.SimpleLogger; - -/** - * @author Martin Kouba - */ -@Dependent -public class Mushroomer { - - private static final SimpleLogger logger = new SimpleLogger(Mushroomer.class); - - private final long id = System.currentTimeMillis(); - - @Produces - @Edible - @RequestScoped - public Mushroom pickMushroom() { - return new Mushroom("Boletus"); - } - - public void eatMushroom(@Disposes @Edible Mushroom mushroom, Forest forest) { - logger.log("Dispose mushroom - {0}", this.toString()); - forest.setEmpty(); - } - - @Override - public String toString() { - return "Mushroomer [id=" + id + "]"; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/ApplicationContextSharedTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/ApplicationContextSharedTest.java deleted file mode 100644 index cae92e826e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/ApplicationContextSharedTest.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.ejb; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.APPLICATION_CONTEXT_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; - -import jakarta.ejb.EJB; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.OperateOnDeployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.util.Timer; -import org.jboss.cdi.tck.util.Timer.StopCondition; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * EJB and related tests with the built-in application context. - * - * @author David Allen - * @author Martin Kouba - */ -@Test(groups = JAVAEE_FULL) -@SpecVersion(spec = "cdi", version = "2.0") -public class ApplicationContextSharedTest extends AbstractTest { - - @Deployment(name = "TEST", order = 1) - public static EnterpriseArchive createTestArchive() { - return new EnterpriseArchiveBuilder().withTestClass(ApplicationContextSharedTest.class).setAsClientMode(false) - .withClasses(BarBean.class, FMS.class, FMSModelIII.class, SimpleApplicationBean.class, FooRemote.class).build(); - } - - @Deployment(name = "REMOTE_EJB", order = 2, testable = false) - public static EnterpriseArchive createEjbArchive() { - return new EnterpriseArchiveBuilder().notTestArchive().noDefaultWebModule().withName("test-ejb.ear") - .withEjbModuleName("test-ejb.jar").withClasses(FooBean.class, FooRemote.class, SimpleApplicationBean.class) - .build(); - } - - @Inject - BarBean bar; - - @EJB(lookup = "java:global/test-ejb/test-ejb/FooBean!org.jboss.cdi.tck.tests.context.application.ejb.FooRemote") - FooRemote foo; - - @OperateOnDeployment("TEST") - @Test - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "e") - public void testApplicationContextShared() throws Exception { - FMSModelIII.reset(); - FMS flightManagementSystem = getContextualReference(FMS.class); - flightManagementSystem.climb(); - - Timer timer = new Timer().setDelay(20, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - public boolean isSatisfied() { - return FMSModelIII.isClimbed(); - } - }).start(); - - flightManagementSystem.descend(); - - timer.addStopCondition(new StopCondition() { - public boolean isSatisfied() { - return FMSModelIII.isDescended(); - } - }, true).start(); - - assertTrue(flightManagementSystem.isSameBean()); - } - - @OperateOnDeployment("TEST") - @Test - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "dc") - public void testApplicationScopeActiveDuringCallToEjbTimeoutMethod() throws Exception { - FMS flightManagementSystem = getContextualReference(FMS.class); - flightManagementSystem.climb(); - - new Timer().setDelay(20, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - public boolean isSatisfied() { - return FMSModelIII.isClimbed(); - } - }).start(); - - assertTrue(flightManagementSystem.isApplicationScopeActive()); - } - - @OperateOnDeployment("TEST") - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "db") - public void testApplicationScopeActiveDuringAsyncCallToEjb(SimpleApplicationBean simpleApplicationBean) throws Exception { - Future result = bar.compute(); - Double id = result.get(); - assertNotEquals(id, -1.00); - assertEquals(id, Double.valueOf(simpleApplicationBean.getId())); - } - - @OperateOnDeployment("TEST") - @Test - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "da") - public void testApplicationScopeActiveDuringRemoteCallToEjb() { - assertNotNull(foo.ping()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/BarBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/BarBean.java deleted file mode 100644 index 65c1e6a225..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/BarBean.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.ejb; - -import java.util.concurrent.Future; - -import jakarta.ejb.AsyncResult; -import jakarta.ejb.Asynchronous; -import jakarta.ejb.Stateless; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.ContextNotActiveException; -import jakarta.enterprise.context.spi.Context; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -@Stateless -@Asynchronous -public class BarBean { - - @Inject - BeanManager beanManager; - - @Inject - SimpleApplicationBean simpleApplicationBean; - - /** - * Async computation. - * - * @return - */ - public Future compute() { - - Double result = null; - Context applicationContext = null; - - try { - applicationContext = beanManager.getContext(ApplicationScoped.class); - } catch (ContextNotActiveException e) { - // No-op - } - - if (applicationContext == null || !applicationContext.isActive() || simpleApplicationBean == null) { - result = -1.00; - } else { - result = simpleApplicationBean.getId(); - } - return new AsyncResult(result); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FMS.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FMS.java deleted file mode 100644 index 35d5248739..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FMS.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.ejb; - -import jakarta.ejb.Local; - -@Local -public interface FMS { - - public void climb() throws Exception; - - public void descend() throws Exception; - - public boolean isSameBean(); - - public boolean isApplicationScopeActive(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FMSModelIII.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FMSModelIII.java deleted file mode 100644 index 6a2c4fc0dc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FMSModelIII.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.ejb; - -import jakarta.annotation.Resource; -import jakarta.ejb.Stateless; -import jakarta.ejb.Timeout; -import jakarta.ejb.Timer; -import jakarta.ejb.TimerService; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.Instance; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -@Stateless -public class FMSModelIII implements FMS { - - private static final String CLIMB_COMMAND = "ClimbCommand"; - private static final String DESCEND_COMMAND = "DescendCommand"; - - @Resource - private TimerService timerService; - - @Inject - private BeanManager beanManager; - - @Inject - private Instance simpleApplicationBeanInstance; - - private static volatile boolean applicationScopeActive = false; - private static volatile double beanId = 0.0d; - private static volatile boolean sameBean = false; - - private static boolean climbed; - private static boolean descended; - - public void climb() throws Exception { - timerService.createTimer(200, CLIMB_COMMAND); - } - - public void descend() throws Exception { - timerService.createTimer(100, DESCEND_COMMAND); - } - - @Timeout - public void timeout(Timer timer) { - if (beanManager.getContext(ApplicationScoped.class).isActive()) { - applicationScopeActive = true; - if (beanId > 0.0) { - if (beanId == simpleApplicationBeanInstance.get().getId()) { - sameBean = true; - } - } else { - beanId = simpleApplicationBeanInstance.get().getId(); - } - } - // CDITCK-221 - applicationScopeActive, beanId and sameBean have been set and are testable - if (timer.getInfo().equals(CLIMB_COMMAND)) { - climbed = true; - } - if (timer.getInfo().equals(DESCEND_COMMAND)) { - descended = true; - } - } - - public boolean isApplicationScopeActive() { - return applicationScopeActive; - } - - public boolean isSameBean() { - return sameBean; - } - - public static boolean isClimbed() { - return climbed; - } - - public static boolean isDescended() { - return descended; - } - - public static void reset() { - beanId = 0.0d; - climbed = false; - descended = false; - applicationScopeActive = false; - sameBean = false; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FooBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FooBean.java deleted file mode 100644 index 40959cf16b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FooBean.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.ejb; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.ContextNotActiveException; -import jakarta.enterprise.context.spi.Context; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -@Stateless -public class FooBean implements FooRemote { - - @Inject - private BeanManager beanManager; - - @Inject - SimpleApplicationBean simpleApplicationBean; - - @Override - public Double ping() { - - Context applicationContext = null; - - try { - applicationContext = beanManager.getContext(ApplicationScoped.class); - } catch (ContextNotActiveException e) { - // No-op - } - - if (applicationContext == null || !applicationContext.isActive() || simpleApplicationBean == null) { - return null; - } - return simpleApplicationBean.getId(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FooRemote.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FooRemote.java deleted file mode 100644 index 8fe3c53b1b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/FooRemote.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.ejb; - -import jakarta.ejb.Remote; - -@Remote -public interface FooRemote { - - public Double ping(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/SimpleApplicationBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/SimpleApplicationBean.java deleted file mode 100644 index 26f8432cfe..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/ejb/SimpleApplicationBean.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.ejb; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class SimpleApplicationBean { - private double id = Math.random(); - - public double getId() { - return id; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/ApplicationScopeEventMultiWarTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/ApplicationScopeEventMultiWarTest.java deleted file mode 100644 index 87beded5c6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/ApplicationScopeEventMultiWarTest.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.event; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.APPLICATION_CONTEXT_EE; - -import java.io.IOException; -import java.net.URL; - -import jakarta.servlet.ServletContext; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.Testable; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.application6.ApplicationDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - *

- * Verifies that an observer is not notified of a non-visible {@link ServletContext}. - *

- *

- * Note that this test has to run in as-client mode since arquillian cannot work with such archive (doesn't know which WAR to - * enrich). - *

- *

- * This test was originally part of Weld test suite. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@Test(groups = JAVAEE_FULL) -@SpecVersion(spec = "cdi", version = "2.0") -public class ApplicationScopeEventMultiWarTest extends AbstractTest { - - @ArquillianResource - URL context; - - private static final String TEST1_ARCHIVE_NAME = "test1"; - private static final String TEST2_ARCHIVE_NAME = "test2"; - - @Deployment(testable = false) - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder() - .notTestArchive() - .withClasses(Collector.class, ObserverNames.class, Helper.class).noDefaultWebModule().build(); - StringAsset applicationXml = new StringAsset(Descriptors.create(ApplicationDescriptor.class) - .version(EnterpriseArchiveBuilder.DEFAULT_APP_VERSION).applicationName("Test").createModule() - .ejb(EnterpriseArchiveBuilder.DEFAULT_EJB_MODULE_NAME).up().createModule().getOrCreateWeb() - .webUri(TEST1_ARCHIVE_NAME + ".war") - .contextRoot("/" + TEST1_ARCHIVE_NAME).up().up().createModule().getOrCreateWeb() - .webUri(TEST2_ARCHIVE_NAME + ".war").contextRoot("/" + TEST2_ARCHIVE_NAME).up() - .up().exportAsString()); - enterpriseArchive.setApplicationXML(applicationXml); - - WebArchive fooArchive = new WebArchiveBuilder().notTestArchive().withName(TEST1_ARCHIVE_NAME + ".war") - .withClasses(Observer2.class, PingServlet.class).withDefaultEjbModuleDependency().build(); - enterpriseArchive.addAsModule(Testable.archiveToTest(fooArchive)); - - WebArchive barArchive = new WebArchiveBuilder().notTestArchive().withName(TEST2_ARCHIVE_NAME + ".war") - .withClasses(Observer3.class, PingServlet.class) - .withDefaultEjbModuleDependency().build(); - enterpriseArchive.addAsModule(barArchive); - - return enterpriseArchive; - } - - @Test - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "ga") - public void testInitializedApplicationScopedEventObserved() throws IOException { - - WebClient client = new WebClient(); - TextPage page1 = client.getPage(context + "/" + TEST1_ARCHIVE_NAME + "/ping"); - TextPage page2 = client.getPage(context + "/" + TEST2_ARCHIVE_NAME + "/ping"); - Assert.assertTrue(page1.getContent().toString().contains(ObserverNames.OBSERVER2_NAME)); - Assert.assertTrue(page2.getContent().toString().contains(ObserverNames.OBSERVER3_NAME)); - - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/ApplicationScopeEventTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/ApplicationScopeEventTest.java deleted file mode 100644 index bd48ba5734..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/ApplicationScopeEventTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.event; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.APPLICATION_CONTEXT; -import static org.jboss.cdi.tck.cdi.Sections.APPLICATION_CONTEXT_EE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVES; -import static org.testng.Assert.assertTrue; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - *

- * This test was originally part of Weld test suite. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class ApplicationScopeEventTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(ApplicationScopeEventTest.class).withClasses(Observer1.class).build(); - } - - @Inject - private Observer1 observer; - - @Test - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "ga") - @SpecAssertion(section = OBSERVES, id = "a") - @SpecAssertion(section = APPLICATION_CONTEXT, id = "a") - @SpecAssertion(section = APPLICATION_CONTEXT, id = "c") - public void testServletContextInitializedInvoked() { - assertTrue(observer.isObserved()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Collector.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Collector.java deleted file mode 100644 index b023f353a7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Collector.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.event; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class Collector { - - //using synchronized collection - see WELD-1673 - private List contextPaths = Collections.synchronizedList(new ArrayList()); - - public Collector() { - - } - - public List getContextPaths() { - return contextPaths; - } - - public void addContextPath(Helper helper) { - contextPaths.add(helper); - } - - public Helper getByClassName(String className) { - Helper helper = null; - for (Helper val : contextPaths) { - if (val.getClassName().equals(className)) - helper = val; - } - return helper; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Helper.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Helper.java deleted file mode 100644 index 210cdd820b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Helper.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.event; - -import jakarta.servlet.ServletContext; - -public class Helper { - - private String className; - private ServletContext context; - - public Helper(String className, ServletContext context) { - this.className = className; - this.context = context; - } - - public String getClassName() { - return className; - } - - public ServletContext getContext() { - return context; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Observer1.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Observer1.java deleted file mode 100644 index 5ab4b67332..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Observer1.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.event; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.event.Observes; -import jakarta.servlet.ServletContext; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@ApplicationScoped -public class Observer1 { - - private static final SimpleLogger logger = new SimpleLogger(Observer1.class); - - private boolean observed; - - void observe(@Observes @Initialized(ApplicationScoped.class) ServletContext event) { - if (observed) { - throw new IllegalStateException("ServletContext invoked multiple times."); - } - observed = true; - } - - public boolean isObserved() { - return observed; - } - - void observeDestroyedServletContext(@Observes @Destroyed(ApplicationScoped.class) ServletContext event) { - logger.log("ServletContext destroyed"); // this is tricky to test properly - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Observer2.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Observer2.java deleted file mode 100644 index d7e03ef37e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Observer2.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.event; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.event.Observes; -import jakarta.inject.Inject; -import jakarta.servlet.ServletContext; - -@Dependent -public class Observer2 { - - @Inject - Collector collector; - - void observe(@Observes @Initialized(ApplicationScoped.class) ServletContext event) { - collector.addContextPath(new Helper(ObserverNames.OBSERVER2_NAME, event)); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Observer3.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Observer3.java deleted file mode 100644 index 2c891c5859..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/Observer3.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.event; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.event.Observes; -import jakarta.inject.Inject; -import jakarta.servlet.ServletContext; - -@Dependent -public class Observer3 { - - @Inject - Collector collector; - - void observe(@Observes @Initialized(ApplicationScoped.class) ServletContext event) { - collector.addContextPath(new Helper(ObserverNames.OBSERVER3_NAME, event)); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/ObserverNames.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/ObserverNames.java deleted file mode 100644 index 1fae201d1d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/ObserverNames.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.event; - -public class ObserverNames { - - public static final String OBSERVER2_NAME = "org.jboss.cdi.tck.tests.context.application.event.Observer2"; - public static final String OBSERVER3_NAME = "org.jboss.cdi.tck.tests.context.application.event.Observer3"; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/PingServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/PingServlet.java deleted file mode 100644 index 04e40304f3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/event/PingServlet.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.application.event; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@WebServlet("/ping") -public class PingServlet extends HttpServlet { - - @Inject - Collector collector; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - - for (Helper helper : collector.getContextPaths()) { - resp.getWriter().append(helper.getClassName() + " " + helper.getContext()); - } - resp.setContentType("text/plain"); - - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/Action.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/Action.java deleted file mode 100644 index 737067e61b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/Action.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.postconstruct; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - * - */ -@RequestScoped -public class Action { - - private boolean isApplicationContextActiveDuringPostConstruct = false; - - @Inject - Service service; - - @Inject - BeanManager beanManager; - - @PostConstruct - public void init() { - if (beanManager != null && beanManager.getContext(ApplicationScoped.class).isActive() && service != null - && service.ping()) { - isApplicationContextActiveDuringPostConstruct = true; - } - } - - public boolean isApplicationContextActiveDuringPostConstruct() { - return isApplicationContextActiveDuringPostConstruct; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/EagerSingleton.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/EagerSingleton.java deleted file mode 100644 index 2714304431..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/EagerSingleton.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.postconstruct; - -import jakarta.annotation.PostConstruct; -import jakarta.ejb.Singleton; -import jakarta.ejb.Startup; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - * - */ -@Startup -@Singleton -@ApplicationScoped -public class EagerSingleton { - - private boolean isApplicationContextActiveDuringPostConstruct = false; - - @Inject - Service service; - - @Inject - BeanManager beanManager; - - @PostConstruct - public void init() { - if (beanManager != null && beanManager.getContext(ApplicationScoped.class).isActive() && service != null - && service.ping()) { - isApplicationContextActiveDuringPostConstruct = true; - } - } - - public boolean isApplicationContextActiveDuringPostConstruct() { - return isApplicationContextActiveDuringPostConstruct; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/EagerSingletonPostConstructCallbackTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/EagerSingletonPostConstructCallbackTest.java deleted file mode 100644 index c06bdfbd82..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/EagerSingletonPostConstructCallbackTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.postconstruct; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.APPLICATION_CONTEXT_EE; -import static org.testng.Assert.assertTrue; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test the request context is active during @PostConstruct callback of an eager singleton. - * - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EagerSingletonPostConstructCallbackTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(EagerSingletonPostConstructCallbackTest.class) - .withClasses(EagerSingleton.class, Service.class).build(); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, groups = INTEGRATION) - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "h") - public void testEagerSingletonPostConstructCallback(EagerSingleton eagerSingleton) throws Exception { - assertTrue(eagerSingleton.isApplicationContextActiveDuringPostConstruct()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/Service.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/Service.java deleted file mode 100644 index 6f62860f32..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/Service.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.postconstruct; - -import jakarta.enterprise.context.ApplicationScoped; - -/** - * @author Martin Kouba - * - */ -@ApplicationScoped -public class Service { - - public boolean ping() { - return true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/SimpleBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/SimpleBean.java deleted file mode 100644 index 51f10a99b0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/SimpleBean.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.postconstruct; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - * - */ -@Dependent -public class SimpleBean { - - private boolean isApplicationContextActiveDuringPostConstruct = false; - - @Inject - Service service; - - @Inject - BeanManager beanManager; - - @PostConstruct - public void init() { - if (beanManager != null && beanManager.getContext(ApplicationScoped.class).isActive() && service != null - && service.ping()) { - isApplicationContextActiveDuringPostConstruct = true; - } - } - - public boolean isApplicationContextActiveDuringPostConstruct() { - return isApplicationContextActiveDuringPostConstruct; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/SimpleBeanPostConstructCallbackTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/SimpleBeanPostConstructCallbackTest.java deleted file mode 100644 index c0d6dcd885..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/postconstruct/SimpleBeanPostConstructCallbackTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.postconstruct; - -import static org.jboss.cdi.tck.cdi.Sections.APPLICATION_CONTEXT_EE; -import static org.testng.Assert.assertTrue; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test the request context is active during @PostConstruct callback of a simple bean. - * - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SimpleBeanPostConstructCallbackTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(SimpleBeanPostConstructCallbackTest.class) - .withClasses(SimpleBean.class, Service.class, Action.class).build(); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "h") - public void testSimplePostConstructCallback(Action action, SimpleBean simpleBean) throws Exception { - assertTrue(action.isApplicationContextActiveDuringPostConstruct()); - assertTrue(simpleBean.isApplicationContextActiveDuringPostConstruct()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/predestroy/ApplicationContextPreDestroyTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/predestroy/ApplicationContextPreDestroyTest.java deleted file mode 100644 index 169db074ab..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/predestroy/ApplicationContextPreDestroyTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.predestroy; - -import static org.jboss.cdi.tck.cdi.Sections.APPLICATION_CONTEXT_EE; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ApplicationContextPreDestroyTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ApplicationContextPreDestroyTest.class).build(); - } - - @Inject - Bar bar; - - @Test - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "dh") - public void testApplicationContextActivePreDestroy() { - Bean bean = getUniqueBean(Foo.class); - CreationalContext ctx = getCurrentManager().createCreationalContext(bean); - Foo foo = bean.create(ctx); - assertFalse(foo.isBarAlone()); - bean.destroy(foo, ctx); - assertTrue(bar.isAlone()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/predestroy/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/predestroy/Bar.java deleted file mode 100644 index b993242bbc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/predestroy/Bar.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.predestroy; - -import jakarta.enterprise.context.ApplicationScoped; - -/** - * @author Martin Kouba - */ -@ApplicationScoped -public class Bar { - - private boolean isAlone = false; - - public void setAlone() { - isAlone = true; - } - - public boolean isAlone() { - return isAlone; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/predestroy/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/application/predestroy/Foo.java deleted file mode 100644 index 6924e0dc50..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/application/predestroy/Foo.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.application.predestroy; - -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - */ -@RequestScoped -public class Foo { - - @Inject - Bar bar; - - @PreDestroy - public void sayGoodbye() { - bar.setAlone(); - } - - public boolean isBarAlone() { - return bar.isAlone(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/AbstractConversationTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/AbstractConversationTest.java deleted file mode 100644 index f06a09e36c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/AbstractConversationTest.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation; - -import java.net.URL; -import java.util.HashSet; -import java.util.Set; - -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; - -import com.gargoylesoftware.htmlunit.Page; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.html.HtmlElement; -import com.gargoylesoftware.htmlunit.html.HtmlPage; - -public abstract class AbstractConversationTest extends AbstractTest { - - @ArquillianResource - protected URL contextPath; - - public static final String CID_REQUEST_PARAMETER_NAME = "cid"; - - public static final String CID_HEADER_NAME = "org.jboss.cdi.tck.cid"; - - public static final String LONG_RUNNING_HEADER_NAME = "org.jboss.cdi.tck.longRunning"; - - protected boolean isCloudDestroyed(WebClient client) throws Exception { - Page page = client.getPage(getConversationStatusPath("cloudDestroyed")); - return page.getWebResponse().getStatusCode() == 200; - } - - protected boolean isConversationContextDestroyed(WebClient client) throws Exception { - Page page = client.getPage(getConversationStatusPath("conversationContextDestroyed")); - return page.getWebResponse().getStatusCode() == 200; - } - - protected void resetCloud(WebClient client) throws Exception { - client.getPage(getConversationStatusPath("resetCloud")); - } - - protected void resetConversationContextObserver(WebClient client) throws Exception { - client.getPage(getConversationStatusPath("resetConversationContextObserver")); - } - - protected void invalidateSession(WebClient client) throws Exception { - client.getPage(getConversationStatusPath("invalidateSession")); - } - - protected String getConversationStatusPath(String method) { - return contextPath + "conversation-status?method=" + method; - } - - protected String getPath(String viewId) { - return contextPath + viewId; - } - - protected String getPath(String viewId, String cid) { - return contextPath + viewId + "?" + CID_REQUEST_PARAMETER_NAME + "=" + cid; - } - - protected Set getElements(HtmlElement rootElement, Class elementClass) { - Set result = new HashSet(); - - for (HtmlElement element : rootElement.getHtmlElementDescendants()) { - result.addAll(getElements(element, elementClass)); - } - - if (elementClass.isInstance(rootElement)) { - result.add(elementClass.cast(rootElement)); - } - return result; - - } - - /** - * Note that this method doesn't return the first element whose id equals specified id but the one whose id contains - * specified id! - * - * @param page - * @param elementClass - * @param id - * @return the first element whose id contains specified id - */ - protected T getFirstMatchingElement(HtmlPage page, Class elementClass, String id) { - - Set inputs = getElements(page.getBody(), elementClass); - for (T input : inputs) { - if (input.getId().contains(id)) { - return input; - } - } - return null; - } - - protected String getCid(Page page) { - return page.getWebResponse().getResponseHeaderValue(AbstractConversationTest.CID_HEADER_NAME); - } - - protected Boolean hasRained(Page page) { - return Boolean.valueOf(page.getWebResponse().getResponseHeaderValue(Cloud.RAINED_HEADER_NAME)); - } - - protected Boolean isLongRunning(Page page) { - return Boolean.valueOf(page.getWebResponse().getResponseHeaderValue(LONG_RUNNING_HEADER_NAME)); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/BuiltInConversation.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/BuiltInConversation.java deleted file mode 100644 index f92618e9a2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/BuiltInConversation.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation; - -import java.io.Serializable; -import java.lang.annotation.Annotation; -import java.util.Set; - -import jakarta.enterprise.context.Conversation; -import jakarta.enterprise.context.ConversationScoped; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.Default; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.inject.Named; - -@ConversationScoped -@Named("builtin") -public class BuiltInConversation implements Serializable { - private static final long serialVersionUID = 1L; - @Inject - private BeanManager manager; - @Inject - private Conversation conversation; - - public boolean isScopeCorrect() { - return getConversationBean().getScope().equals(RequestScoped.class); - } - - public boolean isQualifierCorrect() { - for (Annotation qualifier : getConversationBean().getQualifiers()) { - if (qualifier.annotationType().equals(Default.class)) { - return true; - } - } - return false; - } - - public boolean isNameCorrect() { - return getConversationBean().getName().equals("jakarta.enterprise.context.conversation"); - } - - public boolean isDefaultConversationHasNullId() { - return conversation.isTransient() && conversation.getId() == null; - } - - private Bean getConversationBean() { - Set> beans = manager.getBeans(Conversation.class); - if (beans.size() != 1) { - throw new RuntimeException("Multiple beans found for Conversation class."); - } - return beans.iterator().next(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ClientConversationContextTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ClientConversationContextTest.java deleted file mode 100644 index 8ae41912d9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ClientConversationContextTest.java +++ /dev/null @@ -1,409 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.CONVERSATION; -import static org.jboss.cdi.tck.cdi.Sections.CONVERSATION_CONTEXT_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.Page; -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.gargoylesoftware.htmlunit.html.HtmlSpan; -import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput; - -/** - * @author Nicklas Karlsson - * @author Dan Allen - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ClientConversationContextTest extends AbstractConversationTest { - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassDefinition(ClientConversationContextTest.class) - .withClasses(Storm.class, ConversationTestPhaseListener.class, ConversationStatusServlet.class, Cloud.class, - CloudController.class, OutermostFilter.class, Cumulus.class, BuiltInConversation.class, - ConversationContextObserver.class) - .withWebResource("home.xhtml").withWebResource("cloud.xhtml") - .withWebResource("clouds.xhtml").withWebResource("cumulus.xhtml").withWebResource("builtin.xhtml") - .withWebResource("error.xhtml").withWebResource("storm.xhtml").withWebResource("rain.xhtml") - .withWebResource("faces-config.xml", "/WEB-INF/faces-config.xml").withWebXml("web.xml").build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "hb") - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "o") - public void testConversationIdSetByContainerIsUnique() throws Exception { - WebClient client = new WebClient(); - HtmlPage storm = client.getPage(getPath("storm.jsf")); - HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, - "beginConversationButton"); - storm = beginConversationButton.click(); - - String c1 = getCid(storm); - - storm = client.getPage(getPath("storm.jsf")); - beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton"); - storm = beginConversationButton.click(); - - String c2 = getCid(storm); - - assertNotEquals(c1, c2); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "j") - public void testTransientConversationInstancesDestroyedAtRequestEnd() throws Exception { - WebClient client = new WebClient(); - - resetCloud(client); - resetConversationContextObserver(client); - - HtmlPage page = client.getPage(getPath("cloud.jsf")); - - assertFalse(isLongRunning(page)); - assertTrue(isCloudDestroyed(client)); - assertTrue(isConversationContextDestroyed(client)); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "k") - public void testLongRunningConversationInstancesNotDestroyedAtRequestEnd() throws Exception { - WebClient client = new WebClient(); - HtmlPage storm = client.getPage(getPath("storm.jsf")); - HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, - "beginConversationButton"); - storm = beginConversationButton.click(); - - resetCloud(client); - - client.getPage(getPath("cloud.jsf", getCid(storm))); - assert !isCloudDestroyed(client); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "p") - public void testConversationsDontCrossSessionBoundary1() throws Exception { - WebClient client = new WebClient(); - // Load the page - HtmlPage rain = client.getPage(getPath("rain.jsf")); - - // begin a conversation - HtmlSubmitInput beginConversationButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, - "beginConversationButton"); - rain = beginConversationButton.click(); - String cid = getCid(rain); - - // Cause rain - HtmlSubmitInput rainButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, "rain"); - rain = rainButton.click(); - - // Re-request the page, inside the conversation and check it has rained - rain = client.getPage(getPath("rain.jsf", cid)); - assertTrue(hasRained(rain)); - - // Invalidate the session, invalidate the conversation-scoped cloud - invalidateSession(client); - - // Re-request the page, check NonexistentConversationException is thrown - verifyNonexistentConversationExceptionThrown(client.getPage(getPath("rain.jsf", cid))); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "p") - public void testConversationsDontCrossSessionBoundary2() throws Exception { - WebClient client = new WebClient(); - - // Load the page - HtmlPage rain = client.getPage(getPath("rain.jsf")); - - // begin a conversation - HtmlSubmitInput beginConversationButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, - "beginConversationButton"); - rain = beginConversationButton.click(); - String cid = getCid(rain); - - // Cause rain - HtmlSubmitInput rainButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, "rain"); - rain = rainButton.click(); - - // Re-request the page, inside the conversation and check it has rained - rain = client.getPage(getPath("rain.jsf", cid)); - assertTrue(hasRained(rain)); - - // Create a new web client and load the page - WebClient client2 = new WebClient(); - verifyNonexistentConversationExceptionThrown(client2.getPage(getPath("rain.jsf", cid))); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "a") - public void testConversationActiveDuringNonFacesRequest() throws Exception { - WebClient client = new WebClient(); - HtmlPage page = client.getPage(getPath("cloud.jsf")); - HtmlSpan span = getFirstMatchingElement(page, HtmlSpan.class, "cloudName"); - assert span.getTextContent().equals(Cloud.NAME); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "f") - public void testConversationBeginMakesConversationLongRunning() throws Exception { - WebClient client = new WebClient(); - HtmlPage page = client.getPage(getPath("cumulus.jsf")); - assert !isLongRunning(page); - - // begin a conversation - HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, - "beginConversationButton"); - page = beginConversationButton.click(); - assert isLongRunning(page); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION, id = "r") - public void testBeginAlreadyLongRunningConversationThrowsException() throws Exception { - WebClient client = new WebClient(); - HtmlPage page = client.getPage(getPath("cumulus.jsf")); - assert !isLongRunning(page); - - // begin a conversation - HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, - "beginConversationButton"); - page = beginConversationButton.click(); - assert isLongRunning(page); - - // begin a conversation again and check that IllegalStateException is thrown - HtmlSubmitInput beginConversationButton2 = getFirstMatchingElement(page, HtmlSubmitInput.class, - "beginConversationAndSwallowException"); - page = beginConversationButton2.click(); - assert page.getBody().getTextContent().contains("Hello world!"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION, id = "s") - public void testBeginConversationWithExplicitIdAlreadyUsedByDifferentConversation() throws Exception { - - WebClient client = new WebClient(); - HtmlPage page = client.getPage(getPath("cumulus.jsf")); - assertFalse(isLongRunning(page)); - - // Begin a conversation with explicit id - HtmlSubmitInput beginConversationButton = (HtmlSubmitInput) page - .getElementById("form:beginNextConversationIdentifiedByCustomIdentifier"); - page = beginConversationButton.click(); - assertTrue(isLongRunning(page)); - - // Try it again with the same id - page = client.getPage(getPath("cumulus.jsf")); - beginConversationButton = (HtmlSubmitInput) page - .getElementById("form:beginConversationIdentifiedByCustomIdentifierAndSwallowException"); - page = beginConversationButton.click(); - // Exception is swallowed and the browser is redirected to home - assertTrue(page.getBody().getTextContent().contains("Hello world!")); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "g") - @SpecAssertion(section = CONVERSATION, id = "k") - @SpecAssertion(section = CONVERSATION, id = "o") - public void testConversationEndMakesConversationTransient() throws Exception { - WebClient client = new WebClient(); - HtmlPage page = client.getPage(getPath("cumulus.jsf")); - assert !isLongRunning(page); - - // begin a conversation - HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, - "beginConversationButton"); - page = beginConversationButton.click(); - assert isLongRunning(page); - - // end a conversation - HtmlSubmitInput endConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "endConversationButton"); - page = endConversationButton.click(); - assert !isLongRunning(page); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION, id = "q") - public void testEndTransientConversationThrowsException() throws Exception { - WebClient client = new WebClient(); - HtmlPage page = client.getPage(getPath("cumulus.jsf")); - assert !isLongRunning(page); - - // try ending a transient conversation - HtmlSubmitInput endConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, - "endConversationAndSwallowException"); - page = endConversationButton.click(); - assert page.getBody().getTextContent().contains("Hello world!"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION, id = "ib") - @SpecAssertion(section = CONVERSATION, id = "iaa") - public void testBeanWithRequestScope() throws Exception { - WebClient client = new WebClient(); - HtmlPage page = client.getPage(getPath("builtin.jsf")); - assert page.getBody().getTextContent().contains("Correct scope: true"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION, id = "id") - public void testBeanWithDefaultQualifier() throws Exception { - WebClient client = new WebClient(); - HtmlPage page = client.getPage(getPath("builtin.jsf")); - assert page.getBody().getTextContent().contains("Correct qualifier: true"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION, id = "ie") - public void testBeanWithNameJavaxEnterpriseContextConversation() throws Exception { - WebClient client = new WebClient(); - HtmlPage page = client.getPage(getPath("builtin.jsf")); - assert page.getBody().getTextContent().contains("Correct name: true"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION, id = "l") - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "e") - public void testTransientConversationHasNullId() throws Exception { - WebClient client = new WebClient(); - HtmlPage page = client.getPage(getPath("builtin.jsf")); - assert page.getBody().getTextContent().contains("Default conversation has null id: true"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "ha") - @SpecAssertion(section = CONVERSATION, id = "j") - public void testConversationIdMayBeSetByApplication() throws Exception { - WebClient client = new WebClient(); - HtmlPage page = client.getPage(getPath("cumulus.jsf")); - assertFalse(isLongRunning(page)); - - // begin a conversation - HtmlSubmitInput beginConversationButton = (HtmlSubmitInput) page - .getElementById("form:beginConversationIdentifiedByCustomIdentifier"); - page = beginConversationButton.click(); - assertTrue(isLongRunning(page)); - assertEquals(getCid(page), "humilis"); - assertTrue(page.getBody().getTextContent().contains("Cumulus humilis")); - - HtmlPage nextPage = client.getPage(getPath("cumulus.jsf?cid=humilis")); - assertTrue(isLongRunning(nextPage)); - assertEquals(getCid(page), "humilis"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "hb") - @SpecAssertion(section = CONVERSATION, id = "j") - public void testConversationIdMayBeSetByContainer() throws Exception { - WebClient client = new WebClient(); - HtmlPage page = client.getPage(getPath("cumulus.jsf")); - assert !isLongRunning(page); - - // begin a conversation - HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, - "beginConversationButton"); - page = beginConversationButton.click(); - assert isLongRunning(page); - assert getCid(page) != null; - assert page.getBody().getTextContent().contains("Cumulus congestus"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "tb") - public void testNonexistentConversationExceptionThrown() throws Exception { - WebClient client = new WebClient(); - verifyNonexistentConversationExceptionThrown(client.getPage(getPath("cumulus.jsf?cid=foo"))); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION, id = "m") - @SpecAssertion(section = CONVERSATION, id = "n") - public void testSetConversationTimeoutOverride() throws Exception { - WebClient client = new WebClient(); - HtmlPage page = client.getPage(getPath("cumulus.jsf")); - assert !isLongRunning(page); - - // begin a conversation and set a custom timeout - HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, - "beginConversationAndSetTimeout"); - page = beginConversationButton.click(); - assert page.getBody().getTextContent().contains("Cumulonimbus"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION, id = "m") - public void testConversationHasDefaultTimeout() throws Exception { - WebClient client = new WebClient(); - HtmlPage page = client.getPage(getPath("cumulus.jsf")); - assert !isLongRunning(page); - - // begin a conversation - HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, - "beginConversationButton"); - page = beginConversationButton.click(); - assert page.getBody().getTextContent().contains("Stratocumulus"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "oa") - public void testSuppressedConversationPropagation() throws Exception { - WebClient client = new WebClient(); - - // Access the start page - HtmlPage cloud = client.getPage(getPath("cloud.jsf")); - assertEquals(getFirstMatchingElement(cloud, HtmlSpan.class, "cloudName").getTextContent(), Cloud.NAME); - - // Now start a conversation and check the cloud name changes - HtmlPage page1 = getFirstMatchingElement(cloud, HtmlSubmitInput.class, Cloud.CUMULUS).click(); - assertEquals(getFirstMatchingElement(page1, HtmlSpan.class, "cloudName").getTextContent(), Cloud.CUMULUS); - String cid = getCid(page1); - - // Activate the conversation from a GET request - HtmlPage page2 = client.getPage(getPath("cloud.jsf", cid)); - assertEquals(getFirstMatchingElement(page2, HtmlSpan.class, "cloudName").getTextContent(), Cloud.CUMULUS); - - // Send a GET request with the "cid" parameter and suppressed conversation propagation (using - // conversationPropagation=none) - HtmlPage page3 = client.getPage(getPath("cloud.jsf", cid) + "&conversationPropagation=none"); - assertEquals(getFirstMatchingElement(page3, HtmlSpan.class, "cloudName").getTextContent(), Cloud.NAME); - } - - private void verifyNonexistentConversationExceptionThrown(Page page) { - if (page instanceof TextPage) { - TextPage textPage = (TextPage) page; - assertTrue(textPage.getContent().contains("NonexistentConversationException thrown properly")); - assertTrue(textPage.getContent().contains("Conversation.isTransient: true")); - assertTrue(textPage.getContent().contains("Cloud: " + Cloud.NAME)); - } else { - fail("Unexpected response type: " + page.getClass().getName()); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/Cloud.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/Cloud.java deleted file mode 100644 index 1d32a68329..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/Cloud.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation; - -import java.io.Serializable; - -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.Conversation; -import jakarta.enterprise.context.ConversationScoped; -import jakarta.enterprise.inject.Default; -import jakarta.inject.Inject; -import jakarta.inject.Named; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@Named -@Default -@ConversationScoped -public class Cloud implements Serializable { - /** - * - */ - private static final long serialVersionUID = 5765109971012677278L; - - private static final SimpleLogger logger = new SimpleLogger(Cloud.class); - - public static final String NAME = Cloud.class.getName() + ".Pete"; - - public static final String RAINED_HEADER_NAME = Cloud.class.getName() + ".rained"; - - public static final String CUMULUS = "cumulus"; - - private static boolean destroyed = false; - - private boolean rained; - - private String name = NAME; - - @Inject - Conversation conversation; - - @PreDestroy - public void destroy() { - destroyed = true; - } - - public static boolean isDestroyed() { - return destroyed; - } - - public static void setDestroyed(boolean destroyed) { - Cloud.destroyed = destroyed; - } - - public String getName() { - return name; - } - - public void rain() { - rained = true; - logger.log("rain!"); - } - - public boolean isRained() { - return rained; - } - - public void cumulus() { - this.name = CUMULUS; - conversation.begin(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/CloudController.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/CloudController.java deleted file mode 100644 index d4252ae040..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/CloudController.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation; - -import jakarta.enterprise.context.Conversation; -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; -import jakarta.inject.Named; - -@Named -@Dependent -public class CloudController { - @Inject - Conversation conversation; - - public String getBeginConversation() { - conversation.begin(); - return "long-running conversation begun"; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ConversationContextObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ConversationContextObserver.java deleted file mode 100644 index cbcc65156d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ConversationContextObserver.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.ConversationScoped; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.event.Observes; -import jakarta.servlet.ServletRequest; - -@ApplicationScoped -public class ConversationContextObserver { - - private static boolean initialized = false; - private static boolean destroyed = false; - - public void observeConversationInitialized(@Observes @Initialized(ConversationScoped.class) ServletRequest event) { - initialized = true; - } - - public void observeConversationDestroyed(@Observes @Destroyed(ConversationScoped.class) ServletRequest event) { - destroyed = true; - } - - public static boolean isInitialized() { - return initialized; - } - - public static boolean isDestroyed() { - return destroyed; - } - - public static void reset() { - initialized = false; - destroyed = false; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ConversationStatusServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ConversationStatusServlet.java deleted file mode 100644 index 33d5de3b05..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ConversationStatusServlet.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation; - -import java.io.IOException; -import java.io.ObjectOutputStream; - -import jakarta.enterprise.context.Conversation; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.BeanLookupUtils; - -public class ConversationStatusServlet extends HttpServlet { - - private static final long serialVersionUID = 2984756941080790899L; - - @Inject - private BeanManager beanManager; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - String method = req.getParameter("method"); - if ("cid".equals(method)) { - Conversation conversation = BeanLookupUtils.getContextualReference(beanManager, Conversation.class); - serializeToResponse(conversation.getId(), resp); - } else if ("cloudDestroyed".equals(method)) { - if (Cloud.isDestroyed()) { - resp.setStatus(HttpServletResponse.SC_OK); - } else { - resp.setStatus(208); - } - } else if ("conversationContextDestroyed".equals(method)) { - if (ConversationContextObserver.isDestroyed()) { - resp.setStatus(HttpServletResponse.SC_OK); - } else { - resp.setStatus(208); - } - } else if ("invalidateSession".equals(method)) { - req.getSession().invalidate(); - } else if ("resetCloud".equals(method)) { - Cloud.setDestroyed(false); - } else if ("resetConversationContextObserver".equals(method)) { - ConversationContextObserver.reset(); - } else { - resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); - } - } - - private void serializeToResponse(Object object, HttpServletResponse resp) throws IOException { - ObjectOutputStream oos = new ObjectOutputStream(resp.getOutputStream()); - oos.writeObject(object); - oos.flush(); - oos.close(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ConversationTestPhaseListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ConversationTestPhaseListener.java deleted file mode 100644 index 707421d150..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ConversationTestPhaseListener.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation; - -import jakarta.enterprise.context.ContextNotActiveException; -import jakarta.enterprise.context.Conversation; -import jakarta.enterprise.context.ConversationScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.CDI; -import jakarta.faces.event.PhaseEvent; -import jakarta.faces.event.PhaseId; -import jakarta.faces.event.PhaseListener; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.BeanLookupUtils; - -public class ConversationTestPhaseListener implements PhaseListener { - - private static final long serialVersionUID = 1197355854770726526L; - - public static final String ACTIVE_BEFORE_APPLY_REQUEST_VALUES_HEADER_NAME = "org.jboss.cdi.tck.activeBeforeApplyRequestValues"; - - private boolean activeBeforeApplyRequestValues; - - public void afterPhase(PhaseEvent event) { - } - - public void beforePhase(PhaseEvent event) { - - BeanManager beanManager = CDI.current().getBeanManager(); - - if (event.getPhaseId().equals(PhaseId.APPLY_REQUEST_VALUES)) { - try { - beanManager.getContext(ConversationScoped.class); - activeBeforeApplyRequestValues = true; - } catch (ContextNotActiveException e) { - activeBeforeApplyRequestValues = false; - } - } - if (event.getPhaseId().equals(PhaseId.RENDER_RESPONSE)) { - Conversation conversation = CDI.current().select(Conversation.class).get(); - HttpServletResponse response = (HttpServletResponse) event.getFacesContext().getExternalContext().getResponse(); - response.addHeader(AbstractConversationTest.CID_HEADER_NAME, - conversation.getId() == null ? " null" : conversation.getId()); - response.addHeader(AbstractConversationTest.LONG_RUNNING_HEADER_NAME, String.valueOf(!conversation.isTransient())); - response.addHeader(Cloud.RAINED_HEADER_NAME, - new Boolean(BeanLookupUtils.getContextualReference(beanManager, Cloud.class) - .isRained()).toString()); - response.addHeader(ACTIVE_BEFORE_APPLY_REQUEST_VALUES_HEADER_NAME, - new Boolean(activeBeforeApplyRequestValues).toString()); - } - } - - public PhaseId getPhaseId() { - return PhaseId.ANY_PHASE; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/Cumulus.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/Cumulus.java deleted file mode 100644 index abc7930db9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/Cumulus.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation; - -import java.io.Serializable; - -import jakarta.enterprise.context.Conversation; -import jakarta.enterprise.context.ConversationScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; - -@ConversationScoped -@Named -public class Cumulus implements Serializable { - private static final long serialVersionUID = 1L; - private static final int timeout = 15000; - private static final String customCid = "humilis"; - private static final String customCidAlreadyInUse = "alreadyInUse"; - - @Inject - private Conversation conversation; - - public void beginConversation() { - conversation.begin(); - } - - public void beginConversationIdentifiedByCustomIdentifier() { - conversation.begin(customCid); - } - - public void beginNextConversationIdentifiedByCustomIdentifier() { - conversation.begin(customCidAlreadyInUse); - } - - public String beginConversationIdentifiedByCustomIdentifierAndSwallowException() { - try { - beginNextConversationIdentifiedByCustomIdentifier(); - return "error"; - } catch (IllegalArgumentException e) { - return "home"; - } - } - - public String beginConversationAndSwallowException() { - try { - conversation.begin(); - return "error"; - } catch (IllegalStateException e) { - return "home"; - } - } - - public void beginConversationAndSetTimeout() { - conversation.begin(); - conversation.setTimeout(timeout); - } - - public void endConversation() { - conversation.end(); - } - - public String endConversationAndSwallowException() { - try { - conversation.end(); - return "error"; - } catch (IllegalStateException e) { - return "home"; - } - } - - public boolean isConversationIdentifiedByCustomIdentifier() { - return !conversation.isTransient() && conversation.getId().equals(customCid); - } - - public boolean isConversationIdentifierNull() { - return conversation.getId() == null; - } - - public boolean isConversationTimeoutSetProperly() { - return conversation.getTimeout() == timeout; - } - - public boolean isConversationHasDefaultTimeout() { - return conversation.getTimeout() > 0; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/InvalidatingSessionDestroysConversationTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/InvalidatingSessionDestroysConversationTest.java deleted file mode 100644 index 5da7850d22..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/InvalidatingSessionDestroysConversationTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.CONVERSATION_CONTEXT_EE; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * @author Nicklas Karlsson - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class InvalidatingSessionDestroysConversationTest extends AbstractConversationTest { - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassDefinition(InvalidatingSessionDestroysConversationTest.class) - .withClasses(Storm.class, ConversationTestPhaseListener.class, ConversationStatusServlet.class, Cloud.class, - CloudController.class, OutermostFilter.class) - .withWebResource("cloud.xhtml") - .withBeansXml(new BeansXml(BeanDiscoveryMode.ALL)) - .withWebResource("clouds.xhtml").withWebResource("faces-config.xml", "/WEB-INF/faces-config.xml") - .withWebXml("web.xml").build(); - } - - @Test - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "qa") - // Doesn't precisely probe the boundaries of the service() method, rather tests that the conversation - // is eventually destroyed. - public void testInvalidatingSessionDestroysConversation() throws Exception { - - WebClient webClient = new WebClient(); - - resetCloud(webClient); - webClient.getPage(getPath("clouds.jsf")); - - assertFalse(isCloudDestroyed(webClient)); - invalidateSession(webClient); - assertTrue(isCloudDestroyed(webClient)); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/LongRunningConversationPropagatedByFacesContextTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/LongRunningConversationPropagatedByFacesContextTest.java deleted file mode 100644 index d8b412471d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/LongRunningConversationPropagatedByFacesContextTest.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BUILTIN_SCOPES; -import static org.jboss.cdi.tck.cdi.Sections.CONVERSATION_CONTEXT_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.time.Duration; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.selenium.DriverPool; -import org.jboss.cdi.tck.selenium.ExtendedWebDriver; -import org.jboss.cdi.tck.selenium.WebPage; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.html.HtmlInput; -import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput; -import com.gargoylesoftware.htmlunit.html.HtmlTextInput; - -/** - * @author Nicklas Karlsson - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class LongRunningConversationPropagatedByFacesContextTest extends AbstractConversationTest { - - private static final String STORM_STRENGTH = "12"; - private static final String REDIRECT_STORM_STRENGTH = "15"; - private static final String AJAX_STORM_STRENGTH = "20"; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassDefinition(LongRunningConversationPropagatedByFacesContextTest.class) - .withClasses(Storm.class, ConversationTestPhaseListener.class, ConversationStatusServlet.class, Cloud.class, - OutermostFilter.class) - .withWebResource("storm.xhtml").withWebResource("storm-ajax.xhtml") - .withWebResource("thunder.xhtml").withWebResource("lightening.xhtml") - .withWebResource("faces-config.xml", "/WEB-INF/faces-config.xml").withWebXml("web.xml").build(); - } - - @Test - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "l") - @SpecAssertion(section = BUILTIN_SCOPES, id = "ba") - public void testConversationPropagated() throws Exception { - - WebClient webClient = new WebClient(); - - HtmlPage storm = webClient.getPage(getPath("storm.jsf")); - - // Begin long-running conversation - HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, - "beginConversationButton"); - storm = beginConversationButton.click(); - // Set input value - HtmlTextInput stormStrength = getFirstMatchingElement(storm, HtmlTextInput.class, "stormStrength"); - stormStrength.setValueAttribute(STORM_STRENGTH); - String stormCid = getCid(storm); - // Submit value and forward to the next form - HtmlSubmitInput thunderButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "thunderButton"); - HtmlPage thunder = thunderButton.click(); - - assertEquals(stormCid, getCid(thunder)); - stormStrength = getFirstMatchingElement(thunder, HtmlTextInput.class, "stormStrength"); - assertEquals(stormStrength.getValueAttribute(), STORM_STRENGTH); - } - - @Test - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "m") - public void testConversationPropagatedOverRedirect() throws Exception { - - WebClient webClient = new WebClient(); - - HtmlPage storm = webClient.getPage(getPath("storm.jsf")); - - // Begin long-running conversation - HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, - "beginConversationButton"); - storm = beginConversationButton.click(); - // Set input value - HtmlTextInput stormStrength = getFirstMatchingElement(storm, HtmlTextInput.class, "stormStrength"); - stormStrength.setValueAttribute(REDIRECT_STORM_STRENGTH); - String stormCid = getCid(storm); - // Submit value and redirect to the next form - HtmlSubmitInput lighteningButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "lighteningButton"); - HtmlPage lightening = lighteningButton.click(); - - assertTrue(lightening.getWebResponse().getWebRequest().getUrl().toString().contains("lightening.jsf")); - assertEquals(stormCid, getCid(lightening)); - stormStrength = getFirstMatchingElement(lightening, HtmlTextInput.class, "stormStrength"); - assertEquals(stormStrength.getValueAttribute(), REDIRECT_STORM_STRENGTH); - } - - @Test - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "l") - public void testConversationPropagatedAjax() throws Exception { - - String selenium = System.getProperty("run.selenium", "false"); - if ("true".equals(selenium)) { - DriverPool driverPool = new DriverPool(); - ExtendedWebDriver webDriver = driverPool.getOrNewInstance(); - - webDriver.get(getPath("storm-ajax.jsf")); - WebPage page = new WebPage(webDriver); - page.waitForPageToLoad(Duration.ofSeconds(120)); - - WebElement beginConversationButton = page.findElement(By.id("ajaxForm:beginConversationButton")); - assertNotNull(beginConversationButton); - beginConversationButton.click(); - - page.waitReqJs(); - - WebElement conversationId = page.findElement(By.id("ajaxForm:conversationId")); - String cid = conversationId.getAttribute("value"); - assertFalse(cid.isEmpty()); - - WebElement stormStrength = page.findElement(By.id("ajaxForm:stormStrength")); - stormStrength.sendKeys(AJAX_STORM_STRENGTH); - WebElement thunderButton = page.findElement(By.id("ajaxForm:thunderButton")); - assertNotNull(thunderButton); - thunderButton.click(); - - page.waitReqJs(); - - webDriver.get(getPath("thunder.jsf", cid)); - WebPage thunderPage = new WebPage(webDriver); - thunderPage.waitForPageToLoad(Duration.ofSeconds(120)); - - stormStrength = thunderPage.findElement(By.id("form:stormStrength")); - assertEquals(stormStrength.getAttribute("value"), AJAX_STORM_STRENGTH); - - driverPool.returnInstance(webDriver); - driverPool.quitAll(); - } else { - WebClient webClient = new WebClient(); - webClient.setAjaxController(new NicelyResynchronizingAjaxController()); - - HtmlPage storm = webClient.getPage(getPath("storm-ajax.jsf")); - - // Begin long-running conversation - note that we use ajax - HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, - "beginConversationButton"); - storm = beginConversationButton.click(); - String cid = getFirstMatchingElement(storm, HtmlInput.class, "conversationId").getValueAttribute(); - assertFalse(cid.isEmpty()); - - // Set input value - HtmlTextInput stormStrength = getFirstMatchingElement(storm, HtmlTextInput.class, "stormStrength"); - stormStrength.setValueAttribute(AJAX_STORM_STRENGTH); - // Submit value - note that we use ajax - HtmlSubmitInput thunderButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "thunderButton"); - thunderButton.click(); - - HtmlPage thunder = webClient.getPage(getPath("thunder.jsf", cid)); - stormStrength = getFirstMatchingElement(thunder, HtmlTextInput.class, "stormStrength"); - assertEquals(stormStrength.getValueAttribute(), AJAX_STORM_STRENGTH); - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ManualCidPropagationTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ManualCidPropagationTest.java deleted file mode 100644 index cbd2c1bc73..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/ManualCidPropagationTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.CONVERSATION_CONTEXT_EE; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput; - -/** - * @author Nicklas Karlsson - * @author Dan Allen - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class ManualCidPropagationTest extends AbstractConversationTest { - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassDefinition(ManualCidPropagationTest.class) - .withClasses(Storm.class, ConversationTestPhaseListener.class, ConversationStatusServlet.class, Cloud.class, - CloudController.class, OutermostFilter.class) - .withWebResource("cloud.xhtml") - .withWebResource("storm.xhtml").withWebResource("clouds.xhtml") - .withWebResource("faces-config.xml", "/WEB-INF/faces-config.xml").withWebXml("web.xml").build(); - } - - @Test - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "n") - public void testManualCidPropagation() throws Exception { - - WebClient webClient = new WebClient(); - - HtmlPage storm = webClient.getPage(getPath("storm.jsf")); - HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, - "beginConversationButton"); - storm = beginConversationButton.click(); - - String c1 = getCid(storm); - - HtmlPage cloud = webClient.getPage(getPath("cloud.jsf", c1)); - - String c2 = getCid(cloud); - - assert isLongRunning(cloud); - assert c1.equals(c2); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/OutermostFilter.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/OutermostFilter.java deleted file mode 100644 index b58eb1ebf5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/OutermostFilter.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation; - -import java.io.IOException; - -import jakarta.enterprise.context.Conversation; -import jakarta.enterprise.context.NonexistentConversationException; -import jakarta.inject.Inject; -import jakarta.servlet.Filter; -import jakarta.servlet.FilterChain; -import jakarta.servlet.FilterConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; - -public class OutermostFilter implements Filter { - @Inject - private Conversation conversation; - @Inject - private Cloud cloud; - - public void destroy() { - } - - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, - ServletException { - if ("foo".equals(request.getParameter("cid"))) { - try { - chain.doFilter(request, response); - throw new RuntimeException("Expected exception not thrown"); - } catch (NonexistentConversationException e) { - writeNonexistenConversationException(response); - } - } else { - try { - chain.doFilter(request, response); - } catch (NonexistentConversationException e) { - writeNonexistenConversationException(response); - } - } - } - - public void init(FilterConfig filterConfig) throws ServletException { - } - - private void writeNonexistenConversationException(ServletResponse response) throws IOException { - response.setContentType("text/plain"); - response.getWriter().print("NonexistentConversationException thrown properly\n"); - response.getWriter().print("Conversation.isTransient: " + conversation.isTransient()); - response.getWriter().print("Cloud: " + cloud.getName()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/Storm.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/Storm.java deleted file mode 100644 index 0807729899..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/Storm.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation; - -import java.io.Serializable; - -import jakarta.enterprise.context.Conversation; -import jakarta.enterprise.context.ConversationScoped; -import jakarta.inject.Inject; -import jakarta.inject.Named; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@Named -@ConversationScoped -public class Storm implements Serializable { - - private static final long serialVersionUID = -1513633490356967202L; - - private final SimpleLogger logger = new SimpleLogger(Storm.class); - - @Inject - Conversation conversation; - - private String strength; - - public String thunder() { - return "thunder"; - } - - public String lightening() { - return "lightening?faces-redirect=true"; - } - - public void beginConversation() { - conversation.begin(); - logger.log("Long-running conversation {0}", conversation.getId()); - } - - public String getStrength() { - return strength; - } - - public void setStrength(String strength) { - logger.log("Set strength {0} in conversation {1}", strength, conversation.getId()); - this.strength = strength; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/AsyncFooServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/AsyncFooServlet.java deleted file mode 100644 index 9281c8610f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/AsyncFooServlet.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.determination; - -import java.io.IOException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -import jakarta.inject.Inject; -import jakarta.servlet.AsyncContext; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@WebServlet(value = { "/foo-async" }, asyncSupported = true) -@SuppressWarnings("serial") -public class AsyncFooServlet extends HttpServlet { - - public static final String TIMEOUT = "timeout"; - public static final String COMPLETE = "complete"; - public static final String ERROR = "error"; - public static final String LOOP = "loop"; - - private static boolean inLoop = false; - private ExecutorService executorService; - - @Inject - StatusBean statusBean; - - @Override - public void init() throws ServletException { - // Note that executor thread does not use the same CL - executorService = Executors.newSingleThreadExecutor(); - } - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - String param = req.getParameter("action"); - String cid = req.getParameter("cid"); - - statusBean.reset(); - final AsyncContext actx = req.startAsync(); - actx.addListener(actx.createListener(QuxAsyncListener.class)); - resp.setContentType("text/plain"); - - if (TIMEOUT.equals(param)) { - actx.setTimeout(150l); - } else if (COMPLETE.equals(param)) { - executorService.execute(new AsyncRequestProcessor(actx, 50l, false, null)); - } else if (ERROR.equals(param)) { - executorService.execute(new AsyncRequestProcessor(actx, 50l, true, "/FailingServlet?cid=" + cid)); - } else if (LOOP.equals(param)) { - if (inLoop) { - executorService.execute(new AsyncRequestProcessor(actx, 50l, false, null)); - - } else { - executorService.execute(new AsyncRequestProcessor(actx, 50l, true, null)); - inLoop = true; - } - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/AsyncRequestProcessor.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/AsyncRequestProcessor.java deleted file mode 100644 index 20b5492f75..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/AsyncRequestProcessor.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.conversation.determination; - -import jakarta.servlet.AsyncContext; - -import org.jboss.cdi.tck.util.SimpleLogger; -import org.jboss.cdi.tck.util.Timer; - -/** - * @author Martin Kouba - */ -public class AsyncRequestProcessor implements Runnable { - - private static final SimpleLogger logger = new SimpleLogger(AsyncRequestProcessor.class); - - private final AsyncContext actx; - - private final long timerValue; - - private final String dispatchPath; - - private final boolean useDispatch; - - public AsyncRequestProcessor(AsyncContext ctx, long timerValue, boolean useDispatch, String dispatchPath) { - super(); - this.actx = ctx; - this.timerValue = timerValue; - this.dispatchPath = dispatchPath; - this.useDispatch = useDispatch; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Runnable#run() - */ - @Override - public void run() { - try { - if (timerValue > 0) { - // Simulate long running operation - Timer.startNew(timerValue); - } - } catch (InterruptedException e) { - throw new IllegalStateException("Interrupted"); - } - - // Dispatch or complete - if (useDispatch) { - if (dispatchPath != null) { - actx.dispatch(dispatchPath); - } else { - actx.dispatch(); - - } - } else { - actx.complete(); - } - logger.log("Async processing finished"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/BarFilter.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/BarFilter.java deleted file mode 100644 index 8e115959dc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/BarFilter.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.conversation.determination; - -import java.io.IOException; - -import jakarta.enterprise.context.Conversation; -import jakarta.inject.Inject; -import jakarta.servlet.Filter; -import jakarta.servlet.FilterChain; -import jakarta.servlet.FilterConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.annotation.WebFilter; - -/** - * @author Martin Kouba - * - */ -@WebFilter(filterName = "BarFilter", urlPatterns = "/foo") -public class BarFilter implements Filter { - - @Inject - Conversation conversation; - - @Inject - TestResult testResult; - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - } - - @Override - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, - ServletException { - - if ("test".equals(request.getParameter("action"))) { - if (FooServlet.CID.equals(conversation.getId())) { - // The long-running conversation is available - testResult.setFilterOk(); - } - } - chain.doFilter(request, response); - } - - @Override - public void destroy() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/BazRequestListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/BazRequestListener.java deleted file mode 100644 index 5b469f7f94..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/BazRequestListener.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.conversation.determination; - -import jakarta.enterprise.context.Conversation; -import jakarta.inject.Inject; -import jakarta.servlet.ServletRequestEvent; -import jakarta.servlet.ServletRequestListener; -import jakarta.servlet.annotation.WebListener; - -/** - * @author Martin Kouba - * - */ -@WebListener -public class BazRequestListener implements ServletRequestListener { - - @Inject - Conversation conversation; - - @Inject - TestResult testResult; - - @Override - public void requestDestroyed(ServletRequestEvent sre) { - } - - @Override - public void requestInitialized(ServletRequestEvent sre) { - - if ("test".equals(sre.getServletRequest().getParameter("action"))) { - if (FooServlet.CID.equals(conversation.getId())) { - // The long-running conversation is available - testResult.setListenerOk(); - } - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/ConversationDeterminationTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/ConversationDeterminationTest.java deleted file mode 100644 index be9d7cfa33..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/ConversationDeterminationTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.conversation.determination; - -import static org.jboss.cdi.tck.TestGroups.ASYNC_SERVLET; -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.CONVERSATION_CONTEXT_EE; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ConversationDeterminationTest extends AbstractTest { - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ConversationDeterminationTest.class).build(); - } - - @ArquillianResource - private URL contextPath; - - @Test(groups = { INTEGRATION, ASYNC_SERVLET }) - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "da") - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "db") - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "dc") - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "dd") - public void testConversationDetermination() throws Exception { - - WebClient webClient = new WebClient(); - webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); - - // Begin long-running conversation - TextPage cidPage = webClient.getPage(contextPath + "foo?action=begin"); - String cid = cidPage.getContent().substring(cidPage.getContent().indexOf("cid: [") + 6, - cidPage.getContent().indexOf("]")); - assertTrue(cidPage.getContent().contains("transient: false")); - - // Test built-in conversation bean is available - TextPage resultPage = webClient.getPage(getContextPath(contextPath, "foo", "test", cid)); - assertTrue(resultPage.getContent().contains("testServlet=true")); - assertTrue(resultPage.getContent().contains("testFilter=true")); - assertTrue(resultPage.getContent().contains("testListener=true")); - - // Async listener - webClient.getPage(getContextPath(contextPath, "foo-async", "complete", cid)); - TextPage results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onComplete: true")); - - webClient.getPage(getContextPath(contextPath, "foo-async", "timeout", cid)); - results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onTimeout: true")); - - webClient.getPage(getContextPath(contextPath, "foo-async", "error", cid)); - results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onError: true")); - - webClient.getPage(getContextPath(contextPath, "foo-async", "loop", cid)); - results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onStartAsync: true")); - } - - private String getContextPath(URL contextPath, String servlet, String param, String cid) { - return contextPath + servlet + "?action=" + param + "&cid=" + cid.trim(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/Duck.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/Duck.java deleted file mode 100644 index d4da66cced..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/Duck.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.determination; - -import java.io.Serializable; - -import jakarta.enterprise.context.ConversationScoped; - -@ConversationScoped -public class Duck implements Serializable { - - private static final long serialVersionUID = 1L; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/FailingServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/FailingServlet.java deleted file mode 100644 index bbea3d0235..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/FailingServlet.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.determination; - -import java.io.IOException; - -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@SuppressWarnings("serial") -@WebServlet(name = "FailingServlet", urlPatterns = { "/FailingServlet" }, asyncSupported = true) -public class FailingServlet extends HttpServlet { - - private static final SimpleLogger logger = new SimpleLogger(FailingServlet.class); - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - logger.log("Intentional service failure"); - throw new ServletException(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/FooServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/FooServlet.java deleted file mode 100644 index 8b5ca87a07..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/FooServlet.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.conversation.determination; - -import java.io.IOException; - -import jakarta.enterprise.context.Conversation; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -/** - * @author Martin Kouba - * - */ -@WebServlet("/foo") -public class FooServlet extends HttpServlet { - - public static final String CID = "foo"; - - private static final long serialVersionUID = 1L; - - @Inject - Conversation conversation; - - @Inject - TestResult testResult; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - String action = req.getParameter("action"); - - // Force session creation as we don't use any conversation/session scoped beans - req.getSession(true); - - if ("begin".equals(action)) { - conversation.begin(CID); - resp.setContentType("text/plain"); - resp.getWriter().append("cid: [" + conversation.getId() + "]"); - resp.getWriter().append("transient: " + conversation.isTransient()); - } else if ("test".equals(action)) { - - if (FooServlet.CID.equals(conversation.getId())) { - // The long-running conversation is available - testResult.setServletOk(); - } - resp.setContentType("text/plain"); - resp.getWriter().write(testResult.toString()); - } else { - resp.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/QuxAsyncListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/QuxAsyncListener.java deleted file mode 100644 index ac30571534..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/QuxAsyncListener.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.conversation.determination; - -import java.io.IOException; - -import jakarta.enterprise.context.Conversation; -import jakarta.inject.Inject; -import jakarta.servlet.AsyncEvent; -import jakarta.servlet.AsyncListener; - -/** - * @author Martin Kouba - * - */ -public class QuxAsyncListener implements AsyncListener { - - @Inject - Conversation conversation; - - @Inject - StatusBean statusBean; - - @Override - public void onComplete(AsyncEvent event) throws IOException { - - if (!statusBean.isOnTimeout() && !statusBean.isOnError()) { - statusBean.setOnComplete(checkSameConversationActive()); - } - } - - @Override - public void onTimeout(AsyncEvent event) throws IOException { - statusBean.setOnTimeout(checkSameConversationActive()); - event.getAsyncContext().complete(); - } - - @Override - public void onError(AsyncEvent event) throws IOException { - statusBean.setOnError(checkSameConversationActive()); - event.getAsyncContext().complete(); - } - - @Override - public void onStartAsync(AsyncEvent event) throws IOException { - - statusBean.setOnStartAsync(checkSameConversationActive()); - } - - public boolean checkSameConversationActive() { - return FooServlet.CID.equals(conversation.getId()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/StatusBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/StatusBean.java deleted file mode 100644 index 65f7c046ea..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/StatusBean.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.determination; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class StatusBean { - - private boolean onError; - private boolean onComplete; - private boolean onTimeout; - private boolean onStartAsync; - - public boolean isOnStartAsync() { - return onStartAsync; - } - - public void setOnStartAsync(boolean onStartAsync) { - this.onStartAsync = onStartAsync; - } - - public boolean isOnComplete() { - return onComplete; - } - - public void setOnComplete(boolean onComplete) { - this.onComplete = onComplete; - } - - public boolean isOnError() { - return onError; - } - - public void setOnError(boolean onError) { - this.onError = onError; - } - - public boolean isOnTimeout() { - return onTimeout; - } - - public void setOnTimeout(boolean onTimeout) { - this.onTimeout = onTimeout; - } - - public void reset() { - this.onComplete = false; - this.onStartAsync = false; - this.onTimeout = false; - this.onError = false; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/StatusServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/StatusServlet.java deleted file mode 100644 index 20545ea2b8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/StatusServlet.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.determination; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@WebServlet(name = "StatusServlet", urlPatterns = { "/Status" }) -public class StatusServlet extends HttpServlet { - - @Inject - StatusBean statusBean; - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws IOException { - writeInfo(resp); - } - - private void writeInfo(ServletResponse response) throws IOException { - response.getWriter().print(getInfo()); - response.getWriter().flush(); - } - - public String getInfo() { - return String - .format("onStartAsync: %s, onError: %s, onTimeout: %s, onComplete: %s", - statusBean.isOnStartAsync(), statusBean.isOnError(), statusBean.isOnTimeout(), - statusBean.isOnComplete()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/TestResult.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/TestResult.java deleted file mode 100644 index ffb90c40e4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/determination/TestResult.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.conversation.determination; - -import jakarta.enterprise.context.RequestScoped; - -/** - * @author Martin Kouba - * - */ -@RequestScoped -public class TestResult { - - private boolean testFilter = false; - private boolean testServlet = false; - private boolean testListener = false; - - public boolean isTestFilter() { - return testFilter; - } - - public void setFilterOk() { - this.testFilter = true; - } - - public boolean isTestServlet() { - return testServlet; - } - - public void setServletOk() { - this.testServlet = true; - } - - public boolean isTestListener() { - return testListener; - } - - public void setListenerOk() { - this.testListener = true; - } - - @Override - public String toString() { - return String.format("TestResult [testFilter=%s, testServlet=%s, testListener=%s]", testFilter, - testServlet, testListener); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/ApplicationScopedObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/ApplicationScopedObserver.java deleted file mode 100644 index c6de238a46..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/ApplicationScopedObserver.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.event; - -import java.util.concurrent.atomic.AtomicBoolean; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.BeforeDestroyed; -import jakarta.enterprise.context.ConversationScoped; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.event.Observes; -import jakarta.servlet.ServletRequest; - -@ApplicationScoped -public class ApplicationScopedObserver { - - private final AtomicBoolean destroyedCalled = new AtomicBoolean(); - private final AtomicBoolean beforeDestroyedCalled = new AtomicBoolean(); - - void observeBeforeDestroyed(@Observes @BeforeDestroyed(ConversationScoped.class) ServletRequest event) { - if (event.getAttribute("foo") != null) { - beforeDestroyedCalled.set(true); - } - } - - void observeRequestDestroyed(@Observes @Destroyed(ConversationScoped.class) ServletRequest event) { - if (event.getAttribute("foo") != null) { - destroyedCalled.set(true); - } - } - - boolean isBeforeDestroyedCalled() { - return beforeDestroyedCalled.get(); - } - - boolean isDestroyedCalled() { - return destroyedCalled.get(); - } - - public void reset() { - beforeDestroyedCalled.set(false); - destroyedCalled.set(false); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/ConversationScopedBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/ConversationScopedBean.java deleted file mode 100644 index 02930dc553..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/ConversationScopedBean.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.event; - -import java.io.Serializable; - -import jakarta.enterprise.context.ConversationScoped; -import jakarta.inject.Inject; - -@SuppressWarnings("serial") -@ConversationScoped -public class ConversationScopedBean implements Serializable { - - public static final String CID = ConversationScopedBean.class.getName(); - - @Inject - ApplicationScopedObserver applicationScopedObserver; - - public void ping() { - applicationScopedObserver.reset(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/ConversationScopedObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/ConversationScopedObserver.java deleted file mode 100644 index 31935c5a23..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/ConversationScopedObserver.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.event; - -import java.io.Serializable; - -import jakarta.enterprise.context.ConversationScoped; -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.event.Observes; -import jakarta.servlet.ServletRequest; - -@SuppressWarnings("serial") -@ConversationScoped -public class ConversationScopedObserver implements Serializable { - - private boolean initializedObserved; - - void initialize(@Observes @Initialized(ConversationScoped.class) ServletRequest event) { - if (event != null) { - initializedObserved = true; - } - } - - boolean isInitializedObserved() { - return initializedObserved; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/LongRunningConversationLifecycleEventTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/LongRunningConversationLifecycleEventTest.java deleted file mode 100644 index 6c6de62e8e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/LongRunningConversationLifecycleEventTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.event; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.CONVERSATION_CONTEXT_EE; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - *

- * This test was originally part of Weld test suite. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class LongRunningConversationLifecycleEventTest extends AbstractTest { - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassDefinition(LongRunningConversationLifecycleEventTest.class) - .withClasses(Servlet.class, ApplicationScopedObserver.class, ConversationScopedObserver.class, - ConversationScopedBean.class) - .build(); - } - - @Test - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "ba") - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "bb") - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "bc") - public void testLifecycleEventFiredForLongRunningConversation() throws Exception { - - WebClient client = new WebClient(); - - // The current transient conversation is promoted to long-running - TextPage page = client.getPage(contextPath + "/begin"); - assertTrue(page.getContent().contains("Initialized:true")); - assertTrue(page.getContent().contains("Before Destroyed:false")); - assertTrue(page.getContent().contains("Destroyed:false")); - assertTrue(page.getContent().contains("cid:" + ConversationScopedBean.CID)); - - // The long-running conversation is reassociated - page = client.getPage(contextPath + "/display?cid=" + ConversationScopedBean.CID); - assertTrue(page.getContent().contains("Initialized:true")); - assertTrue(page.getContent().contains("Before Destroyed:false")); - assertTrue(page.getContent().contains("Destroyed:false")); - assertTrue(page.getContent().contains("cid:" + ConversationScopedBean.CID)); - - page = client.getPage(contextPath + "/display?cid=" + ConversationScopedBean.CID); - assertTrue(page.getContent().contains("Initialized:true")); - assertTrue(page.getContent().contains("Before Destroyed:false")); - assertTrue(page.getContent().contains("Destroyed:false")); - assertTrue(page.getContent().contains("cid:" + ConversationScopedBean.CID)); - - // The long-running conversation is marked transient - page = client.getPage(contextPath + "/end?cid=" + ConversationScopedBean.CID); - assertTrue(page.getContent().contains("Initialized:true")); - assertTrue(page.getContent().contains("Before Destroyed:false")); - assertTrue(page.getContent().contains("Destroyed:false")); - assertTrue(page.getContent().contains("cid:null")); - - // The current transient conversation is initialized - // The last long-running conversation was destroyed after the previous servlet request service() method completed - page = client.getPage(contextPath + "/display"); - assertTrue(page.getContent().contains("Initialized:true")); - assertTrue(page.getContent().contains("Before Destroyed:true")); - assertTrue(page.getContent().contains("Destroyed:true")); - assertTrue(page.getContent().contains("cid:null")); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/Servlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/Servlet.java deleted file mode 100644 index 1924b7e31e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/Servlet.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.event; - -import java.io.IOException; - -import jakarta.enterprise.context.Conversation; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@WebServlet("/") -@SuppressWarnings("serial") -public class Servlet extends HttpServlet { - - @Inject - Conversation conversation; - - @Inject - ConversationScopedObserver conversationScopedObserver; - - @Inject - ApplicationScopedObserver applicationScopedObserver; - - @Inject - ConversationScopedBean bean; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - String uri = req.getRequestURI(); - if (uri.endsWith("/begin")) { - conversation.begin(ConversationScopedBean.CID); - bean.ping(); - } else if (uri.contains("/end")) { - req.setAttribute("foo", System.currentTimeMillis()); - conversation.end(); - } else if (uri.contains("/display-transient")) { - req.setAttribute("foo", System.currentTimeMillis()); - } - resp.getWriter().append("Initialized:" + conversationScopedObserver.isInitializedObserved()); - resp.getWriter().append("\n"); - resp.getWriter().append("Before Destroyed:" + applicationScopedObserver.isBeforeDestroyedCalled()); - resp.getWriter().append("\n"); - resp.getWriter().append("Destroyed:" + applicationScopedObserver.isDestroyedCalled()); - resp.getWriter().append("\n"); - resp.getWriter().append("cid:" + conversation.getId()); - resp.setContentType("text/plain"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/TransientConversationLifecycleEventTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/TransientConversationLifecycleEventTest.java deleted file mode 100644 index fb9f9bf92c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/TransientConversationLifecycleEventTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.event; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.CONVERSATION_CONTEXT_EE; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - *

- * This test was originally part of Weld test suite. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class TransientConversationLifecycleEventTest extends AbstractTest { - - @ArquillianResource(Servlet.class) - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassDefinition(TransientConversationLifecycleEventTest.class) - .withClasses(Servlet.class, ConversationScopedObserver.class, ApplicationScopedObserver.class, - ConversationScopedBean.class) - .build(); - } - - @Test - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "ba") - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "bb") - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "bc") - public void testLifecycleEventFiredForTransientConversation() throws Exception { - - WebClient client = new WebClient(); - - TextPage page = client.getPage(contextPath + "/display-transient"); - assertTrue(page.getContent().contains("Initialized:true")); // the current transient - assertTrue(page.getContent().contains("Before Destroyed:false")); - assertTrue(page.getContent().contains("Destroyed:false")); // not destroyed yet - - page = client.getPage(contextPath + "/display"); - assertTrue(page.getContent().contains("Initialized:true")); // the current transient - assertTrue(page.getContent().contains("Before Destroyed:true")); - assertTrue(page.getContent().contains("Destroyed:true")); // the previous transient was destroyed - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/ConversationScopedBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/ConversationScopedBean.java deleted file mode 100644 index b87d7dedbf..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/ConversationScopedBean.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.event.notattached; - -import java.io.Serializable; - -import jakarta.enterprise.context.ConversationScoped; - -@SuppressWarnings("serial") -@ConversationScoped -public class ConversationScopedBean implements Serializable { - - public static final String CID = ConversationScopedBean.class.getName(); - - public void ping() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/DestroyConversationNotAssociatedWithCurrentRequestEventTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/DestroyConversationNotAssociatedWithCurrentRequestEventTest.java deleted file mode 100644 index b632760b5c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/DestroyConversationNotAssociatedWithCurrentRequestEventTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.conversation.event.notattached; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.CONVERSATION_CONTEXT_EE; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * @author Martin Kouba - * - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class DestroyConversationNotAssociatedWithCurrentRequestEventTest extends AbstractTest { - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(DestroyConversationNotAssociatedWithCurrentRequestEventTest.class) - .build(); - } - - @Test - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "bd") - public void testLifecycleEventFired() throws Exception { - - WebClient webClient = new WebClient(); - - // Begin new long-running conversation - TextPage page = webClient.getPage(contextPath + "test?action=begin"); - assertTrue(page.getContent().contains("cid:" + ConversationScopedBean.CID)); - - // Invalidate HTTP session - destroy non-attached long-running conversation - page = webClient.getPage(contextPath + "test?action=invalidate"); - - // Get the info - page = webClient.getPage(contextPath + "test?action=info"); - assertTrue(page.getContent().contains("destroyed cid:" + ConversationScopedBean.CID)); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/ObservingBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/ObservingBean.java deleted file mode 100644 index b41e2eca6e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/ObservingBean.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.event.notattached; - -import java.util.concurrent.atomic.AtomicReference; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.ConversationScoped; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.event.Observes; - -@ApplicationScoped -public class ObservingBean { - - private final AtomicReference destroyedConversationId = new AtomicReference(); - - public void observeConversationDestroyed(@Observes @Destroyed(ConversationScoped.class) String event) { - - if (destroyedConversationId.get() != null) { - throw new IllegalStateException("Only one non-attached long-runnnig conversation should be destroyed"); - } - destroyedConversationId.set(event); - } - - public AtomicReference getDestroyedConversationId() { - return destroyedConversationId; - } - - public void reset() { - destroyedConversationId.set(null); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/TestServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/TestServlet.java deleted file mode 100644 index 77966144b7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/event/notattached/TestServlet.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.event.notattached; - -import java.io.IOException; - -import jakarta.enterprise.context.Conversation; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@WebServlet("/test") -@SuppressWarnings("serial") -public class TestServlet extends HttpServlet { - - @Inject - private ObservingBean observer; - - @Inject - private Conversation conversation; - - @Inject - private ConversationScopedBean bean; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - String action = req.getParameter("action"); - - if ("begin".equals(action)) { - // Begin long-running conversation and force the context to be initialized (it's lazy by default) - conversation.begin(ConversationScopedBean.CID); - bean.ping(); - observer.reset(); - resp.getWriter().append("cid:" + conversation.getId()); - } else if ("invalidate".equals(action)) { - // Invalidate session - all long-running conversations will be destroyed after the servlet service() method - // completes - req.getSession().invalidate(); - } else if ("info".equals(action)) { - resp.getWriter().append("destroyed cid:" + observer.getDestroyedConversationId().get()); - } - resp.setContentType("text/plain"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/ConversationFilterTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/ConversationFilterTest.java deleted file mode 100644 index 95d85c4aec..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/ConversationFilterTest.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.filter; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.CONVERSATION_CONTEXT_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; - -import java.net.URL; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.Timer; -import org.jboss.cdi.tck.util.Timer.StopCondition; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.Page; -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.util.Cookie; - -/** - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ConversationFilterTest extends AbstractTest { - - private static final String JSESSIONID = "JSESSIONID"; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(ConversationFilterTest.class) - .withWebXml( - Descriptors.create(WebAppDescriptor.class).createFilter().filterName(OuterFilter.class.getSimpleName()) - .filterClass(OuterFilter.class.getName()).up().createFilterMapping() - .filterName(OuterFilter.class.getSimpleName()).urlPattern("/*").up().createFilterMapping() - .filterName("CDI Conversation Filter").urlPattern("/*").up()) - .build(); - } - - @ArquillianResource - protected URL contextPath; - - /** - * The conversation context should not be active before the conversation is associated with the servlet request. - * - * @throws Exception - */ - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "d") - public void testConversationActivation() throws Exception { - - WebClient client = new WebClient(); - - // Init the long-running conversation - TextPage initPage = client.getPage(contextPath + "introspect?mode=" + IntrospectServlet.MODE_INIT); - String cid = extractCid(initPage.getContent()); - assertNotNull(cid); - assertFalse(cid.isEmpty()); - - TextPage resultPage = client.getPage(contextPath + "introspect?mode=" + IntrospectServlet.MODE_INSPECT + "&cid=" + cid); - assertFalse(Boolean.valueOf(resultPage.getContent())); - } - - /** - * "The container ensures that a long-running conversation may be associated with at most one request at a time, by blocking - * or rejecting concurrent requests." - * - * In fact the spec doesn't require the container to reject the concurrent requests, but we don't expect it will block them - * forever. - * - * @throws Exception - */ - @Test(groups = INTEGRATION) - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "ua") - public void testConversationBusy() throws Exception { - - // Init the long-running conversation - WebClient client = new WebClient(); - - TextPage initPage = client.getPage(contextPath + "introspect?mode=" + IntrospectServlet.MODE_INIT); - String cid = extractCid(initPage.getContent()); - assertNotNull(cid); - assertFalse(cid.isEmpty()); - String jsessionid = client.getCookieManager().getCookie(JSESSIONID).getValue(); - assertNotNull(jsessionid); - assertFalse(jsessionid.isEmpty()); - - ExecutorService executorService = Executors.newFixedThreadPool(2); - WebRequest longTask = new WebRequest(IntrospectServlet.MODE_LONG_TASK, contextPath, cid, jsessionid); - WebRequest busyRequest = new WebRequest(IntrospectServlet.MODE_BUSY_REQUEST, contextPath, cid, jsessionid); - - final Future longTaskFuture = executorService.submit(longTask); - Timer timer = Timer.startNew(100l); - final Future busyRequestFuture = executorService.submit(busyRequest); - timer.setSleepInterval(100l).setDelay(10, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - @Override - public boolean isSatisfied() { - return longTaskFuture.isDone() || busyRequestFuture.isDone(); - } - }).start(); - - assertEquals(longTaskFuture.get(), "OK"); - assertEquals(busyRequestFuture.get(), "BusyConversationException"); - executorService.shutdown(); - } - - /** - * Note - htmlunit WebClient instance is not thread-safe. - */ - private class WebRequest implements Callable { - - private String mode; - - private URL contextPath; - - private String cid; - - private String jsessionid; - - public WebRequest(String mode, URL contextPath, String cid, String jsessionid) { - super(); - this.mode = mode; - this.contextPath = contextPath; - this.cid = cid; - this.jsessionid = jsessionid; - } - - @Override - public String call() throws Exception { - - WebClient client = new WebClient(); - client.getCookieManager().addCookie(new Cookie(contextPath.getHost(), JSESSIONID, jsessionid)); - - Page page = client.getPage(contextPath + "introspect?mode=" + mode + "&cid=" + cid); - - if (!(page instanceof TextPage)) { - return "" + page.getWebResponse().getStatusCode(); - } - TextPage textPage = (TextPage) page; - return textPage.getContent(); - } - - } - - private String extractCid(String content) { - String[] tokens = content.split("::"); - if (tokens.length != 2) { - throw new IllegalArgumentException(); - } - return tokens[0]; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/Dummy.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/Dummy.java deleted file mode 100644 index 48b4977a55..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/Dummy.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.filter; - -import java.io.Serializable; - -import jakarta.enterprise.context.ConversationScoped; - -@SuppressWarnings("serial") -@ConversationScoped -public class Dummy implements Serializable { - - public void ping() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/IntrospectServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/IntrospectServlet.java deleted file mode 100644 index 8cb5324a12..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/IntrospectServlet.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.filter; - -import java.io.IOException; -import java.util.concurrent.TimeUnit; - -import jakarta.enterprise.context.Conversation; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.SimpleLogger; -import org.jboss.cdi.tck.util.Timer; -import org.jboss.cdi.tck.util.Timer.StopCondition; - -@SuppressWarnings("serial") -@WebServlet("/introspect") -public class IntrospectServlet extends HttpServlet { - - private static final SimpleLogger logger = new SimpleLogger(IntrospectServlet.class); - - public static final String MODE_INIT = "init"; - - public static final String MODE_INSPECT = "inspect"; - - public static final String MODE_LONG_TASK = "long_task"; - - public static final String MODE_BUSY_REQUEST = "busy_request"; - - @Inject - Dummy dummy; - - @Inject - Conversation conversation; - - @Inject - Tester tester; - - @Inject - State state; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - resp.setContentType("text/plain"); - String mode = req.getParameter("mode"); - - if (MODE_INIT.equals(mode)) { - conversation.begin(); - dummy.ping(); - state.reset(); - resp.getWriter().write(conversation.getId() + "::" + req.getSession().getId()); - } else if (MODE_INSPECT.equals(mode)) { - // Conversation should be activated after custom filter - if (conversation.isTransient()) { - resp.sendError(500, "No long running conversation"); - } else { - resp.getWriter().write("" + tester.getResult()); - } - } else if (MODE_LONG_TASK.equals(mode)) { - if (conversation.isTransient()) { - resp.sendError(500, "No long running conversation"); - } else { - long start = System.currentTimeMillis(); - try { - // The concurrent access timeout is not defined by the spec - new Timer().setSleepInterval(100l).setDelay(10, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - @Override - public boolean isSatisfied() { - return state.isBusyAttemptMade(); - } - }).start(); - } catch (InterruptedException e1) { - throw new IllegalStateException(); - } - logger.log("Long task finished [isBusyAttemptMade: {0}, time: {1} ms]", state.isBusyAttemptMade(), - System.currentTimeMillis() - start); - resp.getWriter().write("OK"); - } - } else if (MODE_BUSY_REQUEST.equals(mode)) { - resp.sendError(500, "BusyConversationException should be thrown"); - } else { - throw new ServletException("Unknown test mode"); - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/OuterFilter.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/OuterFilter.java deleted file mode 100644 index 460d5a438c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/OuterFilter.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.filter; - -import java.io.IOException; - -import jakarta.enterprise.context.BusyConversationException; -import jakarta.inject.Inject; -import jakarta.servlet.Filter; -import jakarta.servlet.FilterChain; -import jakarta.servlet.FilterConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; - -public class OuterFilter implements Filter { - - @Inject - Tester tester; - - @Inject - State state; - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - } - - @Override - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, - ServletException { - tester.testConversationContextIsActive(); - try { - chain.doFilter(request, response); - } catch (BusyConversationException e) { - state.setBusyAttemptMade(); - response.setContentType("text/plain"); - response.getWriter().print("BusyConversationException"); - } - } - - @Override - public void destroy() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/State.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/State.java deleted file mode 100644 index 8bc8d65fa0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/State.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.filter; - -import java.util.concurrent.atomic.AtomicBoolean; - -import jakarta.enterprise.context.ApplicationScoped; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@ApplicationScoped -public class State { - - private static final SimpleLogger logger = new SimpleLogger(State.class); - - private AtomicBoolean isBusyAttemptMade = new AtomicBoolean(false); - - public void setBusyAttemptMade() { - isBusyAttemptMade.set(true); - logger.log("Busy conversation attempt made"); - } - - public boolean isBusyAttemptMade() { - return isBusyAttemptMade.get(); - } - - public void reset() { - isBusyAttemptMade.set(false); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/Tester.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/Tester.java deleted file mode 100644 index 497aeeede7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/filter/Tester.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.filter; - -import jakarta.enterprise.context.ContextNotActiveException; -import jakarta.enterprise.context.ConversationScoped; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -@RequestScoped -public class Tester { - - @Inject - private BeanManager beanManager; - - private boolean result; - - public void testConversationContextIsActive() { - try { - result = beanManager.getContext(ConversationScoped.class).isActive(); - } catch (ContextNotActiveException expected) { - result = false; - } - } - - public boolean getResult() { - return result; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/inactive/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/inactive/Bar.java deleted file mode 100644 index 8da1a096f8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/inactive/Bar.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.conversation.inactive; - -import java.util.concurrent.atomic.AtomicBoolean; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class Bar { - - private AtomicBoolean contextNotActiveExceptionThrown = new AtomicBoolean(); - - public void setContextNotActiveExceptionThrown(boolean contextNotActiveExceptionThrown) { - this.contextNotActiveExceptionThrown.set(contextNotActiveExceptionThrown); - - } - - public boolean isContextNotActiveExceptionThrown() { - return contextNotActiveExceptionThrown.get(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/inactive/FooBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/inactive/FooBean.java deleted file mode 100644 index dfc9df035e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/inactive/FooBean.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.conversation.inactive; - -import jakarta.annotation.Resource; -import jakarta.ejb.Stateless; -import jakarta.ejb.Timeout; -import jakarta.ejb.Timer; -import jakarta.ejb.TimerService; -import jakarta.enterprise.context.ContextNotActiveException; -import jakarta.enterprise.context.Conversation; -import jakarta.inject.Inject; - -@Stateless -public class FooBean { - - @Inject - private Bar bar; - - @Inject - private Conversation conversation; - - @Resource - private TimerService timerService; - - public void createTimer() { - timerService.createTimer(5l, null); - } - - @Timeout - public void handleTimeout(Timer timer) { - try { - conversation.begin(); - } catch (ContextNotActiveException e) { - // Should throw ContextNotActiveException - bar.setContextNotActiveExceptionThrown(true); - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/inactive/InactiveConversationTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/inactive/InactiveConversationTest.java deleted file mode 100644 index ee3393dae3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/inactive/InactiveConversationTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.conversation.inactive; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.CONVERSATION; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.TestGroups; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.Timer; -import org.jboss.cdi.tck.util.Timer.StopCondition; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * As "The conversation scope is active during all Servlet requests", this test needs to use some EE functionality (currently - * EJB Timer service) and thus be placed in {@link TestGroups#JAVAEE_FULL}. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class InactiveConversationTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(InactiveConversationTest.class).build(); - } - - @Inject - FooBean foo; - - @Inject - Bar bar; - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = CONVERSATION, id = "p") - public void testContextNotActiveExceptionThrown() throws Exception { - - assertNotNull(foo); - // Conversation scope is not active during EJB timeout method - foo.createTimer(); - - StopCondition condition = new StopCondition() { - @Override - public boolean isSatisfied() { - return bar.isContextNotActiveExceptionThrown(); - } - }; - Timer timer = new Timer().setDelay(1000).addStopCondition(condition).start(); - assertTrue(timer.isStopConditionsSatisfiedBeforeTimeout() || condition.isSatisfied()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/servlet/Message.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/servlet/Message.java deleted file mode 100644 index 958f543ab3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/servlet/Message.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.servlet; - -import java.io.Serializable; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.ConversationScoped; - -import org.jboss.cdi.tck.util.ActionSequence; - -@ConversationScoped -@SuppressWarnings("serial") -public class Message implements Serializable { - - private String value = "Hello"; - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - @PostConstruct - public void init() { - ActionSequence.addAction("conversationCreated"); - } - - @PreDestroy - public void destroy() { - ActionSequence.addAction("conversationDestroyed"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/servlet/Servlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/servlet/Servlet.java deleted file mode 100644 index f21344db65..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/servlet/Servlet.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.servlet; - -import java.io.IOException; -import java.io.PrintWriter; - -import jakarta.enterprise.context.Conversation; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.ActionSequence; - -@SuppressWarnings("serial") -@WebServlet("/servlet/*") -public class Servlet extends HttpServlet { - - @Inject - private Message message; - - @Inject - private Conversation conversation; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - String uri = req.getRequestURI(); - if (uri.endsWith("/display")) { - printInfo(resp.getWriter()); - } else if (uri.endsWith("/begin")) { - conversation.begin(); - printInfo(resp.getWriter()); - } else if (uri.endsWith("/end")) { - conversation.end(); - printInfo(resp.getWriter()); - } else if (uri.endsWith("/set")) { - setMessage(req); - printInfo(resp.getWriter()); - } else if (uri.endsWith("/invalidateSession")) { - ActionSequence.addAction("beforeInvalidate"); - req.getSession().invalidate(); - ActionSequence.addAction("afterInvalidate"); - printInfo(resp.getWriter()); - } else if (uri.endsWith("/resetSequence")) { - ActionSequence.reset(); - } else if (uri.endsWith("/getSequence")) { - resp.getWriter().print(ActionSequence.getSequence().dataToCsv()); - } else { - resp.setStatus(404); - } - resp.setContentType("text/plain"); - } - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - String uri = req.getRequestURI(); - if (uri.endsWith("/set")) { - setMessage(req); - printInfo(resp.getWriter()); - } else { - resp.setStatus(404); - } - resp.setContentType("text/plain"); - } - - private void printInfo(PrintWriter writer) { - writer.append("message: " + message.getValue()); - writer.append("\n"); - writer.append("cid: [" + conversation.getId()); - writer.append("]"); - writer.append("\n"); - writer.append("transient: " + conversation.isTransient()); - } - - private void setMessage(HttpServletRequest request) { - String value = request.getParameter("message"); - if (value == null) { - throw new IllegalArgumentException("message must be specified"); - } - message.setValue(value); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/servlet/ServletConversationTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/servlet/ServletConversationTest.java deleted file mode 100644 index acd17a98ad..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/conversation/servlet/ServletConversationTest.java +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.conversation.servlet; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.CONVERSATION_CONTEXT_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; - -import java.io.IOException; -import java.net.URL; -import java.util.HashSet; -import java.util.Set; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; -import com.gargoylesoftware.htmlunit.Page; -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.html.HtmlElement; -import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput; -import com.gargoylesoftware.htmlunit.html.HtmlTextInput; - -/** - * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class ServletConversationTest extends AbstractTest { - - private final String CONVERSATION_CREATED = "conversationCreated"; - private final String CONVERSATION_DESTROYED = "conversationDestroyed"; - private final String BEFORE_INVALIDATE = "beforeInvalidate"; - private final String AFTER_INVALIDATE = "afterInvalidate"; - - @ArquillianResource - private URL url; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ServletConversationTest.class) - .withWebResource("message.html", "message.html").build(); - } - - @Test - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "aa") - public void testTransientConversation() throws Exception { - WebClient client = new WebClient(); - TextPage page = client.getPage(getPath("/display", null)); - assertTrue(page.getContent().contains("message: Hello")); - assertTrue(page.getContent().contains("cid: [null]")); - assertTrue(page.getContent().contains("transient: true")); - } - - @Test - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "aa") - public void testLongRunningConversation() throws Exception { - WebClient client = new WebClient(); - - // begin conversation - TextPage initialPage = client.getPage(getPath("/begin", null)); - String content = initialPage.getContent(); - assertTrue(content.contains("message: Hello")); - assertTrue(content.contains("transient: false")); - - String cid = getCid(content); - - // verify conversation is not transient - { - TextPage page = client.getPage(getPath("/display", cid)); - assertTrue(page.getContent().contains("message: Hello")); - assertTrue(page.getContent().contains("cid: [" + cid + "]")); - assertTrue(page.getContent().contains("transient: false")); - } - - // modify conversation state - { - TextPage page = client.getPage(getPath("/set", cid) + "&message=Hi"); - assertTrue(page.getContent().contains("message: Hi")); - assertTrue(page.getContent().contains("cid: [" + cid + "]")); - assertTrue(page.getContent().contains("transient: false")); - } - - // verify conversation state - { - TextPage page = client.getPage(getPath("/display", cid)); - assertTrue(page.getContent().contains("message: Hi")); - assertTrue(page.getContent().contains("cid: [" + cid + "]")); - assertTrue(page.getContent().contains("transient: false")); - } - - // end conversation - { - TextPage page = client.getPage(getPath("/end", cid)); - assertTrue(page.getContent().contains("message: Hi")); - assertTrue(page.getContent().contains("transient: true")); - } - - // verify that the conversation can no longer be restored - try { - Page page = client.getPage(getPath("/display", cid)); - fail("Access to /display should have failed"); - } catch (FailingHttpStatusCodeException e) { - assertEquals(e.getStatusCode(), 500); - } - } - - @Test - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "aa") - public void testPost() throws Exception { - WebClient client = new WebClient(); - - // begin conversation - TextPage initialPage = client.getPage(getPath("/begin", null)); - String content = initialPage.getContent(); - assertTrue(content.contains("message: Hello")); - assertTrue(content.contains("transient: false")); - - String cid = getCid(content); - - // submit a form - { - HtmlPage form = client.getPage(url.toString() + "message.html"); - getFirstMatchingElement(form, HtmlTextInput.class, "message").setValueAttribute("Hola!"); - getFirstMatchingElement(form, HtmlTextInput.class, "cid").setValueAttribute(cid); - TextPage page = getFirstMatchingElement(form, HtmlSubmitInput.class, "submit").click(); - - assertTrue(page.getContent().contains("message: Hola!")); - assertTrue(page.getContent().contains("cid: [" + cid + "]")); - assertTrue(page.getContent().contains("transient: false")); - } - - // verify conversation state - { - TextPage page = client.getPage(getPath("/display", cid)); - assertTrue(page.getContent().contains("message: Hola!")); - assertTrue(page.getContent().contains("cid: [" + cid + "]")); - assertTrue(page.getContent().contains("transient: false")); - } - } - - @Test - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "qa") - public void testInvalidatingSessionDestroysConversation() throws Exception { - WebClient client = new WebClient(); - - // reset ActionSequence and begin conversation - String cid = beginConversation(client, true); - - // Invalidate the session - { - client.getPage(getPath("/invalidateSession", cid)); - } - - TextPage sequence = client.getPage(getPath("/getSequence", null)); - String result = sequence.getContent().trim(); - - // Construct expected result locally - ActionSequence.reset(); - ActionSequence.addAction(CONVERSATION_CREATED); - ActionSequence.addAction(BEFORE_INVALIDATE); - ActionSequence.addAction(AFTER_INVALIDATE); - ActionSequence.addAction(CONVERSATION_DESTROYED); - - // Verify that the action sequence fetched from server is equal to the expected sequence - assertEquals(result, ActionSequence.getSequence().dataToCsv()); - - // Additional verification that the conversation cannot be associated - try { - Page page = client.getPage(getPath("/display", cid)); - fail("Access to /display should have failed"); - } catch (FailingHttpStatusCodeException e) { - assertEquals(e.getStatusCode(), 500); - } - } - - @Test - @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "qa") - public void testInvalidatingSessionDestroysAllLongRunningConversations() throws Exception { - WebClient client = new WebClient(); - - // reset ActionSequence and begin two conversations - String firstCid = beginConversation(client, true); - String secondCid = beginConversation(client, false); - assertFalse(firstCid.equals(secondCid)); - - // Invalidate the session with one cid - client.getPage(getPath("/invalidateSession", secondCid)); - - TextPage sequence = client.getPage(getPath("/getSequence", null)); - String result = sequence.getContent().trim(); - - // Construct expected result locally - // Two conv. should be created and both destroyed after invalidation - ActionSequence.reset(); - ActionSequence.addAction(CONVERSATION_CREATED); - ActionSequence.addAction(CONVERSATION_CREATED); - ActionSequence.addAction(BEFORE_INVALIDATE); - ActionSequence.addAction(AFTER_INVALIDATE); - ActionSequence.addAction(CONVERSATION_DESTROYED); - ActionSequence.addAction(CONVERSATION_DESTROYED); - - // Verify that the action sequence fetched from server is equal to the expected sequence - assertEquals(result, ActionSequence.getSequence().dataToCsv()); - } - - protected String getCid(String content) { - return content.substring(content.indexOf("cid: [") + 6, content.indexOf("]")); - } - - protected String getPath(String viewId, String cid) { - StringBuilder builder = new StringBuilder(url.toString()); - builder.append("servlet"); - builder.append(viewId); - if (cid != null) { - builder.append("?"); - builder.append("cid"); - builder.append("="); - builder.append(cid); - } - return builder.toString(); - } - - protected T getFirstMatchingElement(HtmlPage page, Class elementClass, String id) { - - Set inputs = getElements(page.getBody(), elementClass); - for (T input : inputs) { - if (input.getId().contains(id)) { - return input; - } - } - return null; - } - - protected Set getElements(HtmlElement rootElement, Class elementClass) { - Set result = new HashSet(); - - for (HtmlElement element : rootElement.getHtmlElementDescendants()) { - result.addAll(getElements(element, elementClass)); - } - - if (elementClass.isInstance(rootElement)) { - result.add(elementClass.cast(rootElement)); - } - return result; - - } - - protected String beginConversation(WebClient client, boolean resetSequence) throws IOException { - if (resetSequence) { - client.getPage(getPath("/resetSequence", null)); - } - TextPage initialPage = client.getPage(getPath("/begin", null)); - String content = initialPage.getContent(); - assertTrue(content.contains("message: Hello")); - assertTrue(content.contains("transient: false")); - return getCid(content); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/DependentContextEjbTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/DependentContextEjbTest.java deleted file mode 100644 index 59d239ce95..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/DependentContextEjbTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.dependent.ejb; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DEPENDENT_DESTRUCTION_EE; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class DependentContextEjbTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(DependentContextEjbTest.class) - .withBeansXml(new BeansXml(BeanDiscoveryMode.ALL)) - .build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = DEPENDENT_DESTRUCTION_EE, id = "aaab") - public void testDestroyingEjbDestroysDependents() throws Exception { - assert getBeans(HouseLocal.class).size() == 1; - Bean bean = getBeans(HouseLocal.class).iterator().next(); - CreationalContext creationalContext = getCurrentManager().createCreationalContext(bean); - HouseLocal instance = bean.create(creationalContext); - instance.open().getTable().lay(); - Room.destroyed = false; - Table.destroyed = false; - House.destroyed = false; - bean.destroy(instance, creationalContext); - assert House.destroyed; - assert Room.destroyed; - assert Table.destroyed; - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = DEPENDENT_DESTRUCTION_EE, id = "aaab") - public void testDestroyingEjbDestroysDependentSimples() throws Exception { - assert getBeans(FarmLocal.class).size() == 1; - Bean farmBean = getBeans(FarmLocal.class).iterator().next(); - CreationalContext creationalContext = getCurrentManager().createCreationalContext(farmBean); - FarmLocal farm = farmBean.create(creationalContext); - Horse.destroyed = false; - Stable.destroyed = false; - Farm.destroyed = false; - farmBean.destroy(farm, creationalContext); - assert Farm.destroyed; - assert Horse.destroyed; - assert Stable.destroyed; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Farm.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Farm.java deleted file mode 100644 index ef9d52d849..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Farm.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.dependent.ejb; - -import jakarta.annotation.PreDestroy; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; - -@RequestScoped -@Stateful -public class Farm implements FarmLocal { - - public static boolean destroyed; - - @Inject - Stable stable; - - public void open() { - } - - @PreDestroy - public void preDestroy() { - Farm.destroyed = true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FarmLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FarmLocal.java deleted file mode 100644 index a60fdad673..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FarmLocal.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.dependent.ejb; - -public interface FarmLocal { - - public void open(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Fox.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Fox.java deleted file mode 100644 index 035a0f227f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Fox.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.dependent.ejb; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.ContextNotActiveException; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Default; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.inject.Named; - -@Dependent -@Named -@Default -@Stateful -public class Fox implements FoxLocal { - - private static boolean destroyed = false; - private static int destroyCount = 0; - private static boolean dependentContextActiveDuringPostConstruct = false; - - @Inject - private BeanManager beanManager; - - @PostConstruct - public void construct() { - try { - dependentContextActiveDuringPostConstruct = beanManager.getContext(Dependent.class).isActive(); - } catch (ContextNotActiveException e) { - dependentContextActiveDuringPostConstruct = false; - } - } - - public static boolean isDestroyed() { - return destroyed; - } - - public static void setDestroyed(boolean destroyed) { - Fox.destroyed = destroyed; - } - - public static void setDestroyCount(int destroyCount) { - Fox.destroyCount = destroyCount; - } - - public static int getDestroyCount() { - return destroyCount; - } - - public static boolean isDependentContextActiveDuringPostConstruct() { - return dependentContextActiveDuringPostConstruct; - } - - public static void setDependentContextActiveDuringPostConstruct(boolean dependentContextActiveDuringPostConstruct) { - Fox.dependentContextActiveDuringPostConstruct = dependentContextActiveDuringPostConstruct; - } - - @PreDestroy - public void destroy() { - destroyed = true; - destroyCount++; - } - - public String getName() { - return "gavin"; - } - - @Remove - public void remove() { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FoxLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FoxLocal.java deleted file mode 100644 index 0b59721112..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FoxLocal.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.dependent.ejb; - -import jakarta.ejb.Local; - -@Local -public interface FoxLocal { - - public String getName(); - - void remove(); - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FoxRun.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FoxRun.java deleted file mode 100644 index 223f594fdc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FoxRun.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.dependent.ejb; - -import jakarta.annotation.PreDestroy; -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.inject.Inject; -import jakarta.inject.Named; - -@Named("foxRun") -@Stateful -public class FoxRun implements FoxRunLocal { - - private static boolean destroyed = false; - - @Inject - public FoxLocal fox; - - @Inject - public FoxLocal anotherFox; - - @PreDestroy - public void destroy() { - destroyed = true; - } - - public static void setDestroyed(boolean destroyed) { - FoxRun.destroyed = destroyed; - } - - public static boolean isDestroyed() { - return destroyed; - } - - public FoxLocal getFox() { - return fox; - } - - @Remove - public void remove() { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FoxRunLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FoxRunLocal.java deleted file mode 100644 index 16af910954..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/FoxRunLocal.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.dependent.ejb; - -import jakarta.ejb.Local; - -@Local -public interface FoxRunLocal { - - public FoxLocal getFox(); - - void remove(); -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Horse.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Horse.java deleted file mode 100644 index 10ff88747e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Horse.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.dependent.ejb; - -import java.io.Serializable; - -import jakarta.annotation.PreDestroy; - -public class Horse implements Serializable { - - /** - * - */ - private static final long serialVersionUID = 1417245695143239294L; - public static boolean destroyed; - - @PreDestroy - public void preDestroy() { - destroyed = true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/House.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/House.java deleted file mode 100644 index 13cfd7f9c4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/House.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.dependent.ejb; - -import jakarta.annotation.PreDestroy; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; - -@RequestScoped -@Stateful -public class House implements HouseLocal { - - public static boolean destroyed; - - @Inject - RoomLocal room; - - public RoomLocal open() { - return room; - } - - @PreDestroy - public void preDestroy() { - House.destroyed = true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/HouseLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/HouseLocal.java deleted file mode 100644 index 0e216170c2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/HouseLocal.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.dependent.ejb; - -import jakarta.ejb.Local; - -@Local -public interface HouseLocal { - - public RoomLocal open(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Room.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Room.java deleted file mode 100644 index ab6cba08ff..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Room.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.dependent.ejb; - -import jakarta.annotation.PreDestroy; -import jakarta.ejb.Stateful; -import jakarta.inject.Inject; - -@Stateful -public class Room implements RoomLocal { - - @Inject - TableLocal table; - - public TableLocal getTable() { - return table; - } - - public static boolean destroyed; - - @PreDestroy - public void preDestroy() { - destroyed = true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/RoomLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/RoomLocal.java deleted file mode 100644 index da97abdeb6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/RoomLocal.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.dependent.ejb; - -import jakarta.ejb.Local; - -@Local -public interface RoomLocal { - - public TableLocal getTable(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Stable.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Stable.java deleted file mode 100644 index 4f82b75e0a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Stable.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.dependent.ejb; - -import java.io.Serializable; - -import jakarta.annotation.PreDestroy; -import jakarta.inject.Inject; - -public class Stable implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -5240670259345637799L; - - @Inject - Horse horse; - - public static boolean destroyed; - - @PreDestroy - public void preDestroy() { - destroyed = true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Table.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Table.java deleted file mode 100644 index b4e30a1c2c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/Table.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.dependent.ejb; - -import jakarta.annotation.PreDestroy; -import jakarta.ejb.Stateful; - -@Stateful -public class Table implements TableLocal { - - public static boolean destroyed; - - @PreDestroy - public void preDestroy() { - destroyed = true; - } - - public void lay() { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/TableLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/TableLocal.java deleted file mode 100644 index 79f598897f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/dependent/ejb/TableLocal.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.dependent.ejb; - -import jakarta.ejb.Local; - -@Local -public interface TableLocal { - - public void lay(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/AbstractMessageListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/AbstractMessageListener.java deleted file mode 100644 index 37444e6a9a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/AbstractMessageListener.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.jms; - -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.annotation.PostConstruct; -import jakarta.inject.Inject; -import jakarta.jms.JMSException; -import jakarta.jms.Message; -import jakarta.jms.MessageListener; -import jakarta.jms.TextMessage; - -import org.jboss.cdi.tck.util.SimpleLogger; - -public class AbstractMessageListener implements MessageListener { - - public static AtomicInteger processedMessages = new AtomicInteger(0); - private static final SimpleLogger simpleLogger = new SimpleLogger(AbstractMessageListener.class); - private static AtomicBoolean initialized = new AtomicBoolean(); - - @Inject - private LoggerService loggerService; - - @Override - public void onMessage(Message message) { - - if (message instanceof TextMessage) { - try { - loggerService.log(((TextMessage) message).getText()); - } catch (JMSException e) { - simpleLogger.log(e); - } finally { - processedMessages.incrementAndGet(); - } - } else { - throw new IllegalArgumentException("Unsupported message type"); - } - } - - public static void resetProcessedMessages() { - processedMessages.set(0); - } - - public static boolean isInitialized() { - return initialized.get(); - } - - @PostConstruct - public void postConstruct() { - initialized.set(true); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/LogStore.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/LogStore.java deleted file mode 100644 index 1ca08bcde3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/LogStore.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.jms; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class LogStore { - - private final List logMessages = Collections.synchronizedList(new ArrayList()); - - public void recordLogMessage(String text, String serviceId) { - logMessages.add(new LogMessage(Thread.currentThread().getId(), text, serviceId)); - } - - /** - * @return read-only view of logged messages - */ - public List getLogMessages() { - return Collections.unmodifiableList(new ArrayList(this.logMessages)); - } - - /** - * Immutable log message. - */ - public class LogMessage { - - private final long threadId; - - private final String text; - - private final String serviceId; - - public LogMessage(long threadId, String text, String serviceId) { - super(); - this.threadId = threadId; - this.text = text; - this.serviceId = serviceId; - } - - public long getThreadId() { - return threadId; - } - - public String getText() { - return text; - } - - public String getServiceId() { - return serviceId; - } - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/LoggerService.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/LoggerService.java deleted file mode 100644 index 10c6861f0a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/LoggerService.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.jms; - -import java.util.UUID; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; - -@RequestScoped -public class LoggerService { - - private String id; - - @Inject - private LogStore store; - - @PostConstruct - public void init() { - id = UUID.randomUUID().toString(); - } - - /** - * - * @param text - */ - public void log(String text) { - - if (text == null) - throw new IllegalArgumentException(); - - store.recordLogMessage(text, id); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/MessageDrivenBeanContextTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/MessageDrivenBeanContextTest.java deleted file mode 100644 index 41a93b0861..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/MessageDrivenBeanContextTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.jms; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.TestGroups.JMS; -import static org.jboss.cdi.tck.cdi.Sections.APPLICATION_CONTEXT_EE; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT_EE; -import static org.jboss.cdi.tck.shrinkwrap.descriptors.ejb.EjbJarDescriptorBuilder.MessageDriven.newMessageDriven; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; - -import java.util.List; -import java.util.concurrent.TimeUnit; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.impl.ConfigurationFactory; -import org.jboss.cdi.tck.shrinkwrap.descriptors.ejb.EjbJarDescriptorBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.context.jms.LogStore.LogMessage; -import org.jboss.cdi.tck.util.Timer; -import org.jboss.cdi.tck.util.Timer.StopCondition; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.ejbjar31.EjbJarDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test that buil-in request and application scopes are active during message delivery to EJB message-driven bean. - * - * Note that basic JMS configuration is required for this test. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class MessageDrivenBeanContextTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - - EjbJarDescriptor ejbJarDescriptor = new EjbJarDescriptorBuilder().messageDrivenBeans( - newMessageDriven("TestQueue", QueueMessageDrivenBean.class.getName()) - .addActivationConfigProperty("acknowledgeMode", "Auto-acknowledge") - .addActivationConfigProperty("destinationType", "jakarta.jms.Queue") - .addActivationConfigProperty("destinationLookup", ConfigurationFactory.get().getTestJmsQueue()), - newMessageDriven("TestTopic", TopicMessageDrivenBean.class.getName()) - .addActivationConfigProperty("acknowledgeMode", "Auto-acknowledge") - .addActivationConfigProperty("destinationType", "jakarta.jms.Topic") - .addActivationConfigProperty("destinationLookup", ConfigurationFactory.get().getTestJmsTopic())) - .build(); - - return new WebArchiveBuilder().withTestClassPackage(MessageDrivenBeanContextTest.class).withEjbJarXml(ejbJarDescriptor) - .build(); - } - - @Inject - SimpleMessageProducer producer; - - @Inject - LogStore store; - - @Test(groups = { JAVAEE_FULL, JMS }) - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "gd") - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "hd") - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "dd") - public void testRequestScopeActiveDuringMessageDelivery() throws Exception { - - new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - public boolean isSatisfied() { - return AbstractMessageListener.isInitialized(); - } - }).start(); - - AbstractMessageListener.resetProcessedMessages(); - - producer.sendQueueMessage(); - producer.sendTopicMessage(); - - // Wait for async processing - new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - public boolean isSatisfied() { - return AbstractMessageListener.processedMessages.get() >= 2; - } - }).start(); - - List logMessages = store.getLogMessages(); - assertEquals(logMessages.size(), 2); - LogMessage msg1 = logMessages.get(0); - assertEquals(msg1.getText(), SimpleMessageProducer.class.getName()); - LogMessage msg2 = logMessages.get(1); - assertEquals(msg2.getText(), SimpleMessageProducer.class.getName()); - // Test that each message delivery has its own request context - assertFalse(msg1.getServiceId().equals(msg2.getServiceId())); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/QueueMessageDrivenBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/QueueMessageDrivenBean.java deleted file mode 100644 index ed3634da04..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/QueueMessageDrivenBean.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.jms; - -import jakarta.jms.MessageListener; - -public class QueueMessageDrivenBean extends AbstractMessageListener implements MessageListener { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/SimpleMessageProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/SimpleMessageProducer.java deleted file mode 100644 index 07dd60b188..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/SimpleMessageProducer.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.jms; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.Dependent; -import jakarta.jms.Connection; -import jakarta.jms.ConnectionFactory; -import jakarta.jms.JMSException; -import jakarta.jms.MessageProducer; -import jakarta.jms.Queue; -import jakarta.jms.Session; -import jakarta.jms.TextMessage; -import jakarta.jms.Topic; - -import org.jboss.cdi.tck.impl.ConfigurationFactory; -import org.jboss.cdi.tck.util.JndiLookupUtils; -import org.jboss.cdi.tck.util.SimpleLogger; - -@Dependent -public class SimpleMessageProducer { - - private static final SimpleLogger simpleLogger = new SimpleLogger(SimpleMessageProducer.class); - - private ConnectionFactory connectionFactory; - - private Queue queue; - - private Topic topic; - - @PostConstruct - public void init() { - this.connectionFactory = (ConnectionFactory) JndiLookupUtils - .lookup(ConfigurationFactory.get().getTestJmsConnectionFactory()); - this.queue = (Queue) JndiLookupUtils.lookup(ConfigurationFactory.get().getTestJmsQueue()); - this.topic = (Topic) JndiLookupUtils.lookup(ConfigurationFactory.get().getTestJmsTopic()); - } - - public void sendQueueMessage() { - - Connection connection = null; - Session session = null; - MessageProducer messageProducer = null; - TextMessage message = null; - - try { - connection = connectionFactory.createConnection(); - session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - - messageProducer = session.createProducer(queue); - message = session.createTextMessage(); - message.setText(SimpleMessageProducer.class.getName()); - messageProducer.send(message); - - } catch (JMSException e) { - throw new RuntimeException("Cannot send message", e); - } finally { - if (connection != null) { - try { - connection.close(); - } catch (JMSException e) { - simpleLogger.log(e); - } - } - } - } - - public void sendTopicMessage() { - - Connection connection = null; - Session session = null; - MessageProducer messageProducer = null; - TextMessage message = null; - - try { - connection = connectionFactory.createConnection(); - session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - - messageProducer = session.createProducer(topic); - message = session.createTextMessage(); - message.setText(SimpleMessageProducer.class.getName()); - messageProducer.send(message); - - } catch (JMSException e) { - throw new RuntimeException("Cannot send message", e); - } finally { - if (connection != null) { - try { - connection.close(); - } catch (JMSException e) { - simpleLogger.log(e); - } - } - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/TopicMessageDrivenBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/TopicMessageDrivenBean.java deleted file mode 100644 index 7fef627c4c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/jms/TopicMessageDrivenBean.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.jms; - -import jakarta.jms.MessageListener; - -public class TopicMessageDrivenBean extends AbstractMessageListener implements MessageListener { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/EnterpriseBeanWithNonPassivatingDecoratorTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/EnterpriseBeanWithNonPassivatingDecoratorTest.java deleted file mode 100644 index e2cb0bc464..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/EnterpriseBeanWithNonPassivatingDecoratorTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.decorator.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_VALIDATION_EE; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseBeanWithNonPassivatingDecoratorTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(EnterpriseBeanWithNonPassivatingDecoratorTest.class) - .withBeansXml(new BeansXml().decorators(MaarianhaminaDecorator.class)).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "b") - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "hb") - public void testEnterpriseBeanWithNonPassivatingDecoratorFails() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/MaarianHaminaLocal_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/MaarianHaminaLocal_Broken.java deleted file mode 100644 index 2d6f90b50f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/MaarianHaminaLocal_Broken.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.decorator.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface MaarianHaminaLocal_Broken { - void bye(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/MaarianhaminaDecorator.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/MaarianhaminaDecorator.java deleted file mode 100644 index 8718b64c56..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/MaarianhaminaDecorator.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.decorator.enterprise; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; - -@Decorator -abstract class MaarianhaminaDecorator implements MaarianHaminaLocal_Broken { - - @Inject - @Delegate - MaarianHaminaLocal_Broken maarianHamina; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/Maarianhamina_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/Maarianhamina_Broken.java deleted file mode 100644 index ef848c2646..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/Maarianhamina_Broken.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.decorator.enterprise; - -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; - -@Stateful -@SessionScoped -public class Maarianhamina_Broken implements MaarianHaminaLocal_Broken { - @Remove - public void bye() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/BrokenDecorator.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/BrokenDecorator.java deleted file mode 100644 index 82e4854762..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/BrokenDecorator.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.decorator.enterprise.field; - -import java.io.Serializable; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; - -@Decorator -abstract class BrokenDecorator implements EspooLocal_Broken, Serializable { - @Inject - @Delegate - EspooLocal_Broken espooLocal; - - @Inject - District district; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/District.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/District.java deleted file mode 100644 index 30f4b7adef..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/District.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.decorator.enterprise.field; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class District { - public void ping() { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/EnterpriseBeanWithNonPassivatingInjectedFieldInDecoratorTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/EnterpriseBeanWithNonPassivatingInjectedFieldInDecoratorTest.java deleted file mode 100644 index f29cc87e30..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/EnterpriseBeanWithNonPassivatingInjectedFieldInDecoratorTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.decorator.enterprise.field; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_VALIDATION_EE; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseBeanWithNonPassivatingInjectedFieldInDecoratorTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(EnterpriseBeanWithNonPassivatingInjectedFieldInDecoratorTest.class) - .withBeansXml(new BeansXml().decorators(BrokenDecorator.class)).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "bdd") - public void testSessionBeanWithNonPassivatingInjectedFieldInDecoratorFails() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/EspooLocal_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/EspooLocal_Broken.java deleted file mode 100644 index b8c4394a52..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/EspooLocal_Broken.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.decorator.enterprise.field; - -import jakarta.ejb.Local; - -@Local -public interface EspooLocal_Broken { - void bye(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/Espoo_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/Espoo_Broken.java deleted file mode 100644 index bced6d66e4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/decorator/enterprise/field/Espoo_Broken.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.decorator.enterprise.field; - -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; - -@Stateful -@SessionScoped -public class Espoo_Broken implements EspooLocal_Broken { - @Remove - public void bye() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/Cup_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/Cup_Broken.java deleted file mode 100644 index 6b01a628df..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/Cup_Broken.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; - -@Stateful -@SessionScoped -public class Cup_Broken { - - @Inject - @SuppressWarnings("unused") - private Foo foo; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/Foo.java deleted file mode 100644 index 17bbba5076..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/Foo.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.enterprise; - -public class Foo { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/NonPassivationCapableEjbWithPassivatingScopeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/NonPassivationCapableEjbWithPassivatingScopeTest.java deleted file mode 100644 index 131e3a5c65..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/NonPassivationCapableEjbWithPassivatingScopeTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_VALIDATION_EE; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Verifies that a deployment which contains a non-passivation capable SFSB which is bound to a passivating context, is not - * valid. - * - *

- * This test was originally part of Weld test suite. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class NonPassivationCapableEjbWithPassivatingScopeTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(NonPassivationCapableEjbWithPassivatingScopeTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "aa") - public void testDeployment() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/District.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/District.java deleted file mode 100644 index 104a3638ef..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/District.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.enterprise.field; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class District { - - public void ping() { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/EspooLocal_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/EspooLocal_Broken.java deleted file mode 100644 index 812abecbeb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/EspooLocal_Broken.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.enterprise.field; - -import jakarta.ejb.Local; - -@Local -public interface EspooLocal_Broken { - void bye(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/Espoo_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/Espoo_Broken.java deleted file mode 100644 index fcc96bc142..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/Espoo_Broken.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.enterprise.field; - -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; - -@Stateful -@SessionScoped -public class Espoo_Broken implements EspooLocal_Broken { - @Inject - District district; - - @Remove - public void bye() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java deleted file mode 100644 index 6c112a2ca1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/enterprise/field/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.enterprise.field; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_VALIDATION_EE; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "ba") - public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoStatefulSessionBeanFails() { - // Not possible while deployment should fail - // getInstanceByType(EspooLocal_Broken.class); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/Digital.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/Digital.java deleted file mode 100644 index 6e2987ff9d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/Digital.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.interceptor.enterprise; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.interceptor.InterceptorBinding; - -@InterceptorBinding -@Inherited -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Documented -public @interface Digital { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/DigitalInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/DigitalInterceptor.java deleted file mode 100644 index 88838f95b7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/DigitalInterceptor.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.interceptor.enterprise; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@Interceptor -@Digital -// non-serializable interceptor -public class DigitalInterceptor { - - @AroundInvoke - public Object intercept(InvocationContext ctx) throws Exception { - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/EnterpriseBeanWithNonPassivatingInterceptorTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/EnterpriseBeanWithNonPassivatingInterceptorTest.java deleted file mode 100644 index 28249113c9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/EnterpriseBeanWithNonPassivatingInterceptorTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.interceptor.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_VALIDATION_EE; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseBeanWithNonPassivatingInterceptorTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(EnterpriseBeanWithNonPassivatingInterceptorTest.class) - .withBeansXml(new BeansXml().interceptors(DigitalInterceptor.class)).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "b") - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "hd") - public void testEnterpriseBeanWithNonPassivatingDecoratorFails() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/Telephone.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/Telephone.java deleted file mode 100644 index e7d62cf82d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/Telephone.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.interceptor.enterprise; - -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; - -@Stateful -@SessionScoped -@Digital -public class Telephone { - - @Remove - public void remove() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/BrokenInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/BrokenInterceptor.java deleted file mode 100644 index 716a3f4852..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/BrokenInterceptor.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.interceptor.enterprise.field; - -import java.io.Serializable; - -import jakarta.inject.Inject; -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -@SuppressWarnings("serial") -public class BrokenInterceptor implements Serializable { - - @Inject - District district; - - @AroundInvoke - public Object intercept(InvocationContext ctx) throws Exception { - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/District.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/District.java deleted file mode 100644 index f310dbd80c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/District.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.interceptor.enterprise.field; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class District { - public void ping() { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/EnterpriseBeanWithNonPassivatingInjectedFieldInInterceptorTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/EnterpriseBeanWithNonPassivatingInjectedFieldInInterceptorTest.java deleted file mode 100644 index 3e034ca6cf..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/EnterpriseBeanWithNonPassivatingInjectedFieldInInterceptorTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.interceptor.enterprise.field; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_VALIDATION_EE; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseBeanWithNonPassivatingInjectedFieldInInterceptorTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage( - EnterpriseBeanWithNonPassivatingInjectedFieldInInterceptorTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "bda") - // WBRI-361 - public void testSessionBeanWithNonPassivatingInjectedFieldInInterceptorFails() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/EspooLocal_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/EspooLocal_Broken.java deleted file mode 100644 index 64c04ef74d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/EspooLocal_Broken.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.interceptor.enterprise.field; - -import jakarta.ejb.Local; - -@Local -public interface EspooLocal_Broken { - void bye(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/Espoo_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/Espoo_Broken.java deleted file mode 100644 index 8e7718a070..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/interceptor/enterprise/field/Espoo_Broken.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.interceptor.enterprise.field; - -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; -import jakarta.interceptor.Interceptors; - -@Stateful -@SessionScoped -@Interceptors(BrokenInterceptor.class) -public class Espoo_Broken implements EspooLocal_Broken { - @Remove - public void bye() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/British.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/British.java deleted file mode 100644 index c2e64d48d9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/British.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.field.enterprise; - -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.Retention; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -@Qualifier -@Target({ FIELD, PARAMETER, METHOD, TYPE }) -@Retention(RUNTIME) -public @interface British { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/ConstructorInjectionCorralBroken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/ConstructorInjectionCorralBroken.java deleted file mode 100644 index f3d15df1cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/ConstructorInjectionCorralBroken.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.field.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; - -@Stateful -@SessionScoped -public class ConstructorInjectionCorralBroken extends Corral { - - private Cow cow; - - public ConstructorInjectionCorralBroken() { - } - - @Inject - public ConstructorInjectionCorralBroken(@British Cow cow) { - this.cow = cow; - } - - public void ping() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/Corral.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/Corral.java deleted file mode 100644 index 042ccd6567..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/Corral.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.field.enterprise; - -import java.io.Serializable; - -public abstract class Corral implements Serializable { - - public abstract void ping(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/Cow.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/Cow.java deleted file mode 100644 index 9d11c4eed3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/Cow.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.field.enterprise; - -public class Cow { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/CowProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/CowProducer.java deleted file mode 100644 index ccee0eabf7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/CowProducer.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.field.enterprise; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class CowProducer { - @Produces - @British - public Cow cow = new Cow(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/EnterpriseBeanWithIllegalDependencyTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/EnterpriseBeanWithIllegalDependencyTest.java deleted file mode 100644 index a0ee091df0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/EnterpriseBeanWithIllegalDependencyTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.field.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_VALIDATION_EE; - -import jakarta.enterprise.inject.IllegalProductException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseBeanWithIllegalDependencyTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EnterpriseBeanWithIllegalDependencyTest.class).build(); - } - - @Test - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "fbb") - public void testFieldInjectionPointRequiringPassivationCapableDependency() { - verify(FieldInjectionCorralBroken.class); - } - - @Test - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "fbb") - public void testSetterInjectionPointRequiringPassivationCapableDependency() { - verify(SetterInjectionCorralBroken.class); - } - - @Test - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "fbb") - public void testConstructorInjectionPointRequiringPassivationCapableDependency() { - verify(ConstructorInjectionCorralBroken.class); - } - - private void verify(Class clazz) { - try { - getContextualReference(clazz).ping(); - } catch (Throwable t) { - Assert.assertTrue(isThrowablePresent(IllegalProductException.class, t)); - return; - } - Assert.fail(); - - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/FieldInjectionCorralBroken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/FieldInjectionCorralBroken.java deleted file mode 100644 index 82b4ba5812..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/FieldInjectionCorralBroken.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.field.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; - -@SuppressWarnings("serial") -@Stateful -@SessionScoped -public class FieldInjectionCorralBroken extends Corral { - - @Inject - @British - Cow cow; - - public void ping() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/SetterInjectionCorralBroken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/SetterInjectionCorralBroken.java deleted file mode 100644 index 301e9c7a3a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/field/enterprise/SetterInjectionCorralBroken.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.field.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; - -@Stateful -@SessionScoped -public class SetterInjectionCorralBroken extends Corral { - - private Cow cow; - - @Inject - public void setCow(@British Cow cow) { - this.cow = cow; - } - - public void ping() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/British.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/British.java deleted file mode 100644 index e1187d33f9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/British.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.method.enterprise; - -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.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Qualifier -@Target({ FIELD, PARAMETER, METHOD, TYPE }) -@Retention(RUNTIME) -public @interface British { - - public static class BritishLiteral extends AnnotationLiteral implements British { - - public static British INSTANCE = new BritishLiteral(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/ConstructorInjectionCorralBroken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/ConstructorInjectionCorralBroken.java deleted file mode 100644 index 2cc6a83d1f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/ConstructorInjectionCorralBroken.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.method.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; - -@Stateful -@SessionScoped -public class ConstructorInjectionCorralBroken extends Ranch { - - private Cow cow; - - public ConstructorInjectionCorralBroken() { - } - - @Inject - public ConstructorInjectionCorralBroken(@British Cow cow) { - this.cow = cow; - } - - public void ping() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/Cow.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/Cow.java deleted file mode 100644 index ecfd283d9b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/Cow.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.method.enterprise; - -public class Cow { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/CowProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/CowProducer.java deleted file mode 100644 index ec7488012d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/CowProducer.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.method.enterprise; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class CowProducer { - - @Produces - @British - public Cow produce() { - return new Cow(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/EnterpriseBeanWithIllegalDependencyTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/EnterpriseBeanWithIllegalDependencyTest.java deleted file mode 100644 index 8bf967fefa..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/EnterpriseBeanWithIllegalDependencyTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.method.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_VALIDATION_EE; - -import java.lang.annotation.Annotation; - -import jakarta.enterprise.inject.IllegalProductException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseBeanWithIllegalDependencyTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EnterpriseBeanWithIllegalDependencyTest.class).build(); - } - - @Test - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "fab") - public void testFieldInjectionPointRequiringPassivationCapableDependency() { - verify(FieldInjectionCorralBroken.class); - } - - @Test - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "fab") - public void testSetterInjectionPointRequiringPassivationCapableDependency() { - verify(SetterInjectionCorralBroken.class); - } - - @Test - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "fab") - public void testConstructorInjectionPointRequiringPassivationCapableDependency() { - verify(ConstructorInjectionCorralBroken.class); - } - - @Test - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "fab") - public void testProducerMethodParamInjectionPointRequiringPassivationCapableDependency() { - verify(Herd.class, British.BritishLiteral.INSTANCE); - } - - private void verify(Class clazz, Annotation... annotations) { - try { - getContextualReference(clazz, annotations).ping(); - } catch (Throwable t) { - Assert.assertTrue(isThrowablePresent(IllegalProductException.class, t)); - return; - } - Assert.fail(); - - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/FieldInjectionCorralBroken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/FieldInjectionCorralBroken.java deleted file mode 100644 index d7e6c7c150..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/FieldInjectionCorralBroken.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.method.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; - -@Stateful -@SessionScoped -public class FieldInjectionCorralBroken extends Ranch { - - @Inject - @British - Cow cow; - - public void ping() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/Herd.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/Herd.java deleted file mode 100644 index f801d9f88b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/Herd.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.method.enterprise; - -public class Herd extends Ranch { - - public void ping() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/ProducerMethodParamInjectionCorralBroken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/ProducerMethodParamInjectionCorralBroken.java deleted file mode 100644 index 30f788fbbe..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/ProducerMethodParamInjectionCorralBroken.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.method.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.inject.Produces; - -@Stateful -@SessionScoped -public class ProducerMethodParamInjectionCorralBroken extends Ranch { - @Override - public void ping() { - - } - - @Produces - @British - @SessionScoped - public Herd produce(@British Cow cow) { - return new Herd(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/Ranch.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/Ranch.java deleted file mode 100644 index 001bc24e00..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/Ranch.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.method.enterprise; - -import java.io.Serializable; - -public abstract class Ranch implements Serializable { - - public abstract void ping(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/SetterInjectionCorralBroken.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/SetterInjectionCorralBroken.java deleted file mode 100644 index e81eabe7e2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/broken/producer/method/enterprise/SetterInjectionCorralBroken.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.broken.producer.method.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; - -@Stateful -@SessionScoped -public class SetterInjectionCorralBroken extends Ranch { - - private Cow cow; - - @Inject - public void setCow(@British Cow cow) { - this.cow = cow; - } - - public void ping() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/Another.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/Another.java deleted file mode 100644 index 4dc7c767d7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/Another.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.dependency.resource.persistence; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Another { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/DataSourcePassivationDependencyTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/DataSourcePassivationDependencyTest.java deleted file mode 100644 index b42e81a564..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/DataSourcePassivationDependencyTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.passivating.dependency.resource.persistence; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.PERSISTENCE; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_CAPABLE_DEPENDENCY_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import java.io.IOException; -import java.sql.SQLException; - -import javax.sql.DataSource; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.impl.ConfigurationFactory; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class DataSourcePassivationDependencyTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(DataSourcePassivationDependencyTest.class) - .withClasses(Pool.class, Another.class, DataSourceProducer.class) - .withWebXml( - Descriptors.create(WebAppDescriptor.class).createResourceRef().resRefName("jdbc/TestDB") - .resType(DataSource.class.getName()).lookupName(ConfigurationFactory.get().getTestDataSource()) - .up()) - .withDefaultPersistenceXml().build(); - } - - @Test(groups = { PERSISTENCE, INTEGRATION }) - @SpecAssertion(section = PASSIVATION_CAPABLE_DEPENDENCY_EE, id = "da") - public void testDataSource() throws IOException, ClassNotFoundException, SQLException { - - Pool pool = getContextualReference(Pool.class); - - assertNotNull(pool); - assertNotNull(pool.getDataSource()); - - String poolId = pool.getId(); - - byte[] serializedPool = passivate(pool); - - Pool poolCopy = (Pool) activate(serializedPool); - - assertNotNull(poolCopy); - assertEquals(poolCopy.getId(), poolId); - assertNotNull(pool.getDataSource()); - assertNotNull(pool.getDataSource().getLoginTimeout()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/DataSourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/DataSourceProducer.java deleted file mode 100644 index ab9930bba1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/DataSourceProducer.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.dependency.resource.persistence; - -import javax.sql.DataSource; - -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class DataSourceProducer { - - @Produces - @Another - @Resource(name = "jdbc/TestDB") - DataSource dataSource; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/Pool.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/Pool.java deleted file mode 100644 index 8602584169..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/Pool.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.dependency.resource.persistence; - -import java.io.Serializable; -import java.util.UUID; - -import javax.sql.DataSource; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; - -@SessionScoped -public class Pool implements Serializable { - - private static final long serialVersionUID = -6404342841354281000L; - - private String id; - - @Inject - @Another - DataSource dataSource; - - public String getId() { - return id; - } - - public DataSource getDataSource() { - return dataSource; - } - - @PostConstruct - public void init() { - this.id = UUID.randomUUID().toString(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/Profile.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/Profile.java deleted file mode 100644 index 0f97cbb545..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/Profile.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.passivating.dependency.resource.persistence; - -import java.io.Serializable; -import java.util.UUID; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; -import jakarta.persistence.EntityManager; -import jakarta.persistence.EntityManagerFactory; - -@SessionScoped -public class Profile implements Serializable { - - private static final long serialVersionUID = 1830634635545684272L; - - private String id; - - @Inject - @Another - EntityManager entityManager; - - @Inject - @Another - EntityManagerFactory entityManagerFactory; - - @PostConstruct - public void init() { - this.id = UUID.randomUUID().toString(); - } - - public EntityManager getEntityManager() { - return entityManager; - } - - public EntityManagerFactory getEntityManagerFactory() { - return entityManagerFactory; - } - - public String getId() { - return id; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/ResourcePassivationDependencyTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/ResourcePassivationDependencyTest.java deleted file mode 100644 index f5320ea155..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/ResourcePassivationDependencyTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.passivating.dependency.resource.persistence; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.PERSISTENCE; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_CAPABLE_DEPENDENCY_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.io.IOException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ResourcePassivationDependencyTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(ResourcePassivationDependencyTest.class) - .withClasses(ResourceProducer.class, Profile.class, Another.class).withDefaultPersistenceXml().build(); - } - - @Test(groups = { PERSISTENCE, INTEGRATION }) - @SpecAssertion(section = PASSIVATION_CAPABLE_DEPENDENCY_EE, id = "db") - @SpecAssertion(section = PASSIVATION_CAPABLE_DEPENDENCY_EE, id = "dc") - public void testPersistenceUnitAndContext() throws IOException, ClassNotFoundException { - - Profile profile = getContextualReference(Profile.class); - - assertNotNull(profile); - assertNotNull(profile.getEntityManager()); - assertTrue(profile.getEntityManager().isOpen()); - assertNotNull(profile.getEntityManagerFactory()); - assertTrue(profile.getEntityManagerFactory().isOpen()); - - String profileId = profile.getId(); - - byte[] serializedProfile = passivate(profile); - - Profile profileCopy = (Profile) activate(serializedProfile); - - assertEquals(profileCopy.getId(), profileId); - assertNotNull(profileCopy.getEntityManager()); - assertTrue(profileCopy.getEntityManager().isOpen()); - assertNotNull(profileCopy.getEntityManagerFactory()); - assertTrue(profileCopy.getEntityManagerFactory().isOpen()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/ResourceProducer.java deleted file mode 100644 index cc5e6ecb8d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/persistence/ResourceProducer.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.dependency.resource.persistence; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; -import jakarta.persistence.EntityManager; -import jakarta.persistence.EntityManagerFactory; -import jakarta.persistence.PersistenceContext; -import jakarta.persistence.PersistenceUnit; - -@Dependent -public class ResourceProducer { - - @Produces - @Another - @PersistenceContext - EntityManager persistenceContext; - - @Produces - @Another - @PersistenceUnit - EntityManagerFactory persistenceUnit; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/ResourcePassivationDependencyTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/ResourcePassivationDependencyTest.java deleted file mode 100644 index 34d6077307..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/ResourcePassivationDependencyTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.dependency.resource.remote; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_CAPABLE_DEPENDENCY_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import java.io.IOException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.OperateOnDeployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.tests.context.passivating.dependency.resource.remote.ejb.FooBean; -import org.jboss.cdi.tck.tests.context.passivating.dependency.resource.remote.ejb.FooRemote; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ResourcePassivationDependencyTest extends AbstractTest { - - @Deployment(name = "TEST", order = 2) - public static EnterpriseArchive createTestArchive() { - return new EnterpriseArchiveBuilder().withTestClass(ResourcePassivationDependencyTest.class) - .setAsClientMode(false).withClasses(FooRemote.class, Worker.class).build(); - } - - @Deployment(name = "REMOTE_EJB", order = 1, testable = false) - public static EnterpriseArchive createEjbArchive() { - return new EnterpriseArchiveBuilder().notTestArchive().noDefaultWebModule().withName("test-ejb.ear") - .withEjbModuleName("test-ejb.jar").withClasses(FooBean.class, FooRemote.class).build(); - } - - @OperateOnDeployment("TEST") - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = PASSIVATION_CAPABLE_DEPENDENCY_EE, id = "dd") - public void testRemoteSessionBean() throws IOException, ClassNotFoundException { - - Worker worker = getContextualReference(Worker.class); - assertNotNull(worker); - - String workerId = worker.getId(); - String fooRemoteId = worker.getFoo().getId(); - - byte[] serializedWorker = passivate(worker); - Worker workerCopy = (Worker) activate(serializedWorker); - - assertNotNull(workerCopy); - assertNotNull(workerCopy.getFoo()); - assertEquals(workerCopy.getId(), workerId); - assertEquals(workerCopy.getFoo().getId(), fooRemoteId); - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/Worker.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/Worker.java deleted file mode 100644 index 65576cc780..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/Worker.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.passivating.dependency.resource.remote; - -import java.io.Serializable; -import java.util.UUID; - -import jakarta.annotation.PostConstruct; -import jakarta.ejb.EJB; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; - -import org.jboss.cdi.tck.tests.context.passivating.dependency.resource.remote.ejb.FooRemote; - -@SessionScoped -@Stateful -public class Worker implements Serializable { - - private static final long serialVersionUID = 1830634635545684272L; - - private String id; - - @EJB(lookup = "java:global/test-ejb/test-ejb/FooBean!org.jboss.cdi.tck.tests.context.passivating.dependency.resource.remote.ejb.FooRemote") - FooRemote foo; - - @PostConstruct - public void init() { - this.id = UUID.randomUUID().toString(); - } - - public FooRemote getFoo() { - return foo; - } - - public String getId() { - return id; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/ejb/FooBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/ejb/FooBean.java deleted file mode 100644 index 86d70cfbb8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/ejb/FooBean.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.dependency.resource.remote.ejb; - -import java.util.UUID; - -import jakarta.annotation.PostConstruct; -import jakarta.ejb.Singleton; -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -@Singleton -public class FooBean implements FooRemote { - - private String id; - - @PostConstruct - public void init() { - this.id = UUID.randomUUID().toString(); - } - - @Override - public String getId() { - return id; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/ejb/FooRemote.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/ejb/FooRemote.java deleted file mode 100644 index 4f5dad59f9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/resource/remote/ejb/FooRemote.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.dependency.resource.remote.ejb; - -import jakarta.ejb.Remote; - -@Remote -public interface FooRemote { - - public String getId(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Chef.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Chef.java deleted file mode 100644 index 76be050b3d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Chef.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.passivating.dependency.sessionbean; - -import java.io.Serializable; -import java.util.UUID; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; - -@SessionScoped -public class Chef implements Serializable { - - private static final long serialVersionUID = 1830634635545684272L; - - private String id; - - @Inject - Spoon spoon; - - @PostConstruct - public void init() { - this.id = UUID.randomUUID().toString(); - } - - public Spoon getSpoon() { - return spoon; - } - - public String getId() { - return id; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Hammer.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Hammer.java deleted file mode 100644 index 719d73ba0c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Hammer.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.dependency.sessionbean; - -import java.util.UUID; - -import jakarta.annotation.PostConstruct; -import jakarta.ejb.Singleton; - -@Singleton -public class Hammer { - - private String id; - - @PostConstruct - public void init() { - this.id = UUID.randomUUID().toString(); - } - - public String getId() { - return id; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/SessionBeanPassivationDependencyTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/SessionBeanPassivationDependencyTest.java deleted file mode 100644 index 76df37b754..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/SessionBeanPassivationDependencyTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.dependency.sessionbean; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_CAPABLE_DEPENDENCY_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import java.io.IOException; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionBeanPassivationDependencyTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SessionBeanPassivationDependencyTest.class).build(); - } - - @Inject - Worker worker; - - @Inject - Chef chef; - - @Test(groups = INTEGRATION) - @SpecAssertion(section = PASSIVATION_CAPABLE_DEPENDENCY_EE, id = "ab") - public void testSingleton() throws IOException, ClassNotFoundException { - assertNotNull(worker); - assertNotNull(worker.getHammer()); - - String workerId = worker.getId(); - String hammerId = worker.getHammer().getId(); - - byte[] serializedWorker = passivate(worker); - Worker workerCopy = (Worker) activate(serializedWorker); - - assertNotNull(workerCopy); - assertNotNull(workerCopy.getHammer()); - assertEquals(workerCopy.getId(), workerId); - assertEquals(workerCopy.getHammer().getId(), hammerId); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = PASSIVATION_CAPABLE_DEPENDENCY_EE, id = "aa") - public void testStateless() throws IOException, ClassNotFoundException { - assertNotNull(chef); - assertNotNull(chef.getSpoon()); - - String chefId = chef.getId(); - - byte[] serializedChef = passivate(chef); - Chef chefCopy = (Chef) activate(serializedChef); - - assertNotNull(chefCopy); - assertNotNull(chefCopy.getSpoon()); - assertEquals(chefCopy.getId(), chefId); - assertEquals(chefCopy.getSpoon().getId(), Spoon.class.getName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Spoon.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Spoon.java deleted file mode 100644 index e86de3d398..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Spoon.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.dependency.sessionbean; - -import jakarta.ejb.Stateless; - -@Stateless -public class Spoon { - - public String getId() { - // Don't save state on SLSB - return Spoon.class.getName(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Worker.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Worker.java deleted file mode 100644 index f810b71181..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/dependency/sessionbean/Worker.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.passivating.dependency.sessionbean; - -import java.io.Serializable; -import java.util.UUID; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; - -@SessionScoped -public class Worker implements Serializable { - - private static final long serialVersionUID = 1830634635545684272L; - - private String id; - - @Inject - Hammer hammer; - - @PostConstruct - public void init() { - this.id = UUID.randomUUID().toString(); - } - - public Hammer getHammer() { - return hammer; - } - - public String getId() { - return id; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/Digital.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/Digital.java deleted file mode 100644 index e869e5b2fa..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/Digital.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.interceptor.InterceptorBinding; - -@InterceptorBinding -@Inherited -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Documented -public @interface Digital { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/DigitalInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/DigitalInterceptor.java deleted file mode 100644 index ce2b25294c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/DigitalInterceptor.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@Interceptor -@Digital -// non-serializable interceptor -public class DigitalInterceptor { - - @AroundInvoke - public Object intercept(InvocationContext ctx) throws Exception { - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/NonPassivationCapableSessionBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/NonPassivationCapableSessionBeanTest.java deleted file mode 100644 index 3483f63575..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/NonPassivationCapableSessionBeanTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_VALIDATION_EE; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Verifies that a deployment which contains a non-passivation capable SFSB which is not bound to a passivating context, is - * valid. - * - *

- * This test was originally part of Weld test suite. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class NonPassivationCapableSessionBeanTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(NonPassivationCapableSessionBeanTest.class) - .withBeansXml(new BeansXml().interceptors(DigitalInterceptor.class)).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = PASSIVATION_VALIDATION_EE, id = "j") - public void testDeployment() { - // only verify deployment - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/Telephone.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/Telephone.java deleted file mode 100644 index 1c534723d3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/Telephone.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise; - -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; - -@Stateful -@RequestScoped -@Digital -public class Telephone { - - @Inject - private TelephoneLine line; - - public TelephoneLine getLine() { - return line; - } - - @Remove - public void remove() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/TelephoneLine.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/TelephoneLine.java deleted file mode 100644 index 79532df3ef..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/TelephoneLine.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class TelephoneLine { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/Digital.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/Digital.java deleted file mode 100644 index 98c591ec21..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/Digital.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.invalid; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.interceptor.InterceptorBinding; - -@InterceptorBinding -@Inherited -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Documented -public @interface Digital { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/DigitalInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/DigitalInterceptor.java deleted file mode 100644 index 99cf7d8976..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/DigitalInterceptor.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.invalid; - -import java.io.Serializable; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@SuppressWarnings("serial") -@Interceptor -@Digital -public class DigitalInterceptor implements Serializable { - - @AroundInvoke - public Object intercept(InvocationContext ctx) throws Exception { - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/Elephant.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/Elephant.java deleted file mode 100644 index 1a84d9bc84..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/Elephant.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.invalid; - -import jakarta.ejb.Remove; -import jakarta.enterprise.context.SessionScoped; - -@SessionScoped -@Digital -public class Elephant implements ElephantLocal { - - @Remove - public void remove() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/ElephantLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/ElephantLocal.java deleted file mode 100644 index a53ef39eb2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/ElephantLocal.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.invalid; - -import jakarta.ejb.Local; - -@Local -public interface ElephantLocal { - - public void remove(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/StatefulSessionBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/StatefulSessionBeanTest.java deleted file mode 100644 index cd8ce7e9dd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/StatefulSessionBeanTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.invalid; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_CAPABLE_EE; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class StatefulSessionBeanTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(StatefulSessionBeanTest.class) - .withClasses(Digital.class, DigitalInterceptor.class, Telephone.class, TelephoneLine.class) - .withBeansXml(new BeansXml().interceptors(DigitalInterceptor.class)).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = PASSIVATION_CAPABLE_EE, id = "ab") - public void testDeployment() { - // only verify deployment - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/StatefulSessionBeanXmlDescriptorTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/StatefulSessionBeanXmlDescriptorTest.java deleted file mode 100644 index 890a4a2dd6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/StatefulSessionBeanXmlDescriptorTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.invalid; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_CAPABLE_EE; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class StatefulSessionBeanXmlDescriptorTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(StatefulSessionBeanXmlDescriptorTest.class) - .withClasses(Digital.class, DigitalInterceptor.class, Elephant.class, ElephantLocal.class) - .withBeansXml(new BeansXml().interceptors(DigitalInterceptor.class)) - .build() - .addAsWebInfResource(StatefulSessionBeanXmlDescriptorTest.class.getPackage(), "ejb-jar.xml", "ejb-jar.xml"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = PASSIVATION_CAPABLE_EE, id = "ab") - public void testDeployment() { - // only verify deployment - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/Telephone.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/Telephone.java deleted file mode 100644 index db4b105f30..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/Telephone.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.invalid; - -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; - -@Stateful(passivationCapable = false) -@SessionScoped -@Digital -public class Telephone { - - @Inject - private TelephoneLine line; - - public TelephoneLine getLine() { - return line; - } - - @Remove - public void remove() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/TelephoneLine.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/TelephoneLine.java deleted file mode 100644 index f604b1cc8d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/TelephoneLine.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.invalid; - -import java.io.Serializable; - -import jakarta.enterprise.context.Dependent; - -@SuppressWarnings("serial") -@Dependent -public class TelephoneLine implements Serializable { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/Digital.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/Digital.java deleted file mode 100644 index a924103dc3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/Digital.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.valid; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.interceptor.InterceptorBinding; - -@InterceptorBinding -@Inherited -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Documented -public @interface Digital { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/DigitalInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/DigitalInterceptor.java deleted file mode 100644 index d39fbdcd1e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/DigitalInterceptor.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.valid; - -import java.io.Serializable; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@SuppressWarnings("serial") -@Interceptor -@Digital -public class DigitalInterceptor implements Serializable { - - @AroundInvoke - public Object intercept(InvocationContext ctx) throws Exception { - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/Elephant.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/Elephant.java deleted file mode 100644 index c1ab82dcf9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/Elephant.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.valid; - -import jakarta.ejb.Remove; -import jakarta.enterprise.context.SessionScoped; - -@SessionScoped -@Digital -public class Elephant implements ElephantLocal { - - @Remove - public void remove() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/ElephantLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/ElephantLocal.java deleted file mode 100644 index 10125ba770..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/ElephantLocal.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.valid; - -public interface ElephantLocal { - - void remove(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/StatefulSessionBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/StatefulSessionBeanTest.java deleted file mode 100644 index 0fcd809fc9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/StatefulSessionBeanTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.valid; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_CAPABLE_EE; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Verifies that a deployment which contains a passivation capable SFSB is valid. - * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class StatefulSessionBeanTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(StatefulSessionBeanTest.class) - .withClasses(Digital.class, DigitalInterceptor.class, Telephone.class, TelephoneLine.class) - .withBeansXml(new BeansXml().interceptors(DigitalInterceptor.class)).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = PASSIVATION_CAPABLE_EE, id = "aa") - public void testDeployment() { - // only verify deployment - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/StatefulSessionBeanXmlDescriptorTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/StatefulSessionBeanXmlDescriptorTest.java deleted file mode 100644 index 90ff575a65..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/StatefulSessionBeanXmlDescriptorTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.valid; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_CAPABLE_EE; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Verifies that a deployment which contains a passivation capable SFSB is valid. - * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class StatefulSessionBeanXmlDescriptorTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(StatefulSessionBeanXmlDescriptorTest.class) - .withClasses(Digital.class, DigitalInterceptor.class, Elephant.class, ElephantLocal.class) - .withBeansXml(new BeansXml().interceptors(DigitalInterceptor.class)) - .build() - .addAsWebInfResource(StatefulSessionBeanXmlDescriptorTest.class.getPackage(), "ejb-jar.xml", "ejb-jar.xml"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = PASSIVATION_CAPABLE_EE, id = "aa") - public void testDeployment() { - // only verify deployment - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/Telephone.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/Telephone.java deleted file mode 100644 index 46a1abe77a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/Telephone.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.valid; - -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; - -@Stateful -@SessionScoped -@Digital -public class Telephone { - - @Inject - private TelephoneLine line; - - public TelephoneLine getLine() { - return line; - } - - @Remove - public void remove() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/TelephoneLine.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/TelephoneLine.java deleted file mode 100644 index 761ee0303e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/TelephoneLine.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.passivating.enterprise.valid; - -import java.io.Serializable; - -import jakarta.enterprise.context.Dependent; - -@SuppressWarnings("serial") -@Dependent -public class TelephoneLine implements Serializable { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ContextDestructionObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ContextDestructionObserver.java deleted file mode 100644 index 286baea9c0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ContextDestructionObserver.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.event.Observes; -import jakarta.servlet.ServletRequest; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Dependent -public class ContextDestructionObserver { - - public void observerRequestContextDestroyed(@Observes @Destroyed(RequestScoped.class) ServletRequest event) { - ActionSequence.addAction(ContextDestructionObserver.class.getName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/IntrospectFilter.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/IntrospectFilter.java deleted file mode 100644 index c5c9d654ad..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/IntrospectFilter.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request; - -import java.io.IOException; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.Filter; -import jakarta.servlet.FilterChain; -import jakarta.servlet.FilterConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.annotation.WebFilter; - -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.cdi.tck.util.SimpleLogger; - -@WebFilter(filterName = "IntrospectFilter", urlPatterns = "/introspect") -public class IntrospectFilter implements Filter { - - private static final SimpleLogger logger = new SimpleLogger(IntrospectFilter.class); - - @Inject - private BeanManager beanManager; - - @Inject - private SimpleRequestBean simpleBean; - - public void destroy() { - beanManager = null; - } - - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, - ServletException { - logger.log("Do filter..."); - checkRequestContextActive(); - chain.doFilter(request, response); - checkRequestContextActive(); - - String mode = request.getParameter("mode"); - if (IntrospectServlet.MODE_COLLECT.equals(mode)) { - ActionSequence.addAction(IntrospectFilter.class.getName()); - } - } - - private void checkRequestContextActive() throws ServletException { - if (beanManager == null || !beanManager.getContext(RequestScoped.class).isActive() || simpleBean == null) { - throw new ServletException("Request context is not active"); - } - // Check bean invocation - simpleBean.getId(); - } - - public void init(FilterConfig filterConfig) throws ServletException { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/IntrospectServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/IntrospectServlet.java deleted file mode 100644 index c8bed491ab..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/IntrospectServlet.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.ActionSequence; - -@WebServlet(name = "IntrospectServlet", urlPatterns = "/introspect") -public class IntrospectServlet extends HttpServlet { - - public static final String MODE_COLLECT = "collect"; - - public static final String MODE_VERIFY = "verify"; - - private static final long serialVersionUID = 1L; - - @Inject - private SimpleRequestBean simpleBean; - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - resp.setContentType("text/plain"); - String mode = req.getParameter("mode"); - - if (mode == null) { - resp.getWriter().append(simpleBean.getId()); - } else if (MODE_COLLECT.equals(mode)) { - ActionSequence.reset(); - ActionSequence.addAction(IntrospectServlet.class.getName()); - } else if (MODE_VERIFY.equals(mode)) { - resp.setStatus(HttpServletResponse.SC_OK); - resp.getWriter().write(ActionSequence.getSequence().toString()); - } else { - throw new ServletException("Unknown guard mode"); - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/RequestContextTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/RequestContextTest.java deleted file mode 100644 index d3f6cda402..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/RequestContextTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotEquals; -import static org.testng.Assert.assertNotNull; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class RequestContextTest extends AbstractTest { - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(RequestContextTest.class) - .withWebResource("SimplePage.html", "SimplePage.html").build(); - } - - /** - * The request scope is active during the service() method of any Servlet in the web application. - */ - @Test - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "aa") - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "ac") - public void testRequestScopeActiveDuringServiceMethod() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "test"); - } - - /** - * The request scope is active during the doFilter() method of any Filter in the web application. - */ - @Test - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "ab") - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "ac") - public void testRequestScopeActiveDuringServletFilter() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "SimplePage.html"); - } - - /** - * The request context is destroyed at the end of the servlet request, after the service() method and all doFilter() - * methods, and all requestDestroyed() notifications return. - */ - @Test - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "ba") - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "bb") - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "bc") - public void testRequestScopeIsDestroyedAfterServletRequest() throws Exception { - - WebClient webClient = new WebClient(); - - // First request - response content contains SimpleRequestBean id - TextPage firstRequestResult = webClient.getPage(contextPath + "introspect"); - assertNotNull(firstRequestResult.getContent()); - // Make a second request and make sure the same context is not there (compare SimpleRequestBean ids) - TextPage secondRequestResult = webClient.getPage(contextPath + "introspect"); - assertNotNull(secondRequestResult.getContent()); - assertNotEquals(secondRequestResult.getContent().trim(), firstRequestResult.getContent().trim()); - - // Make sure request context is destroyed after service(), doFilter(), requestDestroyed() - webClient.getPage(contextPath + "introspect?mode=collect"); - ActionSequence correctSequence = new ActionSequence().add(IntrospectServlet.class.getName()) - .add(IntrospectFilter.class.getName()).add(TestServletRequestListener.class.getName()) - .add(ContextDestructionObserver.class.getName()); - TextPage destroyRequestResult = webClient.getPage(contextPath + "introspect?mode=verify"); - assertNotNull(destroyRequestResult.getContent()); - assertEquals(destroyRequestResult.getContent(), correctSequence.toString()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/SimpleRequestBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/SimpleRequestBean.java deleted file mode 100644 index d1b8d1875a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/SimpleRequestBean.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request; - -import java.util.UUID; - -import jakarta.enterprise.context.RequestScoped; - -@RequestScoped -public class SimpleRequestBean { - - private String id = UUID.randomUUID().toString(); - - public String getId() { - return id; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/TestFilter.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/TestFilter.java deleted file mode 100644 index b492b00d9b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/TestFilter.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request; - -import java.io.IOException; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.Filter; -import jakarta.servlet.FilterChain; -import jakarta.servlet.FilterConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.annotation.WebFilter; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@WebFilter(filterName = "FilterTest", displayName = "Test Filter for Sessions", urlPatterns = "/SimplePage.html") -public class TestFilter implements Filter { - - private static final SimpleLogger logger = new SimpleLogger(TestFilter.class); - - @Inject - private BeanManager beanManager; - - @Inject - private SimpleRequestBean simpleBean; - - public void destroy() { - beanManager = null; - } - - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, - ServletException { - logger.log("Do filter..."); - checkRequestContextActive(); - chain.doFilter(request, response); - checkRequestContextActive(); - } - - private void checkRequestContextActive() throws ServletException { - if (beanManager == null || !beanManager.getContext(RequestScoped.class).isActive() || simpleBean == null) { - throw new ServletException("Request context is not active"); - } - // Check bean invocation - simpleBean.getId(); - } - - public void init(FilterConfig filterConfig) throws ServletException { - // No-op - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/TestServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/TestServlet.java deleted file mode 100644 index c573e7d56e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/TestServlet.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request; - -import java.io.IOException; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -/** - * Servlet used just to test context during service method. - * - * @author David Allen - * @author Martin Kouba - */ -@WebServlet(name = "ServiceMethod", urlPatterns = "/test") -public class TestServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - @Inject - private BeanManager beanManager; - - @Inject - private SimpleRequestBean simpleBean; - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - checkRequestContextActive(); - super.service(req, resp); - } - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.setContentType("text/text"); - resp.getWriter().println("It worked!"); - } - - private void checkRequestContextActive() throws ServletException { - if (beanManager == null || !beanManager.getContext(RequestScoped.class).isActive() || simpleBean == null) { - throw new ServletException("Request context is not active"); - } - // Check bean invocation - simpleBean.getId(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/TestServletRequestListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/TestServletRequestListener.java deleted file mode 100644 index 22bda9ac6f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/TestServletRequestListener.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.ServletRequestEvent; -import jakarta.servlet.ServletRequestListener; -import jakarta.servlet.annotation.WebListener; - -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.cdi.tck.util.SimpleLogger; - -/** - * @author Martin Kouba - */ -@WebListener -public class TestServletRequestListener implements ServletRequestListener { - - private static final SimpleLogger logger = new SimpleLogger(TestServletRequestListener.class); - - @Inject - private BeanManager beanManager; - - @Inject - private SimpleRequestBean simpleBean; - - @Override - public void requestDestroyed(ServletRequestEvent sre) { - logger.log("Request destroyed..."); - checkRequestContextActive(); - - String mode = sre.getServletRequest().getParameter("mode"); - if (IntrospectServlet.MODE_COLLECT.equals(mode)) { - ActionSequence.addAction(TestServletRequestListener.class.getName()); - } - } - - @Override - public void requestInitialized(ServletRequestEvent sre) { - logger.log("Request initialized..."); - checkRequestContextActive(); - } - - private void checkRequestContextActive() throws IllegalStateException { - if (beanManager == null || !beanManager.getContext(RequestScoped.class).isActive() || simpleBean == null) { - throw new IllegalStateException("Request context is not active"); - } - // Check bean invocation - simpleBean.getId(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/AsyncRequestProcessor.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/AsyncRequestProcessor.java deleted file mode 100644 index 2926832909..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/AsyncRequestProcessor.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.async; - -import jakarta.servlet.AsyncContext; - -import org.jboss.cdi.tck.util.SimpleLogger; -import org.jboss.cdi.tck.util.Timer; - -/** - * @author Martin Kouba - */ -public class AsyncRequestProcessor implements Runnable { - - private static final SimpleLogger logger = new SimpleLogger(AsyncRequestProcessor.class); - - private final AsyncContext actx; - - private final long timerValue; - - private final String dispatchPath; - - private final boolean useDispatch; - - public AsyncRequestProcessor(AsyncContext ctx, long timerValue, boolean useDispatch, String dispatchPath) { - super(); - this.actx = ctx; - this.timerValue = timerValue; - this.dispatchPath = dispatchPath; - this.useDispatch = useDispatch; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Runnable#run() - */ - @Override - public void run() { - try { - if (timerValue > 0) { - // Simulate long running operation - Timer.startNew(timerValue); - } - } catch (InterruptedException e) { - throw new IllegalStateException("Interrupted"); - } - - // Dispatch or complete - if (useDispatch) { - if (dispatchPath != null) { - actx.dispatch(dispatchPath); - } else { - actx.dispatch(); - } - } else { - actx.complete(); - } - logger.log("Async processing finished"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/AsyncServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/AsyncServlet.java deleted file mode 100644 index fd8bbf0d05..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/AsyncServlet.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.async; - -import java.io.IOException; -import java.util.Arrays; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -import jakarta.inject.Inject; -import jakarta.servlet.AsyncContext; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@WebServlet(name = "AsyncServlet", urlPatterns = { "/AsyncServlet" }, asyncSupported = true) -@SuppressWarnings("serial") -public class AsyncServlet extends HttpServlet { - - public static final String TEST_TIMEOUT = "timeout"; - public static final String TEST_COMPLETE = "complete"; - public static final String TEST_ERROR = "error"; - public static final String TEST_LOOP = "loop"; - private static final String[] VALID_TESTS = new String[] { TEST_TIMEOUT, TEST_COMPLETE, TEST_ERROR, TEST_LOOP }; - - private static final SimpleLogger logger = new SimpleLogger(AsyncServlet.class); - - private static final long TIMEOUT = 200l; - - private static boolean inLoop = false; - - private ExecutorService executorService; - - @Inject - StatusBean statusBean; - - @Override - public void init() throws ServletException { - // Note that executor thread does not use the same CL - executorService = Executors.newSingleThreadExecutor(); - } - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - String test = req.getParameter("test"); - if (!Arrays.asList(VALID_TESTS).contains(test)) { - resp.setStatus(404); - return; - } - - statusBean.reset(); - final AsyncContext actx = req.startAsync(); - actx.addListener(actx.createListener(SimpleAsyncListener.class)); - resp.setContentType("text/plain"); - - if (TEST_TIMEOUT.equals(test)) { - actx.setTimeout(TIMEOUT); - } else if (TEST_COMPLETE.equals(test)) { - executorService.execute(new AsyncRequestProcessor(actx, 50l, false, null)); - } else if (TEST_ERROR.equals(test)) { - executorService.execute(new AsyncRequestProcessor(actx, 50l, true, "/FailingServlet")); - } else if (TEST_LOOP.equals(test)) { - if (inLoop) { - executorService.execute(new AsyncRequestProcessor(actx, 50l, false, null)); - } else { - executorService.execute(new AsyncRequestProcessor(actx, 50l, true, null)); - inLoop = true; - } - } - logger.log("Service finished: {0}", test); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/FailingServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/FailingServlet.java deleted file mode 100644 index 83b98c3934..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/FailingServlet.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.async; - -import java.io.IOException; - -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@SuppressWarnings("serial") -@WebServlet(name = "FailingServlet", urlPatterns = { "/FailingServlet" }, asyncSupported = true) -public class FailingServlet extends HttpServlet { - - private static final SimpleLogger logger = new SimpleLogger(FailingServlet.class); - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - logger.log("Intentional service failure"); - throw new ServletException(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/RequestContextAsyncListenerTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/RequestContextAsyncListenerTest.java deleted file mode 100644 index 10ded95864..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/RequestContextAsyncListenerTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.async; - -import static org.jboss.cdi.tck.TestGroups.ASYNC_SERVLET; -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT_EE; -import static org.testng.Assert.assertNotEquals; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.context.application.async.AsyncServlet; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * - * @author Martin Kouba - * @author Tomas Remes - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class RequestContextAsyncListenerTest extends AbstractTest { - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(RequestContextAsyncListenerTest.class).build(); - } - - @Test(groups = { INTEGRATION, ASYNC_SERVLET }) - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "ad") - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "bd") - public void testRequestContextActiveOnComplete() throws Exception { - - WebClient webClient = new WebClient(); - webClient.getPage(getPath(AsyncServlet.TEST_COMPLETE)); - - // check status servlet for results - TextPage results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onComplete: true")); - - // Indirectly test request context is destroyed after onComplete() - webClient.getPage(getPath(AsyncServlet.TEST_COMPLETE)); - TextPage results2 = webClient.getPage(contextPath + "Status"); - assertNotEquals(extractSimpleRequestBeanIdString(results.getContent()), - extractSimpleRequestBeanIdString(results2.getContent())); - } - - @Test(groups = { INTEGRATION, ASYNC_SERVLET }) - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "ad") - public void testRequestContextActiveOnTimeout() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(getPath(AsyncServlet.TEST_TIMEOUT)); - - // check status servlet for results - TextPage results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onTimeout: true")); - } - - @Test(groups = { INTEGRATION, ASYNC_SERVLET }) - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "ad") - public void testRequestContextActiveOnError() throws Exception { - WebClient webClient = new WebClient(); - webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); - webClient.getPage(getPath(AsyncServlet.TEST_ERROR)); - TextPage results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onError: true")); - } - - @Test(groups = { INTEGRATION, ASYNC_SERVLET }) - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "ad") - public void testRequestContextActiveOnStartAsync() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(getPath(AsyncServlet.TEST_LOOP)); - TextPage results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onStartAsync: true")); - } - - private String getPath(String test) { - return contextPath + "AsyncServlet?test=" + test; - } - - private String extractSimpleRequestBeanIdString(String content) { - String[] tokens = content.split(","); - // See SimpleAsyncListener#getInfo() - return tokens[4]; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/SimpleAsyncListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/SimpleAsyncListener.java deleted file mode 100644 index 26ebebd4b8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/SimpleAsyncListener.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.async; - -import java.io.IOException; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.AsyncEvent; -import jakarta.servlet.AsyncListener; - -import org.jboss.cdi.tck.util.SimpleLogger; - -/** - * @author Martin Kouba - * @author Tomas Remes - */ -public class SimpleAsyncListener implements AsyncListener { - - public static boolean isRequestContextActive = false; - private static final SimpleLogger logger = new SimpleLogger(SimpleAsyncListener.class); - - @Inject - SimpleRequestBean simpleRequestBean; - - @Inject - BeanManager beanManager; - - @Inject - StatusBean statusBean; - - /* - * (non-Javadoc) - * - * @see jakarta.servlet.AsyncListener#onComplete(jakarta.servlet.AsyncEvent) - */ - @Override - public void onComplete(AsyncEvent event) throws IOException { - logger.log("onComplete"); - - if (!statusBean.isOnTimeout() && !statusBean.isOnError()) { - // Do not check and write info in case of post timeout/error action - statusBean.setOnComplete(checkRequestContextAvailability()); - } - } - - /* - * (non-Javadoc) - * - * @see jakarta.servlet.AsyncListener#onTimeout(jakarta.servlet.AsyncEvent) - */ - @Override - public void onTimeout(AsyncEvent event) throws IOException { - logger.log("onTimeout"); - statusBean.setOnTimeout(checkRequestContextAvailability()); - event.getAsyncContext().complete(); - } - - /* - * (non-Javadoc) - * - * @see jakarta.servlet.AsyncListener#onError(jakarta.servlet.AsyncEvent) - */ - @Override - public void onError(AsyncEvent event) throws IOException { - logger.log("onError"); - statusBean.setOnError(checkRequestContextAvailability()); - event.getAsyncContext().complete(); - } - - /* - * (non-Javadoc) - * - * @see jakarta.servlet.AsyncListener#onStartAsync(jakarta.servlet.AsyncEvent) - */ - @Override - public void onStartAsync(AsyncEvent event) throws IOException { - logger.log("onStartAsync"); - statusBean.setOnStartAsync(checkRequestContextAvailability()); - } - - private boolean checkRequestContextAvailability() throws IOException { - try { - statusBean.setRequestBeanId(simpleRequestBean.getId()); - isRequestContextActive = beanManager.getContext(RequestScoped.class).isActive(); - } catch (Throwable e) { - logger.log("Problem while checking request scope: " + e.getMessage()); - } - if (!isRequestContextActive || statusBean.getRequestBeanId() == null) { - return false; - } - return true; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/SimpleRequestBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/SimpleRequestBean.java deleted file mode 100644 index a6afcfd61e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/SimpleRequestBean.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.async; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.RequestScoped; - -/** - * @author Martin Kouba - */ -@RequestScoped -public class SimpleRequestBean { - - private long id; - - @PostConstruct - public void init() { - id = System.currentTimeMillis(); - } - - public long getId() { - return id; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/StatusBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/StatusBean.java deleted file mode 100644 index 68fb859d7c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/StatusBean.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.async; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class StatusBean { - - private boolean onError; - private boolean onComplete; - private boolean onTimeout; - private boolean onStartAsync; - private Long requestBeanId; - - public Long getRequestBeanId() { - return requestBeanId; - } - - public void setRequestBeanId(Long requestBeanId) { - this.requestBeanId = requestBeanId; - } - - public boolean isOnStartAsync() { - return onStartAsync; - } - - public void setOnStartAsync(boolean onStartAsync) { - this.onStartAsync = onStartAsync; - } - - public boolean isOnComplete() { - return onComplete; - } - - public void setOnComplete(boolean onComplete) { - this.onComplete = onComplete; - } - - public boolean isOnError() { - return onError; - } - - public void setOnError(boolean onError) { - this.onError = onError; - } - - public boolean isOnTimeout() { - return onTimeout; - } - - public void setOnTimeout(boolean onTimeout) { - this.onTimeout = onTimeout; - } - - public void reset() { - this.onComplete = false; - this.onStartAsync = false; - this.onTimeout = false; - this.onError = false; - this.requestBeanId = null; - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/StatusServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/StatusServlet.java deleted file mode 100644 index 571a216519..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/async/StatusServlet.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.async; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@WebServlet(name = "StatusServlet", urlPatterns = { "/Status" }) -public class StatusServlet extends HttpServlet { - - @Inject - StatusBean statusBean; - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws IOException { - writeInfo(resp); - } - - private void writeInfo(ServletResponse response) throws IOException { - response.getWriter().print(getInfo()); - response.getWriter().flush(); - } - - public String getInfo() { - return String - .format("onStartAsync: %s, onError: %s, onTimeout: %s, onComplete: %s, simpleRequestBeanId: %s", - statusBean.isOnStartAsync(), statusBean.isOnError(), statusBean.isOnTimeout(), - statusBean.isOnComplete(), statusBean.getRequestBeanId()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/BarBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/BarBean.java deleted file mode 100644 index fcbe1e8795..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/BarBean.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.ejb; - -import java.util.concurrent.Future; - -import jakarta.ejb.AsyncResult; -import jakarta.ejb.Asynchronous; -import jakarta.ejb.Stateless; -import jakarta.enterprise.context.ContextNotActiveException; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.context.spi.Context; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -@Stateless -@Asynchronous -public class BarBean { - - @Inject - BeanManager beanManager; - - @Inject - SimpleRequestBean simpleRequestBean; - - /** - * Async computation. - * - * @return - */ - public Future compute() { - - String result = null; - Context requestContext = null; - - try { - requestContext = beanManager.getContext(RequestScoped.class); - } catch (ContextNotActiveException e) { - // No-op - } - - if (requestContext != null && requestContext.isActive() && simpleRequestBean != null) { - result = simpleRequestBean.getId(); - } - return new AsyncResult(result); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/EJBRequestContextTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/EJBRequestContextTest.java deleted file mode 100644 index 16f2c2f8ae..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/EJBRequestContextTest.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.ejb; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT_EE; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; - -import jakarta.ejb.EJB; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.OperateOnDeployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.util.Timer; -import org.jboss.cdi.tck.util.Timer.StopCondition; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * EJB and related tests with the built-in request context. - * - * Clarification for request context lifecycle during remote method invocation of EJB is required - see CDI-180. - * - * @author David Allen - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EJBRequestContextTest extends AbstractTest { - - @Deployment(name = "TEST", order = 1) - public static EnterpriseArchive createTestArchive() { - return new EnterpriseArchiveBuilder().withTestClass(EJBRequestContextTest.class).setAsClientMode(false) - .withClasses(FMS.class, FMSModelIII.class, BarBean.class, SimpleRequestBean.class, FooRemote.class).build(); - } - - @Deployment(name = "REMOTE_EJB", order = 2, testable = false) - public static EnterpriseArchive createEjbArchive() { - return new EnterpriseArchiveBuilder().notTestArchive().noDefaultWebModule().withName("test-ejb.ear") - .withEjbModuleName("test-ejb.jar").withClasses(FooBean.class, FooRemote.class, FooRequestBean.class).build(); - } - - @EJB(lookup = "java:global/test-ejb/test-ejb/FooBean!org.jboss.cdi.tck.tests.context.request.ejb.FooRemote") - FooRemote foo; - - @Inject - BarBean bar; - - /** - * The request scope is active during any remote method invocation of any EJB bean, during any call to an EJB timeout method - * and during message delivery to any EJB message driven bean. - */ - @OperateOnDeployment("TEST") - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "gc") - public void testRequestScopeActiveDuringCallToEjbTimeoutMethod() throws Exception { - FMSModelIII.reset(); - FMS flightManagementSystem = getContextualReference(FMS.class); - flightManagementSystem.climb(); - - new Timer().setDelay(20, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - public boolean isSatisfied() { - return FMSModelIII.isClimbed(); - } - }).start(); - - assertTrue(flightManagementSystem.isRequestScopeActive()); - } - - /** - * The request context is destroyed after the remote method invocation, timeout or message delivery completes. - */ - @OperateOnDeployment("TEST") - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "hc") - public void testRequestScopeDestroyedAfterCallToEjbTimeoutMethod() throws Exception { - FMSModelIII.reset(); - SimpleRequestBean.reset(); - FMS flightManagementSystem = getContextualReference(FMS.class); - - flightManagementSystem.climb(); - - Timer timer = new Timer().setDelay(20, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - public boolean isSatisfied() { - return FMSModelIII.isClimbed(); - } - }).start(); - - flightManagementSystem.descend(); - - timer.addStopCondition(new StopCondition() { - public boolean isSatisfied() { - return FMSModelIII.isDescended(); - } - }, true).start(); - - assertFalse(flightManagementSystem.isSameBean()); - assertTrue(SimpleRequestBean.isBeanDestroyed()); - } - - @OperateOnDeployment("TEST") - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "ga") - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "ha") - public void testRequestScopeActiveDuringRemoteCallToEjb() throws Exception { - assertNotNull(foo.ping()); - assertTrue(foo.wasRequestBeanInPreviousCallDestroyed()); - } - - @OperateOnDeployment("TEST") - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "gb") - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "hb") - public void testRequestScopeActiveDuringAsyncCallToEjb() throws Exception { - SimpleRequestBean simpleRequestBean = getContextualReference(SimpleRequestBean.class); - SimpleRequestBean.reset(); - Future result = bar.compute(); - String id = result.get(); - assertNotNull(id); - assertNotEquals(id, simpleRequestBean.getId()); - assertTrue(SimpleRequestBean.isBeanDestroyed()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FMS.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FMS.java deleted file mode 100644 index 51b8ccd975..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FMS.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.ejb; - -import jakarta.ejb.Local; - -@Local -public interface FMS { - - public void climb(); - - public void descend(); - - public boolean isRequestScopeActive(); - - public boolean isSameBean(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FMSModelIII.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FMSModelIII.java deleted file mode 100644 index 64b5832312..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FMSModelIII.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.ejb; - -import jakarta.annotation.Resource; -import jakarta.ejb.Stateless; -import jakarta.ejb.Timeout; -import jakarta.ejb.Timer; -import jakarta.ejb.TimerService; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.Instance; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -@Stateless -public class FMSModelIII implements FMS { - - private static final String CLIMB_COMMAND = "ClimbCommand"; - private static final String DESCEND_COMMAND = "DescendCommand"; - - @Resource - private TimerService timerService; - - @Inject - private BeanManager beanManager; - - @Inject - Instance simpleRequestBean; - - private static volatile boolean requestScopeActive = false; - private static volatile String beanId = null; - private static volatile boolean sameBean = false; - - private static volatile boolean climbed; - private static volatile boolean descended; - - public void climb() { - timerService.createTimer(200, CLIMB_COMMAND); - } - - public void descend() { - timerService.createTimer(100, DESCEND_COMMAND); - } - - @Timeout - public void timeout(Timer timer) { - if (beanManager.getContext(RequestScoped.class).isActive()) { - requestScopeActive = true; - if (beanId != null && beanId.equals(simpleRequestBean.get().getId())) { - sameBean = true; - } else { - beanId = simpleRequestBean.get().getId(); - } - } - // CDITCK-221 - applicationScopeActive, beanId and sameBean have been set and are testable - if (timer.getInfo().equals(CLIMB_COMMAND)) { - climbed = true; - } - if (timer.getInfo().equals(DESCEND_COMMAND)) { - descended = true; - } - } - - public boolean isRequestScopeActive() { - return requestScopeActive; - } - - public static void reset() { - beanId = null; - climbed = false; - descended = false; - requestScopeActive = false; - sameBean = false; - } - - public boolean isSameBean() { - return sameBean; - } - - public static boolean isClimbed() { - return climbed; - } - - public static boolean isDescended() { - return descended; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FooBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FooBean.java deleted file mode 100644 index 26a95067ed..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FooBean.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.ejb; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.context.ContextNotActiveException; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.context.spi.Context; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -@Stateless -public class FooBean implements FooRemote { - - @Inject - private BeanManager beanManager; - - @Inject - FooRequestBean fooRequestBean; - - @Override - public String ping() { - - FooRequestBean.reset(); - Context requestContext = null; - - try { - requestContext = beanManager.getContext(RequestScoped.class); - } catch (ContextNotActiveException e) { - // No-op - } - - if (requestContext == null || !requestContext.isActive() || fooRequestBean == null) { - return null; - } - double id = fooRequestBean.getId(); - return "pong" + id; - } - - @Override - public boolean wasRequestBeanInPreviousCallDestroyed() { - // We only want to know whether FooRequestBean was destroyed after previous call - return FooRequestBean.isBeanDestroyed(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FooRemote.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FooRemote.java deleted file mode 100644 index d1fd80b7b0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FooRemote.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.ejb; - -import jakarta.ejb.Remote; - -@Remote -public interface FooRemote { - - public String ping(); - - public boolean wasRequestBeanInPreviousCallDestroyed(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FooRequestBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FooRequestBean.java deleted file mode 100644 index 210156bae5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FooRequestBean.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.ejb; - -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.RequestScoped; - -@RequestScoped -public class FooRequestBean { - - private double id = Math.random(); - private static boolean beanDestroyed = false; - - public double getId() { - return id; - } - - @PreDestroy - public void destroy() { - System.out.println("DESTROYED"); - beanDestroyed = true; - } - - public static boolean isBeanDestroyed() { - return beanDestroyed; - } - - public static void reset() { - beanDestroyed = false; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/SimpleRequestBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/SimpleRequestBean.java deleted file mode 100644 index 334a0a8d38..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/SimpleRequestBean.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.ejb; - -import java.util.UUID; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.RequestScoped; - -@RequestScoped -public class SimpleRequestBean { - - private String id; - - private static boolean beanDestroyed = false; - - @PostConstruct - public void init() { - id = UUID.randomUUID().toString(); - } - - @PreDestroy - public void destroy() { - beanDestroyed = true; - } - - public String getId() { - return id; - } - - public static boolean isBeanDestroyed() { - return beanDestroyed; - } - - public static void reset() { - beanDestroyed = false; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/ObservingBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/ObservingBean.java deleted file mode 100644 index 9e3b19c277..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/ObservingBean.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event; - -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.BeforeDestroyed; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.event.Observes; -import jakarta.servlet.ServletRequest; - -@ApplicationScoped -public class ObservingBean { - - private final AtomicInteger initializedRequestCount = new AtomicInteger(); - private final AtomicInteger beforeDestroyedRequestCount = new AtomicInteger(); - private final AtomicInteger destroyedRequestCount = new AtomicInteger(); - - public void observeRequestInitialized(@Observes @Initialized(RequestScoped.class) ServletRequest event) { - if (!"bar".equals(event.getParameter("foo"))) { - throw new IllegalArgumentException("Unknown request, parameter foo not set."); - } - initializedRequestCount.incrementAndGet(); - } - - public void observeBeforeDestroyed(@Observes @BeforeDestroyed(RequestScoped.class) ServletRequest event) { - beforeDestroyedRequestCount.incrementAndGet(); - } - - public void observeRequestDestroyed(@Observes @Destroyed(RequestScoped.class) ServletRequest event) { - destroyedRequestCount.incrementAndGet(); - } - - public AtomicInteger getInitializedRequestCount() { - return initializedRequestCount; - } - - public AtomicInteger getDestroyedRequestCount() { - return destroyedRequestCount; - } - - public AtomicInteger getBeforeDestroyedRequestCount() { - return beforeDestroyedRequestCount; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/RequestScopeEventTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/RequestScopeEventTest.java deleted file mode 100644 index 28c1e5d349..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/RequestScopeEventTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT_EE; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - *

- * This test was originally part of Weld test suite. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class RequestScopeEventTest extends AbstractTest { - - @ArquillianResource(Servlet.class) - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(RequestScopeEventTest.class).build(); - } - - @Test - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "ja") - @SpecAssertion(section = REQUEST_CONTEXT, id = "a") - @SpecAssertion(section = REQUEST_CONTEXT, id = "b") - @SpecAssertion(section = REQUEST_CONTEXT, id = "c") - public void test() throws Exception { - WebClient client = new WebClient(); - - TextPage page1 = client.getPage(contextPath + "?foo=bar"); - assertTrue(page1.getContent().contains("Initialized requests:1")); // the current request - assertTrue(page1.getContent().contains("Before destroyed requests:0")); - assertTrue(page1.getContent().contains("Destroyed requests:0")); // not destroyed yet - - TextPage page2 = client.getPage(contextPath + "?foo=bar"); - assertTrue(page2.getContent().contains("Initialized requests:2")); - assertTrue(page2.getContent().contains("Before destroyed requests:1")); - assertTrue(page2.getContent().contains("Destroyed requests:1")); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/Servlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/Servlet.java deleted file mode 100644 index e1d89fe59a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/Servlet.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@WebServlet("/") -@SuppressWarnings("serial") -public class Servlet extends HttpServlet { - - @Inject - private ObservingBean observer; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.getWriter().append("Initialized requests:" + observer.getInitializedRequestCount().get()); - resp.getWriter().append("\n"); - resp.getWriter().append("Destroyed requests:" + observer.getDestroyedRequestCount().get()); - resp.getWriter().append("\n"); - resp.getWriter().append("Before destroyed requests:" + observer.getBeforeDestroyedRequestCount().get()); - resp.setContentType("text/plain"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/ApplicationScopedObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/ApplicationScopedObserver.java deleted file mode 100644 index 4441aa4ac3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/ApplicationScopedObserver.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event.async; - -import java.util.concurrent.atomic.AtomicBoolean; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.event.Observes; - -@ApplicationScoped -public class ApplicationScopedObserver { - - private final AtomicBoolean destroyedCalled = new AtomicBoolean(); - - void observeRequestDestroyed(@Observes @Destroyed(RequestScoped.class) Object event) { - destroyedCalled.set(true); - } - - boolean isDestroyedCalled() { - return destroyedCalled.get(); - } - - void reset() { - destroyedCalled.set(false); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/AsyncService.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/AsyncService.java deleted file mode 100644 index 1f95ee08ad..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/AsyncService.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.event.async; - -import java.util.concurrent.Future; - -import jakarta.ejb.AsyncResult; -import jakarta.ejb.Asynchronous; -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; - -@Stateless -public class AsyncService { - - @Inject - private RequestScopedObserver requestScopedObserver; - - @Inject - private ApplicationScopedObserver observer; - - @Asynchronous - public Future compute() { - /* - * This verifies that: - * 1) Request context is active - * 2) @Initialized(RequestScoped.class) was received - */ - observer.reset(); - return new AsyncResult(requestScopedObserver.isInitializedObserved()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/InfoServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/InfoServlet.java deleted file mode 100644 index 94a10eefbb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/InfoServlet.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.event.async; - -import java.io.IOException; -import java.util.concurrent.Future; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -/** - * @author Martin Kouba - */ -@SuppressWarnings("serial") -@WebServlet(value = "/info") -public class InfoServlet extends HttpServlet { - - @Inject - ApplicationScopedObserver observingBean; - - @Inject - AsyncService asyncService; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - Future result = asyncService.compute(); - - try { - resp.getWriter().append("Initialized:" + result.get()); - } catch (Exception e) { - throw new ServletException(e); - } - resp.getWriter().append("\n"); - resp.getWriter().append("Destroyed:" + observingBean.isDestroyedCalled()); - resp.setContentType("text/plain"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/RequestScopeEventAsyncTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/RequestScopeEventAsyncTest.java deleted file mode 100644 index fe4876a3bd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/RequestScopeEventAsyncTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.event.async; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; - -import java.net.URL; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * An event with qualifier @Initialized(RequestScoped.class) is fired when the request context is initialized and an event with - * qualifier @Destroyed(RequestScoped.class) when the request context is destroyed. The event payload is the java.lang.Object if - * the context is initialized or destroyed due to a EJB asynchronous method invocation. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class RequestScopeEventAsyncTest extends AbstractTest { - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(RequestScopeEventAsyncTest.class).build(); - } - - @ArquillianResource - private URL contextPath; - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "jd") - @SpecAssertion(section = REQUEST_CONTEXT, id = "a") - @SpecAssertion(section = REQUEST_CONTEXT, id = "c") - public void testEventsFired() throws Exception { - - WebClient client = new WebClient(); - - TextPage page = client.getPage(contextPath + "info"); - String content = page.getContent(); - - checkContent(content, "(Initialized:)(\\w+)", "true"); - // Timeout request only - checkContent(content, "(Destroyed:)(\\w+)", "true"); - } - - private void checkContent(String content, String pattern, String expected) { - Matcher matcher = Pattern.compile(pattern).matcher(content); - if (matcher.find()) { - String value = matcher.group(2); - assertEquals(value, expected); - } else { - fail(); - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/RequestScopedObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/RequestScopedObserver.java deleted file mode 100644 index d0aa32ddff..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/async/RequestScopedObserver.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event.async; - -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.event.Observes; - -@RequestScoped -public class RequestScopedObserver { - - private boolean initializedObserved; - - void initialize(@Observes @Initialized(RequestScoped.class) Object event) { - if (event != null) { - initializedObserved = true; - } - } - - boolean isInitializedObserved() { - return initializedObserved; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/AbstractMessageListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/AbstractMessageListener.java deleted file mode 100644 index bbe9e1b88b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/AbstractMessageListener.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event.jms; - -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.annotation.PostConstruct; -import jakarta.inject.Inject; -import jakarta.jms.Message; -import jakarta.jms.MessageListener; -import jakarta.jms.TextMessage; - -public class AbstractMessageListener implements MessageListener { - - private static AtomicInteger processedMessages = new AtomicInteger(0); - private static AtomicBoolean initializedEventObserver = new AtomicBoolean(); - private static AtomicBoolean initialized = new AtomicBoolean(); - - @Inject - private RequestScopedObserver observer; - - @Override - public void onMessage(Message message) { - - if (message instanceof TextMessage) { - processedMessages.incrementAndGet(); - initializedEventObserver.set(observer.isInitializedObserved()); - } else { - throw new IllegalArgumentException("Unsupported message type"); - } - } - - public static void reset() { - processedMessages.set(0); - initializedEventObserver.set(false); - } - - public static int getProcessedMessages() { - return processedMessages.get(); - } - - public static boolean isInitializedEventObserver() { - return initializedEventObserver.get(); - } - - public static boolean isInitialized() { - return initialized.get(); - } - - @PostConstruct - public void postConstruct() { - initialized.set(true); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/ApplicationScopedObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/ApplicationScopedObserver.java deleted file mode 100644 index ea79abeeea..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/ApplicationScopedObserver.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event.jms; - -import java.util.concurrent.atomic.AtomicBoolean; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.event.Observes; - -@ApplicationScoped -public class ApplicationScopedObserver { - - private final AtomicBoolean destroyedCalled = new AtomicBoolean(); - - void observeRequestDestroyed(@Observes @Destroyed(RequestScoped.class) Object event) { - destroyedCalled.set(true); - } - - boolean isDestroyedCalled() { - return destroyedCalled.get(); - } - - void reset() { - destroyedCalled.set(false); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/RequestScopeEventMessageDeliveryTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/RequestScopeEventMessageDeliveryTest.java deleted file mode 100644 index 255480c7fd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/RequestScopeEventMessageDeliveryTest.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event.jms; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.TestGroups.JMS; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT_EE; -import static org.jboss.cdi.tck.shrinkwrap.descriptors.ejb.EjbJarDescriptorBuilder.MessageDriven.newMessageDriven; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.util.concurrent.TimeUnit; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.impl.ConfigurationFactory; -import org.jboss.cdi.tck.shrinkwrap.descriptors.ejb.EjbJarDescriptorBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.Timer; -import org.jboss.cdi.tck.util.Timer.StopCondition; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.ejbjar31.EjbJarDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class RequestScopeEventMessageDeliveryTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - - EjbJarDescriptor ejbJarDescriptor = new EjbJarDescriptorBuilder().messageDrivenBeans( - newMessageDriven("TestTopic", TopicMessageDrivenBean.class.getName()) - .addActivationConfigProperty("acknowledgeMode", "Auto-acknowledge") - .addActivationConfigProperty("destinationType", "jakarta.jms.Topic") - .addActivationConfigProperty("destinationLookup", ConfigurationFactory.get().getTestJmsTopic())) - .build(); - - return new WebArchiveBuilder().withTestClassPackage(RequestScopeEventMessageDeliveryTest.class) - .withEjbJarXml(ejbJarDescriptor).build(); - } - - @Inject - private SimpleMessageProducer producer; - - @Inject - private ApplicationScopedObserver observer; - - @Test(groups = { JAVAEE_FULL, JMS }) - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "jf") - @SpecAssertion(section = REQUEST_CONTEXT, id = "a") - @SpecAssertion(section = REQUEST_CONTEXT, id = "c") - public void testEventsFired() throws Exception { - - new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - public boolean isSatisfied() { - return AbstractMessageListener.isInitialized(); - } - }).start(); - - AbstractMessageListener.reset(); - observer.reset(); - - producer.sendTopicMessage(); - - new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - public boolean isSatisfied() { - return AbstractMessageListener.isInitializedEventObserver() - && AbstractMessageListener.getProcessedMessages() >= 1; - } - }).start(); - - assertEquals(1, AbstractMessageListener.getProcessedMessages()); - assertTrue(AbstractMessageListener.isInitializedEventObserver()); - - // wait for the request scope for the message delivery to be destroyed and verify that the event was delivered - new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - public boolean isSatisfied() { - return observer.isDestroyedCalled(); - } - }).start(); - - assertTrue(observer.isDestroyedCalled()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/RequestScopedObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/RequestScopedObserver.java deleted file mode 100644 index 0054a09858..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/RequestScopedObserver.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event.jms; - -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.event.Observes; - -@RequestScoped -public class RequestScopedObserver { - - private boolean initializedObserved; - - void initialize(@Observes @Initialized(RequestScoped.class) Object event) { - if (event != null) { - initializedObserved = true; - } - } - - boolean isInitializedObserved() { - return initializedObserved; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/SimpleMessageProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/SimpleMessageProducer.java deleted file mode 100644 index 44b1275506..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/SimpleMessageProducer.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event.jms; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.Dependent; -import jakarta.jms.Connection; -import jakarta.jms.ConnectionFactory; -import jakarta.jms.JMSException; -import jakarta.jms.MessageProducer; -import jakarta.jms.Session; -import jakarta.jms.TextMessage; -import jakarta.jms.Topic; - -import org.jboss.cdi.tck.impl.ConfigurationFactory; -import org.jboss.cdi.tck.util.JndiLookupUtils; -import org.jboss.cdi.tck.util.SimpleLogger; - -@Dependent -public class SimpleMessageProducer { - - private static final SimpleLogger simpleLogger = new SimpleLogger(SimpleMessageProducer.class); - - private ConnectionFactory connectionFactory; - - private Topic topic; - - @PostConstruct - public void init() { - this.connectionFactory = (ConnectionFactory) JndiLookupUtils - .lookup(ConfigurationFactory.get().getTestJmsConnectionFactory()); - this.topic = (Topic) JndiLookupUtils.lookup(ConfigurationFactory.get().getTestJmsTopic()); - } - - public void sendTopicMessage() { - - Connection connection = null; - Session session = null; - MessageProducer messageProducer = null; - TextMessage message = null; - - try { - connection = connectionFactory.createConnection(); - session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - - messageProducer = session.createProducer(topic); - message = session.createTextMessage(); - message.setText(SimpleMessageProducer.class.getName()); - messageProducer.send(message); - - } catch (JMSException e) { - throw new RuntimeException("Cannot send message", e); - } finally { - if (connection != null) { - try { - connection.close(); - } catch (JMSException e) { - simpleLogger.log(e); - } - } - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/TopicMessageDrivenBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/TopicMessageDrivenBean.java deleted file mode 100644 index 210d75e48d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/TopicMessageDrivenBean.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event.jms; - -import jakarta.jms.MessageListener; - -public class TopicMessageDrivenBean extends AbstractMessageListener implements MessageListener { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/ApplicationScopedObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/ApplicationScopedObserver.java deleted file mode 100644 index d42f916811..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/ApplicationScopedObserver.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event.remote; - -import java.util.concurrent.atomic.AtomicBoolean; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.event.Observes; - -@ApplicationScoped -public class ApplicationScopedObserver { - - private final AtomicBoolean destroyedCalled = new AtomicBoolean(); - - void observeRequestDestroyed(@Observes @Destroyed(RequestScoped.class) Object event) { - destroyedCalled.set(true); - } - - boolean isDestroyedCalled() { - return destroyedCalled.get(); - } - - void reset() { - destroyedCalled.set(false); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/FooBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/FooBean.java deleted file mode 100644 index deb6e77110..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/FooBean.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event.remote; - -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; - -@Stateless -public class FooBean implements FooRemote { - - @Inject - private RequestScopedObserver requestScopedObserver; - - @Inject - private ApplicationScopedObserver applicationScopedObserver; - - /** - * Verifies that the request context is active during remote method invocation and that @Initialized(RequestScoped.class) - * was fired when this context was initialized. Also resets {@link ApplicationScopedObserver} which detects @Destroyed - * events. - */ - public boolean first() { - applicationScopedObserver.reset(); - return requestScopedObserver.isInitializedObserved(); - } - - /** - * Verifies that the request context is active during remote method invocation and that @Initialized(RequestScoped.class) - * was fired when this context was initialized. Furthermore, this method verifies that the @Destroyed event observer that - * was reset in the {@link #first()} invocation received @Destroyed event in the meantime (this event was fired once the - * request context of the {@link #first()} invocation was destroyed). - */ - public boolean second() { - return requestScopedObserver.isInitializedObserved() && applicationScopedObserver.isDestroyedCalled(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/FooRemote.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/FooRemote.java deleted file mode 100644 index cba2988b1a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/FooRemote.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event.remote; - -import jakarta.ejb.Remote; - -@Remote -public interface FooRemote { - - boolean first(); - - boolean second(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/RequestScopeEventRemoteTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/RequestScopeEventRemoteTest.java deleted file mode 100644 index 2617774d27..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/RequestScopeEventRemoteTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event.remote; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT_EE; -import static org.testng.Assert.assertTrue; - -import jakarta.ejb.EJB; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.OperateOnDeployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Clarification for request context lifecycle during remote method invocation of EJB is required - see CDI-180. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class RequestScopeEventRemoteTest extends AbstractTest { - - @Deployment(name = "TEST", order = 1) - public static EnterpriseArchive createTestArchive() { - return new EnterpriseArchiveBuilder().withTestClass(RequestScopeEventRemoteTest.class).setAsClientMode(false) - .withClasses(FooRemote.class).build(); - } - - @Deployment(name = "REMOTE_EJB", order = 2, testable = false) - public static EnterpriseArchive createEjbArchive() { - return new EnterpriseArchiveBuilder().notTestArchive().noDefaultWebModule().withName("test-ejb.ear") - .withEjbModuleName("test-ejb.jar") - .withClasses(FooBean.class, FooRemote.class, RequestScopedObserver.class, ApplicationScopedObserver.class) - .build(); - } - - @EJB(lookup = "java:global/test-ejb/test-ejb/FooBean!org.jboss.cdi.tck.tests.context.request.event.remote.FooRemote") - FooRemote foo; - - @OperateOnDeployment("TEST") - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "jc") - public void testRequestScopeActiveDuringRemoteCallToEjb() throws Exception { - - assertTrue(foo.first()); - assertTrue(foo.second()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/RequestScopedObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/RequestScopedObserver.java deleted file mode 100644 index 4061663b21..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/remote/RequestScopedObserver.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event.remote; - -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.event.Observes; - -@RequestScoped -public class RequestScopedObserver { - - private boolean initializedObserved; - - void observeRequestInitialized(@Observes @Initialized(RequestScoped.class) Object event) { - initializedObserved = true; - } - - public boolean isInitializedObserved() { - return initializedObserved; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/ApplicationScopedObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/ApplicationScopedObserver.java deleted file mode 100644 index dce1ce15af..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/ApplicationScopedObserver.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event.timeout; - -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.event.Observes; -import jakarta.inject.Inject; - -@ApplicationScoped -public class ApplicationScopedObserver { - - @Inject - private RequestScopedObserver observer; - - private final CountDownLatch latch = new CountDownLatch(1); - private final AtomicBoolean destroyedCalled = new AtomicBoolean(); - - void observeRequestDestroyed(@Observes @Destroyed(RequestScoped.class) Object event) { - destroyedCalled.set(true); - } - - void reset() { - destroyedCalled.set(false); - } - - boolean isDestroyedCalled() { - return destroyedCalled.get(); - } - - public void countDown() { - if (observer.isInitializedObserved()) { - latch.countDown(); - } - } - - public Boolean await(long timeout, TimeUnit timeUnit) { - Boolean result = new Boolean(false); - try { - result = latch.await(timeout, timeUnit); - } catch (InterruptedException e) { - e.printStackTrace(); - } - return result; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/InfoServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/InfoServlet.java deleted file mode 100644 index 663374460a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/InfoServlet.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.event.timeout; - -import java.io.IOException; -import java.util.concurrent.TimeUnit; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.Timer; -import org.jboss.cdi.tck.util.Timer.StopCondition; - -/** - * @author Martin Kouba - */ -@SuppressWarnings("serial") -@WebServlet("/info") -public class InfoServlet extends HttpServlet { - - private final ApplicationScopedObserver observingBean; - - @Inject - TimeoutService timeoutService; - - @Inject - public InfoServlet(ApplicationScopedObserver observingBean) { - this.observingBean = observingBean; - } - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - timeoutService.start(); - - Boolean initializedResult; - initializedResult = observingBean.await(5, TimeUnit.SECONDS); - - resp.getWriter().append("Initialized:" + initializedResult); - resp.getWriter().append("\n"); - - // wait for the request scope created for the async method invocation to be destroyed - try { - new Timer().setDelay(5, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - public boolean isSatisfied() { - return observingBean.isDestroyedCalled(); - } - }).start(); - } catch (InterruptedException e) { - throw new ServletException(e); - } - - resp.getWriter().append("Destroyed:" + observingBean.isDestroyedCalled()); - resp.setContentType("text/plain"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/RequestScopeEventTimeoutTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/RequestScopeEventTimeoutTest.java deleted file mode 100644 index 474d9a8e14..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/RequestScopeEventTimeoutTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.event.timeout; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; - -import java.net.URL; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * @author Martin Kouba - * - */ -@Test(groups = JAVAEE_FULL) -@SpecVersion(spec = "cdi", version = "2.0") -public class RequestScopeEventTimeoutTest extends AbstractTest { - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(RequestScopeEventTimeoutTest.class).build(); - } - - @ArquillianResource - private URL contextPath; - - @Test - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "je") - public void testEventsFired() throws Exception { - - WebClient client = new WebClient(); - - TextPage page = client.getPage(contextPath + "info"); - String content = page.getContent(); - - // Test request and timeout request - checkContent(content, "(Initialized:)(\\w+)", "true"); - // Timeout request only - checkContent(content, "(Destroyed:)(\\w+)", "true"); - } - - private void checkContent(String content, String pattern, String expected) { - Matcher matcher = Pattern.compile(pattern).matcher(content); - if (matcher.find()) { - String value = matcher.group(2); - assertEquals(value, expected); - } else { - fail(); - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/RequestScopedObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/RequestScopedObserver.java deleted file mode 100644 index ba8177f1cc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/RequestScopedObserver.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.event.timeout; - -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.event.Observes; - -@RequestScoped -public class RequestScopedObserver { - - private boolean initializedObserved; - - void observeRequestInitialized(@Observes @Initialized(RequestScoped.class) Object event) { - initializedObserved = true; - } - - public boolean isInitializedObserved() { - return initializedObserved; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/TimeoutService.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/TimeoutService.java deleted file mode 100644 index 63966bee6f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/TimeoutService.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.event.timeout; - -import jakarta.annotation.Resource; -import jakarta.ejb.Stateless; -import jakarta.ejb.Timeout; -import jakarta.ejb.Timer; -import jakarta.ejb.TimerConfig; -import jakarta.ejb.TimerService; -import jakarta.inject.Inject; - -@Stateless -public class TimeoutService { - - @Resource - private TimerService timerService; - - @Inject - private ApplicationScopedObserver appObserver; - - public void start() { - TimerConfig config = new TimerConfig(); - config.setPersistent(false); - timerService.createSingleActionTimer(100, config); - } - - @Timeout - public void onTimeout(Timer timer) { - appObserver.reset(); - appObserver.countDown(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/Foo.java deleted file mode 100644 index 31e0b5cf1f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/Foo.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.jaxrs; - -import java.util.concurrent.atomic.AtomicLong; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; - -@RequestScoped -public class Foo { - - @Inject - ObservingBean observingBean; - - private static AtomicLong atomicLong = new AtomicLong(System.currentTimeMillis()); - - private long id; - - public long getId() { - return id; - } - - @PostConstruct - public void init() { - this.id = atomicLong.getAndIncrement(); - } - - @PreDestroy - public void destroy() { - observingBean.getFooDestroyedCount().incrementAndGet(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/FooResource.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/FooResource.java deleted file mode 100644 index 356d6c41d9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/FooResource.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.jaxrs; - -import jakarta.inject.Inject; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; - -/** - * RESTful web service which returns a value from an request scoped bean. - */ -@Path("/foo") -public class FooResource { - - @Inject - Foo foo; - - @GET - @Produces("text/plain") - public String getValue() { - return "" + foo.getId(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/InfoServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/InfoServlet.java deleted file mode 100644 index c6557f9b16..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/InfoServlet.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.jaxrs; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@WebServlet("/info") -@SuppressWarnings("serial") -public class InfoServlet extends HttpServlet { - - @Inject - private ObservingBean observer; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.getWriter().append("Initialized requests:" + observer.getInitializedRequestCount().get()); - resp.getWriter().append("\n"); - resp.getWriter().append("Destroyed requests:" + observer.getDestroyedRequestCount().get()); - resp.getWriter().append("\n"); - resp.getWriter().append("Foo destroyed:" + observer.getFooDestroyedCount().get()); - resp.setContentType("text/plain"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/ObservingBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/ObservingBean.java deleted file mode 100644 index cfe5ebd152..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/ObservingBean.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.jaxrs; - -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.event.Observes; -import jakarta.servlet.ServletRequest; - -@ApplicationScoped -public class ObservingBean { - - private final AtomicInteger initializedRequestCount = new AtomicInteger(); - private final AtomicInteger destroyedRequestCount = new AtomicInteger(); - private final AtomicInteger fooDestroyedCount = new AtomicInteger(); - - public void observeRequestInitialized(@Observes @Initialized(RequestScoped.class) ServletRequest event) { - initializedRequestCount.incrementAndGet(); - } - - public void observeRequestDestroyed(@Observes @Destroyed(RequestScoped.class) ServletRequest event) { - destroyedRequestCount.incrementAndGet(); - } - - public AtomicInteger getInitializedRequestCount() { - return initializedRequestCount; - } - - public AtomicInteger getDestroyedRequestCount() { - return destroyedRequestCount; - } - - public AtomicInteger getFooDestroyedCount() { - return fooDestroyedCount; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/RequestContextTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/RequestContextTest.java deleted file mode 100644 index cf68c35fc6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/jaxrs/RequestContextTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.request.jaxrs; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.JAX_RS; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT_EE; -import static org.testng.Assert.assertNotEquals; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.jaxrs.JaxRsActivator; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class RequestContextTest extends AbstractTest { - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(RequestContextTest.class).withClass(JaxRsActivator.class).build(); - } - - @Test(groups = { INTEGRATION, JAX_RS }) - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "b") - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "d") - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "jb") - public void testRequestScopeActiveDuringWebServiceInvocation() throws Exception { - - WebClient webClient = new WebClient(); - - // New instance of Foo is created for each request - TextPage resource01 = webClient.getPage(contextPath + "rest/foo"); - Long id01 = Long.valueOf(resource01.getContent()); - TextPage resource02 = webClient.getPage(contextPath + "rest/foo"); - Long id02 = Long.valueOf(resource02.getContent()); - assertNotEquals(id01, id02); - - // At the time the info servlet is generating response, 3 requests were initialized and 2 destroyed - TextPage resource03 = webClient.getPage(contextPath + "info"); - assertTrue(resource03.getContent().contains("Initialized requests:3")); - assertTrue(resource03.getContent().contains("Destroyed requests:2")); - - assertTrue(resource03.getContent().contains("Foo destroyed:2")); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/Action.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/Action.java deleted file mode 100644 index 93c4e04215..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/Action.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.postconstruct; - -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - * - */ -@RequestScoped -public class Action { - - @Inject - RequestContextObserver observer; - - public boolean ping() { - return true; - } - - @PreDestroy - public void destroy() { - observer.recordDestroy(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/EagerSingleton.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/EagerSingleton.java deleted file mode 100644 index 13828dbaca..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/EagerSingleton.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.postconstruct; - -import jakarta.annotation.PostConstruct; -import jakarta.ejb.Singleton; -import jakarta.ejb.Startup; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - * - */ -@Startup -@Singleton -@ApplicationScoped -public class EagerSingleton { - - private boolean isRequestContextActiveDuringPostConstruct = false; - - @Inject - Action action; - - @Inject - BeanManager beanManager; - - @PostConstruct - public void init() { - if (beanManager != null && beanManager.getContext(RequestScoped.class).isActive() && action != null && action.ping()) { - isRequestContextActiveDuringPostConstruct = true; - } - } - - public boolean isRequestContextActiveDuringPostConstruct() { - return isRequestContextActiveDuringPostConstruct; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/EagerSingletonInfoServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/EagerSingletonInfoServlet.java deleted file mode 100644 index 55350d8849..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/EagerSingletonInfoServlet.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.postconstruct; - -import java.io.IOException; - -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -/** - * @author Martin Kouba - * - */ -@SuppressWarnings("serial") -@WebServlet("/eager") -public class EagerSingletonInfoServlet extends HttpServlet { - - @Inject - RequestContextObserver observer; - - @Inject - BeanManager beanManager; - - @Inject - EagerSingleton eagerSingleton; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.getWriter().append("Active:" + eagerSingleton.isRequestContextActiveDuringPostConstruct()); - resp.getWriter().append("\n"); - resp.getWriter().append("Destroyed requests:" + observer.getDestructions().get()); - resp.setContentType("text/plain"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/EagerSingletonPostConstructCallbackTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/EagerSingletonPostConstructCallbackTest.java deleted file mode 100644 index 094506793d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/EagerSingletonPostConstructCallbackTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.postconstruct; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * Test the request context is active during @PostConstruct callback of an eager singleton. - * - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EagerSingletonPostConstructCallbackTest extends AbstractTest { - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(EagerSingletonPostConstructCallbackTest.class) - .withClasses(EagerSingleton.class, Action.class, RequestContextObserver.class, EagerSingletonInfoServlet.class) - .build(); - } - - @ArquillianResource - private URL contextPath; - - @Test(groups = INTEGRATION) - @SpecAssertion(section = REQUEST_CONTEXT, id = "db") - @SpecAssertion(section = REQUEST_CONTEXT, id = "eb") - public void testEagerSingletonPostConstructCallback() throws Exception { - - WebClient client = new WebClient(); - - TextPage page = client.getPage(contextPath + "eager"); - // Context was active - assertTrue(page.getContent().contains("Active:true")); - // Only singleton callback, current request not destroyed yet - assertTrue(page.getContent().contains("Destroyed requests:1")); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/RequestContextObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/RequestContextObserver.java deleted file mode 100644 index d83792ef49..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/RequestContextObserver.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.postconstruct; - -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.enterprise.context.ApplicationScoped; - -/** - * @author Martin Kouba - * - */ -@ApplicationScoped -public class RequestContextObserver { - - private AtomicInteger initializations = new AtomicInteger(); - private AtomicInteger destructions = new AtomicInteger(); - - public AtomicInteger getInitializations() { - return initializations; - } - - public AtomicInteger getDestructions() { - return destructions; - } - - public void recordInit() { - initializations.incrementAndGet(); - } - - public void recordDestroy() { - destructions.incrementAndGet(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/SimpleBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/SimpleBean.java deleted file mode 100644 index 39b47681cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/SimpleBean.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.postconstruct; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - * - */ -@Dependent -public class SimpleBean { - - private boolean isRequestContextActiveDuringPostConstruct = false; - - @Inject - Action action; - - @Inject - BeanManager beanManager; - - @PostConstruct - public void init() { - if (beanManager != null && beanManager.getContext(RequestScoped.class).isActive() && action != null && action.ping()) { - isRequestContextActiveDuringPostConstruct = true; - } - } - - public boolean isRequestContextActiveDuringPostConstruct() { - return isRequestContextActiveDuringPostConstruct; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/SimpleBeanPostConstructCallbackTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/SimpleBeanPostConstructCallbackTest.java deleted file mode 100644 index 95cb3f7497..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/SimpleBeanPostConstructCallbackTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.postconstruct; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * Test the request context is active during @PostConstruct callback of a simple bean. - * - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SimpleBeanPostConstructCallbackTest extends AbstractTest { - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(SimpleBeanPostConstructCallbackTest.class) - .withClasses(SimpleBean.class, Action.class, RequestContextObserver.class, SimpleInfoServlet.class).build(); - } - - @ArquillianResource - private URL contextPath; - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = REQUEST_CONTEXT, id = "db"), - @SpecAssertion(section = REQUEST_CONTEXT, id = "eb") }) - public void testSimplePostConstructCallback() throws Exception { - - WebClient client = new WebClient(); - - TextPage page = client.getPage(contextPath + "simple"); - // Context was active - assertTrue(page.getContent().contains("Active:true")); - // Not destroyed yet - assertTrue(page.getContent().contains("Destroyed requests:0")); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/SimpleInfoServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/SimpleInfoServlet.java deleted file mode 100644 index ece42e430b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/request/postconstruct/SimpleInfoServlet.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.request.postconstruct; - -import java.io.IOException; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -/** - * @author Martin Kouba - * - */ -@SuppressWarnings("serial") -@WebServlet("/simple") -public class SimpleInfoServlet extends HttpServlet { - - @Inject - RequestContextObserver observer; - - @Inject - BeanManager beanManager; - - @SuppressWarnings("unchecked") - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - Bean bean = (Bean) beanManager.resolve(beanManager.getBeans(SimpleBean.class)); - CreationalContext ctx = beanManager.createCreationalContext(bean); - SimpleBean simpleBean = bean.create(ctx); - boolean isActive = simpleBean.isRequestContextActiveDuringPostConstruct(); - bean.destroy(simpleBean, ctx); - - resp.getWriter().append("Active:" + isActive); - resp.getWriter().append("\n"); - resp.getWriter().append("Initialized requests:" + observer.getInitializations().get()); - resp.getWriter().append("\n"); - resp.getWriter().append("Destroyed requests:" + observer.getDestructions().get()); - resp.setContentType("text/plain"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectFilter.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectFilter.java deleted file mode 100644 index d12d0b13bf..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectFilter.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session; - -import java.io.IOException; - -import jakarta.servlet.Filter; -import jakarta.servlet.FilterChain; -import jakarta.servlet.FilterConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.annotation.WebFilter; - -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.cdi.tck.util.SimpleLogger; - -/** - * Just to verify session context is destroyed after Filter is called. - */ -@WebFilter(filterName = "IntrospectFilter", urlPatterns = "/introspect") -public class IntrospectFilter implements Filter { - - private static final SimpleLogger logger = new SimpleLogger( - IntrospectFilter.class); - - public void destroy() { - } - - public void doFilter(ServletRequest request, ServletResponse response, - FilterChain chain) throws IOException, ServletException { - logger.log("Do filter..."); - chain.doFilter(request, response); - String mode = request.getParameter("mode"); - if (IntrospectServlet.MODE_INVALIDATE.equals(mode)) { - ActionSequence.addAction(IntrospectFilter.class.getName()); - } - } - - public void init(FilterConfig filterConfig) throws ServletException { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectHttpSessionListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectHttpSessionListener.java deleted file mode 100644 index 75609536c7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectHttpSessionListener.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session; - -import jakarta.servlet.annotation.WebListener; -import jakarta.servlet.http.HttpSessionEvent; -import jakarta.servlet.http.HttpSessionListener; - -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.cdi.tck.util.SimpleLogger; - -/** - * Just to verify session context is destroyed after HttpSessionListener is called. - */ -@WebListener -public class IntrospectHttpSessionListener implements HttpSessionListener { - - private static final SimpleLogger logger = new SimpleLogger( - IntrospectHttpSessionListener.class); - - @Override - public void sessionCreated(HttpSessionEvent se) { - logger.log("Session created..."); - } - - @Override - public void sessionDestroyed(HttpSessionEvent se) { - logger.log("Session destroyed..."); - ActionSequence.addAction(IntrospectHttpSessionListener.class.getName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectServlet.java deleted file mode 100644 index 555bd7a596..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectServlet.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.session; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.ActionSequence; - -/** - * Used to process requests to check which session context is in use. - * - * @author David Allen - * @author Martin Kouba - */ -@WebServlet(name = "IntrospectServlet", urlPatterns = "/introspect") -public class IntrospectServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - public static final String MODE_INVALIDATE = "invalidate"; - - public static final String MODE_VERIFY = "verify"; - - public static final String MODE_TIMEOUT = "timeout"; - - @Inject - SimpleSessionBean simpleBean; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - - resp.setContentType("text/text"); - String mode = req.getParameter("mode"); - - if (mode == null) { - resp.getWriter().append(simpleBean.getId()); - } else if (MODE_INVALIDATE.equals(mode)) { - ActionSequence.reset(); - ActionSequence.addAction(IntrospectServlet.class.getName()); - req.getSession().invalidate(); - } else if (MODE_VERIFY.equals(mode)) { - resp.setStatus(HttpServletResponse.SC_OK); - resp.setContentType("text/plain"); - resp.getWriter().write(ActionSequence.getSequence().toString()); - } else if (MODE_TIMEOUT.equals(mode)) { - ActionSequence.reset(); - req.getSession().setMaxInactiveInterval(1); - } else { - throw new ServletException("Unknown mode"); - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectServletRequestListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectServletRequestListener.java deleted file mode 100644 index 1bb1c5abea..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/IntrospectServletRequestListener.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.session; - -import jakarta.servlet.ServletRequestEvent; -import jakarta.servlet.ServletRequestListener; -import jakarta.servlet.annotation.WebListener; - -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.cdi.tck.util.SimpleLogger; - -/** - * Just to verify session context is destroyed after ServletRequestListener is called. - */ -@WebListener -public class IntrospectServletRequestListener implements ServletRequestListener { - - private static final SimpleLogger logger = new SimpleLogger( - IntrospectServletRequestListener.class); - - @Override - public void requestDestroyed(ServletRequestEvent sre) { - logger.log("Request destroyed..."); - String mode = sre.getServletRequest().getParameter("mode"); - if (IntrospectServlet.MODE_INVALIDATE.equals(mode)) { - ActionSequence.addAction(IntrospectServletRequestListener.class - .getName()); - } - } - - @Override - public void requestInitialized(ServletRequestEvent sre) { - // No-op - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/SessionContextTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/SessionContextTest.java deleted file mode 100644 index 3b4ba65e9c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/SessionContextTest.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_CONTEXT_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotEquals; -import static org.testng.Assert.assertNotNull; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.cdi.tck.util.Timer; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionContextTest extends AbstractTest { - - private static final long DEFAULT_SLEEP_INTERVAL = 3000; - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(SessionContextTest.class) - .withWebResource("SimplePage.html", "SimplePage.html").build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = SESSION_CONTEXT_EE, id = "aa"), - @SpecAssertion(section = SESSION_CONTEXT_EE, id = "ae") }) - public void testSessionScopeActiveDuringServiceMethod() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "test"); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = SESSION_CONTEXT_EE, id = "ab"), - @SpecAssertion(section = SESSION_CONTEXT_EE, id = "ae") }) - public void testSessionScopeActiveDuringDoFilterMethod() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "SimplePage.html"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = SESSION_CONTEXT_EE, id = "b") - public void testSessionContextSharedBetweenServletRequestsInSameHttpSession() - throws Exception { - WebClient webClient = new WebClient(); - TextPage firstRequestResult = webClient.getPage(contextPath - + "introspect"); - assertNotNull(firstRequestResult.getContent()); - String sessionBeanId = firstRequestResult.getContent(); - assertNotNull(sessionBeanId); - // Make a second request and make sure the same context is used - TextPage secondRequestResult = webClient.getPage(contextPath - + "introspect"); - assertNotNull(secondRequestResult.getContent()); - assertEquals(secondRequestResult.getContent(), sessionBeanId); - } - - /** - * Test that the session context is destroyed at the very end of any request - * in which invalidate() was called, after all filters and - * ServletRequestListeners have been called. - * - * @throws Exception - */ - @Test(groups = INTEGRATION) - @SpecAssertion(section = SESSION_CONTEXT_EE, id = "ca") - public void testSessionContextDestroyedWhenHttpSessionInvalidated() - throws Exception { - WebClient webClient = new WebClient(); - - TextPage firstRequestResult = webClient.getPage(contextPath - + "introspect"); - assertNotNull(firstRequestResult.getContent()); - String sessionBeanId = firstRequestResult.getContent(); - // Invalidate the session - webClient.getPage(contextPath + "introspect?mode=invalidate"); - // Make a second request and make sure the same context is not there - TextPage secondRequestResult = webClient.getPage(contextPath - + "introspect"); - assertNotNull(secondRequestResult.getContent()); - assertNotEquals(secondRequestResult.getContent(), sessionBeanId); - - // Verify context is destroyed after all filters and - // ServletRequestListeners - TextPage verifyResult = webClient.getPage(contextPath - + "introspect?mode=verify"); - ActionSequence correctSequence = new ActionSequence() - .add(IntrospectServlet.class.getName()) - .add(IntrospectHttpSessionListener.class.getName()) - .add(IntrospectFilter.class.getName()) - .add(IntrospectServletRequestListener.class.getName()) - .add(SimpleSessionBean.class.getName()); - assertEquals(verifyResult.getContent(), correctSequence.toString()); - } - - /** - * The session context is destroyed when the HTTPSession times out, after - * all HttpSessionListeners have been called. - * - * @throws Exception - */ - @Test(groups = INTEGRATION) - @SpecAssertion(section = SESSION_CONTEXT_EE, id = "cb") - public void testSessionContextDestroyedWhenHttpSessionTimesOut() - throws Exception { - WebClient webClient = new WebClient(); - TextPage firstRequestResult = webClient.getPage(contextPath - + "introspect"); - assertNotNull(firstRequestResult.getContent()); - String sessionBeanId = firstRequestResult.getContent(); - assertNotNull(sessionBeanId); - - webClient.getPage(contextPath + "introspect?mode=timeout"); - Timer.startNew(DEFAULT_SLEEP_INTERVAL); - - // Make a second request and make sure the same context is not there - TextPage secondRequestResult = webClient.getPage(contextPath - + "introspect"); - assertNotNull(secondRequestResult.getContent()); - assertNotEquals(secondRequestResult.getContent(), sessionBeanId); - - // Verify context is destroyed after all filters and - // ServletRequestListeners - TextPage verifyResult = webClient.getPage(contextPath - + "introspect?mode=verify"); - ActionSequence correctSequence = new ActionSequence() - .add(IntrospectHttpSessionListener.class.getName()) - .add(SimpleSessionBean.class.getName()); - assertEquals(verifyResult.getContent(), correctSequence.toString()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/SimpleSessionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/SimpleSessionBean.java deleted file mode 100644 index c2a9432ac7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/SimpleSessionBean.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session; - -import java.io.Serializable; -import java.util.UUID; - -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.SessionScoped; - -import org.jboss.cdi.tck.util.ActionSequence; - -@SessionScoped -public class SimpleSessionBean implements Serializable { - - private static final long serialVersionUID = 1L; - - private String id = UUID.randomUUID().toString(); - - public String getId() { - return id; - } - - @PreDestroy - public void destroy() { - ActionSequence.addAction(SimpleSessionBean.class.getName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/TestFilter.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/TestFilter.java deleted file mode 100644 index 7493550983..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/TestFilter.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session; - -import java.io.IOException; - -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.Filter; -import jakarta.servlet.FilterChain; -import jakarta.servlet.FilterConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.annotation.WebFilter; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@WebFilter(filterName = "FilterTest", displayName = "Test Filter for Sessions", urlPatterns = "/SimplePage.html") -public class TestFilter implements Filter { - - private static final SimpleLogger logger = new SimpleLogger( - TestFilter.class); - - @Inject - private BeanManager beanManager; - - @Inject - private SimpleSessionBean simpleBean; - - public void destroy() { - beanManager = null; - } - - public void doFilter(ServletRequest request, ServletResponse response, - FilterChain chain) throws IOException, ServletException { - logger.log("Do filter..."); - checkSessionContextActive(); - chain.doFilter(request, response); - checkSessionContextActive(); - - } - - public void init(FilterConfig filterConfig) throws ServletException { - } - - private void checkSessionContextActive() throws ServletException { - if (beanManager == null - || !beanManager.getContext(SessionScoped.class).isActive() - || simpleBean == null) { - throw new ServletException("Session context is not active"); - } - // Check bean invocation - simpleBean.getId(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/TestServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/TestServlet.java deleted file mode 100644 index 03c8bddb26..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/TestServlet.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.session; - -import java.io.IOException; - -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -/** - * Servlet used just to test context during service method. - * - * @author David Allen - * @author Martin Kouba - */ -@WebServlet(name = "TestServlet", urlPatterns = "/test") -public class TestServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - @Inject - private BeanManager beanManager; - - @Inject - private SimpleSessionBean simpleBean; - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - checkSessionContextActive(); - super.service(req, resp); - } - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException { - resp.setContentType("text/text"); - resp.getWriter().println("It worked!"); - } - - private void checkSessionContextActive() throws ServletException { - if (beanManager == null - || !beanManager.getContext(SessionScoped.class).isActive() - || simpleBean == null) { - throw new ServletException("Session context is not active"); - } - // Check bean invocation - simpleBean.getId(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/AsyncRequestProcessor.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/AsyncRequestProcessor.java deleted file mode 100644 index 041966fca7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/AsyncRequestProcessor.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.session.async; - -import jakarta.servlet.AsyncContext; - -import org.jboss.cdi.tck.util.SimpleLogger; -import org.jboss.cdi.tck.util.Timer; - -/** - * @author Martin Kouba - */ -public class AsyncRequestProcessor implements Runnable { - - private static final SimpleLogger logger = new SimpleLogger(AsyncRequestProcessor.class); - - private final AsyncContext actx; - - private final long timerValue; - - private final String dispatchPath; - - private final boolean useDispatch; - - public AsyncRequestProcessor(AsyncContext ctx, long timerValue, boolean useDispatch, String dispatchPath) { - super(); - this.actx = ctx; - this.timerValue = timerValue; - this.dispatchPath = dispatchPath; - this.useDispatch = useDispatch; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Runnable#run() - */ - @Override - public void run() { - try { - if (timerValue > 0) { - // Simulate long running operation - Timer.startNew(timerValue); - } - } catch (InterruptedException e) { - throw new IllegalStateException("Interrupted"); - } - - // Dispatch or complete - if (useDispatch) { - if (dispatchPath != null) { - actx.dispatch(dispatchPath); - } else { - actx.dispatch(); - } - } else { - actx.complete(); - } - logger.log("Async processing finished"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/AsyncServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/AsyncServlet.java deleted file mode 100644 index 8f7459655e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/AsyncServlet.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session.async; - -import java.io.IOException; -import java.util.Arrays; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -import jakarta.inject.Inject; -import jakarta.servlet.AsyncContext; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@WebServlet(name = "AsyncServlet", urlPatterns = { "/AsyncServlet" }, asyncSupported = true) -@SuppressWarnings("serial") -public class AsyncServlet extends HttpServlet { - - public static final String TEST_TIMEOUT = "timeout"; - public static final String TEST_COMPLETE = "complete"; - public static final String TEST_ERROR = "error"; - public static final String TEST_LOOP = "loop"; - private static final String[] VALID_TESTS = new String[] { TEST_TIMEOUT, TEST_COMPLETE, TEST_ERROR, TEST_LOOP }; - - private static final SimpleLogger logger = new SimpleLogger(AsyncServlet.class); - - private static final long TIMEOUT = 200l; - - private static boolean inLoop = false; - - private ExecutorService executorService; - - @Inject - StatusBean statusBean; - - @Override - public void init() throws ServletException { - // Note that executor thread does not use the same CL - executorService = Executors.newSingleThreadExecutor(); - } - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - String test = req.getParameter("test"); - if (!Arrays.asList(VALID_TESTS).contains(test)) { - resp.setStatus(404); - return; - } - - statusBean.reset(); - final AsyncContext actx = req.startAsync(); - actx.addListener(actx.createListener(SimpleAsyncListener.class)); - resp.setContentType("text/plain"); - - if (TEST_TIMEOUT.equals(test)) { - actx.setTimeout(TIMEOUT); - } else if (TEST_COMPLETE.equals(test)) { - executorService.execute(new AsyncRequestProcessor(actx, 50l, false, null)); - } else if (TEST_ERROR.equals(test)) { - executorService.execute(new AsyncRequestProcessor(actx, 50l, true, "/FailingServlet")); - } else if (TEST_LOOP.equals(test)) { - if (inLoop) { - executorService.execute(new AsyncRequestProcessor(actx, 50l, false, null)); - } else { - executorService.execute(new AsyncRequestProcessor(actx, 50l, true, null)); - inLoop = true; - } - } - logger.log("Service finished: {0}", test); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/FailingServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/FailingServlet.java deleted file mode 100644 index 2b5348bff0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/FailingServlet.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session.async; - -import java.io.IOException; - -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@SuppressWarnings("serial") -@WebServlet(name = "FailingServlet", urlPatterns = { "/FailingServlet" }, asyncSupported = true) -public class FailingServlet extends HttpServlet { - - private static final SimpleLogger logger = new SimpleLogger(FailingServlet.class); - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - logger.log("Intentional service failure"); - throw new ServletException(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/SessionContextAsyncListenerTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/SessionContextAsyncListenerTest.java deleted file mode 100644 index 02a0a26b7e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/SessionContextAsyncListenerTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.session.async; - -import static org.jboss.cdi.tck.TestGroups.ASYNC_SERVLET; -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_CONTEXT_EE; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.net.URL; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionContextAsyncListenerTest extends AbstractTest { - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SessionContextAsyncListenerTest.class).build(); - } - - @Test(groups = { INTEGRATION, ASYNC_SERVLET }) - @SpecAssertions({ @SpecAssertion(section = SESSION_CONTEXT_EE, id = "ad") }) - public void testSessionContextActiveOnComplete() throws Exception { - WebClient webClient = new WebClient(); - - webClient.getPage(getPath(AsyncServlet.TEST_COMPLETE)); - TextPage results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onComplete: true")); - String id = extractSimpleSessionBeanId(results.getContent()); - assertNotNull(id); - assertFalse(id.isEmpty()); - } - - @Test(groups = { INTEGRATION, ASYNC_SERVLET }) - @SpecAssertions({ @SpecAssertion(section = SESSION_CONTEXT_EE, id = "ad") }) - public void testSessionContextActiveOnTimeout() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(getPath(AsyncServlet.TEST_TIMEOUT)); - TextPage results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onTimeout: true")); - } - - @Test(groups = { INTEGRATION, ASYNC_SERVLET }) - @SpecAssertions({ @SpecAssertion(section = SESSION_CONTEXT_EE, id = "ad") }) - public void testSessionContextActiveOnError() throws Exception { - WebClient webClient = new WebClient(); - webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); - webClient.getPage(getPath(AsyncServlet.TEST_ERROR)); - TextPage results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onError: true")); - } - - @Test(groups = { INTEGRATION, ASYNC_SERVLET }) - @SpecAssertions({ @SpecAssertion(section = SESSION_CONTEXT_EE, id = "ad") }) - public void testSessionContextActiveOnStartAsync() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(getPath(AsyncServlet.TEST_LOOP)); - TextPage results = webClient.getPage(contextPath + "Status"); - assertTrue(results.getContent().contains("onComplete: true")); - assertTrue(results.getContent().contains("onStartAsync: true")); - } - - private String getPath(String test) { - return contextPath + "AsyncServlet?test=" + test; - } - - private String extractSimpleSessionBeanId(String content) { - // See SimpleAsyncListener#getInfo() - Matcher matcher = Pattern.compile("^(.+)(simpleSessionBeanId: )(.+)$").matcher(content); - if (matcher.matches()) { - return matcher.group(3); - } - return null; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/SimpleAsyncListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/SimpleAsyncListener.java deleted file mode 100644 index ab0e5cad2b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/SimpleAsyncListener.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.session.async; - -import java.io.IOException; - -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.AsyncEvent; -import jakarta.servlet.AsyncListener; - -import org.jboss.cdi.tck.util.SimpleLogger; - -/** - * @author Martin Kouba - */ -public class SimpleAsyncListener implements AsyncListener { - - public static boolean isSessionContextActive = false; - private static final SimpleLogger logger = new SimpleLogger(SimpleAsyncListener.class); - - @Inject - SimpleSessionBean simpleSessionBean; - - @Inject - BeanManager beanManager; - - @Inject - StatusBean statusBean; - - /* - * (non-Javadoc) - * - * @see jakarta.servlet.AsyncListener#onComplete(jakarta.servlet.AsyncEvent) - */ - @Override - public void onComplete(AsyncEvent event) throws IOException { - logger.log("onComplete"); - - if (!statusBean.isOnTimeout() && !statusBean.isOnError()) { - // Do not check and write info in case of post timeout/error action - statusBean.setOnComplete(checkSessionContextAvailability()); - } - } - - /* - * (non-Javadoc) - * - * @see jakarta.servlet.AsyncListener#onTimeout(jakarta.servlet.AsyncEvent) - */ - @Override - public void onTimeout(AsyncEvent event) throws IOException { - logger.log("onTimeout"); - statusBean.setOnTimeout(checkSessionContextAvailability()); - event.getAsyncContext().complete(); - } - - /* - * (non-Javadoc) - * - * @see jakarta.servlet.AsyncListener#onError(jakarta.servlet.AsyncEvent) - */ - @Override - public void onError(AsyncEvent event) throws IOException { - logger.log("onError"); - statusBean.setOnError(checkSessionContextAvailability()); - event.getAsyncContext().complete(); - } - - /* - * (non-Javadoc) - * - * @see jakarta.servlet.AsyncListener#onStartAsync(jakarta.servlet.AsyncEvent) - */ - @Override - public void onStartAsync(AsyncEvent event) throws IOException { - logger.log("onStartAsync"); - statusBean.setOnStartAsync(checkSessionContextAvailability()); - } - - private boolean checkSessionContextAvailability() throws IOException { - try { - statusBean.setSessionBeanId(simpleSessionBean.getId()); - isSessionContextActive = beanManager.getContext(SessionScoped.class).isActive(); - } catch (Throwable e) { - logger.log("Problem while checking request scope: " + e.getMessage()); - } - if (!isSessionContextActive || statusBean.getSessionBeanId() == null) { - return false; - } - return true; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/SimpleSessionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/SimpleSessionBean.java deleted file mode 100644 index 1f8bb060e9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/SimpleSessionBean.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.session.async; - -import java.io.Serializable; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.SessionScoped; - -/** - * @author Martin Kouba - */ -@SuppressWarnings("serial") -@SessionScoped -public class SimpleSessionBean implements Serializable { - - private long id; - - @PostConstruct - public void init() { - id = System.currentTimeMillis(); - } - - public long getId() { - return id; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/StatusBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/StatusBean.java deleted file mode 100644 index 2b44762763..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/StatusBean.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session.async; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class StatusBean { - - private boolean onError; - private boolean onComplete; - private boolean onTimeout; - private boolean onStartAsync; - private Long sessionBeanId; - - public Long getSessionBeanId() { - return sessionBeanId; - } - - public void setSessionBeanId(Long sessionBeanId) { - this.sessionBeanId = sessionBeanId; - } - - public boolean isOnStartAsync() { - return onStartAsync; - } - - public void setOnStartAsync(boolean onStartAsync) { - this.onStartAsync = onStartAsync; - } - - public boolean isOnComplete() { - return onComplete; - } - - public void setOnComplete(boolean onComplete) { - this.onComplete = onComplete; - } - - public boolean isOnError() { - return onError; - } - - public void setOnError(boolean onError) { - this.onError = onError; - } - - public boolean isOnTimeout() { - return onTimeout; - } - - public void setOnTimeout(boolean onTimeout) { - this.onTimeout = onTimeout; - } - - public void reset() { - this.onComplete = false; - this.onStartAsync = false; - this.onTimeout = false; - this.onError = false; - this.sessionBeanId = null; - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/StatusServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/StatusServlet.java deleted file mode 100644 index f3f214c986..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/async/StatusServlet.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session.async; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@WebServlet(name = "StatusServlet", urlPatterns = { "/Status" }) -public class StatusServlet extends HttpServlet { - - @Inject - StatusBean statusBean; - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws IOException { - writeInfo(resp); - } - - private void writeInfo(ServletResponse response) throws IOException { - response.getWriter().print(getInfo()); - response.getWriter().flush(); - } - - public String getInfo() { - return String - .format("onStartAsync: %s, onError: %s, onTimeout: %s, onComplete: %s, simpleSessionBeanId: %s", - statusBean.isOnStartAsync(), statusBean.isOnError(), statusBean.isOnTimeout(), - statusBean.isOnComplete(), statusBean.getSessionBeanId()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/ObservingBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/ObservingBean.java deleted file mode 100644 index d6842c2eaf..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/ObservingBean.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session.event; - -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.BeforeDestroyed; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.event.Observes; -import jakarta.servlet.http.HttpSession; - -@ApplicationScoped -public class ObservingBean { - - private final AtomicInteger initializedSessionCount = new AtomicInteger(); - private final AtomicInteger beforedDestroyedSessionCount = new AtomicInteger(); - private final AtomicInteger destroyedSessionCount = new AtomicInteger(); - - public void observeSessionInitialized(@Observes @Initialized(SessionScoped.class) HttpSession event) { - initializedSessionCount.incrementAndGet(); - } - - public void observeSessionBeforeDestroyed(@Observes @BeforeDestroyed(SessionScoped.class) HttpSession event) { - beforedDestroyedSessionCount.incrementAndGet(); - } - - public void observeSessionDestroyed(@Observes @Destroyed(SessionScoped.class) HttpSession event) { - destroyedSessionCount.incrementAndGet(); - } - - public AtomicInteger getInitializedSessionCount() { - return initializedSessionCount; - } - - public AtomicInteger getBeforedDestroyedSessionCount() { - return beforedDestroyedSessionCount; - } - - public AtomicInteger getDestroyedSessionCount() { - return destroyedSessionCount; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/Servlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/Servlet.java deleted file mode 100644 index c45ba85387..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/Servlet.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session.event; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@WebServlet("/") -@SuppressWarnings("serial") -public class Servlet extends HttpServlet { - - @Inject - private ObservingBean observer; - - @Inject - private SessionScopedBean bean; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - bean.setFoo("baz"); // the session scope is initialized lazily - if (req.getRequestURI().endsWith("/invalidate")) { - int destroyed = observer.getDestroyedSessionCount().get(); - req.getSession().invalidate(); - if (destroyed != observer.getDestroyedSessionCount().get()) { - throw new RuntimeException( - "@Destroyed(SessionScoped.class) called before the session context was actually destroyed"); - } - } - resp.getWriter().append("Initialized sessions:" + observer.getInitializedSessionCount().get()); - resp.getWriter().append("\n"); - resp.getWriter().append("Before Destroyed sessions:" + observer.getBeforedDestroyedSessionCount().get()); - resp.getWriter().append("\n"); - resp.getWriter().append("Destroyed sessions:" + observer.getDestroyedSessionCount().get()); - resp.setContentType("text/plain"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/SessionScopeEventTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/SessionScopeEventTest.java deleted file mode 100644 index 258eb67913..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/SessionScopeEventTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session.event; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_CONTEXT_EE; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - *

- * This test was originally part of Weld test suite. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionScopeEventTest extends AbstractTest { - - @ArquillianResource(Servlet.class) - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SessionScopeEventTest.class).build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = SESSION_CONTEXT_EE, id = "da"), - @SpecAssertion(section = SESSION_CONTEXT_EE, id = "db"), - @SpecAssertion(section = SESSION_CONTEXT_EE, id = "dc"), - @SpecAssertion(section = SESSION_CONTEXT_EE, id = "ca") }) - public void test() throws Exception { - WebClient client = new WebClient(); - - TextPage page = client.getPage(contextPath); - assertTrue(page.getContent().contains("Initialized sessions:1")); // the current session - assertTrue(page.getContent().contains("Before Destroyed sessions:0")); - assertTrue(page.getContent().contains("Destroyed sessions:0")); // not destroyed yet - - // nothing should change - page = client.getPage(contextPath); - assertTrue(page.getContent().contains("Initialized sessions:1")); - assertTrue(page.getContent().contains("Before Destroyed sessions:0")); - assertTrue(page.getContent().contains("Destroyed sessions:0")); - - // invalidate the session - page = client.getPage(contextPath + "/invalidate"); - assertTrue(page.getContent().contains("Initialized sessions:1")); - assertTrue(page.getContent().contains("Before Destroyed sessions:0")); - // the context is destroyed after the response is sent - // verify in the next request - assertTrue(page.getContent().contains("Destroyed sessions:0")); - - page = client.getPage(contextPath); - // new session context was initialized - assertTrue(page.getContent().contains("Initialized sessions:2")); - assertTrue(page.getContent().contains("Before Destroyed sessions:1")); - // the previous one was destroyed - assertTrue(page.getContent().contains("Destroyed sessions:1")); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/SessionScopedBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/SessionScopedBean.java deleted file mode 100644 index 96ca9e7240..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/event/SessionScopedBean.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session.event; - -import java.io.Serializable; - -import jakarta.enterprise.context.SessionScoped; - -@SessionScoped -@SuppressWarnings("serial") -public class SessionScopedBean implements Serializable { - - private String foo = "bar"; - - public String getFoo() { - return foo; - } - - public void setFoo(String foo) { - this.foo = foo; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/IntrospectServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/IntrospectServlet.java deleted file mode 100644 index 545763db07..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/IntrospectServlet.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session.listener; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.ActionSequence; - -/** - * Used to process requests to check which session context is in use. - * - * @author David Allen - * @author Martin Kouba - */ -@WebServlet(name = "IntrospectServlet", urlPatterns = "/introspect") -public class IntrospectServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - public static final String MODE_INVALIDATE = "invalidate"; - - public static final String MODE_VERIFY = "verify"; - - public static final String MODE_TIMEOUT = "timeout"; - - static boolean isSessionScopeActive = true; - - @Inject - SimpleSessionBean simpleBean; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - resp.setContentType("text/text"); - String mode = req.getParameter("mode"); - - if (mode == null) { - resp.getWriter().append(simpleBean.getId()); - } else if (MODE_INVALIDATE.equals(mode)) { - ActionSequence.reset(); - ActionSequence.addAction(IntrospectServlet.class.getName()); - req.getSession().invalidate(); - } else if (MODE_VERIFY.equals(mode)) { - resp.setStatus(HttpServletResponse.SC_OK); - resp.setContentType("text/plain"); - resp.getWriter().write("" + isSessionScopeActive); - } else if (MODE_TIMEOUT.equals(mode)) { - ActionSequence.reset(); - req.getSession().setMaxInactiveInterval(1); - } else { - throw new ServletException("Unknown mode"); - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/SessionContextHttpSessionListenerTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/SessionContextHttpSessionListenerTest.java deleted file mode 100644 index 4b490ef398..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/SessionContextHttpSessionListenerTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session.listener; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_CONTEXT_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.Timer; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionContextHttpSessionListenerTest extends AbstractTest { - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassDefinition(SessionContextHttpSessionListenerTest.class) - .withClasses(SimpleSessionBean.class, IntrospectServlet.class, TestHttpSessionListener.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = SESSION_CONTEXT_EE, id = "ac") - public void testSessionScopeActiveDuringHttpSessionListenerCall() throws Exception { - WebClient webClient = new WebClient(); - // Create session - String sessionBeanId = webClient.getPage(contextPath + "introspect").getWebResponse().getContentAsString(); - // Verify session scoped bean id - assertEquals(webClient.getPage(contextPath + "introspect").getWebResponse().getContentAsString(), sessionBeanId); - // Invalidate session - webClient.getPage(contextPath + "introspect?mode=invalidate"); - // Verify session scope was active during listener calls - TextPage page = webClient.getPage(contextPath + "introspect?mode=verify"); - assertTrue(Boolean.valueOf(page.getContent())); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = SESSION_CONTEXT_EE, id = "ac") - public void testSessionScopeActiveDuringHttpSessionListenerCallOnTimeout() throws Exception { - - WebClient webClient = new WebClient(); - // Create session - String sessionBeanId = webClient.getPage(contextPath + "introspect").getWebResponse().getContentAsString(); - // Verify session scoped bean id - assertEquals(webClient.getPage(contextPath + "introspect").getWebResponse().getContentAsString(), sessionBeanId); - - // Session timeout - webClient.getPage(contextPath + "introspect?mode=timeout"); - Timer.startNew(2000); - - // Verify session scope was active during listener calls - TextPage page = webClient.getPage(contextPath + "introspect?mode=verify"); - assertTrue(Boolean.valueOf(page.getContent())); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/SessionContextServletRequestListenerTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/SessionContextServletRequestListenerTest.java deleted file mode 100644 index 774465e00e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/SessionContextServletRequestListenerTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session.listener; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_CONTEXT_EE; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionContextServletRequestListenerTest extends AbstractTest { - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassDefinition(SessionContextServletRequestListenerTest.class) - .withClasses(SimpleSessionBean.class, IntrospectServlet.class, TestServletRequestListener.class) - .build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = SESSION_CONTEXT_EE, id = "ae") - public void testSessionScopeActiveDuringServletRequestListenerCall() throws Exception { - WebClient webClient = new WebClient(); - // Create session - webClient.getPage(contextPath + "introspect"); - // Invalidate session - webClient.getPage(contextPath + "introspect?mode=invalidate"); - // Verify result - TextPage page = webClient.getPage(contextPath + "introspect?mode=verify"); - assertTrue(Boolean.valueOf(page.getContent())); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/SimpleSessionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/SimpleSessionBean.java deleted file mode 100644 index b7255d8b40..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/SimpleSessionBean.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session.listener; - -import java.io.Serializable; -import java.util.UUID; - -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.SessionScoped; - -@SessionScoped -public class SimpleSessionBean implements Serializable { - - private static final long serialVersionUID = 1L; - private static boolean beanDestroyed = false; - private String id = UUID.randomUUID().toString(); - - public String getId() { - return id; - } - - @PreDestroy - public void destroy() { - beanDestroyed = true; - } - - public static boolean isBeanDestroyed() { - return beanDestroyed; - } - - public static void setBeanDestroyed(boolean beanDestroyed) { - SimpleSessionBean.beanDestroyed = beanDestroyed; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/TestHttpSessionListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/TestHttpSessionListener.java deleted file mode 100644 index 390bbf7d1b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/TestHttpSessionListener.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session.listener; - -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.annotation.WebListener; -import jakarta.servlet.http.HttpSessionEvent; -import jakarta.servlet.http.HttpSessionListener; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@WebListener -public class TestHttpSessionListener implements HttpSessionListener { - - private static final SimpleLogger logger = new SimpleLogger( - TestHttpSessionListener.class); - - @Inject - private BeanManager beanManager; - - @Inject - private SimpleSessionBean simpleBean; - - @Override - public void sessionCreated(HttpSessionEvent se) { - logger.log("Session {0} created...", se.getSession().getId()); - checkSessionContextActive(); - } - - @Override - public void sessionDestroyed(HttpSessionEvent se) { - logger.log("Session {0} destroyed...", se.getSession().getId()); - checkSessionContextActive(); - } - - private void checkSessionContextActive() throws IllegalStateException { - try { - if (!beanManager.getContext(SessionScoped.class).isActive() - || simpleBean == null) { - IntrospectServlet.isSessionScopeActive = false; - } - // Check bean invocation - logger.log("Simple bean id: {0}", simpleBean.getId()); - } catch (Exception e) { - IntrospectServlet.isSessionScopeActive = false; - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/TestServletRequestListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/TestServletRequestListener.java deleted file mode 100644 index f6a88e76c0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/TestServletRequestListener.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.session.listener; - -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.ServletRequestEvent; -import jakarta.servlet.ServletRequestListener; -import jakarta.servlet.annotation.WebListener; - -import org.jboss.cdi.tck.util.SimpleLogger; - -/** - * @author Martin Kouba - */ -@WebListener -public class TestServletRequestListener implements ServletRequestListener { - - private static final SimpleLogger logger = new SimpleLogger(TestServletRequestListener.class); - - @Inject - private BeanManager beanManager; - - @Inject - private SimpleSessionBean simpleBean; - - @Override - public void requestDestroyed(ServletRequestEvent sre) { - logger.log("Request destroyed..."); - checkSessionContextActive(); - } - - @Override - public void requestInitialized(ServletRequestEvent sre) { - logger.log("Request initialized..."); - checkSessionContextActive(); - } - - private void checkSessionContextActive() throws IllegalStateException { - try { - if (!beanManager.getContext(SessionScoped.class).isActive() - || simpleBean == null) { - IntrospectServlet.isSessionScopeActive = false; - } - // Check bean invocation - simpleBean.getId(); - } catch (Exception e) { - IntrospectServlet.isSessionScopeActive = false; - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/InfoServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/InfoServlet.java deleted file mode 100644 index 066c6f86b9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/InfoServlet.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.session.listener.shutdown; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@SuppressWarnings("serial") -@WebServlet(urlPatterns = "/info") -public class InfoServlet extends HttpServlet { - - private static final SimpleLogger logger = new SimpleLogger(InfoServlet.class); - - @Inject - private TestFlag testFlag; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - String action = request.getParameter("action"); - - if ("set".equals(action)) { - logger.log("Set test flag"); - testFlag.set(); - response.setStatus(HttpServletResponse.SC_OK); - response.setContentType("text/plain"); - response.getWriter().write("" + testFlag.isSet()); - } else if ("get".equals(action)) { - response.setStatus(HttpServletResponse.SC_OK); - response.setContentType("text/plain"); - response.getWriter().write("" + testFlag.isSet()); - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/InitServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/InitServlet.java deleted file mode 100644 index 74ee779fb6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/InitServlet.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.session.listener.shutdown; - -import java.io.IOException; -import java.net.URLDecoder; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@SuppressWarnings("serial") -@WebServlet(urlPatterns = "/init") -public class InitServlet extends HttpServlet { - - @Inject - private SessionScopedTestFlagClient client; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - String url = request.getParameter("url"); - - if (url != null) { - // HTTP session is created during invocation - client.setBravoWebappContext(URLDecoder.decode(url, "UTF-8")); - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - request.getSession().invalidate(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/SessionContextListenerShutdownTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/SessionContextListenerShutdownTest.java deleted file mode 100644 index 020f3cf6cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/SessionContextListenerShutdownTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session.listener.shutdown; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_CONTEXT_EE; -import static org.testng.Assert.assertEquals; - -import java.net.URL; -import java.net.URLEncoder; - -import jakarta.servlet.http.HttpSessionListener; - -import org.jboss.arquillian.container.test.api.Deployer; -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.OperateOnDeployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.api.InSequence; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.SimpleLogger; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * Test the session context is active during {@link HttpSessionListener#sessionDestroyed(jakarta.servlet.http.HttpSessionEvent)} - * invocation when the application is undeployed. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionContextListenerShutdownTest extends AbstractTest { - - private static final String ALPHA_DEPLOYMENT_NAME = "alpha"; - - private static final String BRAVO_ARCHIVE_NAME = "bravo"; - - @Deployment(name = ALPHA_DEPLOYMENT_NAME, managed = false, testable = false) - public static WebArchive createFooTestArchive() { - return new WebArchiveBuilder() - .notTestArchive() - .withClasses(SessionScopedTestFlagClient.class, InitServlet.class, TestHttpSessionListener.class, - SimpleLogger.class) - .withWebXml(Descriptors.create(WebAppDescriptor.class).createSessionConfig().sessionTimeout(10).up()).build(); - } - - @Deployment(name = BRAVO_ARCHIVE_NAME, managed = false, testable = false) - public static WebArchive createBarTestArchive() { - return new WebArchiveBuilder().notTestArchive().withClasses(TestFlag.class, InfoServlet.class, SimpleLogger.class) - .build(); - } - - @ArquillianResource - Deployer deployer; - - /** - * This is not a real test method. - * - * @see #testApplicationContextDestroyed(URL, URL) - */ - @Test(groups = INTEGRATION) - @InSequence(1) - public void deployArchives() { - // In order to use @ArquillianResource URLs we need to deploy both test archives first - deployer.deploy(ALPHA_DEPLOYMENT_NAME); - deployer.deploy(BRAVO_ARCHIVE_NAME); - } - - /** - * Note that this test method depends on (must be run after) {@link #deployArchives()}. - * - * @param alphaContext - * @param bravoContext - * @throws Exception - */ - @Test(groups = INTEGRATION, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = SESSION_CONTEXT_EE, id = "ac") - public void testApplicationContextDestroyed( - @ArquillianResource @OperateOnDeployment(ALPHA_DEPLOYMENT_NAME) URL alphaContext, - @ArquillianResource @OperateOnDeployment(BRAVO_ARCHIVE_NAME) URL bravoContext) throws Exception { - - // Init SessionScopedTestFlagClient - set bravo archive deployment url - WebClient webClient = new WebClient(); - webClient.getPage(alphaContext + "init?url=" + URLEncoder.encode(bravoContext.toExternalForm(), "UTF-8")); - - deployer.undeploy(ALPHA_DEPLOYMENT_NAME); - - TextPage info = webClient.getPage(bravoContext + "info?action=get"); - assertEquals(info.getContent(), "true"); - - deployer.undeploy(BRAVO_ARCHIVE_NAME); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/SessionScopedTestFlagClient.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/SessionScopedTestFlagClient.java deleted file mode 100644 index b777d64aac..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/SessionScopedTestFlagClient.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.session.listener.shutdown; - -import java.io.Serializable; -import java.net.URL; -import java.net.URLConnection; - -import jakarta.enterprise.context.SessionScoped; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@SuppressWarnings("serial") -@SessionScoped -public class SessionScopedTestFlagClient implements Serializable { - - private SimpleLogger logger = new SimpleLogger(SessionScopedTestFlagClient.class); - - private String bravoWebappContext = null; - - public void setBravoWebappContext(String bravoContextUrl) { - this.bravoWebappContext = bravoContextUrl; - logger.log("Test flag client initialized [{0}]", bravoContextUrl); - } - - public void setTestFlag() { - try { - URLConnection connection = new URL(bravoWebappContext + "info" + "?action=set").openConnection(); - connection.getInputStream().close(); - logger.log("Test flag set [{0}]", bravoWebappContext); - } catch (Exception e) { - logger.log("Cannot set test flag: {0}", e); - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/TestFlag.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/TestFlag.java deleted file mode 100644 index bb8808d67d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/TestFlag.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.context.session.listener.shutdown; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class TestFlag { - - private boolean isSet = false; - - public boolean isSet() { - return isSet; - } - - public void set() { - this.isSet = true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/TestHttpSessionListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/TestHttpSessionListener.java deleted file mode 100644 index da85f29fb5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/context/session/listener/shutdown/TestHttpSessionListener.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.context.session.listener.shutdown; - -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.servlet.annotation.WebListener; -import jakarta.servlet.http.HttpSessionEvent; -import jakarta.servlet.http.HttpSessionListener; - -import org.jboss.cdi.tck.util.SimpleLogger; - -@WebListener -public class TestHttpSessionListener implements HttpSessionListener { - - private static final SimpleLogger logger = new SimpleLogger(TestHttpSessionListener.class); - - @Inject - BeanManager beanManager; - - @Inject - SessionScopedTestFlagClient client; - - @Override - public void sessionCreated(HttpSessionEvent se) { - logger.log("Session {0} created...", se.getSession().getId()); - } - - @Override - public void sessionDestroyed(HttpSessionEvent se) { - logger.log("Session {0} destroyed...", se.getSession().getId()); - checkSessionContextActive(); - } - - private void checkSessionContextActive() throws IllegalStateException { - try { - - if (!beanManager.getContext(SessionScoped.class).isActive() || client == null) { - return; - } - client.setTestFlag(); - - } catch (Exception e) { - logger.log("Unable to set test flag: {0}", e.getMessage()); - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/request/BuiltinHttpServletRequestDecoratorTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/request/BuiltinHttpServletRequestDecoratorTest.java deleted file mode 100644 index 61f016fc52..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/request/BuiltinHttpServletRequestDecoratorTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.builtin.http.request; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECORATOR_BEAN_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNull; - -import java.lang.reflect.Type; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; - -import jakarta.enterprise.inject.spi.Decorator; -import jakarta.inject.Inject; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.http.HttpServletRequest; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.full.decorators.AbstractDecoratorTest; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - * - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class BuiltinHttpServletRequestDecoratorTest extends AbstractDecoratorTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(BuiltinHttpServletRequestDecoratorTest.class) - .withClass(AbstractDecoratorTest.class) - .withBeansXml( - new BeansXml().decorators(HttpServletRequestDecorator1.class, HttpServletRequestDecorator2.class)) - .build(); - } - - @Inject - HttpServletRequest httpServletRequest; - - @SuppressWarnings("unchecked") - @Test - @SpecAssertions({ @SpecAssertion(section = DECORATOR_BEAN_EE, id = "aci") }) - public void testDecoratorIsResolved() { - List> decorators = getCurrentManager().resolveDecorators( - Collections. singleton(HttpServletRequest.class)); - assertEquals(2, decorators.size()); - for (Decorator decorator : decorators) { - assertEquals(decorator.getDecoratedTypes(), - new HashSet(Arrays.asList(HttpServletRequest.class, ServletRequest.class))); - assertEquals(decorator.getDelegateType(), HttpServletRequest.class); - } - } - - @Test - @SpecAssertions({ @SpecAssertion(section = DECORATOR_BEAN_EE, id = "aci") }) - public void testDecoratorIsInvoked() { - assertNull(httpServletRequest.getSession()); - assertEquals(httpServletRequest.getLocale(), Locale.SIMPLIFIED_CHINESE); - // Decorator chain - assertNull(httpServletRequest.getCookies()); - assertFalse(httpServletRequest.isUserInRole("Blabla")); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/request/HttpServletRequestDecorator1.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/request/HttpServletRequestDecorator1.java deleted file mode 100644 index d038a9051d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/request/HttpServletRequestDecorator1.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.builtin.http.request; - -import java.io.Serializable; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; -import jakarta.servlet.http.Cookie; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpSession; - -@Decorator -@SuppressWarnings("serial") -public abstract class HttpServletRequestDecorator1 implements HttpServletRequest, Serializable { - - @Inject - @Delegate - HttpServletRequest delegate; - - @Override - public Cookie[] getCookies() { - return delegate.getCookies(); - } - - @Override - public HttpSession getSession() { - return null; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/request/HttpServletRequestDecorator2.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/request/HttpServletRequestDecorator2.java deleted file mode 100644 index 692e7810da..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/request/HttpServletRequestDecorator2.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.builtin.http.request; - -import java.io.Serializable; -import java.util.Locale; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; -import jakarta.servlet.http.Cookie; -import jakarta.servlet.http.HttpServletRequest; - -@Decorator -@SuppressWarnings("serial") -public abstract class HttpServletRequestDecorator2 implements HttpServletRequest, Serializable { - - @Inject - @Delegate - HttpServletRequest delegate; - - @Override - public Cookie[] getCookies() { - return null; - } - - @Override - public Locale getLocale() { - return Locale.SIMPLIFIED_CHINESE; - } - - @Override - public boolean isUserInRole(String role) { - return delegate.isUserInRole(role); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/servletcontext/BuiltinServletContextDecoratorTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/servletcontext/BuiltinServletContextDecoratorTest.java deleted file mode 100644 index 96fdab60b9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/servletcontext/BuiltinServletContextDecoratorTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.builtin.http.servletcontext; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECORATOR_BEAN_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import java.lang.reflect.Type; -import java.util.Collections; -import java.util.List; - -import jakarta.enterprise.inject.spi.Decorator; -import jakarta.inject.Inject; -import jakarta.servlet.ServletContext; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.full.decorators.AbstractDecoratorTest; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - * - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class BuiltinServletContextDecoratorTest extends AbstractDecoratorTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(BuiltinServletContextDecoratorTest.class) - .withClass(AbstractDecoratorTest.class) - .withBeansXml( - new BeansXml().decorators(ServletContextDecorator1.class, ServletContextDecorator2.class)) - .build(); - } - - @Inject - ServletContext servletContext; - - @Test - @SpecAssertions({ @SpecAssertion(section = DECORATOR_BEAN_EE, id = "ack") }) - public void testDecoratorIsResolved() { - List> decorators = getCurrentManager().resolveDecorators( - Collections. singleton(ServletContext.class)); - assertEquals(2, decorators.size()); - for (Decorator decorator : decorators) { - assertEquals(decorator.getDecoratedTypes(), Collections.singleton(ServletContext.class)); - assertEquals(decorator.getDelegateType(), ServletContext.class); - } - } - - @Test - @SpecAssertions({ @SpecAssertion(section = DECORATOR_BEAN_EE, id = "ack") }) - public void testDecoratorIsInvoked() { - assertEquals(servletContext.getContextPath(), "whee"); - assertEquals(servletContext.getMajorVersion(), 20); - assertNotNull(servletContext.getServerInfo()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/servletcontext/ServletContextDecorator1.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/servletcontext/ServletContextDecorator1.java deleted file mode 100644 index 729ae4cdb1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/servletcontext/ServletContextDecorator1.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.builtin.http.servletcontext; - -import java.io.Serializable; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; -import jakarta.servlet.ServletContext; - -@Decorator -@SuppressWarnings("serial") -public abstract class ServletContextDecorator1 implements ServletContext, Serializable { - - @Inject - @Delegate - ServletContext delegate; - - @Override - public String getContextPath() { - return "whee"; - } - - @Override - public int getMajorVersion() { - return delegate.getMajorVersion(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/servletcontext/ServletContextDecorator2.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/servletcontext/ServletContextDecorator2.java deleted file mode 100644 index e372eab3cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/servletcontext/ServletContextDecorator2.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.builtin.http.servletcontext; - -import java.io.Serializable; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; -import jakarta.servlet.ServletContext; - -@Decorator -@SuppressWarnings("serial") -public abstract class ServletContextDecorator2 implements ServletContext, Serializable { - - @Inject - @Delegate - ServletContext delegate; - - @Override - public String getContextPath() { - return "wow"; - } - - @Override - public int getMajorVersion() { - return 20; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/BuiltinHttpSessionDecoratorTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/BuiltinHttpSessionDecoratorTest.java deleted file mode 100644 index 47808b4b8c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/BuiltinHttpSessionDecoratorTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.builtin.http.session; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECORATOR_BEAN_EE; -import static org.jboss.cdi.tck.cdi.Sections.DECORATOR_RESOLUTION; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.lang.reflect.Type; -import java.util.Collections; -import java.util.List; - -import jakarta.enterprise.inject.spi.Decorator; -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpSession; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.full.decorators.AbstractDecoratorTest; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class BuiltinHttpSessionDecoratorTest extends AbstractDecoratorTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(BuiltinHttpSessionDecoratorTest.class) - .withClass(AbstractDecoratorTest.class) - .withBeansXml( - new BeansXml().decorators(HttpSessionDecorator1.class, HttpSessionDecorator2.class)) - .build(); - } - - @Inject - HttpSession httpSession; - - @Inject - HttpSessionObserver httpSessionObserver; - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = DECORATOR_BEAN_EE, id = "acj"), - @SpecAssertion(section = DECORATOR_RESOLUTION, id = "aa") }) - public void testDecoratorIsResolved() { - List> decorators = getCurrentManager().resolveDecorators(Collections. singleton(HttpSession.class)); - assertEquals(2, decorators.size()); - for (Decorator decorator : decorators) { - assertEquals(decorator.getDecoratedTypes(), Collections. singleton(HttpSession.class)); - assertEquals(decorator.getDelegateType(), HttpSession.class); - } - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = DECORATOR_BEAN_EE, id = "acj") }) - public void testDecoratorIsInvoked() { - httpSession.invalidate(); - assertTrue(httpSessionObserver.isDestroyed()); - assertTrue(httpSessionObserver.isDecorated()); - assertEquals(3, httpSession.getLastAccessedTime()); - assertEquals("bar", httpSession.getAttribute("foo")); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/HttpSessionDecorator1.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/HttpSessionDecorator1.java deleted file mode 100644 index 13ef65bb33..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/HttpSessionDecorator1.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.builtin.http.session; - -import java.io.Serializable; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpSession; - -/** - * @author Martin Kouba - * - */ -@Decorator -public abstract class HttpSessionDecorator1 implements HttpSession, Serializable { - - @Inject - @Delegate - HttpSession delegate; - - @Inject - HttpSessionObserver httpSessionObserver; - - @Override - public long getLastAccessedTime() { - return delegate.getLastAccessedTime() * 3; - } - - @Override - public void invalidate() { - delegate.invalidate(); - httpSessionObserver.setDecorated(true); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/HttpSessionDecorator2.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/HttpSessionDecorator2.java deleted file mode 100644 index ec1ba08978..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/HttpSessionDecorator2.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.builtin.http.session; - -import java.io.Serializable; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpSession; - -/** - * @author Jozef Hartinger - * - */ -@Decorator -@SuppressWarnings("serial") -public abstract class HttpSessionDecorator2 implements HttpSession, Serializable { - - @Inject - @Delegate - HttpSession delegate; - - @Override - public long getLastAccessedTime() { - return 1; - } - - @Override - public Object getAttribute(String name) { - if ("foo".equals(name)) { - return "bar"; - } - return delegate.getAttribute(name); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/HttpSessionObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/HttpSessionObserver.java deleted file mode 100644 index 705748262e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/HttpSessionObserver.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.builtin.http.session; - -import jakarta.enterprise.context.ApplicationScoped; - -/** - * @author Martin Kouba - * - */ -@ApplicationScoped -public class HttpSessionObserver { - - private boolean isDecorated = false; - private boolean isDestroyed = false; - - public boolean isDecorated() { - return isDecorated; - } - - public void setDecorated(boolean isDecorated) { - this.isDecorated = isDecorated; - } - - public boolean isDestroyed() { - return isDestroyed; - } - - public void setDestroyed(boolean isDestroyed) { - this.isDestroyed = isDestroyed; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/SessionListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/SessionListener.java deleted file mode 100644 index ac513c8413..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/http/session/SessionListener.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.builtin.http.session; - -import jakarta.inject.Inject; -import jakarta.servlet.annotation.WebListener; -import jakarta.servlet.http.HttpSessionEvent; -import jakarta.servlet.http.HttpSessionListener; - -/** - * @author Martin Kouba - * - */ -@WebListener -public class SessionListener implements HttpSessionListener { - - @Inject - HttpSessionObserver httpSessionObserver; - - @Override - public void sessionCreated(HttpSessionEvent se) { - } - - @Override - public void sessionDestroyed(HttpSessionEvent se) { - httpSessionObserver.setDestroyed(true); - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/principal/BuiltinPrincipalDecoratorTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/principal/BuiltinPrincipalDecoratorTest.java deleted file mode 100644 index b20e685063..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/principal/BuiltinPrincipalDecoratorTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.builtin.principal; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.DECORATOR_BEAN_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import java.lang.reflect.Type; -import java.security.Principal; -import java.util.Collections; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.tests.full.decorators.AbstractDecoratorTest; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Martin Kouba - */ -@Test(groups = JAVAEE_FULL) -@SpecVersion(spec = "cdi", version = "2.0") -public class BuiltinPrincipalDecoratorTest extends AbstractDecoratorTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - return new EnterpriseArchiveBuilder() - .withTestClassPackage(BuiltinPrincipalDecoratorTest.class) - .withClass(AbstractDecoratorTest.class) - .withBeansXml( - new BeansXml().decorators(PrincipalDecorator.class)) - .build(); - } - - @Inject - PrincipalInjector principalInjector; - - @Test - @SpecAssertions({ @SpecAssertion(section = DECORATOR_BEAN_EE, id = "acm") }) - public void testDecoratorIsResolved() { - assertNotNull(principalInjector); - checkDecorator( - resolveUniqueDecorator(principalInjector.getBeanManager(), Collections. singleton(Principal.class)), - PrincipalDecorator.class, Collections. singleton(Principal.class), Principal.class); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = DECORATOR_BEAN_EE, id = "acm") }) - public void testDecoratorInvoked() throws Exception { - assertNotNull(principalInjector); - assertNotNull(principalInjector.getPrincipal()); - assertEquals(principalInjector.getPrincipal().getName(), "Edgar"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/principal/PrincipalDecorator.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/principal/PrincipalDecorator.java deleted file mode 100644 index 14c8045b71..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/principal/PrincipalDecorator.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.builtin.principal; - -import java.io.Serializable; -import java.security.Principal; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; - -@SuppressWarnings("serial") -@Decorator -public abstract class PrincipalDecorator implements Principal, Serializable { - - @Inject - @Delegate - Principal principal; - - @Override - public String getName() { - return "Edgar"; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/principal/PrincipalInjector.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/principal/PrincipalInjector.java deleted file mode 100644 index 3bc1e7a50f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/principal/PrincipalInjector.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.builtin.principal; - -import java.security.Principal; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -@Dependent -public class PrincipalInjector { - - @Inject - private Principal principal; - - @Inject - private BeanManager beanManager; - - public Principal getPrincipal() { - return principal; - } - - public BeanManager getBeanManager() { - return beanManager; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/transaction/BuiltinUserTransactionDecoratorTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/transaction/BuiltinUserTransactionDecoratorTest.java deleted file mode 100644 index 3faabb1c7a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/transaction/BuiltinUserTransactionDecoratorTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.builtin.transaction; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.DECORATOR_BEAN_EE; - -import jakarta.inject.Inject; -import jakarta.transaction.Status; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * - * @author Jozef Hartinger - * - */ -@Test(groups = JAVAEE_FULL) -@SpecVersion(spec = "cdi", version = "2.0") -public class BuiltinUserTransactionDecoratorTest extends AbstractTest { - - @Inject - private SessionBean sessionBean; - - @Deployment - public static EnterpriseArchive createTestArchive() { - return new EnterpriseArchiveBuilder() - .withTestClassPackage(BuiltinUserTransactionDecoratorTest.class) - .withBeansXml( - new BeansXml().decorators(UserTransactionDecorator.class)) - .build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = DECORATOR_BEAN_EE, id = "acn") }) - public void testUserTransactionDecorated() throws Exception { - Assert.assertEquals(sessionBean.getTransaction().getStatus(), Status.STATUS_UNKNOWN); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/transaction/SessionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/transaction/SessionBean.java deleted file mode 100644 index 7ad46d254d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/transaction/SessionBean.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.builtin.transaction; - -import jakarta.ejb.Stateless; -import jakarta.ejb.TransactionManagement; -import jakarta.ejb.TransactionManagementType; -import jakarta.inject.Inject; -import jakarta.transaction.UserTransaction; - -@Stateless -@TransactionManagement(TransactionManagementType.BEAN) -public class SessionBean { - - @Inject - private UserTransaction transaction; - - public UserTransaction getTransaction() { - return transaction; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/transaction/UserTransactionDecorator.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/transaction/UserTransactionDecorator.java deleted file mode 100644 index 6d5276fc83..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/builtin/transaction/UserTransactionDecorator.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.builtin.transaction; - -import java.io.Serializable; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; -import jakarta.transaction.Status; -import jakarta.transaction.SystemException; -import jakarta.transaction.UserTransaction; - -@Decorator -@SuppressWarnings("serial") -public abstract class UserTransactionDecorator implements UserTransaction, Serializable { - - @SuppressWarnings("unused") - @Inject - @Delegate - private UserTransaction delegate; - - @Override - public int getStatus() throws SystemException { - return Status.STATUS_UNKNOWN; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/BankAccount.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/BankAccount.java deleted file mode 100644 index 0e089d726f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/BankAccount.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.definition.lifecycle; - -public interface BankAccount { - - public void withdraw(int amount); - - public void deposit(int amount); - - public int getBalance(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/BankServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/BankServlet.java deleted file mode 100644 index 52f4954007..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/BankServlet.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.definition.lifecycle; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.ActionSequence; - -@WebServlet("/bank") -@SuppressWarnings("serial") -public class BankServlet extends HttpServlet { - - @Inject - ShortTermAccount shortTermAccount; - - @Inject - DurableAccount durableAccount; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - if ("withdraw".equals(req.getParameter("action"))) { - shortTermAccount.withdraw(getAmountValue(req)); - durableAccount.withdraw(getAmountValue(req)); - } else if ("deposit".equals(req.getParameter("action"))) { - shortTermAccount.deposit(getAmountValue(req)); - durableAccount.deposit(getAmountValue(req)); - } - - resp.getWriter().append("ShortTermBalance:" + shortTermAccount.getBalance()); - resp.getWriter().append("\n"); - resp.getWriter().append("DurableBalance:" + durableAccount.getBalance()); - resp.getWriter().append("\n"); - resp.getWriter().append("PostConstructCallers:" + ActionSequence.getSequenceSize("postConstructCallers")); - resp.getWriter().append("\n"); - resp.getWriter().append("PreDestroyCallers:" + ActionSequence.getSequenceSize("preDestroyCallers")); - resp.getWriter().append("\n"); - - resp.setContentType("text/plain"); - } - - private Integer getAmountValue(HttpServletRequest req) { - return Integer.valueOf(req.getParameter("amount")); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/ChargeDecorator.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/ChargeDecorator.java deleted file mode 100644 index 488b7069c9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/ChargeDecorator.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.definition.lifecycle; - -import java.io.Serializable; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; - -import org.jboss.cdi.tck.util.ActionSequence; - -/** - * Decorator is a managed bean and may use the {@link PostConstruct} and {@link PreDestroy} annotations to identify methods to - * be called back by the container at the appropriate points in the bean’s lifecycle. - * - * @author Martin Kouba - */ -@SuppressWarnings("serial") -@Decorator -public abstract class ChargeDecorator implements BankAccount, Serializable { - - private static final int WITHDRAWAL_CHARGE = 5; - - public static int charged = 0; - - @Inject - @Delegate - private BankAccount account; - - @Override - public void withdraw(int amount) { - account.withdraw(amount + WITHDRAWAL_CHARGE); - charged += WITHDRAWAL_CHARGE; - } - - public static void reset() { - charged = 0; - } - - @PostConstruct - public void postConstruct() { - ActionSequence.addAction("postConstructCallers", DurableAccount.class.getName()); - } - - @PreDestroy - public void preDestroy() { - ActionSequence.addAction("preDestroyCallers", DurableAccount.class.getName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/DecoratorInstanceIsDependentObjectTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/DecoratorInstanceIsDependentObjectTest.java deleted file mode 100644 index 4f995058cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/DecoratorInstanceIsDependentObjectTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.definition.lifecycle; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECORATORS; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class DecoratorInstanceIsDependentObjectTest extends AbstractTest { - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(DecoratorInstanceIsDependentObjectTest.class) - .withBeansXml( - new BeansXml().decorators(ChargeDecorator.class)) - .build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = DECORATORS, id = "c") }) - public void testDecoratorInstanceIsDependentObject() throws Exception { - - WebClient webClient = new WebClient(); - - TextPage resp01 = webClient.getPage(contextPath + "bank?action=deposit&amount=10"); - assertTrue(resp01.getContent().contains("ShortTermBalance:10")); - assertTrue(resp01.getContent().contains("DurableBalance:10")); - assertTrue(resp01.getContent().contains("PostConstructCallers:2")); - // Note that short-term account is request scoped and thus destroyed after request - however this info is not available - // during the request - we have to check after the next request - assertTrue(resp01.getContent().contains("PreDestroyCallers:0")); - - TextPage resp02 = webClient.getPage(contextPath + "bank?action=deposit&amount=10"); - assertTrue(resp02.getContent().contains("ShortTermBalance:10")); - assertTrue(resp02.getContent().contains("DurableBalance:20")); - assertTrue(resp02.getContent().contains("PostConstructCallers:3")); - assertTrue(resp02.getContent().contains("PreDestroyCallers:1")); - - // And finally check decorator is applied - TextPage resp03 = webClient.getPage(contextPath + "bank?action=withdraw&amount=5"); - assertTrue(resp03.getContent().contains("ShortTermBalance:-10")); - assertTrue(resp03.getContent().contains("DurableBalance:10")); - assertTrue(resp03.getContent().contains("PostConstructCallers:4")); - assertTrue(resp03.getContent().contains("PreDestroyCallers:2")); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/DurableAccount.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/DurableAccount.java deleted file mode 100644 index 1d0cd9cdf2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/DurableAccount.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.definition.lifecycle; - -import java.io.Serializable; - -import jakarta.enterprise.context.SessionScoped; - -@SuppressWarnings("serial") -@SessionScoped -public class DurableAccount implements BankAccount, Serializable { - - int balance = 0; - - @Override - public void withdraw(int amount) { - balance -= amount; - } - - @Override - public void deposit(int amount) { - balance += amount; - } - - public int getBalance() { - return balance; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/ShortTermAccount.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/ShortTermAccount.java deleted file mode 100644 index 4f351fd6ed..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/definition/lifecycle/ShortTermAccount.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.definition.lifecycle; - -import jakarta.enterprise.context.RequestScoped; - -@RequestScoped -public class ShortTermAccount implements BankAccount { - - int balance = 0; - - @Override - public void withdraw(int amount) { - balance -= amount; - } - - @Override - public void deposit(int amount) { - balance += amount; - } - - public int getBalance() { - return balance; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/EJBDecoratorInvocationTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/EJBDecoratorInvocationTest.java deleted file mode 100644 index b015bd296e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/EJBDecoratorInvocationTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.invocation.ejb; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BIZ_METHOD_EE; -import static org.jboss.cdi.tck.cdi.Sections.DECORATOR_BEAN_EE; -import static org.testng.Assert.assertTrue; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author pmuir - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EJBDecoratorInvocationTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(EJBDecoratorInvocationTest.class) - .withClasses(PigSty.class, PigStyImpl.class, PigStyDecorator.class, Pig.class) - .withBeansXml( - new BeansXml().decorators(PigStyDecorator.class)) - .build(); - } - - @Inject - PigSty pigSty; - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = BIZ_METHOD_EE, id = "d"), - @SpecAssertion(section = DECORATOR_BEAN_EE, id = "ab") }) - public void testEJBDecoratorInvocation() { - PigStyDecorator.reset(); - PigStyImpl.reset(); - pigSty.clean(); - assertTrue(PigStyDecorator.isDecoratorCalled()); - assertTrue(PigStyImpl.isBeanCalled()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/Pig.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/Pig.java deleted file mode 100644 index 8ec247ad9f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/Pig.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.invocation.ejb; - -import java.io.Serializable; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Pig implements Serializable { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/PigSty.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/PigSty.java deleted file mode 100644 index 5aa5ec3e4c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/PigSty.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.invocation.ejb; - -import jakarta.ejb.Local; - -/** - * @author pmuir - * - */ -@Local -public interface PigSty { - - public static final String MESSAGE = "smelly work!"; - - public void clean(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/PigStyDecorator.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/PigStyDecorator.java deleted file mode 100644 index 8dcadbfd2e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/PigStyDecorator.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.invocation.ejb; - -import java.io.Serializable; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; - -@Decorator -public class PigStyDecorator implements PigSty, Serializable { - private static boolean decoratorCalled = false; - - public static boolean isDecoratorCalled() { - return decoratorCalled; - } - - public static void reset() { - decoratorCalled = false; - } - - @Inject - @Delegate - transient PigSty pigSty; - - public void clean() { - decoratorCalled = true; - pigSty.clean(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/PigStyImpl.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/PigStyImpl.java deleted file mode 100644 index 066795dca0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/ejb/PigStyImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.invocation.ejb; - -import jakarta.ejb.Stateful; -import jakarta.inject.Inject; - -/** - * @author pmuir - * - */ -@Stateful -public class PigStyImpl implements PigSty { - - @Inject - private Pig pig; - - private static boolean BEAN_CALLED; - - public void clean() { - BEAN_CALLED = true; - assert pig instanceof Pig; - } - - public static boolean isBeanCalled() { - return BEAN_CALLED; - } - - public static void reset() { - BEAN_CALLED = false; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/Bar.java deleted file mode 100644 index b6ec41353c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/Bar.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.invocation.enterprise; - -import jakarta.ejb.Stateless; - -/** - * @author Martin Kouba - * - */ -@Stateless -public class Bar extends BusinessBase implements BarBusiness { - - @Override - protected String getResult() { - return Bar.class.getName(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/BarBusiness.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/BarBusiness.java deleted file mode 100644 index 47e219b240..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/BarBusiness.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.invocation.enterprise; - -import jakarta.ejb.Local; - -/** - * @author Martin Kouba - */ -@Local -public interface BarBusiness extends Business { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/BarBusinessDecorator.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/BarBusinessDecorator.java deleted file mode 100644 index 22d77d2fe3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/BarBusinessDecorator.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.invocation.enterprise; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; - -import org.jboss.cdi.tck.util.ActionSequence; - -/** - * @author Martin Kouba - */ -@Decorator -public abstract class BarBusinessDecorator implements Business { - - @Inject - @Delegate - private BarBusiness business; - - @Override - public String businessOperation1() { - ActionSequence.addAction(BarBusinessDecorator.class.getName()); - return business.businessOperation1() + BarBusinessDecorator.class.getName(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/Business.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/Business.java deleted file mode 100644 index 45204f0563..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/Business.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.invocation.enterprise; - -import jakarta.ejb.Local; - -/** - * @author Martin Kouba - */ -@Local -public interface Business { - - public String businessOperation1(); - - public String businessOperation2(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/BusinessBase.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/BusinessBase.java deleted file mode 100644 index ef39a01605..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/BusinessBase.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.invocation.enterprise; - -/** - * @author Martin Kouba - * - */ -public abstract class BusinessBase implements Business { - - @Override - public String businessOperation1() { - return getResult(); - } - - @Override - public String businessOperation2() { - return getResult(); - } - - protected abstract String getResult(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/EnterpriseDecoratorInvocationTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/EnterpriseDecoratorInvocationTest.java deleted file mode 100644 index 743a497fef..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/EnterpriseDecoratorInvocationTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.invocation.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BIZ_METHOD_EE; -import static org.jboss.cdi.tck.cdi.Sections.DECORATORS_EE; -import static org.jboss.cdi.tck.cdi.Sections.DECORATOR_BEAN_EE; -import static org.jboss.cdi.tck.cdi.Sections.DELEGATE_ATTRIBUTE; -import static org.testng.Assert.assertEquals; - -import java.lang.reflect.Type; -import java.util.Collections; -import java.util.List; - -import jakarta.enterprise.inject.spi.Decorator; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseDecoratorInvocationTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(EnterpriseDecoratorInvocationTest.class) - .withBeansXml(new BeansXml() - .interceptors(FooInterceptor.class) - .decorators(FooBusinessDecorator1.class, FooBusinessDecorator2.class, BarBusinessDecorator.class)) - .build(); - } - - @Inject - FooBusiness foo; - - @Test - @SpecAssertions({ @SpecAssertion(section = BIZ_METHOD_EE, id = "d"), @SpecAssertion(section = DECORATOR_BEAN_EE, id = "d"), - @SpecAssertion(section = DECORATORS_EE, id = "e"), @SpecAssertion(section = DELEGATE_ATTRIBUTE, id = "cc"), - @SpecAssertion(section = DECORATORS_EE, id = "d"), @SpecAssertion(section = DECORATORS_EE, id = "g"), - @SpecAssertion(section = DECORATORS_EE, id = "f") }) - public void testContextualDecorated() throws Exception { - - List> decorators = getCurrentManager().resolveDecorators(Collections. singleton(FooBusiness.class)); - assertEquals(decorators.size(), 2); - - ActionSequence.reset(); - - // Test actual decoration - assertEquals(foo.businessOperation1(), Foo.class.getName() + FooBusinessDecorator2.class.getName() - + FooBusinessDecorator1.class.getName()); - - // Decorators are called after interceptors and decorator that occures earlier in the list is called first - List sequence = ActionSequence.getSequenceData(); - assertEquals(sequence.size(), 3); - assertEquals(sequence.get(0), FooInterceptor.class.getName()); - assertEquals(sequence.get(1), FooBusinessDecorator1.class.getName()); - assertEquals(sequence.get(2), FooBusinessDecorator2.class.getName()); - - // Only businessOperation1() is decorated - assertEquals(foo.businessOperation2(), Foo.class.getName()); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = BIZ_METHOD_EE, id = "i"), @SpecAssertion(section = DECORATOR_BEAN_EE, id = "d"), - @SpecAssertion(section = DECORATORS_EE, id = "e") }) - public void testNonContextualDecorated() throws Exception { - - List> decorators = getCurrentManager().resolveDecorators(Collections. singleton(BarBusiness.class)); - assertEquals(decorators.size(), 1); - assertEquals(decorators.iterator().next().getDecoratedTypes().size(), 1); - - ActionSequence.reset(); - - // Test actual decoration - assertEquals(foo.invokeBarBusinessOperation1(), Bar.class.getName() + BarBusinessDecorator.class.getName()); - - List sequence = ActionSequence.getSequenceData(); - assertEquals(sequence.size(), 2); - // invokeBarBusinessOperation1() is intercepted - assertEquals(sequence.get(0), FooInterceptor.class.getName()); - assertEquals(sequence.get(1), BarBusinessDecorator.class.getName()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/Foo.java deleted file mode 100644 index 1e32fdfccf..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/Foo.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.invocation.enterprise; - -import jakarta.ejb.EJB; -import jakarta.ejb.Stateful; - -/** - * @author Martin Kouba - */ -@FooBinding -@Stateful -public class Foo extends BusinessBase implements FooBusiness { - - @EJB - BarBusiness bar; - - @Override - protected String getResult() { - return Foo.class.getName(); - } - - @Override - public String invokeBarBusinessOperation1() { - return bar.businessOperation1(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBinding.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBinding.java deleted file mode 100644 index 6fe9be54e3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBinding.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.invocation.enterprise; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import jakarta.interceptor.InterceptorBinding; - -@Inherited -@InterceptorBinding -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface FooBinding { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBusiness.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBusiness.java deleted file mode 100644 index 2ae0222d52..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBusiness.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.invocation.enterprise; - -import jakarta.ejb.Local; - -/** - * @author Martin Kouba - */ -@Local -public interface FooBusiness extends Business { - - public String invokeBarBusinessOperation1(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBusinessDecorator1.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBusinessDecorator1.java deleted file mode 100644 index 04ab7b6f39..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBusinessDecorator1.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.invocation.enterprise; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; - -import org.jboss.cdi.tck.util.ActionSequence; - -/** - * @author Martin Kouba - */ -@Decorator -public abstract class FooBusinessDecorator1 implements Business { - - @Inject - @Delegate - private FooBusiness business; - - @Override - public String businessOperation1() { - ActionSequence.addAction(FooBusinessDecorator1.class.getName()); - return business.businessOperation1() + FooBusinessDecorator1.class.getName(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBusinessDecorator2.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBusinessDecorator2.java deleted file mode 100644 index 5c485d9e2c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooBusinessDecorator2.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.decorators.invocation.enterprise; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; - -import org.jboss.cdi.tck.util.ActionSequence; - -/** - * @author Martin Kouba - */ -@Decorator -public abstract class FooBusinessDecorator2 implements Business { - - @Inject - @Delegate - private FooBusiness business; - - @Override - public String businessOperation1() { - ActionSequence.addAction(FooBusinessDecorator2.class.getName()); - return business.businessOperation1() + FooBusinessDecorator2.class.getName(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooInterceptor.java deleted file mode 100644 index 70841ac441..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/invocation/enterprise/FooInterceptor.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.invocation.enterprise; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Interceptor -@FooBinding -public class FooInterceptor { - - @AroundInvoke - public Object aroundInvoke(InvocationContext ctx) throws Exception { - ActionSequence.addAction(FooInterceptor.class.getName()); - return ctx.proceed(); - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/AbstractDecorator.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/AbstractDecorator.java deleted file mode 100644 index 176a6d7789..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/AbstractDecorator.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.ordering.global; - -import java.util.List; - -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; - -public abstract class AbstractDecorator implements Decorated { - - @Inject - @Delegate - private Decorated delegate; - - @Override - public void getSequence(List list) { - list.add(getClass().getSimpleName()); - delegate.getSequence(list); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/Decorated.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/Decorated.java deleted file mode 100644 index 522a0f5166..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/Decorated.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.ordering.global; - -import java.util.List; - -public interface Decorated { - - public void getSequence(List list); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/DecoratedImpl.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/DecoratedImpl.java deleted file mode 100644 index 1eabc5cf13..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/DecoratedImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.ordering.global; - -import java.util.List; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class DecoratedImpl implements Decorated { - - @Override - public void getSequence(List list) { - list.add(DecoratedImpl.class.getSimpleName()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/DummyDao.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/DummyDao.java deleted file mode 100644 index c43bd55692..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/DummyDao.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.ordering.global; - -import jakarta.ejb.Stateless; - -import org.jboss.cdi.tck.shrinkwrap.ee.DummySessionBean; - -/** - * - * @see DummySessionBean - */ -@Stateless -public class DummyDao { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/EnterpriseDecoratorOrderingTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/EnterpriseDecoratorOrderingTest.java deleted file mode 100644 index f0e15de7b0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/EnterpriseDecoratorOrderingTest.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.ordering.global; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.DECORATORS_EE; -import static org.testng.Assert.assertEquals; - -import java.util.ArrayList; -import java.util.List; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.spec.se.manifest.ManifestDescriptor; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Matus Abaffy - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseDecoratorOrderingTest extends AbstractTest { - - /** - * Modules: - *
    - *
  • A - EJB jar: LegacyDecorator2, DecoratedImpl
  • - *
  • B - lib: Decorated, GloballyEnabledDecorator3
  • - *
  • C - lib: AbstractDecorator
  • - *
  • D - EJB jar: GloballyEnabledDecorator2, GloballyEnabledDecorator5, LegacyDecorator3
  • - *
  • E - web archive - *
      - *
    • F - WEB-INF/classes: GloballyEnabledDecorator1, LegacyDecorator1
    • - *
    • G - WEB-INF/lib: GloballyEnabledDecorator4
    • - *
    - *
  • - *
- * - * @return test archive - */ - @Deployment - public static EnterpriseArchive createTestArchive() { - final String ejbJar = "ejb.jar"; - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - //A - default test-ejb.jar - .withTestClassDefinition(EnterpriseDecoratorOrderingTest.class) - .withClasses(DecoratedImpl.class, LegacyDecorator2.class) - .withBeansXml(new BeansXml().decorators(LegacyDecorator2.class)) - //B - .withBeanLibrary(Decorated.class, GloballyEnabledDecorator3.class) - //C - .withLibrary(AbstractDecorator.class) - .build(); - - //D - JavaArchive ejbArchive = ShrinkWrap - .create(JavaArchive.class, ejbJar) - .addClasses(DummyDao.class, GloballyEnabledDecorator2.class, GloballyEnabledDecorator5.class, - LegacyDecorator3.class) - .addAsManifestResource(new BeansXml().decorators(LegacyDecorator3.class), "beans.xml") - .setManifest( - new StringAsset(Descriptors.create(ManifestDescriptor.class) - .addToClassPath(EnterpriseArchiveBuilder.DEFAULT_EJB_MODULE_NAME) - .exportAsString())); - enterpriseArchive.addAsModule(ejbArchive); - - //E - WebArchive webArchive = new WebArchiveBuilder() - .notTestArchive() - //F - .withClasses(EnterpriseDecoratorOrderingTest.class, GloballyEnabledDecorator1.class, LegacyDecorator1.class) - .withBeansXml(new BeansXml().decorators(LegacyDecorator1.class)) - //G - .withBeanLibrary(GloballyEnabledDecorator4.class) - .build() - .setManifest( - new StringAsset(Descriptors.create(ManifestDescriptor.class) - .addToClassPath(EnterpriseArchiveBuilder.DEFAULT_EJB_MODULE_NAME) - .addToClassPath(ejbJar) - .exportAsString())); - enterpriseArchive.addAsModule(webArchive); - - return enterpriseArchive; - } - - @Inject - private Decorated decorated; - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = DECORATORS_EE, id = "b"), - @SpecAssertion(section = DECORATORS_EE, id = "c"), - @SpecAssertion(section = DECORATORS_EE, id = "d") }) - public void testDecoratorsInWebInfClasses() { - - List expected = new ArrayList(); - // 800 - expected.add(GloballyEnabledDecorator5.class.getSimpleName()); - // 995 - expected.add(GloballyEnabledDecorator1.class.getSimpleName()); - // 1005 - expected.add(GloballyEnabledDecorator2.class.getSimpleName()); - // 1015 - expected.add(GloballyEnabledDecorator3.class.getSimpleName()); - // 1025 - expected.add(GloballyEnabledDecorator4.class.getSimpleName()); - // Decorators enabled using beans.xml - //LegacyDecorator1 enabled only in F - expected.add(LegacyDecorator2.class.getSimpleName()); - //LegacyDecorator3 enabled only in D - // Bean itself - expected.add(DecoratedImpl.class.getSimpleName()); - - List actual = new ArrayList(); - decorated.getSequence(actual); - assertEquals(actual, expected); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GlobalDecoratorOrderingTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GlobalDecoratorOrderingTest.java deleted file mode 100644 index 50b6f34f59..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GlobalDecoratorOrderingTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.ordering.global; - -import static org.jboss.cdi.tck.cdi.Sections.ENABLED_DECORATORS; -import static org.jboss.cdi.tck.cdi.Sections.ENABLED_DECORATORS_BEAN_ARCHIVE; -import static org.jboss.cdi.tck.cdi.Sections.ENABLED_DECORATORS_PRIORITY; -import static org.testng.Assert.assertEquals; - -import java.util.ArrayList; -import java.util.List; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - *

- * This test was originally part of the Weld test suite. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class GlobalDecoratorOrderingTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - - return new WebArchiveBuilder() - .withTestClass(GlobalDecoratorOrderingTest.class) - .withClasses(DecoratedImpl.class, LegacyDecorator1.class, LegacyDecorator2.class, LegacyDecorator3.class, - WebApplicationGlobalDecorator.class) - .withBeansXml(new BeansXml().decorators(LegacyDecorator1.class, LegacyDecorator2.class, LegacyDecorator3.class)) - .withBeanLibrary(AbstractDecorator.class, Decorated.class, GloballyEnabledDecorator1.class, - GloballyEnabledDecorator2.class, GloballyEnabledDecorator3.class, GloballyEnabledDecorator4.class, - GloballyEnabledDecorator5.class) - .build(); - } - - @Inject - private Decorated decorated; - - @Test - @SpecAssertions({ @SpecAssertion(section = ENABLED_DECORATORS_PRIORITY, id = "a"), - @SpecAssertion(section = ENABLED_DECORATORS_BEAN_ARCHIVE, id = "a"), - @SpecAssertion(section = ENABLED_DECORATORS_PRIORITY, id = "b"), - @SpecAssertion(section = ENABLED_DECORATORS, id = "c") }) - public void testDecoratorsInWebInfClasses() { - - List expected = new ArrayList(); - // 800 - expected.add(GloballyEnabledDecorator5.class.getSimpleName()); - // 995 - expected.add(GloballyEnabledDecorator1.class.getSimpleName()); - // 1005 - expected.add(GloballyEnabledDecorator2.class.getSimpleName()); - // 1008 - expected.add(WebApplicationGlobalDecorator.class.getSimpleName()); - // 1015 - expected.add(GloballyEnabledDecorator3.class.getSimpleName()); - // 1025 - expected.add(GloballyEnabledDecorator4.class.getSimpleName()); - // Decorators enabled using beans.xml - expected.add(LegacyDecorator1.class.getSimpleName()); - expected.add(LegacyDecorator2.class.getSimpleName()); - expected.add(LegacyDecorator3.class.getSimpleName()); - // Bean itself - expected.add(DecoratedImpl.class.getSimpleName()); - - List actual = new ArrayList(); - decorated.getSequence(actual); - assertEquals(actual, expected); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator1.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator1.java deleted file mode 100644 index 607fec982c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator1.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.ordering.global; - -import jakarta.annotation.Priority; -import jakarta.decorator.Decorator; - -@Priority(995) -@Decorator -public class GloballyEnabledDecorator1 extends AbstractDecorator { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator2.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator2.java deleted file mode 100644 index 28ccceaf66..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator2.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.ordering.global; - -import jakarta.annotation.Priority; -import jakarta.decorator.Decorator; - -@Priority(1005) -@Decorator -public class GloballyEnabledDecorator2 extends AbstractDecorator { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator3.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator3.java deleted file mode 100644 index bcfc6c7616..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator3.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.ordering.global; - -import jakarta.annotation.Priority; -import jakarta.decorator.Decorator; - -@Priority(1015) -@Decorator -public class GloballyEnabledDecorator3 extends AbstractDecorator { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator4.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator4.java deleted file mode 100644 index 98ef83525f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator4.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.ordering.global; - -import jakarta.annotation.Priority; -import jakarta.decorator.Decorator; - -@Priority(1025) -@Decorator -public class GloballyEnabledDecorator4 extends AbstractDecorator { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator5.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator5.java deleted file mode 100644 index 32b29d875e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/GloballyEnabledDecorator5.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.ordering.global; - -import jakarta.annotation.Priority; -import jakarta.decorator.Decorator; - -@Priority(800) -@Decorator -public class GloballyEnabledDecorator5 extends AbstractDecorator { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/LegacyDecorator1.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/LegacyDecorator1.java deleted file mode 100644 index ec09405e50..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/LegacyDecorator1.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.ordering.global; - -import jakarta.decorator.Decorator; - -@Decorator -public class LegacyDecorator1 extends AbstractDecorator { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/LegacyDecorator2.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/LegacyDecorator2.java deleted file mode 100644 index ea64a4b809..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/LegacyDecorator2.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.ordering.global; - -import jakarta.decorator.Decorator; - -@Decorator -public class LegacyDecorator2 extends AbstractDecorator { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/LegacyDecorator3.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/LegacyDecorator3.java deleted file mode 100644 index 4a4f5c2b9f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/LegacyDecorator3.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.ordering.global; - -import jakarta.decorator.Decorator; - -@Decorator -public class LegacyDecorator3 extends AbstractDecorator { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/WebApplicationGlobalDecorator.java b/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/WebApplicationGlobalDecorator.java deleted file mode 100644 index 932e979719..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/decorators/ordering/global/WebApplicationGlobalDecorator.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.decorators.ordering.global; - -import jakarta.annotation.Priority; -import jakarta.decorator.Decorator; - -@Priority(1008) -@Decorator -public class WebApplicationGlobalDecorator extends AbstractDecorator { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/broken/restricted/ejb/RestrictedSessionBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/broken/restricted/ejb/RestrictedSessionBeanTest.java deleted file mode 100644 index 935fba734d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/broken/restricted/ejb/RestrictedSessionBeanTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.bean.broken.restricted.ejb; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_TYPES_EE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.definition.bean.broken.restricted.Animal; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class RestrictedSessionBeanTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassDefinition(RestrictedSessionBeanTest.class) - .withClasses(Animal.class, RockBean.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = BEAN_TYPES_EE, id = "b") - public void testInvalidTypedValueOnSessionBean() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/broken/restricted/ejb/RockBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/broken/restricted/ejb/RockBean.java deleted file mode 100644 index b2d5b86eb4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/broken/restricted/ejb/RockBean.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.bean.broken.restricted.ejb; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.inject.Typed; - -import org.jboss.cdi.tck.tests.definition.bean.broken.restricted.Animal; - -/** - * - * @author Martin Kouba - */ -@Typed(value = Animal.class) -@Stateless -public class RockBean { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Animal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Animal.java deleted file mode 100644 index 0c4ecdd4a6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Animal.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -public interface Animal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Bird.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Bird.java deleted file mode 100644 index 76209e64cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Bird.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -public abstract class Bird implements Animal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Cobra.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Cobra.java deleted file mode 100644 index 17c0b7bfcf..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Cobra.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -import jakarta.ejb.LocalBean; -import jakarta.ejb.Stateful; - -@Stateful -@LocalBean -public class Cobra extends Snake implements Reptile { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Creature.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Creature.java deleted file mode 100644 index a076a8fa27..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Creature.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class Creature implements CreatureLocal { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/CreatureLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/CreatureLocal.java deleted file mode 100644 index befabdf106..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/CreatureLocal.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface CreatureLocal { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LegendaryCreature.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LegendaryCreature.java deleted file mode 100644 index 0d060a91b4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LegendaryCreature.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -import jakarta.ejb.LocalBean; -import jakarta.ejb.Stateful; - -@LocalBean -@Stateful -public class LegendaryCreature extends Creature implements LegendaryLocal { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LegendaryLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LegendaryLocal.java deleted file mode 100644 index 86ed3065fc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LegendaryLocal.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface LegendaryLocal { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LoginAction.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LoginAction.java deleted file mode 100644 index 4ed64b3d3f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LoginAction.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface LoginAction { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LoginActionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LoginActionBean.java deleted file mode 100644 index 9fd59e6730..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/LoginActionBean.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -import jakarta.ejb.Stateless; - -@Stateless -public class LoginActionBean implements LoginAction { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Mammal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Mammal.java deleted file mode 100644 index fa40f5d92c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Mammal.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface Mammal extends Animal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Mock.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Mock.java deleted file mode 100644 index c431cfcb9b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Mock.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Mock { - class Literal extends AnnotationLiteral implements Mock { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/MockLoginActionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/MockLoginActionBean.java deleted file mode 100644 index 511bb4d30e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/MockLoginActionBean.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -import jakarta.ejb.Stateless; - -@Stateless -@Mock -public class MockLoginActionBean extends LoginActionBean { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Reptile.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Reptile.java deleted file mode 100644 index dfc2db6662..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Reptile.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -public interface Reptile { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/SessionBeanTypesTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/SessionBeanTypesTest.java deleted file mode 100644 index 56e7581eb0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/SessionBeanTypesTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEAN_TYPES; -import static org.jboss.cdi.tck.util.Assert.assertTypeSetMatches; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.util.TypeLiteral; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - * @author Matus Abaffy - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionBeanTypesTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SessionBeanTypesTest.class).build(); - } - - @SuppressWarnings("serial") - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = SESSION_BEAN_TYPES, id = "aa"), - @SpecAssertion(section = SESSION_BEAN_TYPES, id = "ba"), @SpecAssertion(section = SESSION_BEAN_TYPES, id = "c") }) - public void testGenericHierarchyBeanTypes() { - - // Generic class inheritance with abstract class and interface - Bean vultureBean = getUniqueBean(Vulture.class); - assertNotNull(vultureBean); - // Object, Bird, Vulture - assertEquals(vultureBean.getTypes().size(), 3); - assertTypeSetMatches(vultureBean.getTypes(), Object.class, Vulture.class, new TypeLiteral>() { - }.getType()); - - // Generic class inheritance with two interfaces - TypeLiteral> mammalLiteral = new TypeLiteral>() { - }; - Bean> tigerBean = getUniqueBean(mammalLiteral); - assertNotNull(tigerBean); - // Object, Animal, Mammal - assertEquals(tigerBean.getTypes().size(), 3); - assertTypeSetMatches(tigerBean.getTypes(), Object.class, new TypeLiteral>() { - }.getType(), mammalLiteral.getType()); - - // session bean with both local business interface and no-interface view - Bean creatureBean = getUniqueBean(LegendaryCreature.class); - assertNotNull(creatureBean); - // Object, LegendaryCreature, LegendaryLocal, Creature - assertEquals(creatureBean.getTypes().size(), 4); - assertTypeSetMatches(creatureBean.getTypes(), Object.class, LegendaryCreature.class, LegendaryLocal.class, - Creature.class); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = SESSION_BEAN_TYPES, id = "aa"), - @SpecAssertion(section = SESSION_BEAN_TYPES, id = "ba"), @SpecAssertion(section = SESSION_BEAN_TYPES, id = "c") }) - public void testSessionBeanWithBothLocalInterfaceAndNoInterfaceView() { - // session bean with both local business interface and no-interface view - Bean creatureBean = getUniqueBean(LegendaryCreature.class); - assertNotNull(creatureBean); - // Object, LegendaryCreature, LegendaryLocal, Creature - assertEquals(creatureBean.getTypes().size(), 4); - assertTypeSetMatches(creatureBean.getTypes(), Object.class, LegendaryCreature.class, LegendaryLocal.class, - Creature.class); - } - - @SuppressWarnings("serial") - @Test(groups = INTEGRATION) - @SpecAssertion(section = SESSION_BEAN_TYPES, id = "ba") - public void testSessionBeanExtendingSessionBeanWithLocalClientView() { - // no-interface view - Bean loginBean = getUniqueBean(MockLoginActionBean.class, new Mock.Literal()); - assertNotNull(loginBean); - // MockLoginActionBean, LoginActionBean, Object - assertEquals(loginBean.getTypes().size(), 3); - assertTypeSetMatches(loginBean.getTypes(), Object.class, LoginActionBean.class, MockLoginActionBean.class); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = SESSION_BEAN_TYPES, id = "ba") - public void testSessionBeanWithNoInterfaceView() { - Bean cobraBean = getUniqueBean(Cobra.class); - assertNotNull(cobraBean); - assertEquals(cobraBean.getTypes().size(), 3); - assertTypeSetMatches(cobraBean.getTypes(), Object.class, Cobra.class, Snake.class); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Snake.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Snake.java deleted file mode 100644 index 78226e4f04..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Snake.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -public class Snake { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Tiger.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Tiger.java deleted file mode 100644 index c4343f98d3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Tiger.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class Tiger implements Mammal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Vulture.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Vulture.java deleted file mode 100644 index 335729c65d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/Vulture.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class Vulture extends Bird { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Animal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Animal.java deleted file mode 100644 index 21c6c5f2cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Animal.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2017, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise.illegal; - -public interface Animal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/AnimalHolder.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/AnimalHolder.java deleted file mode 100644 index 5883035010..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/AnimalHolder.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2017, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise.illegal; - -public interface AnimalHolder { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/BeanTypesWithIllegalTypeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/BeanTypesWithIllegalTypeTest.java deleted file mode 100644 index b54186bbd0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/BeanTypesWithIllegalTypeTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2017, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise.illegal; - -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEAN_TYPES; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotEquals; - -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; - -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.TestGroups; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@Test(groups = TestGroups.INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class BeanTypesWithIllegalTypeTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(BeanTypesWithIllegalTypeTest.class) - .build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = SESSION_BEAN_TYPES, id = "e") }) - public void sessionBeanTypesContainsOnlyLegalTypes() { - - Bean birdBean = getUniqueBean(Bird.class); - for (Type type : birdBean.getTypes()) { - if (type instanceof ParameterizedType) { - assertNotEquals(((ParameterizedType) type).getRawType(), AnimalHolder.class); - } - } - assertEquals(birdBean.getTypes().size(), 2); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Bird.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Bird.java deleted file mode 100644 index 0e498400f0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Bird.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2017, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise.illegal; - -public interface Bird extends AnimalHolder> { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Eagle.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Eagle.java deleted file mode 100644 index 172591e432..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Eagle.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2017, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise.illegal; - -import jakarta.ejb.Stateless; - -@Stateless -public class Eagle implements Bird { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Produced.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Produced.java deleted file mode 100644 index 800468f5bc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/bean/types/enterprise/illegal/Produced.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2017, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.bean.types.enterprise.illegal; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Produced { - - public static class ProducedLiteral extends AnnotationLiteral implements Produced { - - public static ProducedLiteral INSTANCE = new ProducedLiteral(); - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/BorderCollie.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/BorderCollie.java deleted file mode 100644 index fba80e01b9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/BorderCollie.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -import jakarta.ejb.Stateless; - -@Stateless -public class BorderCollie extends LongHairedDog implements BorderCollieLocal { - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/BorderCollieLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/BorderCollieLocal.java deleted file mode 100644 index 48c92cd6f1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/BorderCollieLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface BorderCollieLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/EnglishBorderCollie.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/EnglishBorderCollie.java deleted file mode 100644 index 4ccdbcbd45..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/EnglishBorderCollie.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -import jakarta.ejb.Stateless; - -@Stateless -public class EnglishBorderCollie extends BorderCollie implements EnglishBorderCollieLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/EnglishBorderCollieLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/EnglishBorderCollieLocal.java deleted file mode 100644 index 6332584b32..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/EnglishBorderCollieLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface EnglishBorderCollieLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/EnterpriseQualifierDefinitionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/EnterpriseQualifierDefinitionTest.java deleted file mode 100644 index c40338fc6e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/EnterpriseQualifierDefinitionTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.TYPE_LEVEL_INHERITANCE_EE; - -import java.lang.annotation.Annotation; -import java.util.Set; - -import jakarta.enterprise.inject.Any; -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseQualifierDefinitionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EnterpriseQualifierDefinitionTest.class).build(); - } - - @SuppressWarnings("unchecked") - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "al") - public void testQualifierDeclaredInheritedIsInherited() throws Exception { - Set qualifiers = getBeans(BorderCollieLocal.class, new HairyQualifier(false)).iterator().next() - .getQualifiers(); - assert annotationSetMatches(qualifiers, Any.class, Hairy.class); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "ala") - public void testQualifierNotDeclaredInheritedIsNotInherited() throws Exception { - assert getBeans(TameSkinnyHairlessCatLocal.class, new SkinnyQualifier()).size() == 0; - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "ap") - public void testQualifierDeclaredInheritedIsIndirectlyInherited() { - Set qualifiers = getBeans(EnglishBorderCollieLocal.class, new HairyQualifier(false)).iterator() - .next().getQualifiers(); - assert annotationSetMatches(qualifiers, Any.class, Hairy.class); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "apa") - public void testQualifierNotDeclaredInheritedIsNotIndirectlyInherited() { - Set> beans = getBeans(FamousCatLocal.class, new SkinnyQualifier()); - assert beans.size() == 0; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/FamousCat.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/FamousCat.java deleted file mode 100644 index 7fdb0388a9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/FamousCat.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -import jakarta.ejb.Stateless; - -@Stateless -public class FamousCat extends TameSkinnyHairlessCat implements FamousCatLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/FamousCatLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/FamousCatLocal.java deleted file mode 100644 index 34b83ee01b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/FamousCatLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface FamousCatLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/Hairless.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/Hairless.java deleted file mode 100644 index 2f17e8c6fb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/Hairless.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -@Inherited -public @interface Hairless { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/HairlessCat.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/HairlessCat.java deleted file mode 100644 index 932ba506da..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/HairlessCat.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -@Hairless -public class HairlessCat { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/HairlessQualifier.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/HairlessQualifier.java deleted file mode 100644 index 3d6daea7b2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/HairlessQualifier.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -import jakarta.enterprise.util.AnnotationLiteral; - -public class HairlessQualifier extends AnnotationLiteral implements Hairless { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/Hairy.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/Hairy.java deleted file mode 100644 index 5d44346d4a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/Hairy.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -@Inherited -public @interface Hairy { - public boolean clipped(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/HairyQualifier.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/HairyQualifier.java deleted file mode 100644 index f48ac9545d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/HairyQualifier.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -import jakarta.enterprise.util.AnnotationLiteral; - -public class HairyQualifier extends AnnotationLiteral implements Hairy { - private boolean clipped; - - public HairyQualifier(boolean clipped) { - this.clipped = clipped; - } - - public boolean clipped() { - return clipped; - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/LongHairedDog.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/LongHairedDog.java deleted file mode 100644 index bd9113a2c6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/LongHairedDog.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -@Hairy(clipped = false) -public class LongHairedDog { - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/Skinny.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/Skinny.java deleted file mode 100644 index ece92322ea..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/Skinny.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Skinny { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/SkinnyHairlessCat.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/SkinnyHairlessCat.java deleted file mode 100644 index 7863f4bb8d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/SkinnyHairlessCat.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -import jakarta.ejb.Stateless; - -@Stateless -@Skinny -public class SkinnyHairlessCat extends HairlessCat implements SkinnyHairlessCatLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/SkinnyHairlessCatLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/SkinnyHairlessCatLocal.java deleted file mode 100644 index 5fef9c51e5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/SkinnyHairlessCatLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface SkinnyHairlessCatLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/SkinnyQualifier.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/SkinnyQualifier.java deleted file mode 100644 index b9ebe9a6e7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/SkinnyQualifier.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -import jakarta.enterprise.util.AnnotationLiteral; - -public class SkinnyQualifier extends AnnotationLiteral implements Skinny { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/TameSkinnyHairlessCat.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/TameSkinnyHairlessCat.java deleted file mode 100644 index 8fd901112c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/TameSkinnyHairlessCat.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -import jakarta.ejb.Stateless; - -@Stateless -public class TameSkinnyHairlessCat extends SkinnyHairlessCat implements TameSkinnyHairlessCatLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/TameSkinnyHairlessCatLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/TameSkinnyHairlessCatLocal.java deleted file mode 100644 index 33ee314885..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/enterprise/TameSkinnyHairlessCatLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.qualifier.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface TameSkinnyHairlessCatLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/SessionBeanTooManyScopesTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/SessionBeanTooManyScopesTest.java deleted file mode 100644 index 4d858c2974..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/SessionBeanTooManyScopesTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.broken.tooManyScopes.ejb; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_BEAN_SCOPE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionBeanTooManyScopesTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(SessionBeanTooManyScopesTest.class) - .withClass(SessionBeanWithTooManyScopeTypes_Broken.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = DECLARING_BEAN_SCOPE, id = "ba") - public void testTooManyScopesSpecifiedInJava() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/SessionBeanWithTooManyScopeTypes_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/SessionBeanWithTooManyScopeTypes_Broken.java deleted file mode 100644 index ed5db209a9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/SessionBeanWithTooManyScopeTypes_Broken.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.broken.tooManyScopes.ejb; - -import jakarta.ejb.Singleton; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.Dependent; - -@ApplicationScoped -@Dependent -@Singleton -public class SessionBeanWithTooManyScopeTypes_Broken { -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/field/SessionBeanProducerFieldTooManyScopesTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/field/SessionBeanProducerFieldTooManyScopesTest.java deleted file mode 100644 index 14995d4623..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/field/SessionBeanProducerFieldTooManyScopesTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.broken.tooManyScopes.ejb.producer.field; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_BEAN_SCOPE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionBeanProducerFieldTooManyScopesTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(SessionBeanProducerFieldTooManyScopesTest.class) - .withClass(SessionBeanProducerFieldWithTooManyScopeTypes_Broken.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = DECLARING_BEAN_SCOPE, id = "bc") - public void testTooManyScopesSpecifiedInJava() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/field/SessionBeanProducerFieldWithTooManyScopeTypes_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/field/SessionBeanProducerFieldWithTooManyScopeTypes_Broken.java deleted file mode 100644 index c2adb390f4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/field/SessionBeanProducerFieldWithTooManyScopeTypes_Broken.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.broken.tooManyScopes.ejb.producer.field; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.ConversationScoped; -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.inject.Produces; - -@Stateful -public class SessionBeanProducerFieldWithTooManyScopeTypes_Broken { - @Produces - @SessionScoped - @ConversationScoped - @Word - public static String word = "producer_field"; -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/field/Word.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/field/Word.java deleted file mode 100644 index ed38b45d42..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/field/Word.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.broken.tooManyScopes.ejb.producer.field; - -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.Retention; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Qualifier -public @interface Word { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/method/SessionBeanProducerMethodTooManyScopesTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/method/SessionBeanProducerMethodTooManyScopesTest.java deleted file mode 100644 index 42ab9af7d6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/method/SessionBeanProducerMethodTooManyScopesTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.broken.tooManyScopes.ejb.producer.method; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_BEAN_SCOPE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionBeanProducerMethodTooManyScopesTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(SessionBeanProducerMethodTooManyScopesTest.class) - .withClass(SessionBeanProducerMethodWithTooManyScopeTypes_Broken.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = DECLARING_BEAN_SCOPE, id = "bb") - public void testTooManyScopesSpecifiedInJava() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/method/SessionBeanProducerMethodWithTooManyScopeTypes_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/method/SessionBeanProducerMethodWithTooManyScopeTypes_Broken.java deleted file mode 100644 index eb897d4e69..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/method/SessionBeanProducerMethodWithTooManyScopeTypes_Broken.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.broken.tooManyScopes.ejb.producer.method; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.context.ConversationScoped; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Stateless -public class SessionBeanProducerMethodWithTooManyScopeTypes_Broken { - @Produces - @ConversationScoped - @Dependent - @Word - public static String getWord() { - return "producer_method"; - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/method/Word.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/method/Word.java deleted file mode 100644 index 5f28f3178d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/broken/tooManyScopes/ejb/producer/method/Word.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.broken.tooManyScopes.ejb.producer.method; - -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.Retention; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Qualifier -public @interface Word { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BengalTiger.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BengalTiger.java deleted file mode 100644 index 36926d6cca..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BengalTiger.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class BengalTiger extends Tiger implements BengalTigerLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BengalTigerLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BengalTigerLocal.java deleted file mode 100644 index d63c5883b5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BengalTigerLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface BengalTigerLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BorderCollie.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BorderCollie.java deleted file mode 100644 index e77f95923e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BorderCollie.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class BorderCollie extends Dog implements BorderCollieLocal { - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BorderCollieLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BorderCollieLocal.java deleted file mode 100644 index e5ef2f98cb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/BorderCollieLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface BorderCollieLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Cat.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Cat.java deleted file mode 100644 index 0046734b7c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Cat.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.enterprise; - -@FooScoped -public class Cat { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Dog.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Dog.java deleted file mode 100644 index dfb3c4f179..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Dog.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.enterprise; - -import jakarta.enterprise.context.RequestScoped; - -@RequestScoped -public class Dog { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/EnglishBorderCollie.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/EnglishBorderCollie.java deleted file mode 100644 index 24a9ffe160..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/EnglishBorderCollie.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class EnglishBorderCollie extends BorderCollie implements EnglishBorderCollieLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/EnglishBorderCollieLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/EnglishBorderCollieLocal.java deleted file mode 100644 index 7626210313..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/EnglishBorderCollieLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface EnglishBorderCollieLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/EnterpriseScopeDefinitionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/EnterpriseScopeDefinitionTest.java deleted file mode 100644 index a1bbb04e08..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/EnterpriseScopeDefinitionTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.TYPE_LEVEL_INHERITANCE_EE; - -import jakarta.enterprise.context.RequestScoped; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseScopeDefinitionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EnterpriseScopeDefinitionTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "be") - public void testScopeTypeDeclaredInheritedIsInherited() throws Exception { - assert getBeans(BorderCollieLocal.class).iterator().next().getScope().equals(RequestScoped.class); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "bea") - public void testScopeTypeNotDeclaredInheritedIsNotInherited() throws Exception { - assert !getBeans(SiameseLocal.class).iterator().next().getScope().equals(FooScoped.class); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "bh") - public void testScopeTypeDeclaredInheritedIsIndirectlyInherited() { - assert getBeans(EnglishBorderCollieLocal.class).iterator().next().getScope().equals(RequestScoped.class); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "bha") - public void testScopeTypeNotDeclaredInheritedIsNotIndirectlyInherited() { - assert !getBeans(BengalTigerLocal.class).iterator().next().getScope().equals(FooScoped.class); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/FooScoped.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/FooScoped.java deleted file mode 100644 index e9edf7659c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/FooScoped.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.enterprise; - -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.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.context.NormalScope; - -@Target({ TYPE, METHOD, FIELD }) -@Retention(RUNTIME) -@Documented -@NormalScope -public @interface FooScoped { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Siamese.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Siamese.java deleted file mode 100644 index 5d210bea31..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Siamese.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class Siamese extends Cat implements SiameseLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/SiameseLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/SiameseLocal.java deleted file mode 100644 index cc9f406303..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/SiameseLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface SiameseLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Tiger.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Tiger.java deleted file mode 100644 index 0018dbe747..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/scope/enterprise/Tiger.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.scope.enterprise; - -public class Tiger extends Cat { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/AbstractService.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/AbstractService.java deleted file mode 100644 index eac37bf666..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/AbstractService.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.stereotype.alternative.enterprise; - -public abstract class AbstractService implements Service { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/EnterpriseStereotypeAlternativeSpecializeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/EnterpriseStereotypeAlternativeSpecializeTest.java deleted file mode 100644 index 32d98bc6e1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/EnterpriseStereotypeAlternativeSpecializeTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.stereotype.alternative.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_SELECTED_ALTERNATIVES_APPLICATION_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - * - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseStereotypeAlternativeSpecializeTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(EnterpriseStereotypeAlternativeSpecializeTest.class) - .withClasses(Mock.class, Service.class, MockService.class, RealService.class, AbstractService.class) - .withBeansXml(new BeansXml().stereotype(Mock.class)) - .build(); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_APPLICATION_EE, id = "a") }) - public void testStereotypeAlternative(Service service) { - assertNotNull(service); - assertEquals(service.ping(), MockService.class.getName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/EnterpriseStereotypeAlternativeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/EnterpriseStereotypeAlternativeTest.java deleted file mode 100644 index f6535ed947..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/EnterpriseStereotypeAlternativeTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.stereotype.alternative.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_SELECTED_ALTERNATIVES_APPLICATION_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - * - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseStereotypeAlternativeTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(EnterpriseStereotypeAlternativeTest.class) - .withClasses(Mock.class, SimpleAlternativeService.class, Service.class) - .withBeansXml(new BeansXml().stereotype(Mock.class)) - .build(); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_APPLICATION_EE, id = "a") }) - public void testStereotypeAlternative(Service service) { - assertNotNull(service); - assertEquals(service.ping(), SimpleAlternativeService.class.getName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/Mock.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/Mock.java deleted file mode 100644 index 8ae04bba30..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/Mock.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.alternative.enterprise; - -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 jakarta.enterprise.inject.Alternative; -import jakarta.enterprise.inject.Stereotype; - -@Stereotype -@Alternative -@Target({ TYPE, METHOD, FIELD }) -@Retention(RUNTIME) -public @interface Mock { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/MockService.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/MockService.java deleted file mode 100644 index b33495e884..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/MockService.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.stereotype.alternative.enterprise; - -import jakarta.ejb.Local; -import jakarta.ejb.Singleton; -import jakarta.enterprise.inject.Specializes; - -@Mock -@Singleton -@Local(Service.class) -@Specializes -public class MockService extends RealService { - - @Override - public String ping() { - return MockService.class.getName(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/RealService.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/RealService.java deleted file mode 100644 index 63652bfea9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/RealService.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.stereotype.alternative.enterprise; - -import jakarta.ejb.Local; -import jakarta.ejb.Singleton; - -@Singleton -@Local(Service.class) -public class RealService extends AbstractService { - - @Override - public String ping() { - return RealService.class.getName(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/Service.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/Service.java deleted file mode 100644 index 5520075315..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/Service.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.stereotype.alternative.enterprise; - -public interface Service { - - public String ping(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/SimpleAlternativeService.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/SimpleAlternativeService.java deleted file mode 100644 index 976db94489..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/alternative/enterprise/SimpleAlternativeService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.definition.stereotype.alternative.enterprise; - -import jakarta.ejb.Stateless; - -@Mock -@Stateless -public class SimpleAlternativeService implements Service { - - @Override - public String ping() { - return SimpleAlternativeService.class.getName(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Animal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Animal.java deleted file mode 100644 index 2b6c8210fd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Animal.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -public interface Animal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/AnimalStereotype.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/AnimalStereotype.java deleted file mode 100644 index 88cc92330f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/AnimalStereotype.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.Stereotype; - -@Stereotype -@Target({ TYPE, METHOD, FIELD }) -@Retention(RUNTIME) -@RequestScoped -@Inherited -public @interface AnimalStereotype { - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Barracuda.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Barracuda.java deleted file mode 100644 index 86191d29f5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Barracuda.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class Barracuda extends Fish implements BarracudaLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/BarracudaLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/BarracudaLocal.java deleted file mode 100644 index 7d23bdf3e5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/BarracudaLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface BarracudaLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/BorderCollie.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/BorderCollie.java deleted file mode 100644 index 65c83f1943..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/BorderCollie.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class BorderCollie extends LongHairedDog implements BorderCollieLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/BorderCollieLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/BorderCollieLocal.java deleted file mode 100644 index fb04989b77..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/BorderCollieLocal.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -public interface BorderCollieLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Chihuahua.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Chihuahua.java deleted file mode 100644 index 5bb45083ce..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Chihuahua.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class Chihuahua extends ShortHairedDog implements ChihuahuaLocal { - - /** - * - */ - private static final long serialVersionUID = -9140665279312580651L; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/ChihuahuaLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/ChihuahuaLocal.java deleted file mode 100644 index 06943f085b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/ChihuahuaLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface ChihuahuaLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/EnglishBorderCollie.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/EnglishBorderCollie.java deleted file mode 100644 index 512988da2f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/EnglishBorderCollie.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class EnglishBorderCollie extends BorderCollie implements EnglishBorderCollieLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/EnglishBorderCollieLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/EnglishBorderCollieLocal.java deleted file mode 100644 index b998d5aff8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/EnglishBorderCollieLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface EnglishBorderCollieLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java deleted file mode 100644 index bca2266ab1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.TYPE_LEVEL_INHERITANCE_EE; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.context.SessionScoped; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseStereotypeDefinitionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EnterpriseStereotypeDefinitionTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "am") - public void testStereotypeDeclaredInheritedIsInherited() throws Exception { - assert getBeans(BorderCollieLocal.class).iterator().next().getScope().equals(RequestScoped.class); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "ama") - public void testStereotypeNotDeclaredInheritedIsNotInherited() throws Exception { - assert !getBeans(BarracudaLocal.class).iterator().next().getScope().equals(RequestScoped.class); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "aq") - public void testStereotypeDeclaredInheritedIsIndirectlyInherited() { - assert getBeans(EnglishBorderCollieLocal.class).iterator().next().getScope().equals(RequestScoped.class); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "aqa") - public void testStereotypeNotDeclaredInheritedIsNotIndirectlyInherited() { - assert !getBeans(TameBarracudaLocal.class).iterator().next().getScope().equals(RequestScoped.class); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "hhj") - public void testStereotypeScopeIsOverriddenByInheritedScope() { - assert getBeans(ChihuahuaLocal.class).iterator().next().getScope().equals(SessionScoped.class); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "hhk") - public void testStereotypeScopeIsOverriddenByIndirectlyInheritedScope() { - assert getBeans(MexicanChihuahuaLocal.class).iterator().next().getScope().equals(SessionScoped.class); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Fish.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Fish.java deleted file mode 100644 index cf14326c18..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/Fish.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -@FishStereotype -public class Fish { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/FishStereotype.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/FishStereotype.java deleted file mode 100644 index 57f0b9f058..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/FishStereotype.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -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 jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.Stereotype; - -@Stereotype -@Target({ TYPE, METHOD, FIELD }) -@Retention(RUNTIME) -@RequestScoped -public @interface FishStereotype { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/LongHairedDog.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/LongHairedDog.java deleted file mode 100644 index 841fdc853b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/LongHairedDog.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -@AnimalStereotype -public class LongHairedDog implements Animal { - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/MexicanChihuahua.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/MexicanChihuahua.java deleted file mode 100644 index f5103146cc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/MexicanChihuahua.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class MexicanChihuahua extends Chihuahua implements MexicanChihuahuaLocal { - - /** - * - */ - private static final long serialVersionUID = 6851776906570623607L; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/MexicanChihuahuaLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/MexicanChihuahuaLocal.java deleted file mode 100644 index 4db6fce31c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/MexicanChihuahuaLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface MexicanChihuahuaLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/ShortHairedDog.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/ShortHairedDog.java deleted file mode 100644 index ffa5e3d41b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/ShortHairedDog.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -import java.io.Serializable; - -import jakarta.enterprise.context.SessionScoped; - -@AnimalStereotype -@SessionScoped -public class ShortHairedDog implements Animal, Serializable { - - /** - * - */ - private static final long serialVersionUID = 8316028446413430833L; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/TameBarracuda.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/TameBarracuda.java deleted file mode 100644 index b8bcba4bbf..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/TameBarracuda.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class TameBarracuda extends Barracuda implements TameBarracudaLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/TameBarracudaLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/TameBarracudaLocal.java deleted file mode 100644 index 6ea10a63de..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/enterprise/TameBarracudaLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface TameBarracudaLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/AlphaBinding.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/AlphaBinding.java deleted file mode 100644 index b76c264b7a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/AlphaBinding.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.interceptor.enterprise; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Documented -@Inherited -@InterceptorBinding -public @interface AlphaBinding { -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/AlphaInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/AlphaInterceptor.java deleted file mode 100644 index a227b21752..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/AlphaInterceptor.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.interceptor.enterprise; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@AlphaBinding -@Interceptor -public class AlphaInterceptor { - - public static boolean intercepted = false; - - @AroundInvoke - public Object intercept(InvocationContext ctx) throws Exception { - intercepted = true; - return ctx.proceed(); - } - - public static void reset() { - intercepted = false; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/AlphaStereotype.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/AlphaStereotype.java deleted file mode 100644 index 8990269f78..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/AlphaStereotype.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.interceptor.enterprise; - -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 jakarta.enterprise.inject.Stereotype; - -@AlphaBinding -@Stereotype -@Target({ TYPE, METHOD, FIELD }) -@Retention(RUNTIME) -public @interface AlphaStereotype { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/EnterpriseStereotypeInterceptorBindingTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/EnterpriseStereotypeInterceptorBindingTest.java deleted file mode 100644 index 093c234d36..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/EnterpriseStereotypeInterceptorBindingTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.interceptor.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.INTERCEPTORS_EE; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseStereotypeInterceptorBindingTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(EnterpriseStereotypeInterceptorBindingTest.class) - .withBeansXml(new BeansXml().interceptors(AlphaInterceptor.class)).build(); - } - - @Inject - Foo foo; - - @Test - @SpecAssertions({ @SpecAssertion(section = INTERCEPTORS_EE, id = "b") }) - public void testStereotypeInterceptorBindings() { - AlphaInterceptor.reset(); - foo.ping(); - Assert.assertTrue(AlphaInterceptor.intercepted); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/Foo.java deleted file mode 100644 index 3ffc5b07cf..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/definition/stereotype/interceptor/enterprise/Foo.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.definition.stereotype.interceptor.enterprise; - -import jakarta.ejb.Stateless; - -@AlphaStereotype -@Stateless -public class Foo { - - public void ping() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Alpha.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Alpha.java deleted file mode 100644 index 06efac137e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Alpha.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class Alpha implements AlphaLocal { - - @Override - public void pong() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/AlphaLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/AlphaLocal.java deleted file mode 100644 index ad5a9dbaa5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/AlphaLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface AlphaLocal extends Ping { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Bravo.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Bravo.java deleted file mode 100644 index ba2c9a1b1f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Bravo.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class Bravo implements BravoLocal { - - @Override - public void pong() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/BravoLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/BravoLocal.java deleted file mode 100644 index 0027bb3ef8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/BravoLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface BravoLocal extends Ping { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Charlie.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Charlie.java deleted file mode 100644 index e7a4f4972e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Charlie.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class Charlie implements CharlieLocal { - - @Override - public void pong() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/CharlieLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/CharlieLocal.java deleted file mode 100644 index 1e9ee29e20..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/CharlieLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface CharlieLocal extends Ping { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Delta.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Delta.java deleted file mode 100644 index fc4c95af05..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Delta.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class Delta implements DeltaLocal { - - @Override - public void pong() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/DeltaLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/DeltaLocal.java deleted file mode 100644 index 4ea0d5aeb8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/DeltaLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface DeltaLocal extends Ping { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Echo.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Echo.java deleted file mode 100644 index 18dc748c02..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Echo.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class Echo implements EchoLocal { - - @Override - public void pong() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/EchoLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/EchoLocal.java deleted file mode 100644 index aea92b4173..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/EchoLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface EchoLocal extends Ping { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/EnterpriseBeanDiscoveryTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/EnterpriseBeanDiscoveryTest.java deleted file mode 100644 index c3a7be7000..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/EnterpriseBeanDiscoveryTest.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_DEFINING_ANNOTATIONS; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_DISCOVERY_STEPS_EE; -import static org.jboss.cdi.tck.cdi.Sections.DEFAULT_BEAN_DISCOVERY_EE; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.inject.spi.Extension; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.beans11.BeanDiscoveryMode; -import org.jboss.shrinkwrap.descriptor.api.beans11.BeansDescriptor; -import org.jboss.shrinkwrap.descriptor.api.spec.se.manifest.ManifestDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseBeanDiscoveryTest extends AbstractTest { - - private static final String ALPHA_JAR = "alpha.jar"; - private static final String BRAVO_JAR = "bravo.jar"; - private static final String CHARLIE_JAR = "charlie.jar"; - private static final String DELTA_JAR = "delta.jar"; - private static final String ECHO_JAR = "echo.jar"; - private static final String FOXTROT_JAR = "foxtrot.jar"; - private static final String LEGACY_JAR = "legacy.jar"; - - @Deployment - public static EnterpriseArchive createTestArchive() { - - // 1.1 version beans.xml with bean-discovery-mode of all - JavaArchive alpha = ShrinkWrap - .create(JavaArchive.class, ALPHA_JAR) - .addClasses(Alpha.class, AlphaLocal.class) - .addAsManifestResource( - new StringAsset(Descriptors.create(BeansDescriptor.class) - .beanDiscoveryMode(BeanDiscoveryMode._ALL.toString()).exportAsString()), - "beans.xml"); - // Empty beans.xml - JavaArchive bravo = ShrinkWrap.create(JavaArchive.class, BRAVO_JAR).addClasses(Bravo.class, BravoLocal.class) - .addAsManifestResource(new StringAsset(""), "beans.xml"); - // No version beans.xml - JavaArchive charlie = ShrinkWrap - .create(JavaArchive.class, CHARLIE_JAR) - .addClasses(Charlie.class, CharlieLocal.class) - .addAsManifestResource(new StringAsset(Descriptors.create(BeansDescriptor.class).exportAsString()), - "beans.xml"); - // Session bean and no beans.xml - JavaArchive delta = ShrinkWrap.create(JavaArchive.class, DELTA_JAR).addClasses(Delta.class, DeltaLocal.class); - // Session bean and 1.1 version beans.xml with bean-discovery-mode of annotated - JavaArchive echo = ShrinkWrap - .create(JavaArchive.class, ECHO_JAR) - .addClasses(Echo.class, EchoLocal.class) - .addAsManifestResource( - new StringAsset(Descriptors.create(BeansDescriptor.class) - .beanDiscoveryMode(BeanDiscoveryMode._ANNOTATED.toString()).exportAsString()), - "beans.xml"); - // Session bean and 1.1 version beans.xml with bean-discovery-mode of none - JavaArchive foxtrot = ShrinkWrap - .create(JavaArchive.class, FOXTROT_JAR) - .addClasses(Foxtrot.class, FoxtrotLocal.class) - .addAsManifestResource( - new StringAsset(Descriptors.create(BeansDescriptor.class) - .beanDiscoveryMode(BeanDiscoveryMode._NONE.toString()).exportAsString()), - "beans.xml"); - - // Archive which contains an extension and no beans.xml file - not a bean archive - JavaArchive legacy = ShrinkWrap.create(JavaArchive.class, LEGACY_JAR) - .addClasses(LegacyExtension.class, LegacyBean.class) - .addAsServiceProvider(Extension.class, LegacyExtension.class); - - WebArchive webArchive = new WebArchiveBuilder() - .withClasses(EnterpriseBeanDiscoveryTest.class) - .notTestArchive() - .build() - .setManifest( - new StringAsset(Descriptors.create(ManifestDescriptor.class) - .addToClassPath(EnterpriseArchiveBuilder.DEFAULT_EJB_MODULE_NAME).addToClassPath(ALPHA_JAR) - .addToClassPath(BRAVO_JAR).addToClassPath(CHARLIE_JAR).addToClassPath(DELTA_JAR) - .addToClassPath(ECHO_JAR).addToClassPath(FOXTROT_JAR).addToClassPath(LEGACY_JAR) - .exportAsString())); - - return new EnterpriseArchiveBuilder().noDefaultWebModule().withTestClassDefinition(EnterpriseBeanDiscoveryTest.class) - .withClasses(VerifyingExtension.class).withExtension(VerifyingExtension.class).withLibrary(Ping.class).build() - .addAsModules(webArchive, alpha, bravo, charlie, delta, echo, foxtrot, legacy); - } - - @Inject - VerifyingExtension extension; - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "ba"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "tc") }) - public void testExplicitBeanArchiveModeAll() { - assertDiscoveredAndAvailable(AlphaLocal.class, Alpha.class); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "bb"), - @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "bc"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "tc") }) - public void testExplicitBeanArchiveEmptyDescriptor() { - assertDiscoveredAndAvailable(BravoLocal.class, Bravo.class); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "bc"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "tc") }) - public void testExplicitBeanArchiveLegacyDescriptor() { - assertDiscoveredAndAvailable(CharlieLocal.class, Charlie.class); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = DEFAULT_BEAN_DISCOVERY_EE, id = "a"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "tc"), - @SpecAssertion(section = BEAN_DEFINING_ANNOTATIONS, id = "ba") }) - public void testImplicitBeanArchiveNoDescriptor() { - assertDiscoveredAndAvailable(DeltaLocal.class, Delta.class); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = DEFAULT_BEAN_DISCOVERY_EE, id = "a"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "tc"), - @SpecAssertion(section = BEAN_DEFINING_ANNOTATIONS, id = "ba") }) - public void testImplicitBeanArchiveModeAnnotated() { - assertDiscoveredAndAvailable(EchoLocal.class, Echo.class); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "oa"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "tc") }) - public void testNoBeanArchiveModeNone() { - assertNotDiscoveredAndNotAvailable(FoxtrotLocal.class, Foxtrot.class); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "ob") }) - public void testNotBeanArchiveExtension() { - assertNotDiscoveredAndNotAvailable(LegacyBean.class, LegacyBean.class); - } - - private void assertDiscoveredAndAvailable(Class beanType, Class beanClazz) { - T instance = getContextualReference(beanType); - assertNotNull(instance); - assertTrue(extension.getObservedAnnotatedTypes().contains(beanClazz)); - instance.pong(); - } - - private void assertNotDiscoveredAndNotAvailable(Class beanType, Class beanClazz) { - assertFalse(extension.getObservedAnnotatedTypes().contains(beanClazz)); - assertTrue(getBeans(beanType).isEmpty()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Foxtrot.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Foxtrot.java deleted file mode 100644 index aa496f30b6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Foxtrot.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class Foxtrot implements FoxtrotLocal { - - @Override - public void pong() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/FoxtrotLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/FoxtrotLocal.java deleted file mode 100644 index f551504a31..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/FoxtrotLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface FoxtrotLocal extends Ping { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/LegacyBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/LegacyBean.java deleted file mode 100644 index 43c934326a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/LegacyBean.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import jakarta.ejb.Stateless; - -@Stateless -public class LegacyBean implements Ping { - - @Override - public void pong() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/LegacyExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/LegacyExtension.java deleted file mode 100644 index b662b655cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/LegacyExtension.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AfterTypeDiscovery; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.Extension; - -public class LegacyExtension implements Extension { - - public void observeBeforeBeanDiscovery(@Observes AfterTypeDiscovery event, BeanManager beanManager) { - // Do nothing - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Ping.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Ping.java deleted file mode 100644 index 6e51d07df4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/Ping.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -public interface Ping { - - public void pong(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/VerifyingExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/VerifyingExtension.java deleted file mode 100644 index a0a72d624e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/VerifyingExtension.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise; - -import java.util.ArrayList; -import java.util.List; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessAnnotatedType; - -public class VerifyingExtension implements Extension { - - private List> observedAnnotatedTypes = new ArrayList>(); - - public void observeProcessAnnotatedType(@Observes ProcessAnnotatedType event) { - observedAnnotatedTypes.add(event.getAnnotatedType().getJavaClass()); - } - - public List> getObservedAnnotatedTypes() { - return observedAnnotatedTypes; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/Apple.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/Apple.java deleted file mode 100644 index 8512fa747e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/Apple.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise.annotated; - -public class Apple { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/AppleTree.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/AppleTree.java deleted file mode 100644 index 3574b9879b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/AppleTree.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise.annotated; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.Disposes; -import jakarta.enterprise.inject.Produces; - -@Stateless -public class AppleTree implements AppleTreeLocal { - - @Produces - static Apple apple = new Apple(); - - @Produces - public Apple produceApple() { - return new Apple(); - } - - public void eatApple(@Disposes Apple apple) { - - } - - public void fallDown(@Observes Apple apple) { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/AppleTreeLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/AppleTreeLocal.java deleted file mode 100644 index 0bd3923814..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/AppleTreeLocal.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise.annotated; - -import jakarta.ejb.Local; - -@Local -public interface AppleTreeLocal { - - Apple produceApple(); - - void eatApple(Apple apple); - - void fallDown(Apple apple); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/EnterpriseDefaultBeanDiscoveryModeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/EnterpriseDefaultBeanDiscoveryModeTest.java deleted file mode 100644 index cb9fa4186e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/EnterpriseDefaultBeanDiscoveryModeTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise.annotated; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.DEFAULT_BEAN_DISCOVERY_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import java.util.Set; - -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.ObserverMethod; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.BeansXmlVersion; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@Test(groups = { JAVAEE_FULL, INTEGRATION }) -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseDefaultBeanDiscoveryModeTest extends AbstractTest { - - @Inject - TestExtension extension; - - @Inject - BeanManager beanManager; - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EnterpriseDefaultBeanDiscoveryModeTest.class) - .withBeansXml(new BeansXml() - .setBeansXmlVersion(BeansXmlVersion.v11) - .setBeanDiscoveryMode(BeanDiscoveryMode.ANNOTATED) - ) - .withExtension(TestExtension.class).build(); - } - - @Test - @SpecAssertion(section = DEFAULT_BEAN_DISCOVERY_EE, id = "b") - public void testProducerMethodDiscovered() { - assertNotNull(extension.getProducerMethod()); - } - - @Test - @SpecAssertion(section = DEFAULT_BEAN_DISCOVERY_EE, id = "c") - public void testProducerFieldDiscovered() { - assertNotNull(extension.getProducerField()); - } - - @Test - @SpecAssertion(section = DEFAULT_BEAN_DISCOVERY_EE, id = "d") - public void testDisposerMethodDiscovered() { - assertNotNull(extension.getDisposesParam()); - } - - @Test - @SpecAssertion(section = DEFAULT_BEAN_DISCOVERY_EE, id = "e") - public void testObserverMethodDiscovered() { - Set> observers = beanManager.resolveObserverMethods(new Apple()); - assertEquals(observers.size(), 1); - assertEquals(observers.iterator().next().getBeanClass(), AppleTree.class); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/TestExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/TestExtension.java deleted file mode 100644 index 5817f88b3b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/enterprise/annotated/TestExtension.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.enterprise.annotated; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AnnotatedField; -import jakarta.enterprise.inject.spi.AnnotatedMethod; -import jakarta.enterprise.inject.spi.AnnotatedParameter; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessProducerField; -import jakarta.enterprise.inject.spi.ProcessProducerMethod; - -public class TestExtension implements Extension { - - private AnnotatedParameter disposesParam; - private AnnotatedMethod producerMethod; - private AnnotatedField producerField; - - public void observeProcessProduceMethod(@Observes ProcessProducerMethod event) { - producerMethod = event.getAnnotatedProducerMethod(); - disposesParam = event.getAnnotatedDisposedParameter(); - - } - - public void observeProcessObserverMethod(@Observes ProcessProducerField event) { - producerField = event.getAnnotatedProducerField(); - } - - public AnnotatedParameter getDisposesParam() { - return disposesParam; - } - - public AnnotatedMethod getProducerMethod() { - return producerMethod; - } - - public AnnotatedField getProducerField() { - return producerField; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/DefaultBeanDiscoveryModeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/DefaultBeanDiscoveryModeTest.java deleted file mode 100644 index b9b3aa5a3f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/DefaultBeanDiscoveryModeTest.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.implicit; - -import static org.jboss.cdi.tck.cdi.Sections.DEFAULT_BEAN_DISCOVERY; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNull; - -import java.util.Set; - -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.ObserverMethod; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.TestGroups; -import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Tomas Remes - */ -@SpecVersion(spec = "cdi", version = "2.0") -@Test(groups = TestGroups.INTEGRATION) -public class DefaultBeanDiscoveryModeTest extends AbstractTest { - - @Inject - BeanManager beanManager; - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withBeansXml(new BeansXml(BeanDiscoveryMode.ANNOTATED)) - .withTestClass(DefaultBeanDiscoveryModeTest.class) - .withExtension(TestExtension.class) - .withPackage(DefaultBeanDiscoveryModeTest.class.getPackage()).build(); - } - - @Test - @SpecAssertion(id = "a", section = DEFAULT_BEAN_DISCOVERY) - public void beanClassesNotDiscoveredTest() { - Set> beans = beanManager.getBeans(NotDiscoveredBean.class); - assertEquals(beans.size(), 0); - } - - @Test - @SpecAssertion(id = "b", section = DEFAULT_BEAN_DISCOVERY) - public void producerMethodNotDiscovered() { - assertEquals(TestExtension.processProducerMethodCounter.get(), 0); - } - - @Test - @SpecAssertion(id = "c", section = DEFAULT_BEAN_DISCOVERY) - public void producerFieldNotDiscovered() { - assertEquals(TestExtension.processProducerFieldCounter.get(), 0); - } - - @Test - @SpecAssertion(id = "d", section = DEFAULT_BEAN_DISCOVERY) - public void disposerMethodNotDiscovered() { - assertNull(TestExtension.disposerParam); - assertFalse(NotDiscoveredBean.disposerCalled); - } - - @Test - @SpecAssertion(id = "e", section = DEFAULT_BEAN_DISCOVERY) - public void observerMethodNotDiscovered() { - Set> observerMethods = beanManager.resolveObserverMethods(new ProducedBean()); - assertEquals(observerMethods.size(), 0); - assertEquals(TestExtension.processObserverCounter.get(), 0); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/DummyBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/DummyBean.java deleted file mode 100644 index 9e88adfdf8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/DummyBean.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2018, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.implicit; - -import jakarta.enterprise.context.ApplicationScoped; - -/** - * This bean has bean defining annotation hence is picked up in implicit archive. - * It serves no other purpose and is not used in the tests. - * - * @author Matej Novotny - */ -@ApplicationScoped -public class DummyBean { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/NotDiscoveredBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/NotDiscoveredBean.java deleted file mode 100644 index ac43b361c5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/NotDiscoveredBean.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.implicit; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.Disposes; -import jakarta.enterprise.inject.Produces; - -public class NotDiscoveredBean { - - public static boolean disposerCalled = false; - - @Produces - public ProducedBean producedBean = new ProducedBean(); - - @Produces - public ProducedBean create() { - return new ProducedBean(); - } - - public void observer(@Observes ProducedBean message) { - } - - public void dispose(@Disposes ProducedBean bean) { - disposerCalled = true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/ProducedBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/ProducedBean.java deleted file mode 100644 index b0c5c42b8c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/ProducedBean.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.implicit; - -public class ProducedBean { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/TestExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/TestExtension.java deleted file mode 100644 index 36a0632855..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/discovery/implicit/TestExtension.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.discovery.implicit; - -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AnnotatedParameter; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessObserverMethod; -import jakarta.enterprise.inject.spi.ProcessProducerField; -import jakarta.enterprise.inject.spi.ProcessProducerMethod; - -public class TestExtension implements Extension { - - public static AtomicInteger processProducerMethodCounter = new AtomicInteger(); - public static AtomicInteger processProducerFieldCounter = new AtomicInteger(); - public static AtomicInteger processObserverCounter = new AtomicInteger(); - public static AnnotatedParameter disposerParam; - - public void processProducerMethod(@Observes ProcessProducerMethod event) { - processProducerMethodCounter.incrementAndGet(); - disposerParam = event.getAnnotatedDisposedParameter(); - } - - public void processProducerField(@Observes ProcessProducerField event) { - processProducerFieldCounter.incrementAndGet(); - } - - public void processObserverMethod(@Observes ProcessObserverMethod event) { - processObserverCounter.incrementAndGet(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Bar.java deleted file mode 100644 index 14c1ad81b8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Bar.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.bundledLibrary; - -import jakarta.enterprise.context.Dependent; - -/** - * @author pmuir - * - */ -@Dependent -public class Bar { - - public int ping() { - return 1; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Baz.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Baz.java deleted file mode 100644 index c6f06ec44a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Baz.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.bundledLibrary; - -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; - -/** - * Injects bar from bean archive - EAR lib. - */ -@Stateless -public class Baz { - - @Inject - private Bar bar; - - public int ping() { - return bar.ping(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Foo.java deleted file mode 100644 index 4196ceca28..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Foo.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.bundledLibrary; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -/** - * @author pmuir - * - */ -@Dependent -public class Foo { - - @Inject - private Bar bar; - - public int ping() { - return bar.ping(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/LibraryInEarTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/LibraryInEarTest.java deleted file mode 100644 index 43321d132b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/LibraryInEarTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.bundledLibrary; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; -import static org.testng.Assert.assertEquals; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Tests related to the final deployment phase of the lifecycle. - * - * Note that we DO NOT include test class in EJB module since we wouldn't be able to inject bean from web module (Java EE - * classloading requirements)! - * - * @author David Allen - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class LibraryInEarTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(LibraryInEarTest.class).withClasses(Baz.class).withBeanLibrary(Bar.class).build(); - - WebArchive webArchive = new WebArchiveBuilder().notTestArchive().withName("test.war") - .withClasses(LibraryInEarTest.class, Foo.class).withDefaultEjbModuleDependency().build(); - enterpriseArchive.addAsModule(webArchive); - - return enterpriseArchive; - } - - @Inject - Baz baz; - - @Inject - Foo foo; - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jb") }) - public void test() { - - assertEquals(getCurrentManager().getBeans(Foo.class).size(), 1); - assertEquals(getCurrentManager().getBeans(Bar.class).size(), 1); - assertEquals(getCurrentManager().getBeans(Baz.class).size(), 1); - - // Bean in EJB module can inject bean from EAR library - assertEquals(baz.ping(), 1); - // Bean in WAR classes can inject bean from EAR library - assertEquals(foo.ping(), 1); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/LibraryInWarTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/LibraryInWarTest.java deleted file mode 100644 index a3a40c4841..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/LibraryInWarTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.bundledLibrary; - -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; -import static org.testng.Assert.assertEquals; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Tests related to the final deployment phase of the lifecycle. - * - * @author David Allen - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class LibraryInWarTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(LibraryInWarTest.class).withClasses(Foo.class).withBeanLibrary(Bar.class) - .build(); - } - - @Inject - Foo foo; - - @Test(groups = {}) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jh") }) - public void test() { - assertEquals(getCurrentManager().getBeans(Foo.class).size(), 1); - assertEquals(getCurrentManager().getBeans(Bar.class).size(), 1); - - // Bean in WAR classes can inject bean from WAR library - assertEquals(foo.ping(), 1); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/LibraryMissingBeansXmlTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/LibraryMissingBeansXmlTest.java deleted file mode 100644 index 101e13c4c0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/LibraryMissingBeansXmlTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.bundledLibrary; - -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Tests related to the final deployment phase of the lifecycle. - * - * @author David Allen - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class LibraryMissingBeansXmlTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(LibraryMissingBeansXmlTest.class).withClasses(Foo.class, Bar.class) - .withLibrary(Unlucky.class).build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jh") }) - public void test() { - assertEquals(getCurrentManager().getBeans(Foo.class).size(), 1); - assertTrue(getCurrentManager().getBeans(Unlucky.class).isEmpty()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Unlucky.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Unlucky.java deleted file mode 100644 index 4447b75b62..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/bundledLibrary/Unlucky.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.bundledLibrary; - -public class Unlucky { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/BarBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/BarBean.java deleted file mode 100644 index 01ac41fb2d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/BarBean.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.ear; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Dependent -public class BarBean { - - @Inject - private BarExtension extension; - - public BarExtension getExtension() { - return extension; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/BarExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/BarExtension.java deleted file mode 100644 index 1776e689b0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/BarExtension.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.ear; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.BeforeBeanDiscovery; -import jakarta.enterprise.inject.spi.Extension; - -import org.jboss.cdi.tck.util.SimpleLogger; - -public class BarExtension implements Extension { - - private static final SimpleLogger logger = new SimpleLogger(BarExtension.class); - - public void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event) { - logger.log("bar"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/BarWebBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/BarWebBean.java deleted file mode 100644 index 57627c2165..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/BarWebBean.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.ear; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -/** - * - * @author Martin Kouba - */ -@Dependent -public class BarWebBean { - - @Inject - BarBean barBean; - - public void ping() { - barBean.getExtension(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/FooBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/FooBean.java deleted file mode 100644 index 6a4de93c28..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/FooBean.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.ear; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Dependent -public class FooBean { - - @Inject - private FooExtension extension; - - public FooExtension getExtension() { - return extension; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/FooExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/FooExtension.java deleted file mode 100644 index 4daa558da1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/FooExtension.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.ear; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.BeforeBeanDiscovery; -import jakarta.enterprise.inject.spi.Extension; - -import org.jboss.cdi.tck.util.SimpleLogger; - -public class FooExtension implements Extension { - - private static final SimpleLogger logger = new SimpleLogger(FooExtension.class); - - public void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event) { - logger.log("foo"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/FooWebBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/FooWebBean.java deleted file mode 100644 index ac88249846..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/FooWebBean.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.ear; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -/** - * - * @author Martin Kouba - */ -@Dependent -public class FooWebBean { - - @Inject - FooBean fooBean; - - public void ping() { - fooBean.getExtension(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/MultiWebModuleWithExtensionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/MultiWebModuleWithExtensionTest.java deleted file mode 100644 index 391a8a7931..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/MultiWebModuleWithExtensionTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.ear; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; -import static org.testng.Assert.assertNotNull; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.Testable; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.SimpleLogger; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.application6.ApplicationDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * This test verifies that multiple CDI-enabled web applications can be bundled inside of an enterprise archive (.ear). - *

- * This test was originally part of Seam Compatibility project. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - * @see GLASSFISH-16303 - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class MultiWebModuleWithExtensionTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder() - .withTestClassDefinition(MultiWebModuleWithExtensionTest.class).withClasses(SimpleLogger.class) - .noDefaultWebModule().build(); - StringAsset applicationXml = new StringAsset(Descriptors.create(ApplicationDescriptor.class) - .version(EnterpriseArchiveBuilder.DEFAULT_APP_VERSION).applicationName("Test").createModule() - .ejb(EnterpriseArchiveBuilder.DEFAULT_EJB_MODULE_NAME).up().createModule().getOrCreateWeb().webUri("foo.war") - .contextRoot("/foo").up().up().createModule().getOrCreateWeb().webUri("bar.war").contextRoot("/bar").up().up() - .exportAsString()); - enterpriseArchive.setApplicationXML(applicationXml); - - WebArchive fooArchive = Testable.archiveToTest(new WebArchiveBuilder().notTestArchive().withName("foo.war") - .withClasses(MultiWebModuleWithExtensionTest.class, FooWebBean.class) - .withBeanLibrary("foo.jar", FooExtension.class, FooBean.class).withDefaultEjbModuleDependency().build()); - enterpriseArchive.addAsModule(fooArchive); - - WebArchive barArchive = new WebArchiveBuilder().notTestArchive().withName("bar.war").withClasses(BarWebBean.class) - .withBeanLibrary("bar.jar", BarExtension.class, BarBean.class).withDefaultEjbModuleDependency().build(); - enterpriseArchive.addAsModule(barArchive); - - return enterpriseArchive; - } - - @Test(groups = JAVAEE_FULL, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jc"), - @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "je") }) - public void testMultipleWebModulesWithExtension(FooBean fooBean) { - assertNotNull(fooBean); - assertNotNull(fooBean.getExtension()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/SingleWebModuleWithExtensionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/SingleWebModuleWithExtensionTest.java deleted file mode 100644 index 67093430d3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/SingleWebModuleWithExtensionTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.ear; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * This test verifies that a CDI extension can be used with a web application bundled inside of an enterprise archive (.ear) - * - * Note that we DO NOT include test class in EJB module since we wouldn't be able to inject bean from web module (Java EE - * classloading requirements)! - * - *

- * This test was originally part of Seam Compatibility project. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - * @see JBAS-8683 - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SingleWebModuleWithExtensionTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(SingleWebModuleWithExtensionTest.class).build(); - // StringAsset applicationXml = new StringAsset(Descriptors.create(ApplicationDescriptor.class).applicationName("Test") - // .createModule().getOrCreateWeb().webUri("test.war").contextRoot("/test").up().up().exportAsString()); - // enterpriseArchive.setApplicationXML(applicationXml); - - WebArchive webArchive = new WebArchiveBuilder().notTestArchive().withName("test.war") - .withClasses(SingleWebModuleWithExtensionTest.class, FooWebBean.class) - .withBeanLibrary("test.jar", FooExtension.class, FooBean.class).withDefaultEjbModuleDependency().build(); - enterpriseArchive.addAsModule(webArchive); - return enterpriseArchive; - } - - @Inject - FooWebBean fooWebBean; - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jc"), - @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "je") }) - public void testSingleWebModuleWithExtension() { - fooWebBean.ping(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/AlternativeBar.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/AlternativeBar.java deleted file mode 100644 index 14c9125f10..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/AlternativeBar.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Alternative; - -/** - * @author Martin Kouba - */ -@Alternative -@Dependent -public class AlternativeBar extends Bar { - - @Override - public boolean isAlternative() { - return true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Bar.java deleted file mode 100644 index f1b7c05e85..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Bar.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.event.Event; -import jakarta.enterprise.event.Observes; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - */ -@Secured -@Stateless -public class Bar { - - @Inject - private Event observedEvent; - - public boolean isAlternative() { - return false; - } - - public void observeBusinessOperation(@Observes BusinessOperationEvent event) { - observedEvent.fire(new BusinessOperationObservedEvent()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BarInspector.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BarInspector.java deleted file mode 100644 index 368d52e36a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BarInspector.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - */ -@Dependent -public class BarInspector { - - @Inject - private Bar bar; - - public Bar getBar() { - return bar; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Baz.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Baz.java deleted file mode 100644 index 98167e8ae9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Baz.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.Observes; - -/** - * @author Martin Kouba - */ -@NonEnterprise -@Dependent -public class Baz implements Business { - - public void observeLegacyServiceDisposal(@Observes LegacyService legacyService) { - LegacyService.disposalObserved = true; - } - - @Override - public void businessOperation1() { - } - - @Override - public void businessOperation2() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Business.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Business.java deleted file mode 100644 index 8ff5712ce9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Business.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -/** - * @author Martin Kouba - */ -public interface Business { - - public void businessOperation1(); - - public void businessOperation2(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BusinessOperationEvent.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BusinessOperationEvent.java deleted file mode 100644 index f75d3e4429..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BusinessOperationEvent.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -/** - * @author Martin Kouba - */ -public class BusinessOperationEvent { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BusinessOperationEventInspector.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BusinessOperationEventInspector.java deleted file mode 100644 index 8c24c03302..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BusinessOperationEventInspector.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.event.Observes; - -/** - * @author Martin Kouba - */ -@ApplicationScoped -public class BusinessOperationEventInspector { - - private AtomicInteger businessOperationObservations = new AtomicInteger(0); - - public void observeBusinessOperationEventObservations(@Observes BusinessOperationObservedEvent event) { - businessOperationObservations.incrementAndGet(); - } - - public int getBusinessOperationObservations() { - return businessOperationObservations.get(); - } - - public void reset() { - businessOperationObservations.set(0); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BusinessOperationObservedEvent.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BusinessOperationObservedEvent.java deleted file mode 100644 index 05d7835dcf..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/BusinessOperationObservedEvent.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -/** - * @author Martin Kouba - */ -public class BusinessOperationObservedEvent { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/ContainerEventsObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/ContainerEventsObserver.java deleted file mode 100644 index db7d25d33e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/ContainerEventsObserver.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.event.Event; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AfterBeanDiscovery; -import jakarta.enterprise.inject.spi.AfterDeploymentValidation; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.BeforeBeanDiscovery; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessAnnotatedType; -import jakarta.enterprise.inject.spi.ProcessBeanAttributes; -import jakarta.enterprise.inject.spi.ProcessInjectionPoint; -import jakarta.enterprise.inject.spi.ProcessInjectionTarget; -import jakarta.enterprise.inject.spi.ProcessObserverMethod; -import jakarta.enterprise.inject.spi.ProcessProducer; -import jakarta.enterprise.inject.spi.ProcessSessionBean; - -/** - * @author Martin Kouba - */ -public class ContainerEventsObserver implements Extension { - - private static boolean isAfterDeploymentValidationOk = false; - private static boolean isBeforeBeanDiscoveryOk = false; - private static boolean isAfterBeanDiscoveryOk = false; - private static boolean isProcessAnnotatedTypeOk = false; - private static boolean isProcessInjectionPointOk = false; - private static boolean isProcessInjectionTargetOk = false; - private static boolean isProcessProducerOk = false; - private static boolean isProcessBeanAttributesOk = false; - private static boolean isProcessManagedBeanOk = false; - private static boolean isProcessObserverMethodOk = false; - - public void observeAfterDeploymentValidation(@Observes AfterDeploymentValidation event, BeanManager beanManager) { - isAfterDeploymentValidationOk = (beanManager != null); - } - - public void observeBeforeBeanDiscovery(@Observes BeforeBeanDiscovery event, BeanManager beanManager) { - isBeforeBeanDiscoveryOk = (beanManager != null); - } - - public void observeAfterBeanDiscovery(@Observes AfterBeanDiscovery event, BeanManager beanManager) { - isAfterBeanDiscoveryOk = (beanManager != null); - } - - public void observeProcessAnnotatedType(@Observes ProcessAnnotatedType event, BeanManager beanManager) { - isProcessAnnotatedTypeOk = (beanManager != null); - } - - public void observeProcessInjectionPoint(@Observes ProcessInjectionPoint> event, BeanManager beanManager) { - isProcessInjectionPointOk = (beanManager != null); - } - - public void observeProcessInjectionTarget(@Observes ProcessInjectionTarget event, BeanManager beanManager) { - isProcessInjectionTargetOk = (beanManager != null); - } - - public void observeProcessProducer(@Observes ProcessProducer event, - BeanManager beanManager) { - isProcessProducerOk = (beanManager != null); - } - - public void observeProcessBeanAttributes(@Observes ProcessBeanAttributes event, BeanManager beanManager) { - isProcessBeanAttributesOk = (beanManager != null); - } - - public void observeProcessBean(@Observes ProcessSessionBean event, BeanManager beanManager) { - isProcessManagedBeanOk = (beanManager != null); - } - - public void observeProcessObserverMethod(@Observes ProcessObserverMethod event, - BeanManager beanManager) { - isProcessObserverMethodOk = (beanManager != null); - } - - public static void assertAllEventsOk() { - assertTrue(isAfterDeploymentValidationOk); - assertTrue(isBeforeBeanDiscoveryOk); - assertTrue(isAfterBeanDiscoveryOk); - assertTrue(isProcessAnnotatedTypeOk); - assertTrue(isProcessInjectionPointOk); - assertTrue(isProcessInjectionTargetOk); - assertTrue(isProcessProducerOk); - assertTrue(isProcessBeanAttributesOk); - assertTrue(isProcessManagedBeanOk); - assertTrue(isProcessObserverMethodOk); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/EnterpriseArchiveModulesTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/EnterpriseArchiveModulesTest.java deleted file mode 100644 index 780cb90c0e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/EnterpriseArchiveModulesTest.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_SELECTED_ALTERNATIVES_BEAN_ARCHIVE_EE; -import static org.jboss.cdi.tck.cdi.Sections.DECORATORS_EE; -import static org.jboss.cdi.tck.cdi.Sections.ENABLED_DECORATORS_BEAN_ARCHIVE; -import static org.jboss.cdi.tck.cdi.Sections.INIT_EVENTS; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVER_RESOLUTION; -import static org.jboss.cdi.tck.cdi.Sections.PERFORMING_TYPESAFE_RESOLUTION; -import static org.jboss.cdi.tck.cdi.Sections.PRODUCER_METHOD; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - -import java.util.Set; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.BeansXmlVersion; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.spec.se.manifest.ManifestDescriptor; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * This test is aimed to verify packaging-related issues in a little bit more complex deployment scenario. The assertions are - * rather informative and redundant as they're already verified in elementary tests. - * - * Note that we DO NOT include test class in EJB module since we wouldn't be able to inject bean from web module (Java EE - * classloading requirements)! - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseArchiveModulesTest extends AbstractTest { - - /** - * Modules: - *

    - *
  • A - EJB jar BDA: Foo, BusinessOperationEventInspector
  • - *
  • B - EJB jar BDA: Bar, BarInspector, ContainerEventsObserver, LegacyServiceProducer, DummyBar
  • - *
  • C - lib BDA: AlternativeBar, Util, Business, BusinessOperationEvent, BusinessOperationObservedEvent, NonEnterprise, - * Secured, SecurityInterceptor, LoggingDecorator
  • - *
  • D - lib non-BDA: LegacyService
  • - *
  • E - web archive - *
      - *
    • F - WEB-INF/classes BDA: Baz
    • - *
    • G - WEB-INF/lib BDA: Qux
    • - *
    - *
  • - *
- * - * @return test archive - */ - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder() - // A - default EJB jar - .withTestClassDefinition(EnterpriseArchiveModulesTest.class) - .withClasses(Foo.class, BusinessOperationEventInspector.class) - // C - lib visible to all - .withBeanLibrary(Util.class, Business.class, BusinessOperationEvent.class, - BusinessOperationObservedEvent.class, NonEnterprise.class, Secured.class, SecurityInterceptor.class, - LoggingDecorator.class) - // D - lib visible to all - .withLibrary(LegacyService.class).noDefaultWebModule().build(); - - // B - not visible for ACD - JavaArchive barArchive = ShrinkWrap - .create(JavaArchive.class, "bar-ejb.jar") - .addClasses(Bar.class, AlternativeBar.class, BarInspector.class, ContainerEventsObserver.class, - LegacyServiceProducer.class) - .addAsServiceProvider(Extension.class, ContainerEventsObserver.class) - .addAsManifestResource(new BeansXml().setBeansXmlVersion(BeansXmlVersion.v11) - .setBeanDiscoveryMode(BeanDiscoveryMode.ALL) - .interceptors(SecurityInterceptor.class), "beans.xml") - // Make A visible in a portable way - .setManifest( - new StringAsset(Descriptors.create(ManifestDescriptor.class) - .addToClassPath(EnterpriseArchiveBuilder.DEFAULT_EJB_MODULE_NAME).exportAsString())); - enterpriseArchive.addAsModule(barArchive); - - // E - not visible for ABCD - WebArchive bazWebArchive = new WebArchiveBuilder() - .notTestArchive() - // F - with enabled decorator - .withClasses(Baz.class, EnterpriseArchiveModulesTest.class) - .withBeansXml(new BeansXml().decorators(LoggingDecorator.class) - .alternatives(AlternativeBar.class) - ) - // G - .withBeanLibrary(Qux.class) - .build() - // Make A and B visible in a portable way - .setManifest( - new StringAsset(Descriptors.create(ManifestDescriptor.class) - .addToClassPath(EnterpriseArchiveBuilder.DEFAULT_EJB_MODULE_NAME).addToClassPath("bar-ejb.jar") - .exportAsString())); - enterpriseArchive.addAsModule(bazWebArchive); - - return enterpriseArchive; - } - - @Inject - Business foo; - - @Inject - BusinessOperationEventInspector inspector; - - @Inject - BarInspector barInspector; - - @NonEnterprise - @Inject - Business baz; - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = INIT_EVENTS, id = "bb") }) - public void testExtensionAndContainerEvents() throws Exception { - // Test extension registration and container lifecycle events - ContainerEventsObserver.assertAllEventsOk(); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "ja"), - @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jb"), - @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jc"), @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "je"), - @SpecAssertion(section = PERFORMING_TYPESAFE_RESOLUTION, id = "n") }) - public void testVisibilityAndInterceptorEnablement() throws Exception { - SecurityInterceptor.reset(); - inspector.reset(); - foo.businessOperation1(); - foo.businessOperation2(); - // BusinessOperationEvent observers: Bar, Qux - assertEquals(inspector.getBusinessOperationObservations(), 2); - // Interceptor is enabled in B only; observed method intercepted - assertEquals(SecurityInterceptor.getNumberOfInterceptions(), 1); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = DECORATORS_EE, id = "a"), - @SpecAssertion(section = ENABLED_DECORATORS_BEAN_ARCHIVE, id = "a") }) - public void testDecoratorEnablement() throws Exception { - // Test LoggingDecorator is enabled in F only - LoggingDecorator.reset(); - baz.businessOperation1(); - foo.businessOperation1(); - assertEquals(LoggingDecorator.getNumberOfDecorationsPerformed(), 1); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = PRODUCER_METHOD, id = "aa"), - @SpecAssertion(section = PRODUCER_METHOD, id = "c"), @SpecAssertion(section = OBSERVER_RESOLUTION, id = "c") }) - public void testProducerAndEventDuringDisposal() throws Exception { - // Test legacy service producer in B, bean from F is observing event fired during legacy service disposal - Bean bean = getUniqueBean(LegacyService.class); - CreationalContext ctx = getCurrentManager().createCreationalContext(bean); - LegacyService instance = bean.create(ctx); - bean.destroy(instance, ctx); - assertTrue(LegacyService.cleanupPerformed); - assertTrue(LegacyService.disposalObserved); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_BEAN_ARCHIVE_EE, id = "bb") }) - public void testAlternatives() throws Exception { - Set> beans = getCurrentManager().getBeans(AlternativeBar.class); - assertEquals(beans.size(), 1); - assertEquals(beans.iterator().next().getBeanClass(), AlternativeBar.class); - // Bar alternative is enabled in F only - assertFalse(barInspector.getBar().isAlternative()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Foo.java deleted file mode 100644 index da840d019d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Foo.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.event.Event; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - */ -@Secured -@RequestScoped -@Stateful -public class Foo implements Business { - - @Inject - private Util util; - - @Inject - private Event event; - - @Override - public void businessOperation1() { - event.fire(new BusinessOperationEvent()); - } - - @Override - public void businessOperation2() { - util.utilize(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/LegacyService.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/LegacyService.java deleted file mode 100644 index 3f64b7b33c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/LegacyService.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -/** - * @author Martin Kouba - */ -public class LegacyService { - - public static boolean cleanupPerformed = false; - - public static boolean disposalObserved = false; - - public void cleanup() { - cleanupPerformed = true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/LegacyServiceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/LegacyServiceProducer.java deleted file mode 100644 index 8e54094cb5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/LegacyServiceProducer.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.Event; -import jakarta.enterprise.inject.Disposes; -import jakarta.enterprise.inject.Produces; - -/** - * @author Martin Kouba - */ -@Dependent -public class LegacyServiceProducer { - - @Produces - public LegacyService produce() { - return new LegacyService(); - } - - public void dispose(@Disposes LegacyService legacyService, Event event) { - legacyService.cleanup(); - event.fire(legacyService); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/LoggingDecorator.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/LoggingDecorator.java deleted file mode 100644 index 3b0439602e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/LoggingDecorator.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.enterprise.inject.Any; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - * - */ -@Decorator -public abstract class LoggingDecorator implements Business { - - private static AtomicInteger decorationPerformed = new AtomicInteger(0); - - @Inject - @Delegate - @Any - private Business loggable; - - @Override - public void businessOperation1() { - decorationPerformed.incrementAndGet(); - loggable.businessOperation1(); - } - - public static int getNumberOfDecorationsPerformed() { - return decorationPerformed.get(); - } - - public static void reset() { - decorationPerformed.set(0); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/NonEnterprise.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/NonEnterprise.java deleted file mode 100644 index 5a8daeffa1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/NonEnterprise.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -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 jakarta.inject.Qualifier; - -/** - * @author Martin Kouba - * - */ -@Qualifier -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -public @interface NonEnterprise { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Qux.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Qux.java deleted file mode 100644 index c2d9614056..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Qux.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.Event; -import jakarta.enterprise.event.Observes; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - */ -@Dependent -public class Qux { - - @Inject - private Event observedEvent; - - @Inject - private Util util; - - public void observeBusinessOperation(@Observes BusinessOperationEvent event) { - util.utilize(); - observedEvent.fire(new BusinessOperationObservedEvent()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Secured.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Secured.java deleted file mode 100644 index 3c471dbe7d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Secured.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.interceptor.InterceptorBinding; - -@Inherited -@Target({ TYPE }) -@Retention(RUNTIME) -@Documented -@InterceptorBinding -public @interface Secured { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/SecurityInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/SecurityInterceptor.java deleted file mode 100644 index 6f1dc1b086..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/SecurityInterceptor.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -/** - * @author Martin Kouba - */ -@Secured -@Interceptor -public class SecurityInterceptor { - - private static AtomicInteger intercepted = new AtomicInteger(0); - - @AroundInvoke - public Object alwaysReturnThis(InvocationContext ctx) throws Exception { - intercepted.incrementAndGet(); - return ctx.proceed(); - } - - public static int getNumberOfInterceptions() { - return intercepted.get(); - } - - public static void reset() { - intercepted.set(0); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Util.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Util.java deleted file mode 100644 index 25526a183c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ear/modules/Util.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ear.modules; - -import jakarta.enterprise.context.Dependent; - -/** - * @author Martin Kouba - */ -@Dependent -public class Util { - - public void utilize() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/Bar.java deleted file mode 100644 index b2b9ee0cb3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/Bar.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ejb; - -public class Bar { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/EJBJarDeploymentTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/EJBJarDeploymentTest.java deleted file mode 100644 index 781ac1e5ea..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/EJBJarDeploymentTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ejb; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import jakarta.ejb.EJB; -import jakarta.enterprise.inject.spi.Extension; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.OperateOnDeployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EJBJarDeploymentTest extends AbstractTest { - - @Deployment(name = "EJB", order = 1, testable = false) - public static JavaArchive createEjbtArchive() { - return ShrinkWrap - .create(JavaArchive.class, "test-ejb.jar") - .addClasses(FooRemote.class, FooBean.class, Bar.class, ProcessBeanObserver.class) - .addAsServiceProvider(Extension.class, ProcessBeanObserver.class) - .addAsManifestResource(new BeansXml(), "beans.xml"); - } - - @Deployment(name = "TEST", order = 2) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(EJBJarDeploymentTest.class).withClasses(FooRemote.class) - .setAsClientMode(false).build(); - } - - @EJB(lookup = "java:global/test-ejb/FooBean!org.jboss.cdi.tck.tests.deployment.packaging.ejb.FooRemote") - FooRemote foo; - - @Test(groups = JAVAEE_FULL) - @OperateOnDeployment("TEST") - @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jj") - public void testContainerSearchesEJBJar() throws Exception { - assertNotNull(foo); - assertTrue(foo.isBarBeanObserved()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/FooBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/FooBean.java deleted file mode 100644 index 59a0779420..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/FooBean.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.ejb; - -import jakarta.ejb.Stateless; - -@Stateless -public class FooBean implements FooRemote { - - @Override - public Boolean isBarBeanObserved() { - return ProcessBeanObserver.isBarBeanObserved(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/FooRemote.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/FooRemote.java deleted file mode 100644 index a50e53b202..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/FooRemote.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.ejb; - -import jakarta.ejb.Remote; - -@Remote -public interface FooRemote { - - public Boolean isBarBeanObserved(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/ProcessBeanObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/ProcessBeanObserver.java deleted file mode 100644 index 582ec20b57..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/ejb/ProcessBeanObserver.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.ejb; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessBean; - -public class ProcessBeanObserver implements Extension { - - public static boolean barBeanObserved = false; - - public void observeBarBean(@Observes ProcessBean event) { - barBeanObserved = true; - } - - public static boolean isBarBeanObserved() { - return barBeanObserved; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/Alpha.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/Alpha.java deleted file mode 100644 index 669dd082af..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/Alpha.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.installedLibrary; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Alpha extends AssertBean { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/AssertBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/AssertBean.java deleted file mode 100644 index 450eadd6fb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/AssertBean.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.installedLibrary; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; - -import java.lang.annotation.Annotation; - -import jakarta.enterprise.inject.AmbiguousResolutionException; -import jakarta.enterprise.inject.Any; -import jakarta.enterprise.inject.Instance; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -public abstract class AssertBean { - - @Inject - @Any - Instance instance; - - @Inject - BeanManager beanManager; - - /** - * Asserts that typesafe resolution fails - multiple beans are eligible for injection. - * - * Don't use this method until CDI-331 is resolved. - * - * @param beanType - * @param qualifiers - */ - public void assertUnsatisfied(Class beanType, Annotation... qualifiers) { - - assertEquals(beanManager.getBeans(beanType, qualifiers).size(), 0); - - Instance subtypeInstance = instance.select(beanType, qualifiers); - assertTrue(subtypeInstance.isUnsatisfied()); - } - - /** - * Asserts that typesafe resolution fails - no bean is eligible for injection. - * - * Don't use this method until CDI-331 is resolved. - * - * @param beanType - * @param qualifiers - */ - public void assertAmbiguous(Class beanType, Annotation... qualifiers) { - - try { - beanManager.resolve(beanManager.getBeans(beanType, qualifiers)); - fail("AmbiguousResolutionException not thrown"); - } catch (AmbiguousResolutionException e) { - // Expected - } - - Instance subtypeInstance = instance.select(beanType, qualifiers); - assertTrue(subtypeInstance.isAmbiguous()); - } - - /** - * Assert that a bean with given type and qualifiers is available for injection. - * - * @param beanType - * @param qualifiers - * @return the bean instance - */ - public T assertAvailable(Class beanType, Annotation... qualifiers) { - - assertNotNull(beanManager.resolve(beanManager.getBeans(beanType, qualifiers))); - - Instance beanTypeInstance = instance.select(beanType, qualifiers); - T beanInstance = beanTypeInstance.get(); - assertNotNull(beanInstance); - - return beanInstance; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/Bravo.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/Bravo.java deleted file mode 100644 index 0188809827..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/Bravo.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.installedLibrary; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Bravo extends AssertBean { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/Charlie.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/Charlie.java deleted file mode 100644 index 6fb30e8f1c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/Charlie.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.installedLibrary; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Charlie extends AssertBean { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/InstalledLibraryEarTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/InstalledLibraryEarTest.java deleted file mode 100644 index bbd2230edc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/InstalledLibraryEarTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.installedLibrary; - -import static org.jboss.cdi.tck.TestGroups.INSTALLED_LIB; -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.extlib.StrictLiteral; -import org.jboss.cdi.tck.extlib.Translator; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.spec.se.manifest.ManifestDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test installed library bean archive referenced by an EAR. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class InstalledLibraryEarTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder() - .withTestClassDefinition(InstalledLibraryEarTest.class).withClasses(Alpha.class).withBeanLibrary(Bravo.class) - .withLibrary(AssertBean.class).noDefaultWebModule().debugMode().build(); - - WebArchive webArchive = new WebArchiveBuilder().withClasses(InstalledLibraryEarTest.class, Charlie.class) - .notTestArchive().withDefaultEjbModuleDependency().debugMode().build(); - enterpriseArchive.addAsModule(webArchive); - - enterpriseArchive.setManifest(new StringAsset(Descriptors.create(ManifestDescriptor.class) - .attribute("Extension-List", "CDITCKExtLib") - .attribute("CDITCKExtLib-Extension-Name", "org.jboss.cdi.tck.extlib") - .attribute("CDITCKExtLib-Specification-Version", "1.0") - .attribute("CDITCKExtLib-Implementation-Version", "1.0") - .attribute("CDITCKExtLib-Implementation-Vendor-Id", "org.jboss") - .exportAsString())); - - return enterpriseArchive; - } - - @Test(groups = { JAVAEE_FULL, INSTALLED_LIB }, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jf") }) - public void testEjbJarInjection(Alpha alpha) { - assertNotNull(alpha); - assertEquals(alpha.assertAvailable(Translator.class, StrictLiteral.INSTANCE).echo("hello"), "hello"); - } - - @Test(groups = { JAVAEE_FULL, INSTALLED_LIB }, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jf") }) - public void testBundledLibraryInjection(Bravo bravo) { - assertNotNull(bravo); - assertEquals(bravo.assertAvailable(Translator.class, StrictLiteral.INSTANCE).echo("hello"), "hello"); - } - - @Test(groups = { JAVAEE_FULL, INSTALLED_LIB }, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jf") }) - public void testWarInjection(Charlie charlie) { - assertNotNull(charlie); - assertEquals(charlie.assertAvailable(Translator.class, StrictLiteral.INSTANCE).echo("hello"), "hello"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/InstalledLibraryWarTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/InstalledLibraryWarTest.java deleted file mode 100644 index f0919dd934..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/installedLibrary/InstalledLibraryWarTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.installedLibrary; - -import static org.jboss.cdi.tck.TestGroups.INSTALLED_LIB; -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.extlib.StrictLiteral; -import org.jboss.cdi.tck.extlib.Translator; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.spec.se.manifest.ManifestDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test installed library bean archive referenced by a WAR. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class InstalledLibraryWarTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(InstalledLibraryWarTest.class) - .withClasses(Alpha.class, AssertBean.class) - .build() - .setManifest( - new StringAsset(Descriptors.create(ManifestDescriptor.class) - .attribute("Extension-List", "CDITCKExtLib") - .attribute("CDITCKExtLib-Extension-Name", "org.jboss.cdi.tck.extlib") - .attribute("CDITCKExtLib-Specification-Version", "1.0") - .attribute("CDITCKExtLib-Implementation-Version", "1.0") - .attribute("CDITCKExtLib-Implementation-Vendor-Id", "org.jboss") - .exportAsString())); - } - - @Test(groups = { INTEGRATION, INSTALLED_LIB }, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "ji") }) - public void testInjection(Alpha alpha) { - assertNotNull(alpha); - assertEquals(alpha.assertAvailable(Translator.class, StrictLiteral.INSTANCE).echo("hello"), "hello"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/rar/ResourceAdapterArchiveTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/rar/ResourceAdapterArchiveTest.java deleted file mode 100644 index 10e3289244..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/rar/ResourceAdapterArchiveTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.rar; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.util.Versions; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.beans11.BeanDiscoveryMode; -import org.jboss.shrinkwrap.descriptor.api.beans11.BeansDescriptor; -import org.jboss.shrinkwrap.descriptor.api.connector16.ConnectorDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test resource adapter bean archive included in an EAR. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ResourceAdapterArchiveTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().withTestClass(ResourceAdapterArchiveTest.class) - .build(); - - ResourceAdapterArchive rar = ShrinkWrap.create(ResourceAdapterArchive.class); - // JCA spec 20.2.0.1 Resource Adapter Archive - rar.addAsLibrary(ShrinkWrap - .create(JavaArchive.class) - .addClasses(Translator.class, TestResourceAdapter.class) - .addAsManifestResource(new StringAsset(Descriptors.create(BeansDescriptor.class) - .beanDiscoveryMode(BeanDiscoveryMode._ALL.toString()).version(Versions.v1_1) - .exportAsString()), "beans.xml")); - rar.addAsManifestResource( - new StringAsset(Descriptors.create(ConnectorDescriptor.class).version("1.6").displayName("Test RA") - .vendorName("Red Hat Middleware LLC").eisType("Test RA").resourceadapterVersion("0.1") - .getOrCreateResourceadapter().resourceadapterClass(TestResourceAdapter.class.getName()) - .getOrCreateOutboundResourceadapter().transactionSupport("NoTransaction") - .reauthenticationSupport(false).up().up().exportAsString()), - "ra.xml"); - - enterpriseArchive.addAsModule(rar); - return enterpriseArchive; - } - - @Test(groups = JAVAEE_FULL, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jd") }) - public void testInjection(Translator translator) { - assertNotNull(translator); - assertEquals(translator.ping(), 1); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jd") }) - public void testResolution() { - getUniqueBean(Translator.class); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/rar/TestResourceAdapter.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/rar/TestResourceAdapter.java deleted file mode 100644 index 78d0b011d8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/rar/TestResourceAdapter.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.rar; - -import java.util.logging.Logger; - -import javax.transaction.xa.XAResource; - -import jakarta.resource.ResourceException; -import jakarta.resource.spi.ActivationSpec; -import jakarta.resource.spi.BootstrapContext; -import jakarta.resource.spi.ResourceAdapter; -import jakarta.resource.spi.ResourceAdapterInternalException; -import jakarta.resource.spi.endpoint.MessageEndpointFactory; - -/** - * TestResourceAdapter - * - * @version $Revision: $ - */ -public class TestResourceAdapter implements ResourceAdapter, java.io.Serializable { - - /** The serial version UID */ - private static final long serialVersionUID = 1L; - - /** The logger */ - private static Logger log = Logger.getLogger("TestResourceAdapter"); - - /** - * Default constructor - */ - public TestResourceAdapter() { - - } - - /** - * This is called during the activation of a message endpoint. - * - * @param endpointFactory A message endpoint factory instance. - * @param spec An activation spec JavaBean instance. - * @throws ResourceException generic exception - */ - public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException { - log.finest("endpointActivation()"); - } - - /** - * This is called when a message endpoint is deactivated. - * - * @param endpointFactory A message endpoint factory instance. - * @param spec An activation spec JavaBean instance. - */ - public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) { - log.finest("endpointDeactivation()"); - } - - /** - * This is called when a resource adapter instance is bootstrapped. - * - * @param ctx A bootstrap context containing references - * @throws ResourceAdapterInternalException indicates bootstrap failure. - */ - public void start(BootstrapContext ctx) throws ResourceAdapterInternalException { - log.finest("start()"); - } - - /** - * This is called when a resource adapter instance is undeployed or during application server shutdown. - */ - public void stop() { - log.finest("stop()"); - } - - /** - * This method is called by the application server during crash recovery. - * - * @param specs An array of ActivationSpec JavaBeans - * @throws ResourceException generic exception - * @return An array of XAResource objects - */ - public XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException { - log.finest("getXAResources()"); - return null; - } - - /** - * Returns a hash code value for the object. - * - * @return A hash code value for this object. - */ - @Override - public int hashCode() { - int result = 17; - return result; - } - - /** - * Indicates whether some other object is equal to this one. - * - * @param other The reference object with which to compare. - * @return true if this object is the same as the obj argument, false otherwise. - */ - @Override - public boolean equals(Object other) { - if (other == null) - return false; - if (other == this) - return true; - if (!(other instanceof TestResourceAdapter)) - return false; - @SuppressWarnings("unused") - TestResourceAdapter obj = (TestResourceAdapter) other; - boolean result = true; - return result; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/rar/Translator.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/rar/Translator.java deleted file mode 100644 index 4cac085c28..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/rar/Translator.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.rar; - -public class Translator { - - public int ping() { - return 1; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/American.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/American.java deleted file mode 100644 index 7b115e4cd9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/American.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.visibility; - -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 jakarta.inject.Qualifier; - -@Qualifier -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -public @interface American { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/AnnotatedTypeObserverExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/AnnotatedTypeObserverExtension.java deleted file mode 100644 index 19ba531c57..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/AnnotatedTypeObserverExtension.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.visibility; - -import java.util.ArrayList; -import java.util.List; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessAnnotatedType; - -public class AnnotatedTypeObserverExtension implements Extension { - - private List> observed; - - public AnnotatedTypeObserverExtension() { - observed = new ArrayList>(); - } - - public void processAnnotatedType(@Observes ProcessAnnotatedType event) { - observed.add(event.getAnnotatedType().getJavaClass()); - } - - public boolean observed(Class c) { - return observed.contains(c); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Bar.java deleted file mode 100644 index 9bc149438d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Bar.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.visibility; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; - -@RequestScoped -public class Bar { - @SuppressWarnings("unused") - @Inject - private Foo foo; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Beer.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Beer.java deleted file mode 100644 index c4213d1636..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Beer.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.visibility; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Beer { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/BeerCollector.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/BeerCollector.java deleted file mode 100644 index b2e9ab0c83..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/BeerCollector.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.visibility; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Any; -import jakarta.enterprise.inject.Instance; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -@Dependent -public class BeerCollector { - @Inject - private BeanManager beanManager; - - @Inject - @Any - private Instance beerRefs; - - public Integer getNumDiscovered() { - int cnt = 0; - for (@SuppressWarnings("unused") - Beer b : beerRefs) { - cnt++; - } - return cnt; - } - - public boolean isNamedBeerVisible(String name) { - return beanManager.getBeans(name).size() == 1; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/CraftBeer.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/CraftBeer.java deleted file mode 100644 index bf943d98b3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/CraftBeer.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.visibility; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Named; - -@Named("americanCraftBeer") -@American -@Dependent -public class CraftBeer extends Beer { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Foo.java deleted file mode 100644 index 7c208bc26d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Foo.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.visibility; - -import jakarta.enterprise.context.RequestScoped; - -@RequestScoped -public class Foo { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/JarToJarAlphaVisibilityTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/JarToJarAlphaVisibilityTest.java deleted file mode 100644 index 56eebe8491..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/JarToJarAlphaVisibilityTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.visibility; - -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; -import static org.jboss.cdi.tck.cdi.Sections.PERFORMING_TYPESAFE_RESOLUTION; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Verifies that a bean from a BDA is injectable into another BDA. - * - *

- * This test was originally part of Seam Compatibility project. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class JarToJarAlphaVisibilityTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(JarToJarAlphaVisibilityTest.class).withBeanLibrary("alpha.jar", Foo.class) - .withBeanLibrary("bravo.jar", Bar.class).build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jh"), - @SpecAssertion(section = PERFORMING_TYPESAFE_RESOLUTION, id = "n") }) - public void testDeployment() { - // noop - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/JarToJarReverseAlphaVisibilityTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/JarToJarReverseAlphaVisibilityTest.java deleted file mode 100644 index 096827886c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/JarToJarReverseAlphaVisibilityTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.visibility; - -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; -import static org.jboss.cdi.tck.cdi.Sections.PERFORMING_TYPESAFE_RESOLUTION; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Same as {@link JarToJarAlphaVisibilityTest} but the content of alpha and bravo jars is swapped to detect ordering issues. - * - *

- * This test was originally part of Seam Compatibility project. - *

- * - * - * @author Jozef Hartinger - * @author Martin Kouba - * @see GLASSFISH-15735 - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class JarToJarReverseAlphaVisibilityTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(JarToJarReverseAlphaVisibilityTest.class) - .withBeanLibrary("bravo.jar", Foo.class).withBeanLibrary("alpha.jar", Bar.class).build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jh"), - @SpecAssertion(section = PERFORMING_TYPESAFE_RESOLUTION, id = "n") }) - public void testDeployment() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Soda.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Soda.java deleted file mode 100644 index dbcfcb023f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/Soda.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.visibility; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Soda { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/VisibilityOfAnnotatedTypesFromExtensionInAlphaBeanArchiveTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/VisibilityOfAnnotatedTypesFromExtensionInAlphaBeanArchiveTest.java deleted file mode 100644 index 42f4839885..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/VisibilityOfAnnotatedTypesFromExtensionInAlphaBeanArchiveTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.visibility; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.INIT_EVENTS; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * Tests whether an extension that observes annotated types, when put in a library with a higher order name (alpha.jar), is - * notified of annotated types in a library with a lower order name (bravo.jar). - * - *

- * This test was originally part of Seam Compatibility project. - *

- * - * @author Dan Allen - * @author Martin Kouba - * @see GLASSFISH-15735 - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class VisibilityOfAnnotatedTypesFromExtensionInAlphaBeanArchiveTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(VisibilityOfAnnotatedTypesFromExtensionInAlphaBeanArchiveTest.class) - .withBeanLibrary("bravo.jar", Soda.class) - .withBeanLibrary("alpha.jar", Beer.class, AnnotatedTypeObserverExtension.class).build(); - } - - @Inject - AnnotatedTypeObserverExtension observer; - - @Test - @SpecAssertion(section = INIT_EVENTS, id = "b") - public void shouldObserveExpectedAnnotatedTypes() { - Assert.assertTrue(observer.observed(Beer.class)); - Assert.assertTrue(observer.observed(Soda.class)); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/VisibilityOfAnnotatedTypesFromExtensionInBravoBeanArchiveTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/VisibilityOfAnnotatedTypesFromExtensionInBravoBeanArchiveTest.java deleted file mode 100644 index 00d073fe57..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/VisibilityOfAnnotatedTypesFromExtensionInBravoBeanArchiveTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.visibility; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.INIT_EVENTS; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * Tests whether an extension that observes annotated types, when put in a library with a lower order name (bravo.jar), is - * notified of annotated types in a library with a higher order name (alpha.jar). - * - *

- * This test was originally part of Seam Compatibility project. - *

- * - * @author Dan Allen - * @author Martin Kouba - * @see GLASSFISH-15735 (unresolved) - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class VisibilityOfAnnotatedTypesFromExtensionInBravoBeanArchiveTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(VisibilityOfAnnotatedTypesFromExtensionInBravoBeanArchiveTest.class) - .withBeanLibrary("alpha.jar", Soda.class) - .withBeanLibrary("bravo.jar", Beer.class, AnnotatedTypeObserverExtension.class).build(); - } - - @Inject - AnnotatedTypeObserverExtension observer; - - @Test - @SpecAssertion(section = INIT_EVENTS, id = "b") - public void shouldObserveExpectedAnnotatedTypes() { - Assert.assertTrue(observer.observed(Beer.class)); - Assert.assertTrue(observer.observed(Soda.class)); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/VisibilityOfBeanInWebModuleFromBeanManagerInBeanLibraryTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/VisibilityOfBeanInWebModuleFromBeanManagerInBeanLibraryTest.java deleted file mode 100644 index 7357951b32..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/visibility/VisibilityOfBeanInWebModuleFromBeanManagerInBeanLibraryTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.visibility; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * Validates that a bean in the WEB-INF/classes directory is visible to the BeanManager injected into a bean contained within a - * bean library in the same bean (web) archive. - *

- *

- * This test was originally part of Seam Compatibility project. - *

- * - * @author Dan Allen - * @author Martin Kouba - * @see GLASSFISH-15721 - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class VisibilityOfBeanInWebModuleFromBeanManagerInBeanLibraryTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(VisibilityOfBeanInWebModuleFromBeanManagerInBeanLibraryTest.class) - .withClass(CraftBeer.class).withBeanLibrary(Beer.class, BeerCollector.class, American.class).build(); - } - - @Inject - BeerCollector collector; - - @Test - @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jh") - public void shouldFindBeanByType() { - Assert.assertTrue(collector.getNumDiscovered() == 2); - } - - @Test - @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jh") - public void shouldFindBeanByName() { - Assert.assertTrue(collector.isNamedBeerVisible("americanCraftBeer")); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/BeansDescriptorAlternativeLocationTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/BeansDescriptorAlternativeLocationTest.java deleted file mode 100644 index 184f119857..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/BeansDescriptorAlternativeLocationTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.war; - -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; -import static org.testng.Assert.assertNotNull; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * The WEB-INF/classes directory of a war is a bean archive if there is a file named beans.xml in the - * WEB-INF/classes/META-INF directory of the war. - * - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class BeansDescriptorAlternativeLocationTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(BeansDescriptorAlternativeLocationTest.class) - .withBeansDescriptorTargetBase("classes/META-INF/").build(); - } - - @Test - @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "fb") - public void testAlternativeLocation() { - // Injection works - assertNotNull(beanManager); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/AlternativeBar.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/AlternativeBar.java deleted file mode 100644 index d8e5aba4e7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/AlternativeBar.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Alternative; - -/** - * @author Martin Kouba - */ -@Alternative -@Dependent -public class AlternativeBar extends Bar { - - @Override - public boolean isAlternative() { - return true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Bar.java deleted file mode 100644 index e2145f05d7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Bar.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - */ -@Secured -@Dependent -public class Bar { - - @Inject - private Baz baz; - - @Inject - private Qux qux; - - public Baz getBaz() { - return baz; - } - - public Qux getQux() { - return qux; - } - - public boolean isAlternative() { - return false; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/BarInspector.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/BarInspector.java deleted file mode 100644 index eb736f82c2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/BarInspector.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - */ -@Dependent -public class BarInspector { - - @Inject - private Bar bar; - - public Bar getBar() { - return bar; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Baz.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Baz.java deleted file mode 100644 index 3ad251c088..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Baz.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -import jakarta.annotation.PostConstruct; - -/** - * @author Martin Kouba - */ -@Bazinga -public class Baz implements Business { - - private Long id = null; - - @PostConstruct - public void init() { - id = System.currentTimeMillis(); - } - - public Long getId() { - return id; - } - - @Override - public void businessOperation1() { - } - - @Override - public void businessOperation2() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Bazinga.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Bazinga.java deleted file mode 100644 index b89e049f84..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Bazinga.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -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 jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.Stereotype; - -@RequestScoped -@Stereotype -@Target({ TYPE }) -@Retention(RUNTIME) -@Documented -public @interface Bazinga { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Business.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Business.java deleted file mode 100644 index eace2a9eae..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Business.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -/** - * @author Martin Kouba - */ -public interface Business { - - public void businessOperation1(); - - public void businessOperation2(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/BusinessOperationEvent.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/BusinessOperationEvent.java deleted file mode 100644 index de950a006a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/BusinessOperationEvent.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -/** - * @author Martin Kouba - */ -public class BusinessOperationEvent { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/ContainerEventsObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/ContainerEventsObserver.java deleted file mode 100644 index 546e795d15..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/ContainerEventsObserver.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AfterBeanDiscovery; -import jakarta.enterprise.inject.spi.AfterDeploymentValidation; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.BeforeBeanDiscovery; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessAnnotatedType; -import jakarta.enterprise.inject.spi.ProcessBeanAttributes; -import jakarta.enterprise.inject.spi.ProcessInjectionPoint; -import jakarta.enterprise.inject.spi.ProcessInjectionTarget; -import jakarta.enterprise.inject.spi.ProcessManagedBean; -import jakarta.enterprise.inject.spi.ProcessObserverMethod; -import jakarta.enterprise.inject.spi.ProcessProducer; - -/** - * @author Martin Kouba - */ -public class ContainerEventsObserver implements Extension { - - private static boolean isAfterDeploymentValidationOk = false; - private static boolean isBeforeBeanDiscoveryOk = false; - private static boolean isAfterBeanDiscoveryOk = false; - private static boolean isProcessAnnotatedTypeOk = false; - private static boolean isProcessInjectionPointOk = false; - private static boolean isProcessInjectionTargetOk = false; - private static boolean isProcessProducerOk = false; - private static boolean isProcessBeanAttributesOk = false; - private static boolean isProcessManagedBeanOk = false; - private static boolean isProcessObserverMethodOk = false; - - public void observeAfterDeploymentValidation(@Observes AfterDeploymentValidation event, BeanManager beanManager) { - isAfterDeploymentValidationOk = (beanManager != null); - } - - public void observeBeforeBeanDiscovery(@Observes BeforeBeanDiscovery event, BeanManager beanManager) { - isBeforeBeanDiscoveryOk = (beanManager != null); - } - - public void observeAfterBeanDiscovery(@Observes AfterBeanDiscovery event, BeanManager beanManager) { - isAfterBeanDiscoveryOk = (beanManager != null); - } - - public void observeProcessAnnotatedType(@Observes ProcessAnnotatedType event, BeanManager beanManager) { - isProcessAnnotatedTypeOk = (beanManager != null); - } - - public void observeProcessInjectionPoint(@Observes ProcessInjectionPoint event, BeanManager beanManager) { - isProcessInjectionPointOk = (beanManager != null); - } - - public void observeProcessInjectionTarget(@Observes ProcessInjectionTarget event, BeanManager beanManager) { - isProcessInjectionTargetOk = (beanManager != null); - } - - public void observeProcessProducer(@Observes ProcessProducer event, - BeanManager beanManager) { - isProcessProducerOk = (beanManager != null); - } - - public void observeProcessBeanAttributes(@Observes ProcessBeanAttributes event, BeanManager beanManager) { - isProcessBeanAttributesOk = (beanManager != null); - } - - public void observeProcessBean(@Observes ProcessManagedBean event, BeanManager beanManager) { - isProcessManagedBeanOk = (beanManager != null); - } - - public void observeProcessObserverMethod(@Observes ProcessObserverMethod event, - BeanManager beanManager) { - isProcessObserverMethodOk = (beanManager != null); - } - - public static boolean allEventsOk() { - return isAfterDeploymentValidationOk && isBeforeBeanDiscoveryOk && isAfterBeanDiscoveryOk - && isProcessAnnotatedTypeOk && isProcessInjectionPointOk - && isProcessInjectionTargetOk && isProcessProducerOk && isProcessBeanAttributesOk && isProcessManagedBeanOk - && isProcessObserverMethodOk; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Foo.java deleted file mode 100644 index 203ef447f3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Foo.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.event.Event; -import jakarta.enterprise.event.Observes; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - */ -@Secured -@RequestScoped -public class Foo implements Business { - - private Bar bar; - - @Inject - private Event event; - - public static Boolean legacyObserved; - - public Foo() { - } - - @Inject - public Foo(Bar bar) { - this.bar = bar; - } - - public Bar getBar() { - return bar; - } - - @Override - public void businessOperation1() { - event.fire(new BusinessOperationEvent()); - } - - @Override - public void businessOperation2() { - } - - public void observeLegacyServiceDisposal(@Observes LegacyService legacyService) { - legacyObserved = LegacyService.cleanupPerformed; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/LegacyService.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/LegacyService.java deleted file mode 100644 index faf07fb108..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/LegacyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -/** - * @author Martin Kouba - */ -public class LegacyService { - - public static boolean cleanupPerformed = false; - - public void cleanup() { - cleanupPerformed = true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/LegacyServiceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/LegacyServiceProducer.java deleted file mode 100644 index bc160c5a19..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/LegacyServiceProducer.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.Event; -import jakarta.enterprise.inject.Disposes; -import jakarta.enterprise.inject.Produces; - -/** - * @author Martin Kouba - */ -@Dependent -public class LegacyServiceProducer { - - @Produces - public LegacyService produce() { - return new LegacyService(); - } - - public void dispose(@Disposes LegacyService legacyService, Event event) { - legacyService.cleanup(); - event.fire(legacyService); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/LoggingDecorator.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/LoggingDecorator.java deleted file mode 100644 index 872cc50096..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/LoggingDecorator.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - * - */ -@Decorator -public abstract class LoggingDecorator implements Business { - - private static AtomicInteger decorationPerformed = new AtomicInteger(0); - - @Inject - @Delegate - private Business loggable; - - @Override - public void businessOperation1() { - decorationPerformed.incrementAndGet(); - loggable.businessOperation1(); - } - - public static int getNumberOfDecorationsPerformed() { - return decorationPerformed.get(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Qux.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Qux.java deleted file mode 100644 index 03f6ee8658..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Qux.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.Observes; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - */ -@Dependent -public class Qux { - - private static AtomicInteger eventsObserved = new AtomicInteger(0); - - private Baz baz; - - public Baz getBaz() { - return baz; - } - - @Inject - public void setBaz(Baz baz) { - this.baz = baz; - } - - public void observeBusinessOperations(@Observes BusinessOperationEvent event) { - eventsObserved.incrementAndGet(); - } - - public static int getEventsObserved() { - return eventsObserved.get(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Secured.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Secured.java deleted file mode 100644 index a18ff91e22..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/Secured.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.interceptor.InterceptorBinding; - -@Inherited -@Target({ TYPE }) -@Retention(RUNTIME) -@Documented -@InterceptorBinding -public @interface Secured { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/SecurityInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/SecurityInterceptor.java deleted file mode 100644 index c667f4782b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/SecurityInterceptor.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -/** - * @author Martin Kouba - */ -@Secured -@Interceptor -public class SecurityInterceptor { - - private static AtomicInteger intercepted = new AtomicInteger(0); - - @AroundInvoke - public Object alwaysReturnThis(InvocationContext ctx) throws Exception { - intercepted.incrementAndGet(); - return ctx.proceed(); - } - - public static int getNumberOfInterceptions() { - return intercepted.get(); - } - - public static void reset() { - intercepted.set(0); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/WebArchiveModulesTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/WebArchiveModulesTest.java deleted file mode 100644 index 36fb369e20..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/packaging/war/modules/WebArchiveModulesTest.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.packaging.war.modules; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_SELECTED_ALTERNATIVES_BEAN_ARCHIVE; -import static org.jboss.cdi.tck.cdi.Sections.DECORATOR_RESOLUTION; -import static org.jboss.cdi.tck.cdi.Sections.ENABLED_DECORATORS_BEAN_ARCHIVE; -import static org.jboss.cdi.tck.cdi.Sections.INIT_EVENTS; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVER_RESOLUTION; -import static org.jboss.cdi.tck.cdi.Sections.PERFORMING_TYPESAFE_RESOLUTION; -import static org.jboss.cdi.tck.cdi.Sections.PRODUCER_METHOD; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - -import java.util.Set; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * This test is aimed to verify packaging-related issues in a little bit more complex deployment scenario. The assertions are - * rather informative and redundant as they're already verified in elementary tests. - * - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class WebArchiveModulesTest extends AbstractTest { - - /** - * Modules: - *

    - *
  • A - WEB-INF/classes BDA: Foo, Secured, SecurityInterceptor, Business, BusinessOperationEvent
  • - *
  • B - WEB-INF/lib BDA: Bar, AlternativeBar, BarInspector
  • - *
  • C - WEB-INF/lib BDA: Baz, LoggingDecorator, Bazinga
  • - *
  • D - WEB-INF/lib BDA: Qux, ContainerEventsObserver, LegacyServiceProducer
  • - *
  • E - WEB-INF/lib non-BDA: LegacyService
  • - *
- * - * @return test archive - */ - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(WebArchiveModulesTest.class) - // A - .withClasses(Foo.class, Secured.class, SecurityInterceptor.class, Business.class, BusinessOperationEvent.class) - .withBeansXml(new BeansXml().alternatives(AlternativeBar.class)) - // B - .withBeanLibrary(new BeansXml().interceptors(SecurityInterceptor.class), Bar.class, AlternativeBar.class, - BarInspector.class) - // C - .withBeanLibrary(new BeansXml().decorators(LoggingDecorator.class), Baz.class, LoggingDecorator.class, - Bazinga.class) - // D - .withBeanLibrary(Qux.class, ContainerEventsObserver.class, LegacyServiceProducer.class) - // E - .withLibrary(LegacyService.class).build(); - } - - @Inject - Foo foo; - - @Test - @SpecAssertions({ @SpecAssertion(section = INIT_EVENTS, id = "bb") }) - public void testExtensionAndContainerEvents() throws Exception { - // Test extension registration and container lifecycle events - assertTrue(ContainerEventsObserver.allEventsOk()); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jg"), - @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "jh"), - @SpecAssertion(section = PERFORMING_TYPESAFE_RESOLUTION, id = "n") }) - public void testInjectionChainVisibilityAndInterceptorEnablement() { - // Test injection chain, visibility, SecurityInterceptor is enabled in B only - SecurityInterceptor.reset(); - Bar bar = foo.getBar(); - assertTrue(bar.isAlternative()); - assertTrue(bar.getBaz().getId().equals(bar.getQux().getBaz().getId())); - assertEquals(SecurityInterceptor.getNumberOfInterceptions(), 3); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = DECORATOR_RESOLUTION, id = "aa"), - @SpecAssertion(section = ENABLED_DECORATORS_BEAN_ARCHIVE, id = "a"), - @SpecAssertion(section = OBSERVER_RESOLUTION, id = "c") }) - public void testDecoratorAndCrossModuleEventObserver() throws Exception { - // Test LoggingDecorator is enabled in C only; bean from D observes event from A - foo.getBar().getBaz().businessOperation1(); - foo.businessOperation1(); - assertEquals(LoggingDecorator.getNumberOfDecorationsPerformed(), 1); - assertEquals(Qux.getEventsObserved(), 1); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PRODUCER_METHOD, id = "aa"), @SpecAssertion(section = PRODUCER_METHOD, id = "c"), - @SpecAssertion(section = OBSERVER_RESOLUTION, id = "c") }) - public void testProducerAndEventDuringDisposal() throws Exception { - // Test legacy service producer in D, bean from A is observing event fired during legacy service disposal in D - Bean bean = getUniqueBean(LegacyService.class); - CreationalContext ctx = getCurrentManager().createCreationalContext(bean); - LegacyService instance = bean.create(ctx); - bean.destroy(instance, ctx); - assertTrue(Foo.legacyObserved); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_BEAN_ARCHIVE, id = "i") }) - public void testAlternatives(BarInspector barInspector) throws Exception { - - Set> beans = getCurrentManager().getBeans(AlternativeBar.class); - assertEquals(beans.size(), 1); - assertEquals(beans.iterator().next().getBeanClass(), AlternativeBar.class); - - // Bar alternative is enabled in WEB-INF/classes only - assertFalse(barInspector.getBar().isAlternative()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/ApplicationShutdownLifecycleTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/ApplicationShutdownLifecycleTest.java deleted file mode 100644 index 6a61cc8216..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/ApplicationShutdownLifecycleTest.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.shutdown; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.APPLICATION_CONTEXT_EE; -import static org.jboss.cdi.tck.cdi.Sections.BEFORE_SHUTDOWN; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT_EE; -import static org.jboss.cdi.tck.cdi.Sections.SHUTDOWN; -import static org.testng.Assert.assertTrue; - -import java.net.URL; -import java.net.URLEncoder; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.ConversationScoped; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.inject.spi.BeforeShutdown; - -import org.jboss.arquillian.container.test.api.Deployer; -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.OperateOnDeployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.api.InSequence; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.cdi.tck.util.SimpleLogger; -import org.jboss.cdi.tck.util.TransformationUtils; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * Test application shutdown lifecycle. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -@Test(groups = INTEGRATION) -public class ApplicationShutdownLifecycleTest extends AbstractTest { - - private static final String FOO = "foo"; - - private static final String INFO = "info"; - - @Deployment(name = FOO, managed = false, testable = false) - public static WebArchive createFooTestArchive() { - return new WebArchiveBuilder() - .notTestArchive() - .withClasses(ContextDestructionObserver.class, LifecycleMonitoringExtension.class, SimpleLogger.class, - InitServlet.class, InfoClient.class, Foo.class, Bar.class, Baz.class, Qux.class) - .withExtension(LifecycleMonitoringExtension.class).build(); - } - - @Deployment(name = INFO, managed = false, testable = false) - public static WebArchive createBarTestArchive() { - return new WebArchiveBuilder().notTestArchive() - .withClasses(InfoServlet.class, ActionSequence.class, TransformationUtils.class, - TransformationUtils.Function.class) - .build(); - } - - @ArquillianResource - Deployer deployer; - - /** - * This is not a real test method. - * - * @see #testShutdown(URL, URL) - */ - @Test - @InSequence(1) - public void deployArchives() { - // In order to use @ArquillianResource URLs we need to deploy both test archives first - deployer.deploy(FOO); - deployer.deploy(INFO); - } - - /** - * Note that this test method depends on (must be run after) - * - * @throws Exception - */ - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = SHUTDOWN, id = "a"), @SpecAssertion(section = SHUTDOWN, id = "b"), - @SpecAssertion(section = REQUEST_CONTEXT_EE, id = "ja"), - @SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "ga"), - @SpecAssertion(section = BEFORE_SHUTDOWN, id = "a") }) - public void testShutdown(@ArquillianResource @OperateOnDeployment(FOO) URL fooContext, - @ArquillianResource @OperateOnDeployment(INFO) URL infoContext) throws Exception { - - // Init foo - set info archive deployment url - WebClient webClient = new WebClient(); - webClient.getPage(fooContext + "init?url=" + URLEncoder.encode(infoContext.toExternalForm(), "UTF-8")); - - // Undeploy foo - deployer.undeploy(FOO); - - // 1. Destroy contexts (the order is not set) - // 2. BeforeShutdown event - TextPage info = webClient.getPage(infoContext + "info?action=get"); - ActionSequence actual = ActionSequence.buildFromCsvData(info.getContent()); - assertTrue(actual.endsWith(BeforeShutdown.class.getName())); - actual.assertDataContainsAll(RequestScoped.class.getName(), SessionScoped.class.getName(), - ApplicationScoped.class.getName(), - ConversationScoped.class.getName(), Foo.class.getName(), Bar.class.getName(), Baz.class.getName(), - Qux.class.getName()); - - // Undeploy info - deployer.undeploy(INFO); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Bar.java deleted file mode 100644 index ac79e5f763..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Bar.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.shutdown; - -import java.io.Serializable; - -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.Conversation; -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; - -@SessionScoped -public class Bar implements Serializable { - - private static final long serialVersionUID = 1L; - - @Inject - Conversation conversation; - - @Inject - Baz baz; - - public void ping() { - conversation.begin(); - baz.ping(); - } - - @PreDestroy - public void destroy() { - InfoClient.doGetInfo(Bar.class.getName()); - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Baz.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Baz.java deleted file mode 100644 index 510ec45f8b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Baz.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.shutdown; - -import java.io.Serializable; - -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.ConversationScoped; -import jakarta.inject.Inject; - -@ConversationScoped -public class Baz implements Serializable { - - private static final long serialVersionUID = 1L; - - @Inject - Qux qux; - - public void ping() { - qux.ping(); - } - - @PreDestroy - public void destroy() { - InfoClient.doGetInfo(Baz.class.getName()); - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/ContextDestructionObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/ContextDestructionObserver.java deleted file mode 100644 index c31f5816f0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/ContextDestructionObserver.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.shutdown; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.ConversationScoped; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.event.Observes; -import jakarta.servlet.ServletContext; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.http.HttpSession; - -@Dependent -public class ContextDestructionObserver { - - public void observerRequestContextDestroyed(@Observes @Destroyed(RequestScoped.class) ServletRequest event) { - InfoClient.doGetInfo(RequestScoped.class.getName()); - } - - public void observerApplicationContextDestroyed(@Observes @Destroyed(ApplicationScoped.class) ServletContext event) { - InfoClient.doGetInfo(ApplicationScoped.class.getName()); - } - - public void observerConversationContextDestroyed(@Observes @Destroyed(ConversationScoped.class) String id) { - InfoClient.doGetInfo(ConversationScoped.class.getName()); - } - - public void observerSessionContextDestroyed(@Observes @Destroyed(SessionScoped.class) HttpSession event) { - InfoClient.doGetInfo(SessionScoped.class.getName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Foo.java deleted file mode 100644 index 3b79519a5f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Foo.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.shutdown; - -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; - -@RequestScoped -public class Foo { - - @Inject - Bar bar; - - public void ping() { - bar.ping(); - } - - @PreDestroy - public void destroy() { - InfoClient.doGetInfo(Foo.class.getName()); - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/InfoClient.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/InfoClient.java deleted file mode 100644 index 25f5282d48..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/InfoClient.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.shutdown; - -import java.net.URL; -import java.net.URLConnection; - -import org.jboss.cdi.tck.util.SimpleLogger; - -public final class InfoClient { - - private static final SimpleLogger logger = new SimpleLogger(InfoClient.class); - - private static String infoContext = null; - - public static void setInfoContext(String infoContext) { - InfoClient.infoContext = infoContext; - } - - public static void doGetInfo(String action) { - try { - URLConnection connection = new URL(infoContext + "info" + "?action=add&id=" + action).openConnection(); - connection.getInputStream().close(); - logger.log("Add action [{0}]", infoContext); - } catch (Exception e) { - logger.log("Cannot add action {0}: {1}", action, e); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/InfoServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/InfoServlet.java deleted file mode 100644 index ceb6769edc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/InfoServlet.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.shutdown; - -import java.io.IOException; - -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.util.ActionSequence; - -@SuppressWarnings("serial") -@WebServlet(urlPatterns = "/info") -public class InfoServlet extends HttpServlet { - - @Override - public void init() throws ServletException { - ActionSequence.reset(); - } - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - String action = request.getParameter("action"); - - if ("add".equals(action)) { - ActionSequence.addAction(request.getParameter("id")); - response.setStatus(HttpServletResponse.SC_OK); - response.setContentType("text/plain"); - } else if ("get".equals(action)) { - response.setStatus(HttpServletResponse.SC_OK); - response.setContentType("text/plain"); - response.getWriter().write(ActionSequence.getSequence().dataToCsv()); - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/InitServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/InitServlet.java deleted file mode 100644 index 1d38a6be6d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/InitServlet.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.deployment.shutdown; - -import java.io.IOException; -import java.net.URLDecoder; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@SuppressWarnings("serial") -@WebServlet(urlPatterns = "/init") -public class InitServlet extends HttpServlet { - - @Inject - Foo foo; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - String url = request.getParameter("url"); - - if (url != null) { - InfoClient.setInfoContext(URLDecoder.decode(url, "UTF-8")); - } else { - response.setStatus(HttpServletResponse.SC_NOT_FOUND); - } - - foo.ping(); - request.getSession().invalidate(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/LifecycleMonitoringExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/LifecycleMonitoringExtension.java deleted file mode 100644 index cc87e06889..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/LifecycleMonitoringExtension.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.shutdown; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.BeforeShutdown; -import jakarta.enterprise.inject.spi.Extension; - -/** - * - * @author Martin Kouba - */ -public class LifecycleMonitoringExtension implements Extension { - - public void observeBeforeShutdown(@Observes BeforeShutdown event) { - InfoClient.doGetInfo(BeforeShutdown.class.getName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Qux.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Qux.java deleted file mode 100644 index 5f2eded4a7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/shutdown/Qux.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.shutdown; - -import jakarta.annotation.PreDestroy; -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class Qux { - - public void ping() { - } - - @PreDestroy - public void destroy() { - InfoClient.doGetInfo(Qux.class.getName()); - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/Bike.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/Bike.java deleted file mode 100644 index 6b58dd9547..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/Bike.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2017, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.trimmed.enteprise; - -import jakarta.ejb.Singleton; - -@Singleton -public class Bike { - - public boolean ping() { - return true; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/Car.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/Car.java deleted file mode 100644 index d3012d9439..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/Car.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2017, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.trimmed.enteprise; - -import jakarta.ejb.Stateless; - -@Stateless -public class Car implements MotorizedVehicle { - - @Override - public String start() { - return "car started"; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/EnterpriseTrimmedBeanArchiveTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/EnterpriseTrimmedBeanArchiveTest.java deleted file mode 100644 index bf75e79208..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/EnterpriseTrimmedBeanArchiveTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2017, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.trimmed.enteprise; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.Instance; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.TestGroups; -import org.jboss.cdi.tck.cdi.Sections; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Tomas Remes - */ -@Test(groups = TestGroups.INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseTrimmedBeanArchiveTest extends AbstractTest { - - @Inject - TestExtension extension; - - @Inject - Instance bikeInstance; - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EnterpriseTrimmedBeanArchiveTest.class) - .withExtension(TestExtension.class) - .withBeansXml("beans.xml").build(); - } - - @Test - @SpecAssertion(section = Sections.TRIMMED_BEAN_ARCHIVE_EE, id = "a") - public void testDiscoveredBean() { - assertEquals(extension.getVehiclePBAinvocations().get(), 1); - Bean vehicleBean = getUniqueBean(MotorizedVehicle.class); - CreationalContext cc = getCurrentManager().createCreationalContext(vehicleBean); - MotorizedVehicle vehicle = (MotorizedVehicle) getCurrentManager().getReference(vehicleBean, MotorizedVehicle.class, cc); - assertEquals(vehicle.start(), "car started"); - - assertEquals(extension.getBikePBAinvocations().get(), 1); - assertTrue(bikeInstance.isResolvable()); - assertTrue(bikeInstance.get().ping()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/MotorizedVehicle.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/MotorizedVehicle.java deleted file mode 100644 index 8423b260f3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/MotorizedVehicle.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2017, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.trimmed.enteprise; - -public interface MotorizedVehicle { - - String start(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/TestExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/TestExtension.java deleted file mode 100644 index 49d9689864..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/TestExtension.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2017, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.deployment.trimmed.enteprise; - -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessBeanAttributes; - -public class TestExtension implements Extension { - - private AtomicInteger vehiclePBAinvocations = new AtomicInteger(0); - private AtomicInteger bikePBAinvocations = new AtomicInteger(0); - - void observesVehiclePBA(@Observes ProcessBeanAttributes event) { - vehiclePBAinvocations.incrementAndGet(); - } - - void observesBikePBA(@Observes ProcessBeanAttributes event) { - bikePBAinvocations.incrementAndGet(); - } - - public AtomicInteger getVehiclePBAinvocations() { - return vehiclePBAinvocations; - } - - public AtomicInteger getBikePBAinvocations() { - return bikePBAinvocations; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/notBusinessMethod/EJBObserverMethodNotBusinessMethodTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/notBusinessMethod/EJBObserverMethodNotBusinessMethodTest.java deleted file mode 100644 index 81522b2711..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/notBusinessMethod/EJBObserverMethodNotBusinessMethodTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.broken.observer.notBusinessMethod; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVER_METHODS_EE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVES_EE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test an observer method on an EJB that is neither a business method nor a static method of the class. - * - * @author David Allen - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EJBObserverMethodNotBusinessMethodTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EJBObserverMethodNotBusinessMethodTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = OBSERVER_METHODS_EE, id = "d") - @SpecAssertion(section = OBSERVES_EE, id = "g") - public void testObserverMethodOnEnterpriseBeanNotBusinessMethodOrStaticFails() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/notBusinessMethod/Terrier.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/notBusinessMethod/Terrier.java deleted file mode 100644 index 7af9a12aac..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/notBusinessMethod/Terrier.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.broken.observer.notBusinessMethod; - -import jakarta.ejb.Local; - -@Local -public interface Terrier { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier_Broken.java deleted file mode 100644 index c2dc4f7ea0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier_Broken.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.broken.observer.notBusinessMethod; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.event.Observes; - -@Stateless -public class TibetanTerrier_Broken implements Terrier { - public void observeSomeEvent(@Observes String someEvent) { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/EJBAsyncObserverMethodRemoteBusinessMethodTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/EJBAsyncObserverMethodRemoteBusinessMethodTest.java deleted file mode 100644 index c2dc7f662f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/EJBAsyncObserverMethodRemoteBusinessMethodTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.broken.observer.remoteBusinessMethod; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVER_METHODS_EE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVES_EE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EJBAsyncObserverMethodRemoteBusinessMethodTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withClasses(Terrier.class, FoxTerrrier.class) - .withTestClass(EJBAsyncObserverMethodRemoteBusinessMethodTest.class) - .build(); - } - - @Test(groups = { INTEGRATION, JAVAEE_FULL }) - @SpecAssertion(section = OBSERVER_METHODS_EE, id = "d") - @SpecAssertion(section = OBSERVES_EE, id = "g") - public void testAsyncObserverMethodOnRemoteBusinessMethodFails() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/EJBObserverMethodRemoteBusinessMethodTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/EJBObserverMethodRemoteBusinessMethodTest.java deleted file mode 100644 index 65a5670865..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/EJBObserverMethodRemoteBusinessMethodTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.broken.observer.remoteBusinessMethod; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVER_METHODS_EE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVES_EE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EJBObserverMethodRemoteBusinessMethodTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withClasses(Terrier.class, TibetanTerrier.class) - .withTestClass(EJBObserverMethodRemoteBusinessMethodTest.class).build(); - } - - @Test(groups = { INTEGRATION, JAVAEE_FULL }) - @SpecAssertion(section = OBSERVER_METHODS_EE, id = "d") - @SpecAssertion(section = OBSERVES_EE, id = "g") - public void testObserverMethodOnRemoteBusinessMethodFails() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/FoxTerrrier.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/FoxTerrrier.java deleted file mode 100644 index 2e9f0b37a6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/FoxTerrrier.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.broken.observer.remoteBusinessMethod; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.event.ObservesAsync; - -@Stateless -public class FoxTerrrier implements Terrier { - - @Override - public void observeSomeEvent(@ObservesAsync String someEvent) { - - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/Terrier.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/Terrier.java deleted file mode 100644 index 2b5e6494f9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/Terrier.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.broken.observer.remoteBusinessMethod; - -import jakarta.ejb.Remote; - -@Remote -public interface Terrier { - - void observeSomeEvent(String someEvent); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/TibetanTerrier.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/TibetanTerrier.java deleted file mode 100644 index b312aac6a8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/remoteBusinessMethod/TibetanTerrier.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.broken.observer.remoteBusinessMethod; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.event.Observes; - -@Stateless -public class TibetanTerrier implements Terrier { - - public void observeSomeEvent(@Observes String someEvent) { - - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Foo.java deleted file mode 100644 index 3dfbf95fbe..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Foo.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context; - -public class Foo { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/FooObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/FooObserver.java deleted file mode 100644 index 4d9d51e965..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/FooObserver.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; - -import javax.naming.InitialContext; - -import jakarta.ejb.EJB; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.event.TransactionPhase; -import jakarta.transaction.TransactionSynchronizationRegistry; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Dependent -public class FooObserver { - - @EJB - private Toner toner; - - @EJB - private Printer printer; - - private static TransactionSynchronizationRegistry tsr; - - public void observeInProgress(@Observes(during = TransactionPhase.IN_PROGRESS) Foo foo) throws Exception { - // this observer method is called first and we do not have to look up TransactionSynchronizationRegistry each time - if (tsr == null) { - tsr = (TransactionSynchronizationRegistry) InitialContext.doLookup("java:comp/TransactionSynchronizationRegistry"); - } - assertEquals(tsr.getTransactionKey(), Printer.getKey(), - "Non-transactional observer method was NOT called in the same transaction context as the invocation of Event.fire()"); - assertClientSecurityContext(TransactionPhase.IN_PROGRESS); - } - - public void observeBeforeCompletion(@Observes(during = TransactionPhase.BEFORE_COMPLETION) Foo foo) throws Exception { - assertEquals(tsr.getTransactionKey(), Printer.getKey(), - "Before completion transactional observer method was NOT called within the context of the transaction that was about to complete."); - assertClientSecurityContext(TransactionPhase.BEFORE_COMPLETION); - } - - public void observeAfterCompletion(@Observes(during = TransactionPhase.AFTER_COMPLETION) Foo foo) throws Exception { - assertClientSecurityContext(TransactionPhase.AFTER_COMPLETION); - } - - public void observeAfterFailure(@Observes(during = TransactionPhase.AFTER_FAILURE) Foo foo) throws Exception { - assertClientSecurityContext(TransactionPhase.AFTER_FAILURE); - } - - public void observeAfterSuccess(@Observes(during = TransactionPhase.AFTER_SUCCESS) Foo foo) throws Exception { - assertClientSecurityContext(TransactionPhase.AFTER_SUCCESS); - } - - private void assertClientSecurityContext(TransactionPhase phase) { - - toner.spill(); - try { - printer.tryAccess(); - fail("Transactional observer method was NOT called within the same client security context."); - } catch (jakarta.ejb.EJBAccessException expected) { - // OK - } - - ActionSequence.addAction(phase.toString()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/ObserverMethodInvocationContextTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/ObserverMethodInvocationContextTest.java deleted file mode 100644 index 35382dae6d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/ObserverMethodInvocationContextTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.TestGroups.PERSISTENCE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVER_METHOD_INVOCATION_CONTEXT; - -import jakarta.enterprise.event.TransactionPhase; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Matus Abaffy - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ObserverMethodInvocationContextTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ObserverMethodInvocationContextTest.class) - .withDefaultPersistenceXml() - .build(); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, groups = { PERSISTENCE, JAVAEE_FULL }) - @SpecAssertions({ @SpecAssertion(section = OBSERVER_METHOD_INVOCATION_CONTEXT, id = "a"), - @SpecAssertion(section = OBSERVER_METHOD_INVOCATION_CONTEXT, id = "b"), - @SpecAssertion(section = OBSERVER_METHOD_INVOCATION_CONTEXT, id = "c") }) - public void testTransactionalObserverMethod(Student student) throws Exception { - ActionSequence.reset(); - - student.printSuccess(); - student.printFailure(); - - // Checking transaction and client security context is done in FooObserver - ActionSequence.assertSequenceDataContainsAll(TransactionPhase.IN_PROGRESS.toString(), - TransactionPhase.BEFORE_COMPLETION.toString(), TransactionPhase.AFTER_COMPLETION.toString(), - TransactionPhase.AFTER_SUCCESS.toString(), TransactionPhase.AFTER_FAILURE.toString()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Printer.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Printer.java deleted file mode 100644 index 1e30ff29e1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Printer.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context; - -import jakarta.annotation.Resource; -import jakarta.annotation.security.RolesAllowed; -import jakarta.annotation.security.RunAs; -import jakarta.ejb.EJB; -import jakarta.ejb.Stateless; -import jakarta.ejb.TransactionManagement; -import jakarta.ejb.TransactionManagementType; -import jakarta.enterprise.event.Event; -import jakarta.inject.Inject; -import jakarta.transaction.TransactionSynchronizationRegistry; -import jakarta.transaction.UserTransaction; - -@Stateless -@RunAs("printer") -@RolesAllowed("student") -@TransactionManagement(TransactionManagementType.BEAN) -public class Printer { - - @EJB - private Toner toner; - - @Resource - private TransactionSynchronizationRegistry tsr; - - @Resource - private UserTransaction userTransaction; - - @Inject - Event event; - - private static Object key; - - public static Object getKey() { - return key; - } - - public void printSuccess() throws Exception { - userTransaction.begin(); - - // we need to set the key before firing an event as the observer checks for equality - key = tsr.getTransactionKey(); - - toner.spill(); - event.fire(new Foo()); - - userTransaction.commit(); - } - - public void printFailure() throws Exception { - userTransaction.begin(); - - // we need to set the key before firing an event as the observer checks for equality - key = tsr.getTransactionKey(); - - toner.spill(); - event.fire(new Foo()); - - userTransaction.rollback(); - } - - public void tryAccess() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Student.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Student.java deleted file mode 100644 index 11436c342d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Student.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context; - -import jakarta.annotation.security.PermitAll; -import jakarta.annotation.security.RunAs; -import jakarta.ejb.EJB; -import jakarta.ejb.Stateful; - -@Stateful -@RunAs("student") -@PermitAll -public class Student { - - @EJB - private Printer printer; - - public void printSuccess() throws Exception { - printer.printSuccess(); - } - - public void printFailure() throws Exception { - printer.printFailure(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Toner.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Toner.java deleted file mode 100644 index 1e992f6cde..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/Toner.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context; - -import jakarta.annotation.security.RolesAllowed; -import jakarta.ejb.Stateless; - -@Stateless -@RolesAllowed("printer") -public class Toner { - - public void spill() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/AsyncMessageObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/AsyncMessageObserver.java deleted file mode 100644 index eaafc7999f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/AsyncMessageObserver.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.async; - -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.event.ObservesAsync; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.transaction.SystemException; -import jakarta.transaction.UserTransaction; - -@ApplicationScoped -public class AsyncMessageObserver { - - @Inject - UserTransaction transaction; - - @Inject - Counter counter; - - @Inject - BeanManager bm; - - public static AtomicBoolean requestScopeActive = new AtomicBoolean(false); - - public static AtomicInteger status = new AtomicInteger(); - public static AtomicBoolean counterIsZero = new AtomicBoolean(); - - public void observe(@ObservesAsync Message message) throws SystemException { - status.set(transaction.getStatus()); - - } - - public void observe(@ObservesAsync String text) { - requestScopeActive.set(bm.getContext(RequestScoped.class).isActive()); - counterIsZero.set(counter.getCount().get() > 0 ? false : true); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/AsyncObserverMethodInvocationContextTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/AsyncObserverMethodInvocationContextTest.java deleted file mode 100644 index fcd6a9c86b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/AsyncObserverMethodInvocationContextTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.async; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVER_METHOD_INVOCATION_CONTEXT; -import static org.jboss.cdi.tck.cdi.Sections.REQUEST_CONTEXT; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; - -import jakarta.enterprise.event.Event; -import jakarta.inject.Inject; -import jakarta.transaction.Status; -import jakarta.transaction.UserTransaction; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class AsyncObserverMethodInvocationContextTest extends AbstractTest { - - @Inject - UserTransaction userTransaction; - - @Inject - Event event; - - @Inject - Event stringEvent; - - @Inject - Counter counter; - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(AsyncObserverMethodInvocationContextTest.class).build(); - } - - @Test - @SpecAssertion(section = OBSERVER_METHOD_INVOCATION_CONTEXT, id = "ab") - public void testAsyncObserverIsCalledInNewTransactionContext() throws Exception { - userTransaction.begin(); - BlockingQueue queue = new LinkedBlockingQueue<>(); - event.fireAsync(new Message()).thenAccept(queue::offer); - Message message = queue.poll(2l, TimeUnit.SECONDS); - assertNotNull(message); - assertEquals(Status.STATUS_NO_TRANSACTION, AsyncMessageObserver.status.get()); - userTransaction.commit(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = OBSERVER_METHOD_INVOCATION_CONTEXT, id = "aa"), - @SpecAssertion(section = REQUEST_CONTEXT, id = "da") }) - public void testAsyncObserverIsCalledInNewRequestContext() throws Exception { - counter.increment(); - BlockingQueue queue = new LinkedBlockingQueue<>(); - stringEvent.fireAsync(new String()).thenAccept(queue::offer); - String string = queue.poll(2l, TimeUnit.SECONDS); - assertNotNull(string); - assertTrue(AsyncMessageObserver.requestScopeActive.get()); - assertTrue(AsyncMessageObserver.counterIsZero.get()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/Counter.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/Counter.java deleted file mode 100644 index 2fb7eb1ca3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/Counter.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.async; - -import java.util.concurrent.atomic.AtomicInteger; - -import jakarta.enterprise.context.RequestScoped; - -@RequestScoped -public class Counter { - - private AtomicInteger count = new AtomicInteger(); - - public void increment() { - count.incrementAndGet(); - } - - public AtomicInteger getCount() { - return count; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/Message.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/Message.java deleted file mode 100644 index 3b0f89abf8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/Message.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.async; - -public class Message { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/EnterpriseSecurityContextPropagationInAsyncObserverTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/EnterpriseSecurityContextPropagationInAsyncObserverTest.java deleted file mode 100644 index 5ad8763539..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/EnterpriseSecurityContextPropagationInAsyncObserverTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.async.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVER_METHOD_INVOCATION_CONTEXT_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.concurrent.ExecutionException; - -import jakarta.ejb.EJBAccessException; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@Test(groups = { INTEGRATION, JAVAEE_FULL }) -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseSecurityContextPropagationInAsyncObserverTest extends AbstractTest { - - @Inject - Student student; - - @Inject - Teacher teacher; - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EnterpriseSecurityContextPropagationInAsyncObserverTest.class) - .build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = OBSERVER_METHOD_INVOCATION_CONTEXT_EE, id = "a"), - @SpecAssertion(section = OBSERVER_METHOD_INVOCATION_CONTEXT_EE, id = "b") }) - public void testSecurityContextPropagation() throws InterruptedException, ExecutionException { - assertEquals(Student.STUDENT_MESSAGE, student.print().getContent()); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = OBSERVER_METHOD_INVOCATION_CONTEXT_EE, id = "a"), - @SpecAssertion(section = OBSERVER_METHOD_INVOCATION_CONTEXT_EE, id = "b") }) - public void testSecurityContextNotPropagated() throws InterruptedException { - Throwable expectedException = teacher.print(); - assertNotNull(expectedException); - assertTrue(expectedException.getCause() instanceof EJBAccessException); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Printer.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Printer.java deleted file mode 100644 index ca16b7c0fb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Printer.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.async.enterprise; - -import jakarta.annotation.security.RolesAllowed; -import jakarta.ejb.Stateless; -import jakarta.enterprise.event.ObservesAsync; - -@Stateless -@RolesAllowed("student") -public class Printer { - - public void observes(@ObservesAsync Text text) { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Student.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Student.java deleted file mode 100644 index b2f453be1f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Student.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.async.enterprise; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; - -import jakarta.annotation.security.PermitAll; -import jakarta.annotation.security.RunAs; -import jakarta.ejb.Stateful; -import jakarta.enterprise.event.Event; -import jakarta.inject.Inject; - -@Stateful -@RunAs("student") -@PermitAll -public class Student { - - public static String STUDENT_MESSAGE = "student message"; - - @Inject - Event printer; - - public Text print() throws ExecutionException, InterruptedException { - BlockingQueue sync = new LinkedBlockingQueue<>(); - printer.fireAsync(new Text(STUDENT_MESSAGE)).thenAccept(sync::offer); - return sync.poll(2l, TimeUnit.SECONDS); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Teacher.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Teacher.java deleted file mode 100644 index 205ae12905..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Teacher.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.async.enterprise; - -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; - -import jakarta.annotation.security.PermitAll; -import jakarta.ejb.Stateful; -import jakarta.enterprise.event.Event; -import jakarta.inject.Inject; - -@Stateful -@PermitAll -public class Teacher { - - public static String TEACHER_MESSAGE = "teacher message"; - - @Inject - Event printer; - - public Throwable print() throws InterruptedException { - BlockingQueue sync = new LinkedBlockingQueue<>(); - // this expects jakarta.ejb.EJBAccessException so the queue accepts only Throwable instance - printer.fireAsync(new Text(TEACHER_MESSAGE)).whenComplete((text, throwable) -> sync.offer(throwable)); - return sync.poll(2l, TimeUnit.SECONDS); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Text.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Text.java deleted file mode 100644 index ff35860c28..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/async/enterprise/Text.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.async.enterprise; - -public class Text { - - public String getContent() { - return content; - } - - private String content; - - public Text(String content) { - this.content = content; - - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Foo.java deleted file mode 100644 index bca57320bc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Foo.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.enterprise; - -public class Foo { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/FooObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/FooObserver.java deleted file mode 100644 index 62d1760496..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/FooObserver.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.enterprise; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; - -import javax.naming.InitialContext; - -import jakarta.annotation.Resource; -import jakarta.annotation.security.RolesAllowed; -import jakarta.ejb.EJB; -import jakarta.ejb.SessionContext; -import jakarta.ejb.Stateless; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.event.TransactionPhase; -import jakarta.transaction.TransactionSynchronizationRegistry; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Stateless -@RolesAllowed("printer") -public class FooObserver implements ObserverLocal { - - @EJB - private Toner toner; - - @EJB - private Printer printer; - - @Resource - private SessionContext sc; - - private static TransactionSynchronizationRegistry tsr; - - @Override - public void observeInProgress(@Observes(during = TransactionPhase.IN_PROGRESS) Foo foo) throws Exception { - // this observer method is called first and we do not have to look up TransactionSynchronizationRegistry each time - if (tsr == null) { - tsr = (TransactionSynchronizationRegistry) InitialContext.doLookup("java:comp/TransactionSynchronizationRegistry"); - } - assertEquals(tsr.getTransactionKey(), Printer.getKey(), - "Non-transactional observer method was NOT called in the same transaction context as the invocation of Event.fire()"); - assertClientSecurityContext(TransactionPhase.IN_PROGRESS); - } - - @Override - public void observeBeforeCompletion(@Observes(during = TransactionPhase.BEFORE_COMPLETION) Foo foo) throws Exception { - assertEquals(tsr.getTransactionKey(), Printer.getKey(), - "Before completion transactional observer method was NOT called within the context of the transaction that was about to complete."); - assertClientSecurityContext(TransactionPhase.BEFORE_COMPLETION); - } - - @Override - public void observeAfterCompletion(@Observes(during = TransactionPhase.AFTER_COMPLETION) Foo foo) throws Exception { - assertClientSecurityContext(TransactionPhase.AFTER_COMPLETION); - } - - @Override - public void observeAfterFailure(@Observes(during = TransactionPhase.AFTER_FAILURE) Foo foo) throws Exception { - assertClientSecurityContext(TransactionPhase.AFTER_FAILURE); - } - - @Override - public void observeAfterSuccess(@Observes(during = TransactionPhase.AFTER_SUCCESS) Foo foo) throws Exception { - assertClientSecurityContext(TransactionPhase.AFTER_SUCCESS); - } - - private void assertClientSecurityContext(TransactionPhase phase) { - - assertTrue(sc.isCallerInRole("printer")); - - toner.spill(); - try { - printer.tryAccess(); - fail("Transactional observer method was NOT called within the same client security context."); - } catch (jakarta.ejb.EJBAccessException expected) { - // OK - } - - ActionSequence.addAction(phase.toString()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/ObserverLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/ObserverLocal.java deleted file mode 100644 index 11dac2e41c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/ObserverLocal.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface ObserverLocal { - - public void observeInProgress(Foo foo) throws Exception; - - public void observeBeforeCompletion(Foo foo) throws Exception; - - public void observeAfterCompletion(Foo foo) throws Exception; - - public void observeAfterFailure(Foo foo) throws Exception; - - public void observeAfterSuccess(Foo foo) throws Exception; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Printer.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Printer.java deleted file mode 100644 index 40bfea03c9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Printer.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.enterprise; - -import jakarta.annotation.Resource; -import jakarta.annotation.security.RolesAllowed; -import jakarta.annotation.security.RunAs; -import jakarta.ejb.EJB; -import jakarta.ejb.Stateless; -import jakarta.ejb.TransactionManagement; -import jakarta.ejb.TransactionManagementType; -import jakarta.enterprise.event.Event; -import jakarta.inject.Inject; -import jakarta.transaction.TransactionSynchronizationRegistry; -import jakarta.transaction.UserTransaction; - -@Stateless -@RunAs("printer") -@RolesAllowed("student") -@TransactionManagement(TransactionManagementType.BEAN) -public class Printer { - - @EJB - private Toner toner; - - @Resource - private TransactionSynchronizationRegistry tsr; - - @Resource - private UserTransaction userTransaction; - - @Inject - Event event; - - private static Object key; - - public static Object getKey() { - return key; - } - - public void printSuccess() throws Exception { - userTransaction.begin(); - - // we need to set the key before firing an event as the observer checks for equality - key = tsr.getTransactionKey(); - - toner.spill(); - event.fire(new Foo()); - - userTransaction.commit(); - } - - public void printFailure() throws Exception { - userTransaction.begin(); - - // we need to set the key before firing an event as the observer checks for equality - key = tsr.getTransactionKey(); - - toner.spill(); - event.fire(new Foo()); - - userTransaction.rollback(); - } - - public void tryAccess() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/SessionBeanObserverMethodInvocationContextTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/SessionBeanObserverMethodInvocationContextTest.java deleted file mode 100644 index 8e081337a8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/SessionBeanObserverMethodInvocationContextTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.enterprise; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.TestGroups.PERSISTENCE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVER_METHOD_INVOCATION_CONTEXT; - -import jakarta.enterprise.event.TransactionPhase; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Matus Abaffy - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionBeanObserverMethodInvocationContextTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SessionBeanObserverMethodInvocationContextTest.class) - .withDefaultPersistenceXml() - .build(); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, groups = { PERSISTENCE, JAVAEE_FULL }) - @SpecAssertions({ @SpecAssertion(section = OBSERVER_METHOD_INVOCATION_CONTEXT, id = "a"), - @SpecAssertion(section = OBSERVER_METHOD_INVOCATION_CONTEXT, id = "b"), - @SpecAssertion(section = OBSERVER_METHOD_INVOCATION_CONTEXT, id = "c") }) - public void testTransactionalObserverMethod(Student student) throws Exception { - ActionSequence.reset(); - - student.printSuccess(); - student.printFailure(); - - // Checking transaction and client security context is done in FooObserver - ActionSequence.assertSequenceDataContainsAll(TransactionPhase.IN_PROGRESS.toString(), - TransactionPhase.BEFORE_COMPLETION.toString(), TransactionPhase.AFTER_COMPLETION.toString(), - TransactionPhase.AFTER_SUCCESS.toString(), TransactionPhase.AFTER_FAILURE.toString()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Student.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Student.java deleted file mode 100644 index 32c7ce5330..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Student.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.enterprise; - -import jakarta.annotation.security.PermitAll; -import jakarta.annotation.security.RunAs; -import jakarta.ejb.EJB; -import jakarta.ejb.Stateful; - -@Stateful -@RunAs("student") -@PermitAll -public class Student { - - @EJB - private Printer printer; - - public void printSuccess() throws Exception { - printer.printSuccess(); - } - - public void printFailure() throws Exception { - printer.printFailure(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Toner.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Toner.java deleted file mode 100644 index df38365482..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/Toner.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.enterprise; - -import jakarta.annotation.security.RolesAllowed; -import jakarta.ejb.Stateless; - -@Stateless -@RolesAllowed("printer") -public class Toner { - - public void spill() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Foo.java deleted file mode 100644 index d639eb9e19..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Foo.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.enterprise.staticMethod; - -public class Foo { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/FooObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/FooObserver.java deleted file mode 100644 index ebc24bb4fc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/FooObserver.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.enterprise.staticMethod; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; - -import javax.naming.InitialContext; - -import jakarta.annotation.security.DeclareRoles; -import jakarta.ejb.EJBContext; -import jakarta.ejb.Stateless; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.event.TransactionPhase; -import jakarta.transaction.TransactionSynchronizationRegistry; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Stateless -@DeclareRoles({ "student", "printer" }) -public class FooObserver { - - private static TransactionSynchronizationRegistry tsr; - private static EJBContext ejbContext; - - private static Toner toner; - private static Printer printer; - - public static void observeInProgress(@Observes(during = TransactionPhase.IN_PROGRESS) Foo foo) throws Exception { - // this observer method is called first -> it is sufficient to lookup the needed resources just once - if (tsr == null) { - init(); - } - - assertEquals(tsr.getTransactionKey(), Printer.getKey(), - "Non-transactional observer method was NOT called in the same transaction context as the invocation of Event.fire()"); - assertClientSecurityContext(TransactionPhase.IN_PROGRESS); - } - - private static void init() throws Exception { - tsr = (TransactionSynchronizationRegistry) InitialContext.doLookup("java:comp/TransactionSynchronizationRegistry"); - ejbContext = (EJBContext) InitialContext.doLookup("java:comp/EJBContext"); - toner = (Toner) InitialContext.doLookup("java:module/Toner"); - printer = (Printer) InitialContext.doLookup("java:module/Printer"); - } - - public static void observeBeforeCompletion(@Observes(during = TransactionPhase.BEFORE_COMPLETION) Foo foo) - throws Exception { - assertEquals(tsr.getTransactionKey(), Printer.getKey(), - "Before completion transactional observer method was NOT called within the context of the transaction that was about to complete."); - assertClientSecurityContext(TransactionPhase.BEFORE_COMPLETION); - } - - public static void observeAfterCompletion(@Observes(during = TransactionPhase.AFTER_COMPLETION) Foo foo) throws Exception { - assertClientSecurityContext(TransactionPhase.AFTER_COMPLETION); - } - - public static void observeAfterFailure(@Observes(during = TransactionPhase.AFTER_FAILURE) Foo foo) throws Exception { - assertClientSecurityContext(TransactionPhase.AFTER_FAILURE); - } - - public static void observeAfterSuccess(@Observes(during = TransactionPhase.AFTER_SUCCESS) Foo foo) throws Exception { - assertClientSecurityContext(TransactionPhase.AFTER_SUCCESS); - } - - private static void assertClientSecurityContext(TransactionPhase phase) { - assertTrue(ejbContext.isCallerInRole("student")); - assertTrue(!ejbContext.isCallerInRole("printer")); - - toner.spill(); - try { - printer.tryAccess(); - fail("Transactional observer method was NOT called within the same client security context."); - } catch (jakarta.ejb.EJBAccessException expected) { - // OK - } - - ActionSequence.addAction(phase.toString()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Printer.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Printer.java deleted file mode 100644 index 508c579989..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Printer.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.enterprise.staticMethod; - -import jakarta.annotation.Resource; -import jakarta.annotation.security.RolesAllowed; -import jakarta.annotation.security.RunAs; -import jakarta.ejb.EJB; -import jakarta.ejb.Stateless; -import jakarta.ejb.TransactionManagement; -import jakarta.ejb.TransactionManagementType; -import jakarta.enterprise.event.Event; -import jakarta.inject.Inject; -import jakarta.transaction.TransactionSynchronizationRegistry; -import jakarta.transaction.UserTransaction; - -@Stateless -@RunAs("printer") -@RolesAllowed("student") -@TransactionManagement(TransactionManagementType.BEAN) -public class Printer { - - @EJB - private Toner toner; - - @Resource - private TransactionSynchronizationRegistry tsr; - - @Resource - private UserTransaction userTransaction; - - @Inject - Event event; - - private static Object key; - - public static Object getKey() { - return key; - } - - public void printSuccess() throws Exception { - userTransaction.begin(); - - // we need to set the key before firing an event as the observer checks for equality - key = tsr.getTransactionKey(); - - toner.spill(); - event.fire(new Foo()); - - userTransaction.commit(); - } - - public void printFailure() throws Exception { - userTransaction.begin(); - - // we need to set the key before firing an event as the observer checks for equality - key = tsr.getTransactionKey(); - - toner.spill(); - event.fire(new Foo()); - - userTransaction.rollback(); - } - - public void tryAccess() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/SessionBeanStaticObserverMethodInvocationContextTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/SessionBeanStaticObserverMethodInvocationContextTest.java deleted file mode 100644 index cb75c0965e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/SessionBeanStaticObserverMethodInvocationContextTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.enterprise.staticMethod; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.TestGroups.PERSISTENCE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVER_METHOD_INVOCATION_CONTEXT; - -import jakarta.enterprise.event.TransactionPhase; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Matus Abaffy - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionBeanStaticObserverMethodInvocationContextTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SessionBeanStaticObserverMethodInvocationContextTest.class) - .withDefaultPersistenceXml() - .build(); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, groups = { PERSISTENCE, JAVAEE_FULL }) - @SpecAssertions({ @SpecAssertion(section = OBSERVER_METHOD_INVOCATION_CONTEXT, id = "a"), - @SpecAssertion(section = OBSERVER_METHOD_INVOCATION_CONTEXT, id = "b"), - @SpecAssertion(section = OBSERVER_METHOD_INVOCATION_CONTEXT, id = "c") }) - public void testTransactionalObserverMethod(Student student) throws Exception { - ActionSequence.reset(); - - student.printSuccess(); - student.printFailure(); - - // Checking transaction and client security context is done in FooObserver - ActionSequence.assertSequenceDataContainsAll(TransactionPhase.IN_PROGRESS.toString(), - TransactionPhase.BEFORE_COMPLETION.toString(), TransactionPhase.AFTER_COMPLETION.toString(), - TransactionPhase.AFTER_SUCCESS.toString(), TransactionPhase.AFTER_FAILURE.toString()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Student.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Student.java deleted file mode 100644 index b328d7ce98..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Student.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.enterprise.staticMethod; - -import jakarta.annotation.security.PermitAll; -import jakarta.annotation.security.RunAs; -import jakarta.ejb.EJB; -import jakarta.ejb.Stateful; - -@Stateful -@RunAs("student") -@PermitAll -public class Student { - - @EJB - private Printer printer; - - public void printSuccess() throws Exception { - printer.printSuccess(); - } - - public void printFailure() throws Exception { - printer.printFailure(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Toner.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Toner.java deleted file mode 100644 index 9ccfd599dc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/context/enterprise/staticMethod/Toner.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.context.enterprise.staticMethod; - -import jakarta.annotation.security.RolesAllowed; -import jakarta.ejb.Stateless; - -@Stateless -@RolesAllowed("printer") -public class Toner { - - public void spill() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/Egg.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/Egg.java deleted file mode 100644 index ed81ac7615..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/Egg.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.inheritance.enterprise; - -public class Egg extends EventPayload { - - public void recordVisit(FarmerLocal farmer) { - recordVisit(farmer.getName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/EnterpriseObserverInheritanceTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/EnterpriseObserverInheritanceTest.java deleted file mode 100644 index 5cbc531b57..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/EnterpriseObserverInheritanceTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.inheritance.enterprise; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.MEMBER_LEVEL_INHERITANCE_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Event observer inheritance test with enterprise beans. - * - * @author Shane Bryzak - * @author Martin Kouba - */ -@Test(groups = JAVAEE_FULL) -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseObserverInheritanceTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - return new EnterpriseArchiveBuilder().withTestClassPackage(EnterpriseObserverInheritanceTest.class) - .withBeansXml(new BeansXml(BeanDiscoveryMode.ALL)).build(); - } - - @Test - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "df") - public void testNonStaticObserverMethodInherited() throws Exception { - Egg egg = new Egg(); - getCurrentManager().getEvent().select(Egg.class).fire(egg); - assertEquals(egg.getVisited().size(), 2); - assertTrue(egg.getVisited().contains(Farmer.class.getSimpleName())); - assertTrue(egg.getVisited().contains(LazyFarmer.class.getSimpleName())); - } - - @Test - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "dl") - public void testNonStaticObserverMethodIndirectlyInherited() throws Exception { - StockPrice stockPrice = new StockPrice(); - getCurrentManager().getEvent().select(StockPrice.class).fire(stockPrice); - assertEquals(stockPrice.getVisited().size(), 3); - assertTrue(stockPrice.getVisited().contains(StockWatcher.class.getSimpleName())); - assertTrue(stockPrice.getVisited().contains(IntermediateStockWatcher.class.getSimpleName())); - assertTrue(stockPrice.getVisited().contains(IndirectStockWatcher.class.getSimpleName())); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/EventPayload.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/EventPayload.java deleted file mode 100644 index 47888e953c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/EventPayload.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.inheritance.enterprise; - -import java.util.ArrayList; -import java.util.List; - -abstract class EventPayload { - private List visited = new ArrayList(); - - public List getVisited() { - return visited; - } - - public void recordVisit(String name) { - visited.add(name); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/Farmer.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/Farmer.java deleted file mode 100644 index f5f3828169..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/Farmer.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.inheritance.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.event.Observes; - -public @Stateful class Farmer implements FarmerLocal { - public void observeEggLaying(@Observes Egg egg) { - egg.recordVisit(this); - } - - public String getName() { - return Farmer.class.getSimpleName(); - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/FarmerLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/FarmerLocal.java deleted file mode 100644 index 6dcf271ec4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/FarmerLocal.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.inheritance.enterprise; - -import jakarta.ejb.Local; -import jakarta.enterprise.event.Observes; - -public @Local interface FarmerLocal { - - void observeEggLaying(@Observes Egg egg); - - public String getName(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/IndirectStockWatcher.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/IndirectStockWatcher.java deleted file mode 100644 index 5e257a2983..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/IndirectStockWatcher.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.inheritance.enterprise; - -import jakarta.ejb.Stateful; - -public @Stateful class IndirectStockWatcher extends IntermediateStockWatcher - implements IndirectStockWatcherLocal, StockWatcherLocal { - - @Override - public String getName() { - return IndirectStockWatcher.class.getSimpleName(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/IndirectStockWatcherLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/IndirectStockWatcherLocal.java deleted file mode 100644 index 8b2515112b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/IndirectStockWatcherLocal.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.inheritance.enterprise; - -import jakarta.ejb.Local; - -public @Local interface IndirectStockWatcherLocal { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/IntermediateStockWatcher.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/IntermediateStockWatcher.java deleted file mode 100644 index 706fda3f62..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/IntermediateStockWatcher.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.inheritance.enterprise; - -public class IntermediateStockWatcher extends StockWatcher { - - @Override - public String getName() { - return IntermediateStockWatcher.class.getSimpleName(); - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/LazyFarmer.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/LazyFarmer.java deleted file mode 100644 index 0d8ef5b92c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/LazyFarmer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.inheritance.enterprise; - -import jakarta.ejb.Stateful; - -public @Stateful class LazyFarmer extends Farmer implements LazyFarmerLocal, FarmerLocal { - - @Override - public String getName() { - return LazyFarmer.class.getSimpleName(); - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/LazyFarmerLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/LazyFarmerLocal.java deleted file mode 100644 index df3539c1f3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/LazyFarmerLocal.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.inheritance.enterprise; - -import jakarta.ejb.Local; - -public @Local interface LazyFarmerLocal { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/StockPrice.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/StockPrice.java deleted file mode 100644 index ac1c9a1e93..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/StockPrice.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.inheritance.enterprise; - -public class StockPrice extends EventPayload { - - public void recordVisit(StockWatcherLocal stockWatcher) { - recordVisit(stockWatcher.getName()); - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/StockWatcher.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/StockWatcher.java deleted file mode 100644 index ce9549f3c2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/StockWatcher.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.inheritance.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.event.Observes; - -public @Stateful class StockWatcher implements StockWatcherLocal { - public void observeStockPrice(@Observes StockPrice price) { - price.recordVisit(this); - } - - public String getName() { - return StockWatcher.class.getSimpleName(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/StockWatcherLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/StockWatcherLocal.java deleted file mode 100644 index 70504763a0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/inheritance/enterprise/StockWatcherLocal.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.inheritance.enterprise; - -import jakarta.ejb.Local; -import jakarta.enterprise.event.Observes; - -public @Local interface StockWatcherLocal { - void observeStockPrice(@Observes StockPrice price); - - String getName(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/contextLifecycleEvent/ee/InfoServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/contextLifecycleEvent/ee/InfoServlet.java deleted file mode 100644 index 4e3c4957fe..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/contextLifecycleEvent/ee/InfoServlet.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.priority.contextLifecycleEvent.ee; - -import java.io.IOException; -import java.io.PrintWriter; - -import jakarta.inject.Inject; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@WebServlet("/") -public class InfoServlet extends HttpServlet { - - @Inject - RequestContextLifecycleObserver observer; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - - PrintWriter pwr = resp.getWriter(); - pwr.append("Initialized observer sequence: "); - observer.getInitializedEvents().stream().forEach(pwr::append); - pwr.append("\n"); - pwr.append("Destroyed observer sequence: "); - observer.getDestroyedEvents().stream().forEach(pwr::append); - pwr.append("\n"); - resp.setContentType("text/plain"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/contextLifecycleEvent/ee/RequestContextLifecycleEventObserverOrderingTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/contextLifecycleEvent/ee/RequestContextLifecycleEventObserverOrderingTest.java deleted file mode 100644 index 7371f1215c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/contextLifecycleEvent/ee/RequestContextLifecycleEventObserverOrderingTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.priority.contextLifecycleEvent.ee; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVER_ORDERING; - -import java.io.IOException; -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class RequestContextLifecycleEventObserverOrderingTest extends AbstractTest { - - @ArquillianResource - private URL contextPath; - - private static final String seq = "ABC"; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withClasses(RequestContextLifecycleObserver.class, InfoServlet.class) - .withTestClass(RequestContextLifecycleEventObserverOrderingTest.class).build(); - } - - @Test - @SpecAssertion(section = OBSERVER_ORDERING, id = "b") - public void testContextLifecycleEventOrdering() throws IOException { - - WebClient client = new WebClient(); - - TextPage page = client.getPage(contextPath); - Assert.assertTrue(page.getContent().toString().contains("Initialized observer sequence: " + seq)); - TextPage page2 = client.getPage(contextPath); - Assert.assertTrue(page2.getContent().toString().contains("Initialized observer sequence: " + seq + seq)); - Assert.assertTrue(page2.getContent().toString().contains("Destroyed observer sequence: " + seq)); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/contextLifecycleEvent/ee/RequestContextLifecycleObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/contextLifecycleEvent/ee/RequestContextLifecycleObserver.java deleted file mode 100644 index 9060f4247c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/contextLifecycleEvent/ee/RequestContextLifecycleObserver.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.priority.contextLifecycleEvent.ee; - -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; - -import jakarta.annotation.Priority; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.Destroyed; -import jakarta.enterprise.context.Initialized; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.event.Observes; -import jakarta.interceptor.Interceptor; -import jakarta.servlet.ServletRequest; - -@ApplicationScoped -public class RequestContextLifecycleObserver { - - private List initializedEvents = new CopyOnWriteArrayList<>(); - private List destroyedEvents = new CopyOnWriteArrayList<>(); - - public void firstInit(@Observes @Initialized(RequestScoped.class) @Priority(Interceptor.Priority.APPLICATION - - 100) ServletRequest servletRequest) { - initializedEvents.add("A"); - } - - public void secondInit(@Observes @Initialized(RequestScoped.class) ServletRequest servletRequest) { - initializedEvents.add("B"); - ; - } - - public void thirdInit(@Observes @Initialized(RequestScoped.class) @Priority(Interceptor.Priority.APPLICATION - + 501) ServletRequest servletRequest) { - initializedEvents.add("C"); - } - - public void firstDestroy( - @Observes @Destroyed(RequestScoped.class) @Priority(Interceptor.Priority.APPLICATION) ServletRequest servletRequest) { - destroyedEvents.add("A"); - } - - public void secondDestroy(@Observes @Destroyed(RequestScoped.class) ServletRequest servletRequest) { - destroyedEvents.add("B"); - } - - public void thirdDestroy(@Observes @Destroyed(RequestScoped.class) @Priority(Interceptor.Priority.APPLICATION - + 501) ServletRequest servletRequest) { - destroyedEvents.add("C"); - } - - public List getDestroyedEvents() { - return destroyedEvents; - } - - public List getInitializedEvents() { - return initializedEvents; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/AbstractObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/AbstractObserver.java deleted file mode 100644 index 2ae508ee26..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/AbstractObserver.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.priority.transactional; - -import jakarta.enterprise.event.TransactionPhase; - -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.cdi.tck.util.SimpleLogger; - -public abstract class AbstractObserver { - - private final SimpleLogger logger = new SimpleLogger(getClass()); - - protected void logEventFired(TransactionPhase phase) { - logger.log(phase.toString() + "." + getClass().getSimpleName()); - ActionSequence.addAction(phase.toString() + "." + getClass().getSimpleName()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/OnlineAccountService.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/OnlineAccountService.java deleted file mode 100644 index 876dc8d642..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/OnlineAccountService.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.priority.transactional; - -import jakarta.annotation.Resource; -import jakarta.ejb.Stateless; -import jakarta.ejb.TransactionManagement; -import jakarta.ejb.TransactionManagementType; -import jakarta.enterprise.event.Event; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.transaction.Status; -import jakarta.transaction.UserTransaction; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Named -@Stateless -@TransactionManagement(TransactionManagementType.BEAN) -public class OnlineAccountService { - - @Resource - private UserTransaction userTransaction; - - @Inject - Event event; - - @Inject - Event eventFailure; - - /** - * - * @param amount - * @throws Exception - */ - public void withdrawSuccesTransaction(int amount) throws Exception { - userTransaction.begin(); - event.fire(new TxWithdrawal(amount)); - ActionSequence.addAction("checkpoint"); - userTransaction.commit(); - } - - /** - * - * @param amount - * @throws Exception - */ - public void withdrawFailedTransaction(int amount) throws Exception { - userTransaction.begin(); - event.fire(new TxWithdrawal(amount)); - ActionSequence.addAction("checkpoint"); - // Failed for any reason - userTransaction.rollback(); - } - - /** - * - * @param amount - * @throws Exception - */ - public void withdrawNoTransaction(int amount) throws Exception { - event.fire(new TxWithdrawal(amount)); - ActionSequence.addAction("checkpoint"); - } - - /** - * - * @param amount - * @throws Exception - */ - public void withdrawObserverFailedTransaction(int amount) throws Exception { - userTransaction.begin(); - event.fire(new TxWithdrawal(amount)); - eventFailure.fire(new TxFailure()); - ActionSequence.addAction("checkpoint"); - if (userTransaction.getStatus() == Status.STATUS_MARKED_ROLLBACK) { - userTransaction.rollback(); - } else { - userTransaction.commit(); - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/PhisherAccountTransactionObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/PhisherAccountTransactionObserver.java deleted file mode 100644 index 366add8141..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/PhisherAccountTransactionObserver.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.priority.transactional; - -import jakarta.annotation.Priority; -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.event.TransactionPhase; -import jakarta.interceptor.Interceptor; -import jakarta.transaction.UserTransaction; - -/** - * - * @author Mark Paluch - */ -@Dependent -public class PhisherAccountTransactionObserver extends AbstractObserver { - - @Resource - private UserTransaction userTransaction; - - /** - * - * @param txWithdrawal - * @throws Exception - */ - public void withdrawAfterSuccess( - @Observes(during = TransactionPhase.AFTER_SUCCESS) @Priority(Interceptor.Priority.APPLICATION - + 111) TxWithdrawal txWithdrawal) - throws Exception { - logEventFired(TransactionPhase.AFTER_SUCCESS); - } - - /** - * - * @param txWithdrawal - * @throws Exception - */ - public void withdrawAfterCompletion( - @Observes(during = TransactionPhase.AFTER_COMPLETION) @Priority(Interceptor.Priority.APPLICATION - + 111) TxWithdrawal txWithdrawal) - throws Exception { - logEventFired(TransactionPhase.AFTER_COMPLETION); - } - - /** - * - * @param txWithdrawal - * @throws Exception - */ - public void withdrawBeforeCompletion( - @Observes(during = TransactionPhase.BEFORE_COMPLETION) @Priority(Interceptor.Priority.APPLICATION - + 700) TxWithdrawal txWithdrawal) - throws Exception { - logEventFired(TransactionPhase.BEFORE_COMPLETION); - } - - /** - * Always fire immediately. - * - * @param txWithdrawal - * @throws Exception - */ - public void withdrawNoTx( - @Observes(during = TransactionPhase.IN_PROGRESS) @Priority(Interceptor.Priority.APPLICATION - + 700) TxWithdrawal txWithdrawal) - throws Exception { - logEventFired(TransactionPhase.IN_PROGRESS); - } - - /** - * - * @param txWithdrawal - * @throws Exception - */ - public void withdrawAfterFailure( - @Observes(during = TransactionPhase.AFTER_FAILURE) @Priority(Interceptor.Priority.APPLICATION - + 999) TxWithdrawal txWithdrawal) - throws Exception { - logEventFired(TransactionPhase.AFTER_FAILURE); - } - - /** - * - * @param txFailure - * @throws Exception - */ - public void failBeforeCompletion( - @Observes(during = TransactionPhase.IN_PROGRESS) @Priority(Interceptor.Priority.APPLICATION - + 999) TxFailure txFailure) - throws Exception { - logEventFired(TransactionPhase.IN_PROGRESS); - userTransaction.setRollbackOnly(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/ReceiverAccountTransactionObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/ReceiverAccountTransactionObserver.java deleted file mode 100644 index b07512d50d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/ReceiverAccountTransactionObserver.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.priority.transactional; - -import jakarta.annotation.Priority; -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.event.TransactionPhase; -import jakarta.interceptor.Interceptor; -import jakarta.transaction.UserTransaction; - -/** - * - * @author Mark Paluch - */ -@Dependent -public class ReceiverAccountTransactionObserver extends AbstractObserver { - - @Resource - private UserTransaction userTransaction; - - /** - * - * @param txWithdrawal - * @throws Exception - */ - public void withdrawAfterSuccess( - @Observes(during = TransactionPhase.AFTER_SUCCESS) @Priority(Interceptor.Priority.APPLICATION - + 100) TxWithdrawal txWithdrawal) - throws Exception { - logEventFired(TransactionPhase.AFTER_SUCCESS); - } - - /** - * - * @param txWithdrawal - * @throws Exception - */ - public void withdrawAfterCompletion( - @Observes(during = TransactionPhase.AFTER_COMPLETION) @Priority(Interceptor.Priority.APPLICATION - + 50) TxWithdrawal txWithdrawal) - throws Exception { - logEventFired(TransactionPhase.AFTER_COMPLETION); - } - - /** - * - * @param txWithdrawal - * @throws Exception - */ - public void withdrawBeforeCompletion( - @Observes(during = TransactionPhase.BEFORE_COMPLETION) @Priority(Interceptor.Priority.APPLICATION - - 1) TxWithdrawal txWithdrawal) - throws Exception { - logEventFired(TransactionPhase.BEFORE_COMPLETION); - } - - /** - * Always fire immediately. - * - * @param txWithdrawal - * @throws Exception - */ - public void withdrawNoTx( - @Observes(during = TransactionPhase.IN_PROGRESS) @Priority(Interceptor.Priority.APPLICATION - + 600) TxWithdrawal txWithdrawal) - throws Exception { - logEventFired(TransactionPhase.IN_PROGRESS); - } - - /** - * - * @param txWithdrawal - * @throws Exception - */ - public void withdrawAfterFailure(@Observes(during = TransactionPhase.AFTER_FAILURE) TxWithdrawal txWithdrawal) - throws Exception { - logEventFired(TransactionPhase.AFTER_FAILURE); - } - - /** - * - * @param txFailure - * @throws Exception - */ - public void failBeforeCompletion(@Observes(during = TransactionPhase.IN_PROGRESS) TxFailure txFailure) throws Exception { - logEventFired(TransactionPhase.IN_PROGRESS); - userTransaction.setRollbackOnly(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/SenderAccountTransactionObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/SenderAccountTransactionObserver.java deleted file mode 100644 index d338c39483..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/SenderAccountTransactionObserver.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.priority.transactional; - -import jakarta.annotation.Priority; -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.event.TransactionPhase; -import jakarta.interceptor.Interceptor; -import jakarta.transaction.UserTransaction; - -/** - * - * @author Mark Paluch - */ -@Dependent -public class SenderAccountTransactionObserver extends AbstractObserver { - - @Resource - private UserTransaction userTransaction; - - /** - * - * @param txWithdrawal - * @throws Exception - */ - public void withdrawAfterSuccess( - @Observes(during = TransactionPhase.AFTER_SUCCESS) @Priority(Interceptor.Priority.APPLICATION - + 50) TxWithdrawal txWithdrawal) - throws Exception { - logEventFired(TransactionPhase.AFTER_SUCCESS); - } - - /** - * - * @param txWithdrawal - * @throws Exception - */ - public void withdrawAfterCompletion( - @Observes(during = TransactionPhase.AFTER_COMPLETION) @Priority(Interceptor.Priority.APPLICATION - + 100) TxWithdrawal txWithdrawal) - throws Exception { - logEventFired(TransactionPhase.AFTER_COMPLETION); - } - - /** - * - * @param txWithdrawal - * @throws Exception - */ - public void withdrawBeforeCompletion(@Observes(during = TransactionPhase.BEFORE_COMPLETION) TxWithdrawal txWithdrawal) - throws Exception { - logEventFired(TransactionPhase.BEFORE_COMPLETION); - } - - /** - * Always fire immediately. - * - * @param txWithdrawal - * @throws Exception - */ - public void withdrawNoTx(@Observes(during = TransactionPhase.IN_PROGRESS) TxWithdrawal txWithdrawal) throws Exception { - logEventFired(TransactionPhase.IN_PROGRESS); - } - - /** - * - * @param txWithdrawal - * @throws Exception - */ - public void withdrawAfterFailure(@Observes(during = TransactionPhase.AFTER_FAILURE) TxWithdrawal txWithdrawal) - throws Exception { - logEventFired(TransactionPhase.AFTER_FAILURE); - } - - /** - * - * @param txFailure - * @throws Exception - */ - public void failBeforeCompletion(@Observes(during = TransactionPhase.IN_PROGRESS) TxFailure txFailure) throws Exception { - logEventFired(TransactionPhase.IN_PROGRESS); - userTransaction.setRollbackOnly(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/TransactionalPriorityObserverTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/TransactionalPriorityObserverTest.java deleted file mode 100644 index 3a65e655db..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/TransactionalPriorityObserverTest.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.priority.transactional; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.PERSISTENCE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVER_NOTIFICATION; -import static org.jboss.cdi.tck.cdi.Sections.TRANSACTIONAL_OBSERVER_METHODS; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.util.List; - -import jakarta.enterprise.event.TransactionPhase; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.cdi.tck.util.SimpleLogger; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Mark Paluch - */ -@Test(groups = { INTEGRATION, PERSISTENCE }) -@SpecVersion(spec = "cdi", version = "2.0") -public class TransactionalPriorityObserverTest extends AbstractTest { - - private static final SimpleLogger logger = new SimpleLogger(TransactionalPriorityObserverTest.class); - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(TransactionalPriorityObserverTest.class) - .withDefaultPersistenceXml().build(); - } - - @Inject - OnlineAccountService accountService; - - @Test - @SpecAssertions({ @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "a"), - @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "b"), - @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "c"), - @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "d"), - @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "e"), - @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "gaa"), - @SpecAssertion(section = OBSERVER_NOTIFICATION, id = "b") }) - public void testSucessfulTransaction() throws Exception { - - logger.log("testSucessfulTransaction"); - ActionSequence.reset(); - - // Checkpoint is right before tx commit - accountService.withdrawSuccesTransaction(1); - - // Test sequence - // BEFORE_COMPLETION must be fired at the beginning of the commit (after checkpoint) - // AFTER_SUCCESS and AFTER_COMPLETION must be fired after BEFORE_COMPLETION - // AFTER_FAILURE is not fired - - // Order: - // IN_PROGRESS.SenderAccountTransactionObserver (DEFAULT) - // IN_PROGRESS.ReceiverAccountTransactionObserver (APPLICATION + 1) - // IN_PROGRESS.PhisherAccountTransactionObserver (APPLICATION + 500) - - // BEFORE_COMPLETION.ReceiverAccountTransactionObserver (APPLICATION - 1) - // BEFORE_COMPLETION.SenderAccountTransactionObserver (DEFAULT) - // BEFORE_COMPLETION.PhisherAccountTransactionObserver (APPLICATION + 200) - - List phases = ActionSequence.getSequenceData(); - assertEquals(phases.size(), 13); - - assertEquals(phases.get(0), - TransactionPhase.IN_PROGRESS.name() + "." + SenderAccountTransactionObserver.class.getSimpleName()); - assertEquals(phases.get(1), - TransactionPhase.IN_PROGRESS.name() + "." + ReceiverAccountTransactionObserver.class.getSimpleName()); - assertEquals(phases.get(2), - TransactionPhase.IN_PROGRESS.name() + "." + PhisherAccountTransactionObserver.class.getSimpleName()); - - assertEquals(phases.get(3), "checkpoint"); - - assertEquals(phases.get(4), - TransactionPhase.BEFORE_COMPLETION.name() + "." + ReceiverAccountTransactionObserver.class.getSimpleName()); - assertEquals(phases.get(5), - TransactionPhase.BEFORE_COMPLETION.name() + "." + SenderAccountTransactionObserver.class.getSimpleName()); - assertEquals(phases.get(6), - TransactionPhase.BEFORE_COMPLETION.name() + "." + PhisherAccountTransactionObserver.class.getSimpleName()); - - assertTrue(phases.contains(TransactionPhase.AFTER_SUCCESS.name() + "." - + ReceiverAccountTransactionObserver.class.getSimpleName())); - assertTrue(phases.contains(TransactionPhase.AFTER_SUCCESS.name() + "." - + SenderAccountTransactionObserver.class.getSimpleName())); - assertTrue(phases.contains(TransactionPhase.AFTER_SUCCESS.name() + "." - + PhisherAccountTransactionObserver.class.getSimpleName())); - - assertTrue(phases.contains(TransactionPhase.AFTER_COMPLETION.name() + "." - + ReceiverAccountTransactionObserver.class.getSimpleName())); - assertTrue(phases.contains(TransactionPhase.AFTER_COMPLETION.name() + "." - + SenderAccountTransactionObserver.class.getSimpleName())); - assertTrue(phases.contains(TransactionPhase.AFTER_COMPLETION.name() + "." - + PhisherAccountTransactionObserver.class.getSimpleName())); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/TxFailure.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/TxFailure.java deleted file mode 100644 index 5db0aa6ea9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/TxFailure.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.event.observer.priority.transactional; - -public class TxFailure { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/TxWithdrawal.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/TxWithdrawal.java deleted file mode 100644 index 532a17d75c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/priority/transactional/TxWithdrawal.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.priority.transactional; - -public class TxWithdrawal { - - private int amount; - - public TxWithdrawal(int amount) { - super(); - this.amount = amount; - } - - public int getAmount() { - return amount; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/EJBEvent.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/EJBEvent.java deleted file mode 100644 index e0c067aae1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/EJBEvent.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.resolve.enterprise; - -import java.io.Serializable; - -@SuppressWarnings("serial") -public class EJBEvent implements Serializable { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/LocalInterface.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/LocalInterface.java deleted file mode 100644 index 4de1ce325b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/LocalInterface.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.resolve.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface LocalInterface { - public void observeLocal(EJBEvent someEvent); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/NoInterfaceSLSB.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/NoInterfaceSLSB.java deleted file mode 100644 index 0eb8110352..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/NoInterfaceSLSB.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.resolve.enterprise; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.event.Observes; - -@Stateless -public class NoInterfaceSLSB { - - static boolean notified = false; - - public void observe(@Observes EJBEvent someEvent) { - notified = true; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/ResolveEnterpriseEventObserverTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/ResolveEnterpriseEventObserverTest.java deleted file mode 100644 index 5301665d60..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/ResolveEnterpriseEventObserverTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.resolve.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVER_METHODS_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class ResolveEnterpriseEventObserverTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ResolveEnterpriseEventObserverTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = OBSERVER_METHODS_EE, id = "d") - public void testObserverMethodOnEnterpriseBeanIsBusinessMethodOrStatic() { - assertEquals(getCurrentManager().resolveObserverMethods(new EJBEvent()).size(), 3); - getCurrentManager().getEvent().select(EJBEvent.class).fire(new EJBEvent()); - assertTrue(Spitz.localNotified); - assertTrue(Spitz.staticallyNotified); - assertTrue(NoInterfaceSLSB.notified); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/Spitz.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/Spitz.java deleted file mode 100644 index 642177a834..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/Spitz.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.resolve.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.event.Observes; - -@Stateful -public class Spitz implements LocalInterface { - - static boolean localNotified = false; - static boolean staticallyNotified = false; - - public void observeLocal(@Observes EJBEvent someEvent) { - localNotified = true; - } - - public static void staticallyObserveEvent(@Observes EJBEvent someEvent) { - staticallyNotified = true; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/AccountService.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/AccountService.java deleted file mode 100644 index 84f0b221be..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/AccountService.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.transactional; - -import jakarta.annotation.Resource; -import jakarta.ejb.Stateless; -import jakarta.ejb.TransactionManagement; -import jakarta.ejb.TransactionManagementType; -import jakarta.enterprise.event.Event; -import jakarta.inject.Inject; -import jakarta.inject.Named; -import jakarta.transaction.Status; -import jakarta.transaction.UserTransaction; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Named -@Stateless -@TransactionManagement(TransactionManagementType.BEAN) -public class AccountService { - - @Resource - private UserTransaction userTransaction; - - @Inject - Event event; - - @Inject - Event eventFailure; - - /** - * - * @param amount - * @throws Exception - */ - public void withdrawSuccesTransaction(int amount) throws Exception { - userTransaction.begin(); - event.fire(new Withdrawal(amount)); - ActionSequence.addAction("checkpoint"); - userTransaction.commit(); - } - - /** - * - * @param amount - * @throws Exception - */ - public void withdrawFailedTransaction(int amount) throws Exception { - userTransaction.begin(); - event.fire(new Withdrawal(amount)); - ActionSequence.addAction("checkpoint"); - // Failed for any reason - userTransaction.rollback(); - } - - /** - * - * @param amount - * @throws Exception - */ - public void withdrawNoTransaction(int amount) throws Exception { - event.fire(new Withdrawal(amount)); - ActionSequence.addAction("checkpoint"); - } - - /** - * - * @param amount - * @throws Exception - */ - public void withdrawObserverFailedTransaction(int amount) throws Exception { - userTransaction.begin(); - event.fire(new Withdrawal(amount)); - eventFailure.fire(new Failure()); - ActionSequence.addAction("checkpoint"); - if (userTransaction.getStatus() == Status.STATUS_MARKED_ROLLBACK) { - userTransaction.rollback(); - } else { - userTransaction.commit(); - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/AccountTransactionObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/AccountTransactionObserver.java deleted file mode 100644 index 98a8bca361..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/AccountTransactionObserver.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.transactional; - -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.event.TransactionPhase; -import jakarta.transaction.UserTransaction; - -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.cdi.tck.util.SimpleLogger; - -/** - * - * @author Martin Kouba - */ -@Dependent -public class AccountTransactionObserver { - - private static final SimpleLogger logger = new SimpleLogger(AccountTransactionObserver.class); - - @Resource - private UserTransaction userTransaction; - - /** - * - * @param withdrawal - * @throws Exception - */ - public void withdrawAfterSuccess(@Observes(during = TransactionPhase.AFTER_SUCCESS) Withdrawal withdrawal) - throws Exception { - logEventFired(TransactionPhase.AFTER_SUCCESS); - } - - /** - * - * @param withdrawal - * @throws Exception - */ - public void withdrawAfterCompletion(@Observes(during = TransactionPhase.AFTER_COMPLETION) Withdrawal withdrawal) - throws Exception { - logEventFired(TransactionPhase.AFTER_COMPLETION); - } - - /** - * - * @param withdrawal - * @throws Exception - */ - public void withdrawBeforeCompletion(@Observes(during = TransactionPhase.BEFORE_COMPLETION) Withdrawal withdrawal) - throws Exception { - logEventFired(TransactionPhase.BEFORE_COMPLETION); - } - - /** - * Always fire immediately. - * - * @param withdrawal - * @throws Exception - */ - public void withdrawNoTx(@Observes(during = TransactionPhase.IN_PROGRESS) Withdrawal withdrawal) throws Exception { - logEventFired(TransactionPhase.IN_PROGRESS); - } - - /** - * - * @param withdrawal - * @throws Exception - */ - public void withdrawAfterFailure(@Observes(during = TransactionPhase.AFTER_FAILURE) Withdrawal withdrawal) - throws Exception { - logEventFired(TransactionPhase.AFTER_FAILURE); - } - - /** - * - * @param failure - * @throws Exception - */ - public void failBeforeCompletion(@Observes(during = TransactionPhase.IN_PROGRESS) Failure failure) throws Exception { - logEventFired(TransactionPhase.IN_PROGRESS); - userTransaction.setRollbackOnly(); - } - - private void logEventFired(TransactionPhase phase) { - logger.log(phase.toString()); - ActionSequence.addAction(phase.toString()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/Failure.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/Failure.java deleted file mode 100644 index b5378d934d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/Failure.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.event.observer.transactional; - -public class Failure { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/TransactionalObserverTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/TransactionalObserverTest.java deleted file mode 100644 index c86b10b68c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/TransactionalObserverTest.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.transactional; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.PERSISTENCE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVER_NOTIFICATION; -import static org.jboss.cdi.tck.cdi.Sections.TRANSACTIONAL_OBSERVER_METHODS; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.util.List; - -import jakarta.enterprise.event.TransactionPhase; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.cdi.tck.util.SimpleLogger; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@Test(groups = { INTEGRATION, PERSISTENCE }) -@SpecVersion(spec = "cdi", version = "2.0") -public class TransactionalObserverTest extends AbstractTest { - - private static final SimpleLogger logger = new SimpleLogger(TransactionalObserverTest.class); - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(TransactionalObserverTest.class).withDefaultPersistenceXml() - .build(); - } - - @Inject - AccountService accountService; - - @Test - @SpecAssertions({ @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "a"), - @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "b"), - @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "c"), - @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "d"), - @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "e"), - @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "gaa"), - @SpecAssertion(section = OBSERVER_NOTIFICATION, id = "b") }) - public void testSucessfullTransaction() throws Exception { - - logger.log("testSucessfullTransaction"); - ActionSequence.reset(); - - // Checkpoint is right before tx commit - accountService.withdrawSuccesTransaction(1); - - // Test sequence - // BEFORE_COMPLETION must be fired at the beginning of the commit (after checkpoint) - // AFTER_SUCCESS and AFTER_COMPLETION must be fired after BEFORE_COMPLETION - // AFTER_FAILURE is not fired - List phases = ActionSequence.getSequenceData(); - assertEquals(phases.size(), 5); - assertEquals(phases.get(0), TransactionPhase.IN_PROGRESS.name()); - assertEquals(phases.get(1), "checkpoint"); - assertEquals(phases.get(2), TransactionPhase.BEFORE_COMPLETION.name()); - assertTrue(phases.contains(TransactionPhase.AFTER_SUCCESS.name())); - assertTrue(phases.contains(TransactionPhase.AFTER_COMPLETION.name())); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "a"), - @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "b"), - @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "c"), - @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "d"), - @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "e"), - @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "gaa"), - @SpecAssertion(section = OBSERVER_NOTIFICATION, id = "b") }) - public void testFailedTransaction() throws Exception { - - logger.log("testFailedTransaction"); - ActionSequence.reset(); - - // Checkpoint is right before tx rollback - accountService.withdrawFailedTransaction(2); - - // AFTER_FAILURE and AFTER_COMPLETION must be fired after checkpoint - // AFTER_SUCCESS and BEFORE_COMPLETION is not fired - List phases = ActionSequence.getSequenceData(); - assertEquals(phases.size(), 4); - assertEquals(phases.get(0), TransactionPhase.IN_PROGRESS.name()); - assertEquals(phases.get(1), "checkpoint"); - assertTrue(phases.contains(TransactionPhase.AFTER_FAILURE.name())); - assertTrue(phases.contains(TransactionPhase.AFTER_COMPLETION.name())); - } - - /** - * No transaction - send all events immediately. - * - * @throws Exception - */ - @Test - @SpecAssertions({ @SpecAssertion(section = TRANSACTIONAL_OBSERVER_METHODS, id = "a"), - @SpecAssertion(section = OBSERVER_NOTIFICATION, id = "b") }) - public void testNoTransaction() throws Exception { - - logger.log("testNoTransaction"); - ActionSequence.reset(); - - // Checkpoint is after event send - accountService.withdrawNoTransaction(3); - - // No TX is active - all events are fired immediately and thus before checkpoint - List sequence = ActionSequence.getSequenceData(); - assertEquals(sequence.size(), 6); - assertEquals(sequence.get(sequence.size() - 1), "checkpoint"); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = OBSERVER_NOTIFICATION, id = "bda") }) - public void testObserverFailedTransaction() throws Exception { - - logger.log("testObserverFailedTransaction"); - ActionSequence.reset(); - - accountService.withdrawObserverFailedTransaction(2); - - // IN_PROGRESS is fired twice - // AFTER_FAILURE and AFTER_COMPLETION must be fired after checkpoint - // AFTER_SUCCESS and BEFORE_COMPLETION is not fired - List phases = ActionSequence.getSequenceData(); - assertEquals(phases.size(), 5); - assertEquals(phases.get(0), TransactionPhase.IN_PROGRESS.name()); - assertEquals(phases.get(1), TransactionPhase.IN_PROGRESS.name()); - assertEquals(phases.get(2), "checkpoint"); - assertTrue(phases.contains(TransactionPhase.AFTER_FAILURE.name())); - assertTrue(phases.contains(TransactionPhase.AFTER_COMPLETION.name())); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/Withdrawal.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/Withdrawal.java deleted file mode 100644 index 4faf62acca..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/Withdrawal.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.transactional; - -public class Withdrawal { - - private int amount; - - public Withdrawal(int amount) { - super(); - this.amount = amount; - } - - public int getAmount() { - return amount; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/CustomTransactionalObserverTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/CustomTransactionalObserverTest.java deleted file mode 100644 index e73a12477c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/CustomTransactionalObserverTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.event.observer.transactional.custom; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.PERSISTENCE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVER_NOTIFICATION; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.event.TransactionPhase; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class CustomTransactionalObserverTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(CustomTransactionalObserverTest.class) - .withExtension(ObserverExtension.class).withDefaultPersistenceXml().build(); - } - - @Inject - private GiraffeService giraffeService; - - @Inject - private ObserverExtension extension; - - @Test(groups = { INTEGRATION, PERSISTENCE }) - @SpecAssertions({ @SpecAssertion(section = OBSERVER_NOTIFICATION, id = "fa"), - @SpecAssertion(section = OBSERVER_NOTIFICATION, id = "fb") }) - public void testCustomTransactionalObserver() throws Exception { - - ActionSequence.reset(); - - // GiraffeObserver 2x, GiraffeCustomObserver 1x - assertEquals(getCurrentManager().resolveObserverMethods(new Giraffe()).size(), 3); - - // Transactional invocation - giraffeService.feed(); - - // Test ObserverMethod.notify() was called - assertNotNull(extension.getAnyGiraffeObserver().getReceivedPayload()); - assertEquals(Giraffe.class, extension.getAnyGiraffeObserver().getReceivedPayload().getEvent().getClass()); - assertNotNull(extension.getAnyGiraffeObserver().getReceivedPayload().getMetadata()); - // Test ObserverMethod.getTransactionPhase() was called - assertTrue(extension.getAnyGiraffeObserver().isTransactionPhaseCalled()); - - // Test custom observer received notification during the after completion phase (after succesfull commit) - // BEFORE_COMPLETION must be fired at the beginning of the commit (after checkpoint) - // AFTER_SUCCESS and AFTER_COMPLETION must be fired after BEFORE_COMPLETION - // AFTER_FAILURE is not fired - ActionSequence.getSequence().beginsWith("checkpoint", TransactionPhase.BEFORE_COMPLETION.toString()); - ActionSequence.getSequence().assertDataContainsAll(TransactionPhase.AFTER_SUCCESS.toString(), - TransactionPhase.AFTER_COMPLETION.toString()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/Giraffe.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/Giraffe.java deleted file mode 100644 index e5f24ee8ba..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/Giraffe.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.transactional.custom; - -public class Giraffe { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/GiraffeCustomObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/GiraffeCustomObserver.java deleted file mode 100644 index 3f67533580..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/GiraffeCustomObserver.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.transactional.custom; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -import jakarta.enterprise.event.Reception; -import jakarta.enterprise.event.TransactionPhase; -import jakarta.enterprise.inject.spi.EventContext; -import jakarta.enterprise.inject.spi.ObserverMethod; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class GiraffeCustomObserver implements ObserverMethod { - - private boolean transactionPhaseCalled; - private EventContext receivedPayload; - - private final Set qualifiers; - - protected GiraffeCustomObserver(Set qualifiers) { - this.qualifiers = qualifiers; - reset(); - } - - protected GiraffeCustomObserver(Annotation... qualifiers) { - this(new HashSet(Arrays.asList(qualifiers))); - } - - protected void reset() { - this.receivedPayload = null; - this.transactionPhaseCalled = false; - } - - public Class getBeanClass() { - return this.getClass(); - } - - public Type getObservedType() { - return Giraffe.class; - } - - public Set getObservedQualifiers() { - return qualifiers; - } - - public Reception getReception() { - return Reception.ALWAYS; - } - - public TransactionPhase getTransactionPhase() { - this.transactionPhaseCalled = true; - return TransactionPhase.AFTER_SUCCESS; - } - - public void notify(EventContext event) { - ActionSequence.addAction(TransactionPhase.AFTER_SUCCESS.toString()); - receivedPayload = event; - - } - - public EventContext getReceivedPayload() { - return receivedPayload; - } - - public boolean isTransactionPhaseCalled() { - return transactionPhaseCalled; - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/GiraffeObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/GiraffeObserver.java deleted file mode 100644 index 43f4480a4d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/GiraffeObserver.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.event.observer.transactional.custom; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.event.TransactionPhase; - -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.cdi.tck.util.SimpleLogger; - -@Dependent -public class GiraffeObserver { - - private static final SimpleLogger logger = new SimpleLogger(GiraffeObserver.class); - - /** - * - * @param giraffe - * @throws Exception - */ - public void withdrawAfterCompletion(@Observes(during = TransactionPhase.AFTER_COMPLETION) Giraffe giraffe) - throws Exception { - logEventFired(TransactionPhase.AFTER_COMPLETION); - } - - /** - * - * @param giraffe - * @throws Exception - */ - public void withdrawBeforeCompletion(@Observes(during = TransactionPhase.BEFORE_COMPLETION) Giraffe giraffe) - throws Exception { - logEventFired(TransactionPhase.BEFORE_COMPLETION); - } - - private void logEventFired(TransactionPhase phase) { - logger.log(phase.toString()); - ActionSequence.addAction(phase.toString()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/GiraffeService.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/GiraffeService.java deleted file mode 100644 index 1a24235295..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/GiraffeService.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.event.observer.transactional.custom; - -import jakarta.annotation.Resource; -import jakarta.ejb.Stateless; -import jakarta.ejb.TransactionManagement; -import jakarta.ejb.TransactionManagementType; -import jakarta.enterprise.event.Event; -import jakarta.inject.Inject; -import jakarta.transaction.UserTransaction; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Stateless -@TransactionManagement(TransactionManagementType.BEAN) -public class GiraffeService { - - @Inject - private Event event; - - @Resource - private UserTransaction userTransaction; - - public void feed() throws Exception { - userTransaction.begin(); - event.fire(new Giraffe()); - ActionSequence.addAction("checkpoint"); - userTransaction.commit(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/ObserverExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/ObserverExtension.java deleted file mode 100644 index ce72bb4b97..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/custom/ObserverExtension.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.transactional.custom; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.Any; -import jakarta.enterprise.inject.spi.AfterBeanDiscovery; -import jakarta.enterprise.inject.spi.Extension; - -public class ObserverExtension implements Extension { - - private GiraffeCustomObserver anyGiraffeObserver = new GiraffeCustomObserver(Any.Literal.INSTANCE); - - public void registerObservers(@Observes AfterBeanDiscovery event) { - event.addObserverMethod(anyGiraffeObserver); - } - - public GiraffeCustomObserver getAnyGiraffeObserver() { - return anyGiraffeObserver; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/EjbTestBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/EjbTestBean.java deleted file mode 100644 index d02454efb9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/EjbTestBean.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2017, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.transactional.roolback; - -import jakarta.annotation.Resource; -import jakarta.ejb.EJBContext; -import jakarta.ejb.Stateless; -import jakarta.ejb.TransactionAttribute; -import jakarta.ejb.TransactionAttributeType; -import jakarta.ejb.TransactionManagement; -import jakarta.ejb.TransactionManagementType; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; -import jakarta.transaction.SystemException; - -/** - * @author Matej Novotny - */ -@Stateless -@TransactionManagement(TransactionManagementType.CONTAINER) -public class EjbTestBean { - - private static final long serialVersionUID = 1L; - - @Resource - private EJBContext ctx; - - @Inject - private BeanManager beanManager; - - @TransactionAttribute(TransactionAttributeType.REQUIRED) - public void initTransaction() throws SystemException { - ctx.setRollbackOnly(); - beanManager.getEvent().select(Foo.class).fire(new Foo()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/Foo.java deleted file mode 100644 index 892f79a797..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/Foo.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2017, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.transactional.roolback; - -public class Foo { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/FooTransactionalObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/FooTransactionalObserver.java deleted file mode 100644 index c46f69e808..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/FooTransactionalObserver.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2017, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.transactional.roolback; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.event.TransactionPhase; - -import org.jboss.cdi.tck.util.ActionSequence; - -@ApplicationScoped -public class FooTransactionalObserver { - - public void observesProgress(@Observes(during = TransactionPhase.IN_PROGRESS) Foo foo) { - ActionSequence.addAction(TransactionPhase.IN_PROGRESS.toString()); - } - - public void observesBeforeCompletion(@Observes(during = TransactionPhase.BEFORE_COMPLETION) Foo foo) { - ActionSequence.addAction(TransactionPhase.BEFORE_COMPLETION.toString()); - } - - public void observesAfterCompletion(@Observes(during = TransactionPhase.AFTER_COMPLETION) Foo foo) { - ActionSequence.addAction(TransactionPhase.AFTER_COMPLETION.toString()); - } - - public void observesAfterFailure(@Observes(during = TransactionPhase.AFTER_FAILURE) Foo foo) { - ActionSequence.addAction(TransactionPhase.AFTER_FAILURE.toString()); - } - - public void observesAfterSuccess(@Observes(during = TransactionPhase.AFTER_SUCCESS) Foo foo) { - ActionSequence.addAction(TransactionPhase.AFTER_SUCCESS.toString()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/TransactionalObserverRollbackTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/TransactionalObserverRollbackTest.java deleted file mode 100644 index c6cc01cbec..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/event/observer/transactional/roolback/TransactionalObserverRollbackTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2017, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.event.observer.transactional.roolback; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; - -import java.util.Arrays; - -import jakarta.enterprise.event.TransactionPhase; -import jakarta.inject.Inject; -import jakarta.transaction.SystemException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.cdi.Sections; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * This test was originally part of the Weld testsuite. - */ -@Test(groups = { INTEGRATION }) -@SpecVersion(spec = "cdi", version = "2.0") -public class TransactionalObserverRollbackTest extends AbstractTest { - - @Inject - EjbTestBean ejbTestBean; - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(TransactionalObserverRollbackTest.class) - .build(); - } - - @Test - @SpecAssertion(section = Sections.TRANSACTIONAL_OBSERVER_METHODS, id = "aa") - public void afterSuccessObserverIsNotNotifiedAfterTxRollBack() throws SystemException { - ActionSequence.reset(); - ejbTestBean.initTransaction(); - ActionSequence.assertSequenceDataContainsAll( - Arrays.asList(TransactionPhase.IN_PROGRESS.toString(), TransactionPhase.BEFORE_COMPLETION.toString(), - TransactionPhase.AFTER_COMPLETION.toString(), - TransactionPhase.AFTER_FAILURE.toString())); - Assert.assertFalse(ActionSequence.getSequenceData().contains(TransactionPhase.AFTER_SUCCESS.toString())); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/AlternativeMetadataTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/AlternativeMetadataTest.java deleted file mode 100644 index dade6540fa..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/AlternativeMetadataTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.alternative.metadata.ejb; - -import static org.jboss.cdi.tck.cdi.Sections.ALTERNATIVE_METADATA_SOURCES_EE; -import static org.testng.Assert.assertEquals; - -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.full.extensions.alternative.metadata.ItalianFood; -import org.jboss.shrinkwrap.api.BeansXmlVersion; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * This test class contains tests for adding meta data using extensions. - * - * @author Jozef Hartinger - * @author Martin Kouba - * @author Tomas Remes - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class AlternativeMetadataTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - WebArchive war = new WebArchiveBuilder() - .withTestClassPackage(AlternativeMetadataTest.class) - .withClasses(ItalianFood.class) - .withBeansXml(new BeansXml().setBeansXmlVersion(BeansXmlVersion.v11)) - .withExtension(ProcessAnnotatedTypeObserver.class).build(); - System.out.println(war.toString(true)); - return war; - } - - @Test - @SpecAssertion(section = ALTERNATIVE_METADATA_SOURCES_EE, id = "kb") - public void testGetTypeClosureUsedToDetermineTypeOfSessionBean() { - Bean pasta = getBeans(Pasta.class).iterator().next(); - assertEquals(pasta.getTypes().size(), 2, "" + pasta.getTypes()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/Pasta.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/Pasta.java deleted file mode 100644 index 3a374593dc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/Pasta.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.alternative.metadata.ejb; - -import jakarta.ejb.Stateless; - -import org.jboss.cdi.tck.tests.full.extensions.alternative.metadata.ItalianFood; - -@Stateless -public class Pasta extends ItalianFood { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/PastaWrapper.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/PastaWrapper.java deleted file mode 100644 index 0dbec946e4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/PastaWrapper.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.alternative.metadata.ejb; - -import java.lang.reflect.Type; -import java.util.HashSet; -import java.util.Set; - -import jakarta.enterprise.inject.spi.AnnotatedType; - -import org.jboss.cdi.tck.util.annotated.AnnotatedTypeWrapper; - -public class PastaWrapper extends AnnotatedTypeWrapper { - - private final Set typeClosure = new HashSet(); - - public PastaWrapper(AnnotatedType delegate) { - super(delegate, true); - typeClosure.add(Pasta.class); - typeClosure.add(Object.class); - - } - - @Override - public Set getTypeClosure() { - return typeClosure; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/ProcessAnnotatedTypeObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/ProcessAnnotatedTypeObserver.java deleted file mode 100644 index 0e5d721c32..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/alternative/metadata/ejb/ProcessAnnotatedTypeObserver.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.alternative.metadata.ejb; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessAnnotatedType; - -public class ProcessAnnotatedTypeObserver implements Extension { - - public void observeFoodAnnotatedType(@Observes ProcessAnnotatedType event) { - event.setAnnotatedType(new PastaWrapper(event.getAnnotatedType())); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/annotated/delivery/ejb/EnterpriseWithAnnotationsTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/annotated/delivery/ejb/EnterpriseWithAnnotationsTest.java deleted file mode 100644 index e733353f94..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/annotated/delivery/ejb/EnterpriseWithAnnotationsTest.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.extensions.annotated.delivery.ejb; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_ANNOTATED_TYPE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - -import java.util.List; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.full.extensions.annotated.delivery.Baby; -import org.jboss.cdi.tck.tests.full.extensions.annotated.delivery.Chicken; -import org.jboss.cdi.tck.tests.full.extensions.annotated.delivery.Desired; -import org.jboss.cdi.tck.tests.full.extensions.annotated.delivery.MetaAnnotation; -import org.jboss.cdi.tck.tests.full.extensions.annotated.delivery.ProcessAnnotatedTypeObserver; -import org.jboss.cdi.tck.tests.full.extensions.annotated.delivery.Wanted; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - * - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseWithAnnotationsTest extends AbstractTest { - - @SuppressWarnings("unchecked") - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(EnterpriseWithAnnotationsTest.class) - .withBeansXml(new BeansXml(BeanDiscoveryMode.ALL)) - .withClasses(Baby.class, Desired.class, ProcessAnnotatedTypeObserver.class, Hawk.class, Wanted.class, - Chicken.class, MetaAnnotation.class) - .withExtensions(ProcessAnnotatedTypeObserver.class).build(); - } - - @Inject - ProcessAnnotatedTypeObserver processAnnotatedTypeObserver; - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_ANNOTATED_TYPE, id = "fc") }) - public void testDelivery() { - - List> processedDesiredAnWantedTypes = processAnnotatedTypeObserver.getProcessedDesiredAndWantedTypes(); - assertFalse(processedDesiredAnWantedTypes.isEmpty()); - assertEquals(processedDesiredAnWantedTypes.size(), 1); - assertTrue(processedDesiredAnWantedTypes.contains(Hawk.class)); - - List> processedDesiredTypes = processAnnotatedTypeObserver.getProcessedDesiredTypes(); - assertFalse(processedDesiredTypes.isEmpty()); - assertEquals(processedDesiredTypes.size(), 1); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_ANNOTATED_TYPE, id = "fc"), - @SpecAssertion(section = PROCESS_ANNOTATED_TYPE, id = "g") }) - public void testDeliveryMetaAnnotation() { - List> processedTypes = processAnnotatedTypeObserver.getProcessedMetaAnnotationTypes(); - assertFalse(processedTypes.isEmpty()); - assertEquals(processedTypes.size(), 2); - assertTrue(processedTypes.contains(Hawk.class)); - assertTrue(processedTypes.contains(Chicken.class)); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/annotated/delivery/ejb/Hawk.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/annotated/delivery/ejb/Hawk.java deleted file mode 100644 index b8d09bdbc4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/annotated/delivery/ejb/Hawk.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.extensions.annotated.delivery.ejb; - -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; - -import org.jboss.cdi.tck.tests.full.extensions.annotated.delivery.Baby; -import org.jboss.cdi.tck.tests.full.extensions.annotated.delivery.Chicken; -import org.jboss.cdi.tck.tests.full.extensions.annotated.delivery.Desired; - -@Stateless -public class Hawk { - - @Inject - public void init(@Desired @Baby Chicken chicken) { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/CreateBeanAttributesTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/CreateBeanAttributesTest.java deleted file mode 100644 index d4f5f7b567..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/CreateBeanAttributesTest.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.beanManager.beanAttributes.ejb; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BM_OBTAIN_BEANATTRIBUTES; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertNull; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Any; -import jakarta.enterprise.inject.Default; -import jakarta.enterprise.inject.spi.AnnotatedConstructor; -import jakarta.enterprise.inject.spi.AnnotatedField; -import jakarta.enterprise.inject.spi.AnnotatedMethod; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.BeanAttributes; -import jakarta.inject.Named; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.full.extensions.beanManager.beanAttributes.Animal; -import org.jboss.cdi.tck.tests.full.extensions.beanManager.beanAttributes.Fish; -import org.jboss.cdi.tck.tests.full.extensions.beanManager.beanAttributes.InvalidBeanType; -import org.jboss.cdi.tck.tests.full.extensions.beanManager.beanAttributes.Landmark; -import org.jboss.cdi.tck.tests.full.extensions.beanManager.beanAttributes.Natural; -import org.jboss.cdi.tck.tests.full.extensions.beanManager.beanAttributes.TundraStereotype; -import org.jboss.cdi.tck.tests.full.extensions.beanManager.beanAttributes.WaterBody; -import org.jboss.cdi.tck.tests.full.extensions.beanManager.beanAttributes.Wild; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - *

- * This test was originally part of Weld test suite. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class CreateBeanAttributesTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(CreateBeanAttributesTest.class) - .withClasses(Animal.class, Fish.class, InvalidBeanType.class, Landmark.class, Natural.class, - TundraStereotype.class, WaterBody.class, Wild.class) - .build(); - } - - @SuppressWarnings("unchecked") - @Test(groups = INTEGRATION) - @SpecAssertion(section = BM_OBTAIN_BEANATTRIBUTES, id = "a") - public void testBeanAttributesForSessionBean() { - AnnotatedType type = getCurrentManager().createAnnotatedType(Lake.class); - BeanAttributes attributes = getCurrentManager().createBeanAttributes(type); - - assertTrue(typeSetMatches(attributes.getTypes(), LakeLocal.class, WaterBody.class, Landmark.class, Object.class)); - assertTrue(typeSetMatches(attributes.getStereotypes(), TundraStereotype.class)); - assertTrue(annotationSetMatches(attributes.getQualifiers(), Natural.class, Any.class)); - assertEquals(attributes.getScope(), Dependent.class); - assertEquals(attributes.getName(), "lake"); - assertTrue(attributes.isAlternative()); - } - - @Test - @SpecAssertion(section = BM_OBTAIN_BEANATTRIBUTES, id = "b") - public void testBeanAttributesForMethod() { - AnnotatedType type = getCurrentManager().createAnnotatedType(Dam.class); - - AnnotatedMethod lakeFishMethod = null; - AnnotatedMethod damFishMethod = null; - AnnotatedMethod volumeMethod = null; - - for (AnnotatedMethod method : type.getMethods()) { - if (method.getJavaMember().getName().equals("getFish") - && method.getJavaMember().getDeclaringClass().equals(Dam.class)) { - damFishMethod = method; - } - if (method.getJavaMember().getName().equals("getFish") - && method.getJavaMember().getDeclaringClass().equals(Lake.class)) { - lakeFishMethod = method; - } - if (method.getJavaMember().getName().equals("getVolume") - && method.getJavaMember().getDeclaringClass().equals(Lake.class)) { - volumeMethod = method; - } - } - assertNotNull(lakeFishMethod); - assertNotNull(damFishMethod); - assertNotNull(volumeMethod); - - verifyLakeFish(getCurrentManager().createBeanAttributes(lakeFishMethod)); - verifyDamFish(getCurrentManager().createBeanAttributes(damFishMethod)); - verifyVolume(getCurrentManager().createBeanAttributes(volumeMethod)); - } - - @Test - @SpecAssertion(section = BM_OBTAIN_BEANATTRIBUTES, id = "b") - public void testBeanAttributesForField() { - AnnotatedType type = getCurrentManager().createAnnotatedType(Dam.class); - - AnnotatedField lakeFishField = null; - AnnotatedField damFishField = null; - AnnotatedField volumeField = null; - - for (AnnotatedField field : type.getFields()) { - if (field.getJavaMember().getName().equals("fish") && field.getJavaMember().getDeclaringClass().equals(Dam.class)) { - damFishField = field; - } - if (field.getJavaMember().getName().equals("fish") - && field.getJavaMember().getDeclaringClass().equals(Lake.class)) { - lakeFishField = field; - } - if (field.getJavaMember().getName().equals("volume") - && field.getJavaMember().getDeclaringClass().equals(Lake.class)) { - volumeField = field; - } - } - assertNotNull(lakeFishField); - assertNotNull(damFishField); - assertNotNull(volumeField); - - verifyLakeFish(getCurrentManager().createBeanAttributes(lakeFishField)); - verifyDamFish(getCurrentManager().createBeanAttributes(damFishField)); - verifyVolume(getCurrentManager().createBeanAttributes(volumeField)); - } - - @SuppressWarnings("unchecked") - private void verifyLakeFish(BeanAttributes attributes) { - assertTrue(typeSetMatches(attributes.getTypes(), Fish.class, Object.class)); - assertTrue(typeSetMatches(attributes.getStereotypes(), TundraStereotype.class)); - assertTrue(annotationSetMatches(attributes.getQualifiers(), Natural.class, Any.class, Named.class)); - assertEquals(attributes.getScope(), ApplicationScoped.class); - assertEquals(attributes.getName(), "fish"); - assertTrue(attributes.isAlternative()); - } - - @SuppressWarnings("unchecked") - private void verifyDamFish(BeanAttributes attributes) { - assertTrue(typeSetMatches(attributes.getTypes(), Fish.class, Animal.class, Object.class)); - assertTrue(annotationSetMatches(attributes.getQualifiers(), Wild.class, Any.class)); - assertTrue(attributes.getStereotypes().isEmpty()); - assertEquals(attributes.getScope(), Dependent.class); - assertNull(attributes.getName()); - assertFalse(attributes.isAlternative()); - } - - @SuppressWarnings("unchecked") - private void verifyVolume(BeanAttributes attributes) { - assertTrue(typeSetMatches(attributes.getTypes(), long.class, Object.class)); - assertTrue(annotationSetMatches(attributes.getQualifiers(), Any.class, Default.class, Named.class)); - assertTrue(attributes.getStereotypes().isEmpty()); - assertEquals(attributes.getScope(), Dependent.class); - assertEquals(attributes.getName(), "volume"); - assertFalse(attributes.isAlternative()); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - @SpecAssertion(section = BM_OBTAIN_BEANATTRIBUTES, id = "c") - public void testInvalidMember() { - AnnotatedConstructor constructor = getCurrentManager().createAnnotatedType(InvalidBeanType.class).getConstructors() - .iterator().next(); - getCurrentManager().createBeanAttributes(constructor); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/Dam.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/Dam.java deleted file mode 100644 index 724605ff9f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/Dam.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.beanManager.beanAttributes.ejb; - -import org.jboss.cdi.tck.tests.full.extensions.beanManager.beanAttributes.Fish; -import org.jboss.cdi.tck.tests.full.extensions.beanManager.beanAttributes.Wild; - -public class Dam extends Lake { - - @SuppressWarnings("unused") - @Wild - private Fish fish; - - @Wild - @Override - public Fish getFish() { - return null; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/Lake.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/Lake.java deleted file mode 100644 index 9ea2b2b26f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/Lake.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.beanManager.beanAttributes.ejb; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.Typed; -import jakarta.inject.Named; - -import org.jboss.cdi.tck.tests.full.extensions.beanManager.beanAttributes.Fish; -import org.jboss.cdi.tck.tests.full.extensions.beanManager.beanAttributes.Natural; -import org.jboss.cdi.tck.tests.full.extensions.beanManager.beanAttributes.TundraStereotype; - -@Stateless -@TundraStereotype -@Natural -public class Lake implements LakeLocal { - - @SuppressWarnings("unused") - @ApplicationScoped - @Natural - @TundraStereotype - @Typed(Fish.class) - @Named - private Fish fish; - - @Named - protected long volume; - - @ApplicationScoped - @Natural - @TundraStereotype - @Typed(Fish.class) - @Named - public Fish getFish() { - return null; - } - - @Named - public long getVolume() { - return 100; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/LakeLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/LakeLocal.java deleted file mode 100644 index 3d03f5281d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/beanManager/beanAttributes/ejb/LakeLocal.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.beanManager.beanAttributes.ejb; - -import jakarta.ejb.Local; - -import org.jboss.cdi.tck.tests.full.extensions.beanManager.beanAttributes.WaterBody; - -@Local -public interface LakeLocal extends WaterBody { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Cheese.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Cheese.java deleted file mode 100644 index 78bb994a8a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Cheese.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event; - -public class Cheese extends Food { - public Cheese(boolean fresh) { - super(fresh); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ContainerEventTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ContainerEventTest.java deleted file mode 100644 index 706137f9e1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ContainerEventTest.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event; - -import static jakarta.enterprise.inject.spi.SessionBeanType.STATEFUL; -import static jakarta.enterprise.inject.spi.SessionBeanType.STATELESS; -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_DISCOVERY_STEPS; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_DISCOVERY_STEPS_EE; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_BEAN; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_BEAN_EE; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_INJECTION_TARGET; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_INJECTION_TARGET_EE; -import static org.jboss.cdi.tck.cdi.Sections.TYPE_BEAN_DISCOVERY_EE; -import static org.jboss.cdi.tck.cdi.Sections.TYPE_DISCOVERY_STEPS; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.inject.Produces; -import jakarta.enterprise.inject.spi.Annotated; -import jakarta.enterprise.inject.spi.AnnotatedType; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Tests for ProcessAnnotatedType, ProcessBean and ProcessInjectionTarget events. - * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@Test(groups = JAVAEE_FULL) -@SpecVersion(spec = "cdi", version = "2.0") -public class ContainerEventTest extends AbstractTest { - - @SuppressWarnings("unchecked") - @Deployment - public static EnterpriseArchive createTestArchive() { - return new EnterpriseArchiveBuilder() - .withTestClassPackage(ContainerEventTest.class) - .withBeansXml(new BeansXml(BeanDiscoveryMode.ALL)) - .withExtensions(ProcessBeanObserver.class, ProcessInjectionTargetObserver.class, - ProcessAnnotatedTypeObserver.class) - .withEjbJarXml("ejb-jar.xml").build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = BEAN_DISCOVERY_STEPS, id = "f"), - @SpecAssertion(section = PROCESS_INJECTION_TARGET, id = "aaa") }) - public void testProcessInjectionTargetFiredForManagedBean() { - assert ProcessInjectionTargetObserver.getManagedBeanType() != null; - validateManagedBean(ProcessInjectionTargetObserver.getManagedBeanType()); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "aab"), - @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "abb"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "bb") }) - public void testProcessInjectionTargetFiredForSessionBean() { - assert ProcessInjectionTargetObserver.getStatelessSessionBeanType() != null; - assert ProcessInjectionTargetObserver.getStatefulSessionBeanType() != null; - validateStatelessSessionBean(ProcessInjectionTargetObserver.getStatelessSessionBeanType()); - validateStatefulSessionBean(ProcessInjectionTargetObserver.getStatefulSessionBeanType()); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "aaf"), - @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "abf"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "bh") }) - public void testProcessInjectionTargetFiredForSessionBeanInterceptor() { - assert ProcessInjectionTargetObserver.getSessionBeanInterceptorType() != null; - validateSessionBeanInterceptor(ProcessInjectionTargetObserver.getSessionBeanInterceptorType()); - } - - @Test - @SpecAssertion(section = TYPE_DISCOVERY_STEPS, id = "c") - public void testProcessAnnotatedTypeFiredForManagedBean() { - assert ProcessAnnotatedTypeObserver.getManagedBeanType() != null; - validateManagedBean(ProcessAnnotatedTypeObserver.getManagedBeanType()); - } - - @Test - @SpecAssertion(section = TYPE_BEAN_DISCOVERY_EE, id = "bb") - public void testProcessAnnotatedTypeFiredForSessionBean() { - assert ProcessAnnotatedTypeObserver.getStatelessSessionBeanType() != null; - assert ProcessAnnotatedTypeObserver.getStatefulSessionBeanType() != null; - validateStatelessSessionBean(ProcessAnnotatedTypeObserver.getStatelessSessionBeanType()); - validateStatefulSessionBean(ProcessAnnotatedTypeObserver.getStatefulSessionBeanType()); - } - - @Test - @SpecAssertion(section = TYPE_BEAN_DISCOVERY_EE, id = "bh") - public void testProcessAnnotatedTypeFiredForSessionBeanInterceptor() { - assert ProcessAnnotatedTypeObserver.getSessionBeanInterceptorType() != null; - validateSessionBeanInterceptor(ProcessAnnotatedTypeObserver.getSessionBeanInterceptorType()); - } - - @Test - @SpecAssertion(section = PROCESS_BEAN, id = "ba") - public void testProcessManagedBeanFired() { - assert ProcessBeanObserver.getProcessManagedBeanType() != null; - validateManagedBean(ProcessBeanObserver.getProcessManagedBeanType()); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN_EE, id = "ca"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "fb") }) - public void testProcessSessionBeanFiredForStatelessSessionBean() { - assert ProcessBeanObserver.getProcessStatelessSessionBeanAnnotatedType() != null; - validateStatelessSessionBean(ProcessBeanObserver.getProcessStatelessSessionBeanAnnotatedType()); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN_EE, id = "ca"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "fb") }) - public void testProcessSessionBeanFiredForStatefulSessionBean() { - assert ProcessBeanObserver.getProcessStatefulSessionBeanAnnotatedType() != null; - validateStatefulSessionBean(ProcessBeanObserver.getProcessStatefulSessionBeanAnnotatedType()); - } - - @Test - @SpecAssertion(section = PROCESS_BEAN_EE, id = "hb") - public void testGetEJBName() { - assert ProcessBeanObserver.getProcessStatelessSessionBeanName().equals("sheep"); - assert ProcessBeanObserver.getProcessStatefulSessionBeanName().equals("cow"); - } - - @Test - @SpecAssertion(section = PROCESS_BEAN_EE, id = "hc") - public void testGetSessionBeanType() { - assert ProcessBeanObserver.getProcessStatelessSessionBeanType().equals(STATELESS); - assert ProcessBeanObserver.getProcessStatefulSessionBeanType().equals(STATEFUL); - } - - private void validateStatelessSessionBean(Annotated type) { - assert type.getBaseType().equals(Sheep.class); - assert typeSetMatches(type.getTypeClosure(), Sheep.class, SheepLocal.class, Object.class); - assert type.getAnnotations().size() == 2; - assert annotationSetMatches(type.getAnnotations(), Tame.class, Stateless.class); - } - - private void validateStatefulSessionBean(Annotated type) { - assert type.getBaseType().equals(Cow.class); - assert typeSetMatches(type.getTypeClosure(), Cow.class, CowLocal.class, Object.class); - assert type.getAnnotations().size() == 0; - } - - private void validateSessionBeanInterceptor(AnnotatedType type) { - assert type.getBaseType().equals(SheepInterceptor.class); - assert typeSetMatches(type.getTypeClosure(), SheepInterceptor.class, Object.class); - assert type.getAnnotations().size() == 0; - assert type.getFields().size() == 0; - assert type.getMethods().size() == 1; - } - - private void validateManagedBean(AnnotatedType type) { - assert type.getBaseType().equals(Farm.class); - assert typeSetMatches(type.getTypeClosure(), Farm.class, Object.class); - assert type.getFields().size() == 1; - assert type.getFields().iterator().next().isAnnotationPresent(Produces.class); - assert type.getMethods().size() == 1; - assert type.getMethods().iterator().next().isAnnotationPresent(Produces.class); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Cow.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Cow.java deleted file mode 100644 index ca51fb7814..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Cow.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event; - -/** - * This is a stateful session bean defined in ejb-jar.xml - * - */ -public class Cow implements CowLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/CowLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/CowLocal.java deleted file mode 100644 index b2ccfdc47d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/CowLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event; - -/** - * This is a local interface for a session bean defined in ejb-jar.xml - * - */ -public interface CowLocal { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Farm.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Farm.java deleted file mode 100644 index 5a6dea67d4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Farm.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event; - -import jakarta.enterprise.inject.Produces; - -public class Farm { - @SuppressWarnings("unused") - @Produces - private Milk milk = new Milk(true); - - @Produces - public Cheese getCheese() { - return new Cheese(true); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Food.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Food.java deleted file mode 100644 index 1233cccd92..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Food.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event; - -public class Food { - @SuppressWarnings("unused") - private boolean fresh; - - public Food(boolean fresh) { - this.fresh = fresh; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Milk.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Milk.java deleted file mode 100644 index 041c4579cc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Milk.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event; - -public class Milk extends Food { - public Milk(boolean fresh) { - super(fresh); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessAnnotatedTypeObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessAnnotatedTypeObserver.java deleted file mode 100644 index 364dad1e43..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessAnnotatedTypeObserver.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.BeforeShutdown; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessAnnotatedType; - -public class ProcessAnnotatedTypeObserver implements Extension { - private static AnnotatedType statelessSessionBeanType = null; - private static AnnotatedType statefulSessionBeanType = null; - private static AnnotatedType sessionBeanInterceptorType = null; - private static AnnotatedType managedBeanType = null; - - public void cleanup(@Observes BeforeShutdown shutdown) { - statefulSessionBeanType = null; - statelessSessionBeanType = null; - sessionBeanInterceptorType = null; - managedBeanType = null; - } - - public void observeStatelessSessionBean(@Observes ProcessAnnotatedType event) { - statelessSessionBeanType = event.getAnnotatedType(); - } - - public void observeStatefulSessionBean(@Observes ProcessAnnotatedType event) { - statefulSessionBeanType = event.getAnnotatedType(); - } - - public void observeSessionBeanInterceptor(@Observes ProcessAnnotatedType event) { - sessionBeanInterceptorType = event.getAnnotatedType(); - } - - public void observeManagedBean(@Observes ProcessAnnotatedType event) { - managedBeanType = event.getAnnotatedType(); - } - - public static AnnotatedType getStatelessSessionBeanType() { - return statelessSessionBeanType; - } - - public static AnnotatedType getStatefulSessionBeanType() { - return statefulSessionBeanType; - } - - public static AnnotatedType getSessionBeanInterceptorType() { - return sessionBeanInterceptorType; - } - - public static AnnotatedType getManagedBeanType() { - return managedBeanType; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessBeanObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessBeanObserver.java deleted file mode 100644 index a2e30b638a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessBeanObserver.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.BeforeShutdown; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessManagedBean; -import jakarta.enterprise.inject.spi.ProcessSessionBean; -import jakarta.enterprise.inject.spi.SessionBeanType; - -public class ProcessBeanObserver implements Extension { - private static AnnotatedType processManagedBeanType = null; - private static AnnotatedType processStatelessSessionBeanAnnotatedType = null; - private static String processStatelessSessionBeanName = null; - private static SessionBeanType processStatelessSessionBeanType = null; - private static AnnotatedType processStatefulSessionBeanAnnotatedType = null; - private static String processStatefulSessionBeanName = null; - private static SessionBeanType processStatefulSessionBeanType = null; - - public void cleanup(@Observes BeforeShutdown shutdown) { - processManagedBeanType = null; - processStatelessSessionBeanAnnotatedType = null; - processStatelessSessionBeanName = null; - processStatelessSessionBeanType = null; - processStatefulSessionBeanAnnotatedType = null; - processStatefulSessionBeanName = null; - processStatefulSessionBeanType = null; - } - - public void observeProcessManagedBean(@Observes ProcessManagedBean event) { - processManagedBeanType = event.getAnnotatedBeanClass(); - } - - public void observeProcessStatelessSessionBean(@Observes ProcessSessionBean event) { - processStatelessSessionBeanAnnotatedType = event.getAnnotatedBeanClass(); - processStatelessSessionBeanName = event.getEjbName(); - processStatelessSessionBeanType = event.getSessionBeanType(); - } - - public void observeProcessStatefulSessionBean(@Observes ProcessSessionBean event) { - processStatefulSessionBeanAnnotatedType = event.getAnnotatedBeanClass(); - processStatefulSessionBeanName = event.getEjbName(); - processStatefulSessionBeanType = event.getSessionBeanType(); - } - - public static AnnotatedType getProcessManagedBeanType() { - return processManagedBeanType; - } - - public static AnnotatedType getProcessStatelessSessionBeanAnnotatedType() { - return processStatelessSessionBeanAnnotatedType; - } - - public static String getProcessStatelessSessionBeanName() { - return processStatelessSessionBeanName; - } - - public static SessionBeanType getProcessStatelessSessionBeanType() { - return processStatelessSessionBeanType; - } - - public static AnnotatedType getProcessStatefulSessionBeanAnnotatedType() { - return processStatefulSessionBeanAnnotatedType; - } - - public static String getProcessStatefulSessionBeanName() { - return processStatefulSessionBeanName; - } - - public static SessionBeanType getProcessStatefulSessionBeanType() { - return processStatefulSessionBeanType; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessInjectionTargetObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessInjectionTargetObserver.java deleted file mode 100644 index 00fca1fab4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessInjectionTargetObserver.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.BeforeShutdown; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessInjectionTarget; - -public class ProcessInjectionTargetObserver implements Extension { - private static AnnotatedType statelessSessionBeanType = null; - private static AnnotatedType statefulSessionBeanType = null; - private static AnnotatedType sessionBeanInterceptorType = null; - private static AnnotatedType managedBeanType = null; - - public void cleanup(@Observes BeforeShutdown shutdown) { - statefulSessionBeanType = null; - statelessSessionBeanType = null; - sessionBeanInterceptorType = null; - managedBeanType = null; - } - - public void observeStatelessSessionBean(@Observes ProcessInjectionTarget event) { - statelessSessionBeanType = event.getAnnotatedType(); - } - - public void observeStatefulSessionBean(@Observes ProcessInjectionTarget event) { - statefulSessionBeanType = event.getAnnotatedType(); - } - - public void observeSessionBeanInterceptor(@Observes ProcessInjectionTarget event) { - sessionBeanInterceptorType = event.getAnnotatedType(); - } - - public void observeManagedBean(@Observes ProcessInjectionTarget event) { - managedBeanType = event.getAnnotatedType(); - } - - public static AnnotatedType getStatelessSessionBeanType() { - return statelessSessionBeanType; - } - - public static AnnotatedType getStatefulSessionBeanType() { - return statefulSessionBeanType; - } - - public static AnnotatedType getSessionBeanInterceptorType() { - return sessionBeanInterceptorType; - } - - public static AnnotatedType getManagedBeanType() { - return managedBeanType; - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Sheep.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Sheep.java deleted file mode 100644 index e240a8b003..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Sheep.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event; - -import jakarta.ejb.Stateless; -import jakarta.interceptor.Interceptors; - -@Stateless(name = "sheep") -@Tame -public class Sheep implements SheepLocal { - @Interceptors(Sheep.class) - public void baa() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/SheepInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/SheepInterceptor.java deleted file mode 100644 index 13e05330c0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/SheepInterceptor.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -public class SheepInterceptor { - @AroundInvoke - public Object intercept(InvocationContext invocation) throws Exception { - return invocation.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/SheepLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/SheepLocal.java deleted file mode 100644 index 53d4092858..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/SheepLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event; - -import jakarta.ejb.Local; - -@Local -public interface SheepLocal { - void baa(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Tame.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Tame.java deleted file mode 100644 index ad997f0393..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/Tame.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Tame { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/ContainerEventTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/ContainerEventTest.java deleted file mode 100644 index fe4533cc01..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/ContainerEventTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event.jms; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.TestGroups.JMS; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_INJECTION_TARGET_EE; -import static org.jboss.cdi.tck.shrinkwrap.descriptors.ejb.EjbJarDescriptorBuilder.MessageDriven.newMessageDriven; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; - -import jakarta.enterprise.inject.spi.AnnotatedField; -import jakarta.enterprise.inject.spi.AnnotatedMethod; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.impl.ConfigurationFactory; -import org.jboss.cdi.tck.shrinkwrap.descriptors.ejb.EjbJarDescriptorBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.ejbjar31.EjbJarDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * This test verifies that ProcessInjectionTarget event is fired for message driven bean. - * - * Note that basic JMS configuration is required for this test. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ContainerEventTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - - EjbJarDescriptor ejbJarDescriptor = new EjbJarDescriptorBuilder().messageDrivenBeans( - newMessageDriven("TestQueue", QueueMessageDrivenBean.class.getName()) - .addActivationConfigProperty("acknowledgeMode", "Auto-acknowledge") - .addActivationConfigProperty("destinationType", "jakarta.jms.Queue") - .addActivationConfigProperty("destinationLookup", ConfigurationFactory.get().getTestJmsQueue())) - .build(); - - return new WebArchiveBuilder().withTestClassPackage(ContainerEventTest.class) - .withEjbJarXml(ejbJarDescriptor) - .withExtension(ProcessInjectionTargetObserver.class).build(); - } - - @Test(groups = { JAVAEE_FULL, JMS }) - @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "aaba"), - @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "abba") }) - public void testProcessInjectionTargetEventFiredForMessageDrivenBean() { - - AnnotatedType annotatedType = ProcessInjectionTargetObserver.getMdbType(); - - assertNotNull(annotatedType); - assertEquals(annotatedType.getBaseType(), QueueMessageDrivenBean.class); - - // Methods initialize() and onMessage() - assertEquals(annotatedType.getMethods().size(), 2); - for (AnnotatedMethod method : annotatedType.getMethods()) { - if ("initialize".equals(method.getJavaMember().getName())) { - assertTrue(method.isAnnotationPresent(Inject.class)); - assertEquals(method.getParameters().size(), 1); - assertEquals(method.getDeclaringType().getJavaClass(), QueueMessageDrivenBean.class); - } else if ("onMessage".equals(method.getJavaMember().getName())) { - assertEquals(method.getParameters().size(), 1); - assertEquals(method.getDeclaringType().getJavaClass(), QueueMessageDrivenBean.class); - } else { - fail(); - } - } - - // Fields sheep and initializerCalled - assertEquals(annotatedType.getFields().size(), 2); - for (AnnotatedField field : annotatedType.getFields()) { - if ("sheep".equals(field.getJavaMember().getName())) { - assertTrue(field.isAnnotationPresent(Inject.class)); - assertEquals(field.getDeclaringType().getJavaClass(), QueueMessageDrivenBean.class); - } else if ("initializerCalled".equals(field.getJavaMember().getName())) { - assertEquals(field.getDeclaringType().getJavaClass(), QueueMessageDrivenBean.class); - } else { - fail(); - } - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/ProcessInjectionTargetObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/ProcessInjectionTargetObserver.java deleted file mode 100644 index 96f7c1c71d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/ProcessInjectionTargetObserver.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event.jms; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessInjectionTarget; - -public class ProcessInjectionTargetObserver implements Extension { - - private static AnnotatedType mdbType = null; - - public void observeMdb(@Observes ProcessInjectionTarget event) { - mdbType = event.getAnnotatedType(); - } - - public static AnnotatedType getMdbType() { - return mdbType; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/QueueMessageDrivenBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/QueueMessageDrivenBean.java deleted file mode 100644 index 0d0a9b753b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/QueueMessageDrivenBean.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event.jms; - -import jakarta.inject.Inject; -import jakarta.jms.Message; -import jakarta.jms.MessageListener; - -public class QueueMessageDrivenBean implements MessageListener { - - @Inject - private Sheep sheep; - - @SuppressWarnings("unused") - private boolean initializerCalled = false; - - @Inject - public void initialize(Sheep sheep) { - initializerCalled = sheep != null; - } - - @Override - public void onMessage(Message message) { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/Sheep.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/Sheep.java deleted file mode 100644 index b2b12802fd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/jms/Sheep.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.container.event.jms; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Sheep { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/FullMarathon.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/FullMarathon.java deleted file mode 100644 index 7c937fd1ef..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/FullMarathon.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.interceptors; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target(value = { ElementType.TYPE }) -public @interface FullMarathon { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/Incremented.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/Incremented.java deleted file mode 100644 index 7e2fc63fe7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/Incremented.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.interceptors; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target(value = { ElementType.TYPE, ElementType.METHOD }) -public @interface Incremented { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/IncrementingInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/IncrementingInterceptor.java deleted file mode 100644 index 085689d7c6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/IncrementingInterceptor.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.interceptors; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -/** - * Interceptor that adds one to the result of a method - * - * @author Stuart Douglas stuart@baileyroberts.com.au> - */ -@Incremented -@Interceptor -public class IncrementingInterceptor { - private static boolean doAroundCalled = false; - - @AroundInvoke - public Object doAround(InvocationContext context) throws Exception { - doAroundCalled = true; - Integer res = (Integer) context.proceed(); - return res + 1; - } - - public static boolean isDoAroundCalled() { - return doAroundCalled; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/InterceptorExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/InterceptorExtension.java deleted file mode 100644 index 950b818d15..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/InterceptorExtension.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.interceptors; - -import java.util.HashSet; -import java.util.Set; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AnnotatedMethod; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.BeforeBeanDiscovery; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.util.Nonbinding; - -import org.jboss.cdi.tck.util.AddForwardingAnnotatedTypeAction; -import org.jboss.cdi.tck.util.annotated.AnnotatedMethodWrapper; -import org.jboss.cdi.tck.util.annotated.AnnotatedTypeWrapper; - -/** - * @author Stuart Douglas stuart@baileyroberts.com.au - * @author Martin Kouba - */ -public class InterceptorExtension implements Extension { - - /** - * registers two interceptors via the SPI - */ - public void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event, final BeanManager beanManager) - throws SecurityException, NoSuchMethodException { - - event.addInterceptorBinding(Incremented.class); - event.addInterceptorBinding(FullMarathon.class); - event.addInterceptorBinding(new AnnotatedTypeWrapper(beanManager.createAnnotatedType(Suffixed.class), true) { - Set> methods; - - { - methods = new HashSet>(); - for (AnnotatedMethod method : super.getMethods()) { - if ("value".equals(method.getJavaMember().getName())) { - methods.add(new AnnotatedMethodWrapper((AnnotatedMethod) method, this, true, - new Nonbinding.Literal())); - } else { - methods.add(new AnnotatedMethodWrapper((AnnotatedMethod) method, this, true)); - } - } - } - - @Override - public Set> getMethods() { - return methods; - } - }); - - new AddForwardingAnnotatedTypeAction() { - @Override - public String getBaseId() { - return InterceptorExtension.class.getName(); - } - - @Override - public AnnotatedType delegate() { - return beanManager.createAnnotatedType(IncrementingInterceptor.class); - } - }.perform(event); - - new AddForwardingAnnotatedTypeAction() { - @Override - public String getBaseId() { - return InterceptorExtension.class.getName(); - } - - @Override - public AnnotatedType delegate() { - return beanManager.createAnnotatedType(LifecycleInterceptor.class); - } - }.perform(event); - - new AddForwardingAnnotatedTypeAction() { - @Override - public String getBaseId() { - return InterceptorExtension.class.getName(); - } - - @Override - public AnnotatedType delegate() { - return beanManager.createAnnotatedType(SuffixingInterceptor.class); - } - }.perform(event); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/InterceptorExtensionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/InterceptorExtensionTest.java deleted file mode 100644 index 69a042f86f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/InterceptorExtensionTest.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.interceptors; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BEFORE_BEAN_DISCOVERY; -import static org.jboss.cdi.tck.cdi.Sections.INIT_EVENTS; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Tests that interceptors registered via the SPI work correctly. - * - *

- * This test was originally part of Weld test suite. - *

- * - * @author Stuart Douglas stuart@baileyroberts.com.au - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class InterceptorExtensionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - - return new WebArchiveBuilder() - .withTestClass(InterceptorExtensionTest.class) - .withClasses(Marathon.class, NumberSource.class, WordSource.class) - .withLibrary(SuffixingInterceptor.class, IncrementingInterceptor.class, LifecycleInterceptor.class, - Suffixed.class, FullMarathon.class, Incremented.class, - InterceptorExtension.class) - .withBeansXml( - new BeansXml().interceptors(SuffixingInterceptor.class, IncrementingInterceptor.class, - LifecycleInterceptor.class)) - .build(); - } - - @Inject - private BeanManager beanManager; - - @Inject - private NumberSource numberSource; - - @Inject - private WordSource wordSource; - - @Test - @SpecAssertions({ @SpecAssertion(section = INIT_EVENTS, id = "b"), @SpecAssertion(section = INIT_EVENTS, id = "bb"), - @SpecAssertion(section = BEFORE_BEAN_DISCOVERY, id = "ae") }) - public void testInterceptorAddedByClass() { - assertEquals(numberSource.value(), 2); - assertTrue(IncrementingInterceptor.isDoAroundCalled()); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = INIT_EVENTS, id = "b"), @SpecAssertion(section = INIT_EVENTS, id = "bb"), - @SpecAssertion(section = BEFORE_BEAN_DISCOVERY, id = "ae") }) - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void testLifecycleInterceptor() { - - Bean bean = beanManager.getBeans(Marathon.class).iterator().next(); - CreationalContext creationalContext = beanManager.createCreationalContext(bean); - Marathon marathon = (Marathon) bean.create(creationalContext); - - assertTrue(LifecycleInterceptor.isPostConstructCalled()); - assertEquals(marathon.getLength(), 42); - bean.destroy(marathon, creationalContext); - assertTrue(LifecycleInterceptor.isPreDestroyCalled()); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = INIT_EVENTS, id = "b"), @SpecAssertion(section = INIT_EVENTS, id = "bb"), - @SpecAssertion(section = BEFORE_BEAN_DISCOVERY, id = "aea") }) - public void testInterceptorAddedByAnnotatedType() { - assertEquals(wordSource.getWord(), WordSource.word); - assertEquals(wordSource.getWordWithSuffix(), WordSource.wordWithSuffix); - assertTrue(SuffixingInterceptor.isDoAroundCalled()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/LifecycleInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/LifecycleInterceptor.java deleted file mode 100644 index 8ba61271de..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/LifecycleInterceptor.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.interceptors; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -/** - * @author Stuart Douglas stuart@baileyroberts.com.au - */ -@FullMarathon -@Interceptor -public class LifecycleInterceptor { - static private boolean preDestroyCalled = false; - static private boolean postConstructCalled = false; - - @PreDestroy - public void preDestroy(InvocationContext ctx) { - preDestroyCalled = true; - } - - @PostConstruct - public void postConstruct(InvocationContext ctx) { - Object marathon = ctx.getTarget(); - if (marathon instanceof Marathon) { - Marathon m = (Marathon) marathon; - m.setLength(42); - } - postConstructCalled = true; - } - - static public boolean isPostConstructCalled() { - return postConstructCalled; - } - - static public boolean isPreDestroyCalled() { - return preDestroyCalled; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/Marathon.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/Marathon.java deleted file mode 100644 index 9300883867..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/Marathon.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.interceptors; - -import jakarta.enterprise.context.Dependent; - -@FullMarathon -@Dependent -public class Marathon { - long length; - - public long getLength() { - return length; - } - - public void setLength(long length) { - this.length = length; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/NumberSource.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/NumberSource.java deleted file mode 100644 index a81ffa280b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/NumberSource.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.interceptors; - -import jakarta.enterprise.context.Dependent; - -/** - * @author Stuart Douglas stuart@baileyroberts.com.au - */ -@Dependent -public class NumberSource { - @Incremented - public int value() { - return 1; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/Suffixed.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/Suffixed.java deleted file mode 100644 index b39ecd2a51..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/Suffixed.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.interceptors; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target(value = { ElementType.TYPE, ElementType.METHOD }) -public @interface Suffixed { - - String value() default "ly"; -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/SuffixingInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/SuffixingInterceptor.java deleted file mode 100644 index 85a6c59da5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/SuffixingInterceptor.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.interceptors; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -/** - * Interceptor that adds suffix -ly to a word - */ -@Suffixed -@Interceptor -public class SuffixingInterceptor { - private static boolean doAroundCalled = false; - - @AroundInvoke - public Object doAround(InvocationContext context) throws Exception { - doAroundCalled = true; - String result = (String) context.proceed(); - String suffix = context.getMethod().getAnnotation(Suffixed.class).value(); - return result + suffix; - } - - public static boolean isDoAroundCalled() { - return doAroundCalled; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/WordSource.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/WordSource.java deleted file mode 100644 index a11b36354c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/interceptors/WordSource.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.interceptors; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class WordSource { - - public static final String word = "awesome"; - public static final String suffix = "ness"; - public static final String wordWithSuffix = word + suffix; - - @Suffixed(suffix) - public String getWordWithSuffix() { - return word; - } - - public String getWord() { - return word; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ContainerLifeCycleEventRuntimeInvocationTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ContainerLifeCycleEventRuntimeInvocationTest.java deleted file mode 100644 index b40d7f0b97..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ContainerLifeCycleEventRuntimeInvocationTest.java +++ /dev/null @@ -1,605 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.events; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.AFTER_BEAN_DISCOVERY; -import static org.jboss.cdi.tck.cdi.Sections.AFTER_DEPLOYMENT_VALIDATION; -import static org.jboss.cdi.tck.cdi.Sections.AFTER_TYPE_DISCOVERY; -import static org.jboss.cdi.tck.cdi.Sections.BEFORE_BEAN_DISCOVERY; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_ANNOTATED_TYPE; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_BEAN; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_BEAN_ATTRIBUTES; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_INJECTION_POINT; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_INJECTION_TARGET; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_OBSERVER_METHOD; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_PRODUCER; -import static org.testng.Assert.fail; - -import java.lang.annotation.Annotation; -import java.util.Collections; -import java.util.Set; - -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.AfterBeanDiscovery; -import jakarta.enterprise.inject.spi.AfterDeploymentValidation; -import jakarta.enterprise.inject.spi.AfterTypeDiscovery; -import jakarta.enterprise.inject.spi.AnnotatedField; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.BeanAttributes; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.BeforeBeanDiscovery; -import jakarta.enterprise.inject.spi.InjectionPoint; -import jakarta.enterprise.inject.spi.InjectionTarget; -import jakarta.enterprise.inject.spi.ProcessAnnotatedType; -import jakarta.enterprise.inject.spi.ProcessBean; -import jakarta.enterprise.inject.spi.ProcessBeanAttributes; -import jakarta.enterprise.inject.spi.ProcessInjectionPoint; -import jakarta.enterprise.inject.spi.ProcessInjectionTarget; -import jakarta.enterprise.inject.spi.ProcessManagedBean; -import jakarta.enterprise.inject.spi.ProcessObserverMethod; -import jakarta.enterprise.inject.spi.ProcessProducer; -import jakarta.enterprise.inject.spi.ProcessProducerField; -import jakarta.enterprise.inject.spi.ProcessProducerMethod; -import jakarta.enterprise.inject.spi.ProcessSyntheticAnnotatedType; -import jakarta.enterprise.inject.spi.Producer; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * This test was originally part of the Weld test suite. - * - * @author Jozef Hartinger - * @author Tomas Remes - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class ContainerLifeCycleEventRuntimeInvocationTest extends AbstractTest { - - @Inject - TestExtension extension; - - @Inject - BeanManager beanManager; - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(ContainerLifeCycleEventRuntimeInvocationTest.class) - .withClasses(TestExtension.class, SimpleAnnotation.class, SimpleBean.class).withExtension(TestExtension.class) - .build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = BEFORE_BEAN_DISCOVERY, id = "f") }) - public void testBeforeBeanDiscoveryEventFails() { - final BeforeBeanDiscovery event = extension.getBeforeBeanDiscovery(); - final AnnotatedType type = beanManager.createAnnotatedType(ContainerLifeCycleEventRuntimeInvocationTest.class); - final AnnotatedType annotation = beanManager.createAnnotatedType(SimpleAnnotation.class); - - new Invocation() { - void execute() { - event.addAnnotatedType(type, type.getJavaClass().getSimpleName()); - } - }.run(); - new Invocation() { - void execute() { - event.addAnnotatedType(type, "foo"); - } - }.run(); - new Invocation() { - void execute() { - event.addInterceptorBinding(SimpleAnnotation.class); - } - }.run(); - new Invocation() { - void execute() { - event.addInterceptorBinding(annotation); - } - }.run(); - new Invocation() { - void execute() { - event.addQualifier(SimpleAnnotation.class); - } - }.run(); - new Invocation() { - void execute() { - event.addQualifier(annotation); - } - }.run(); - new Invocation() { - void execute() { - event.addScope(SimpleAnnotation.class, true, false); - } - }.run(); - new Invocation() { - void execute() { - event.addStereotype(SimpleAnnotation.class); - } - }.run(); - new Invocation() { - void execute() { - event.addAnnotatedType(String.class, "test"); - } - }.run(); - - } - - @Test - @SpecAssertions({ @SpecAssertion(section = AFTER_TYPE_DISCOVERY, id = "j") }) - public void testAfterTypeDiscoveryEventFails() { - - final AfterTypeDiscovery event = extension.getAfterTypeDiscovery(); - final AnnotatedType type = beanManager.createAnnotatedType(ContainerLifeCycleEventRuntimeInvocationTest.class); - new Invocation() { - void execute() { - event.addAnnotatedType(type, "bar"); - } - }.run(); - new Invocation() { - void execute() { - event.getAlternatives(); - } - }.run(); - new Invocation() { - void execute() { - event.getDecorators(); - } - }.run(); - new Invocation() { - void execute() { - event.getInterceptors(); - } - }.run(); - new Invocation() { - void execute() { - event.addAnnotatedType(String.class, "test"); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = AFTER_BEAN_DISCOVERY, id = "j") }) - public void testAfterBeanDiscoveryEventFails() { - - final AfterBeanDiscovery event = extension.getAfterBeanDiscovery(); - new Invocation() { - void execute() { - event.addBean(beanManager.getBeans(SimpleBean.class).iterator().next()); - } - }.run(); - new Invocation() { - void execute() { - event.addContext(beanManager.getContext(SessionScoped.class)); - } - }.run(); - new Invocation() { - void execute() { - event.addObserverMethod(extension.getProcessObserverMethod().getObserverMethod()); - } - }.run(); - new Invocation() { - void execute() { - event.getAnnotatedType(ContainerLifeCycleEventRuntimeInvocationTest.class, "foo"); - } - }.run(); - new Invocation() { - void execute() { - event.getAnnotatedTypes(ContainerLifeCycleEventRuntimeInvocationTest.class); - } - }.run(); - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - new Invocation() { - void execute() { - event.addBean(); - } - }.run(); - new Invocation() { - void execute() { - event.addObserverMethod(); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = AFTER_DEPLOYMENT_VALIDATION, id = "e") }) - public void testAfterDeploymentValidationEventFails() { - final AfterDeploymentValidation event = extension.getAfterDeploymentValidation(); - new Invocation() { - void execute() { - event.addDeploymentProblem(new NullPointerException()); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_ANNOTATED_TYPE, id = "f") }) - public void testProcessAnnotatedTypeEventFails() { - final ProcessAnnotatedType event = extension.getProcessAnnotatedType(); - final AnnotatedType type = beanManager.createAnnotatedType(SimpleBean.class); - new Invocation() { - void execute() { - event.getAnnotatedType(); - } - }.run(); - - new Invocation() { - void execute() { - event.setAnnotatedType(type); - } - }.run(); - - new Invocation() { - void execute() { - event.configureAnnotatedType(); - } - }.run(); - - new Invocation() { - void execute() { - event.veto(); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_ANNOTATED_TYPE, id = "f") }) - public void testProcessSyntheticAnnotatedTypeEventFails() { - final ProcessSyntheticAnnotatedType event = extension.getProcessSyntheticAnnotatedType(); - final AnnotatedType type = beanManager.createAnnotatedType(SimpleBean.class); - new Invocation() { - void execute() { - event.getAnnotatedType(); - } - }.run(); - - new Invocation() { - void execute() { - event.getSource(); - } - }.run(); - - new Invocation() { - void execute() { - event.setAnnotatedType(type); - } - }.run(); - - new Invocation() { - void execute() { - event.veto(); - } - }.run(); - - new Invocation() { - void execute() { - event.configureAnnotatedType(); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN, id = "o") }) - public void testProcessBeanEventFails() { - final ProcessBean event = extension.getProcessBean(); - new Invocation() { - void execute() { - event.getAnnotated(); - } - }.run(); - - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - - new Invocation() { - void execute() { - event.getBean(); - } - }.run(); - - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN, id = "o") }) - public void testProcessManagedBeanEventFails() { - final ProcessManagedBean event = extension.getProcessManagedBean(); - new Invocation() { - void execute() { - event.getAnnotated(); - } - }.run(); - - new Invocation() { - void execute() { - event.getAnnotatedBeanClass(); - } - }.run(); - - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - - new Invocation() { - void execute() { - event.getBean(); - } - }.run(); - - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN, id = "o") }) - public void testProcessProducerMethodEventFails() { - final ProcessProducerMethod event = extension.getProcessProducerMethod(); - new Invocation() { - void execute() { - event.getAnnotated(); - } - }.run(); - - new Invocation() { - void execute() { - event.getAnnotatedProducerMethod(); - } - }.run(); - - new Invocation() { - void execute() { - event.getAnnotatedDisposedParameter(); - } - }.run(); - - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - - new Invocation() { - void execute() { - event.getBean(); - } - }.run(); - - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN, id = "o") }) - public void testProcessProducerFieldEventFails() { - final ProcessProducerField event = extension.getProcessProducerField(); - new Invocation() { - void execute() { - event.getAnnotated(); - } - }.run(); - - new Invocation() { - void execute() { - event.getAnnotatedProducerField(); - } - }.run(); - - new Invocation() { - void execute() { - event.getAnnotatedDisposedParameter(); - } - }.run(); - - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - - new Invocation() { - void execute() { - event.getBean(); - } - }.run(); - - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN_ATTRIBUTES, id = "f") }) - public void testProcessBeanAttributesEventFails() { - final ProcessBeanAttributes event = extension.getProcessBeanAttributes(); - AnnotatedType type = beanManager.createAnnotatedType(SimpleBean.class); - final BeanAttributes attributes = beanManager.createBeanAttributes(type); - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - new Invocation() { - void execute() { - event.getAnnotated(); - } - }.run(); - new Invocation() { - void execute() { - event.setBeanAttributes(attributes); - } - }.run(); - new Invocation() { - void execute() { - event.getBeanAttributes(); - } - }.run(); - new Invocation() { - void execute() { - event.veto(); - } - }.run(); - new Invocation() { - void execute() { - event.configureBeanAttributes(); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_OBSERVER_METHOD, id = "dc") }) - public void testProcessObserverMethodEventFails() { - final ProcessObserverMethod event = extension.getProcessObserverMethod(); - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - new Invocation() { - void execute() { - event.getAnnotatedMethod(); - } - }.run(); - new Invocation() { - void execute() { - event.getObserverMethod(); - } - }.run(); - new Invocation() { - void execute() { - event.configureObserverMethod(); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_TARGET, id = "g") }) - public void testProcessInjectionTargetEventFails() { - final ProcessInjectionTarget event = extension.getProcessInjectionTarget(); - AnnotatedType type = beanManager.createAnnotatedType(SimpleBean.class); - final InjectionTarget target = beanManager.getInjectionTargetFactory(type).createInjectionTarget(null); - - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - new Invocation() { - void execute() { - event.getAnnotatedType(); - } - }.run(); - new Invocation() { - void execute() { - event.getInjectionTarget(); - } - }.run(); - new Invocation() { - void execute() { - event.setInjectionTarget(target); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_POINT, id = "e") }) - public void testProcessInjectionPointEventFails() { - final ProcessInjectionPoint event = extension.getProcessInjectionPoint(); - AnnotatedType type = beanManager.createAnnotatedType(SimpleBean.class); - AnnotatedField field = type.getFields().iterator().next(); - final InjectionPoint injectionPoint = beanManager.createInjectionPoint(field); - - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - new Invocation() { - void execute() { - event.getInjectionPoint(); - } - }.run(); - new Invocation() { - void execute() { - event.setInjectionPoint(injectionPoint); - } - }.run(); - new Invocation() { - void execute() { - event.configureInjectionPoint(); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_PRODUCER, id = "i") }) - public void testProcessProducer() { - final ProcessProducer event = extension.getProcessProducer(); - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - new Invocation() { - void execute() { - event.getProducer(); - } - }.run(); - new Invocation() { - void execute() { - event.getAnnotatedMember(); - } - }.run(); - new Invocation() { - void execute() { - event.setProducer(new Producer() { - @Override - public Integer produce(CreationalContext ctx) { - return new Integer(0); - } - - @Override - public void dispose(Integer instance) { - } - - @Override - public Set getInjectionPoints() { - return Collections.emptySet(); - } - }); - } - }.run(); - } - - private static abstract class Invocation { - void run() { - try { - execute(); - fail("Expected exception not thrown"); - } catch (IllegalStateException expected) { - } - } - - abstract void execute(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/SimpleAnnotation.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/SimpleAnnotation.java deleted file mode 100644 index ed9e573bcf..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/SimpleAnnotation.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.events; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -@Retention(RetentionPolicy.RUNTIME) -public @interface SimpleAnnotation { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/SimpleBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/SimpleBean.java deleted file mode 100644 index 04fa9f2647..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/SimpleBean.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.events; - -import jakarta.enterprise.context.Conversation; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.Produces; -import jakarta.inject.Inject; - -@Dependent -public class SimpleBean { - - @Inject - Conversation conversation; - - @Produces - public Integer numberOfNumbers = new Integer(13); - - @Produces - public Integer create() { - return new Integer(0); - } - - // we need some observer for this bean just for test purposes - public void dummyObserver(@Observes SimpleBean bean) { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/TestExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/TestExtension.java deleted file mode 100644 index cca61d5a18..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/TestExtension.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.events; - -import static org.testng.Assert.fail; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AfterBeanDiscovery; -import jakarta.enterprise.inject.spi.AfterDeploymentValidation; -import jakarta.enterprise.inject.spi.AfterTypeDiscovery; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.BeforeBeanDiscovery; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessAnnotatedType; -import jakarta.enterprise.inject.spi.ProcessBean; -import jakarta.enterprise.inject.spi.ProcessBeanAttributes; -import jakarta.enterprise.inject.spi.ProcessInjectionPoint; -import jakarta.enterprise.inject.spi.ProcessInjectionTarget; -import jakarta.enterprise.inject.spi.ProcessManagedBean; -import jakarta.enterprise.inject.spi.ProcessObserverMethod; -import jakarta.enterprise.inject.spi.ProcessProducer; -import jakarta.enterprise.inject.spi.ProcessProducerField; -import jakarta.enterprise.inject.spi.ProcessProducerMethod; -import jakarta.enterprise.inject.spi.ProcessSyntheticAnnotatedType; - -public class TestExtension implements Extension { - - private BeforeBeanDiscovery bbd; - private AfterTypeDiscovery atd; - private AfterBeanDiscovery abd; - private ProcessAnnotatedType pat; - private ProcessSyntheticAnnotatedType psat; - private AfterDeploymentValidation adv; - private ProcessBean pb; - private ProcessBeanAttributes pba; - private ProcessObserverMethod pom; - private ProcessInjectionTarget pit; - private ProcessInjectionPoint pip; - private ProcessProducer pp; - private ProcessManagedBean pmb; - private ProcessProducerField ppf; - private ProcessProducerMethod ppm; - - void observesBeforeBeanDiscovery(@Observes BeforeBeanDiscovery event, BeanManager bm) { - this.bbd = event; - bbd.addAnnotatedType(bm.createAnnotatedType(SimpleBean.class), - TestExtension.class.getName() + ":" + SimpleBean.class.getName()); - } - - void observesProcessAnnotatedType(@Observes ProcessAnnotatedType event) { - if (!(event instanceof ProcessSyntheticAnnotatedType)) { - this.pat = event; - } - } - - void observesProcessSyntheticAnnotatedType(@Observes ProcessSyntheticAnnotatedType event) { - this.psat = event; - } - - void observesAfterTypeDiscovery(@Observes AfterTypeDiscovery event) { - this.atd = event; - } - - void observesProcessInjectionTarget(@Observes ProcessInjectionTarget event) { - this.pit = event; - } - - void observesProcessProducer(@Observes ProcessProducer event) { - this.pp = event; - } - - void observesProcessInjectionPoint(@Observes ProcessInjectionPoint event) { - this.pip = event; - } - - void observesProcessBeanAttributes(@Observes ProcessBeanAttributes event) { - this.pba = event; - } - - // Modifying PAT in another lifecycle event should also fail with IllegalStateException - void observesProcessBean(@Observes ProcessBean event, BeanManager bm) { - - this.pb = event; - try { - pat.getAnnotatedType(); - fail("Expected exception not thrown"); - } catch (IllegalStateException expected) { - } - - try { - pat.setAnnotatedType(bm.createAnnotatedType(SimpleBean.class)); - fail("Expected exception not thrown"); - } catch (IllegalStateException expected) { - } - - } - - void observesProcessManagedBean(@Observes ProcessManagedBean event) { - this.pmb = event; - } - - void observesProcessProducerField(@Observes ProcessProducerField event) { - this.ppf = event; - } - - void observesProcessSessionBean(@Observes ProcessProducerMethod event) { - this.ppm = event; - } - - void observesProcessObserverMethod(@Observes ProcessObserverMethod event) { - this.pom = event; - } - - void observesAfterBeanDiscovery(@Observes AfterBeanDiscovery event) { - this.abd = event; - } - - void observesAfterDeploymentValidation(@Observes AfterDeploymentValidation event) { - this.adv = event; - } - - public BeforeBeanDiscovery getBeforeBeanDiscovery() { - return bbd; - } - - public AfterTypeDiscovery getAfterTypeDiscovery() { - return atd; - } - - public AfterBeanDiscovery getAfterBeanDiscovery() { - return abd; - } - - public AfterDeploymentValidation getAfterDeploymentValidation() { - return adv; - } - - public ProcessBean getProcessBean() { - return pb; - } - - public ProcessAnnotatedType getProcessAnnotatedType() { - return pat; - } - - public ProcessSyntheticAnnotatedType getProcessSyntheticAnnotatedType() { - return psat; - } - - public ProcessBeanAttributes getProcessBeanAttributes() { - return pba; - } - - public ProcessObserverMethod getProcessObserverMethod() { - return pom; - } - - public ProcessInjectionTarget getProcessInjectionTarget() { - return pit; - } - - public ProcessInjectionPoint getProcessInjectionPoint() { - return pip; - } - - public ProcessProducer getProcessProducer() { - return pp; - } - - public ProcessManagedBean getProcessManagedBean() { - return pmb; - } - - public ProcessProducerField getProcessProducerField() { - return ppf; - } - - public ProcessProducerMethod getProcessProducerMethod() { - return ppm; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/ContainerLifeCycleEventRuntimeInvocationTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/ContainerLifeCycleEventRuntimeInvocationTest.java deleted file mode 100644 index d726393024..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/ContainerLifeCycleEventRuntimeInvocationTest.java +++ /dev/null @@ -1,650 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.events.ejb; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.AFTER_BEAN_DISCOVERY; -import static org.jboss.cdi.tck.cdi.Sections.AFTER_DEPLOYMENT_VALIDATION; -import static org.jboss.cdi.tck.cdi.Sections.AFTER_TYPE_DISCOVERY; -import static org.jboss.cdi.tck.cdi.Sections.BEFORE_BEAN_DISCOVERY; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_ANNOTATED_TYPE; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_BEAN; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_BEAN_ATTRIBUTES; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_INJECTION_POINT; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_INJECTION_TARGET; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_OBSERVER_METHOD; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_PRODUCER; -import static org.testng.Assert.fail; - -import java.lang.annotation.Annotation; -import java.util.Collections; -import java.util.Set; - -import jakarta.enterprise.context.SessionScoped; -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.AfterBeanDiscovery; -import jakarta.enterprise.inject.spi.AfterDeploymentValidation; -import jakarta.enterprise.inject.spi.AfterTypeDiscovery; -import jakarta.enterprise.inject.spi.AnnotatedField; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.BeanAttributes; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.BeforeBeanDiscovery; -import jakarta.enterprise.inject.spi.InjectionPoint; -import jakarta.enterprise.inject.spi.InjectionTarget; -import jakarta.enterprise.inject.spi.ProcessAnnotatedType; -import jakarta.enterprise.inject.spi.ProcessBean; -import jakarta.enterprise.inject.spi.ProcessBeanAttributes; -import jakarta.enterprise.inject.spi.ProcessInjectionPoint; -import jakarta.enterprise.inject.spi.ProcessInjectionTarget; -import jakarta.enterprise.inject.spi.ProcessManagedBean; -import jakarta.enterprise.inject.spi.ProcessObserverMethod; -import jakarta.enterprise.inject.spi.ProcessProducer; -import jakarta.enterprise.inject.spi.ProcessProducerField; -import jakarta.enterprise.inject.spi.ProcessProducerMethod; -import jakarta.enterprise.inject.spi.ProcessSessionBean; -import jakarta.enterprise.inject.spi.ProcessSyntheticAnnotatedType; -import jakarta.enterprise.inject.spi.Producer; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * This test was originally part of the Weld test suite. - * - * @author Jozef Hartinger - * @author Tomas Remes - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class ContainerLifeCycleEventRuntimeInvocationTest extends AbstractTest { - - @Inject - TestExtension extension; - - @Inject - BeanManager beanManager; - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(ContainerLifeCycleEventRuntimeInvocationTest.class) - .withClasses(TestExtension.class, SimpleAnnotation.class, SimpleBean.class, SessionBean.class) - .withExtension(TestExtension.class) - .build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = BEFORE_BEAN_DISCOVERY, id = "f") }) - public void testBeforeBeanDiscoveryEventFails() { - final BeforeBeanDiscovery event = extension.getBeforeBeanDiscovery(); - final AnnotatedType type = beanManager.createAnnotatedType(ContainerLifeCycleEventRuntimeInvocationTest.class); - final AnnotatedType annotation = beanManager.createAnnotatedType(SimpleAnnotation.class); - - new Invocation() { - void execute() { - event.addAnnotatedType(type, type.getJavaClass().getSimpleName()); - } - }.run(); - new Invocation() { - void execute() { - event.addAnnotatedType(type, "foo"); - } - }.run(); - new Invocation() { - void execute() { - event.addInterceptorBinding(SimpleAnnotation.class); - } - }.run(); - new Invocation() { - void execute() { - event.addInterceptorBinding(annotation); - } - }.run(); - new Invocation() { - void execute() { - event.addQualifier(SimpleAnnotation.class); - } - }.run(); - new Invocation() { - void execute() { - event.addQualifier(annotation); - } - }.run(); - new Invocation() { - void execute() { - event.addScope(SimpleAnnotation.class, true, false); - } - }.run(); - new Invocation() { - void execute() { - event.addStereotype(SimpleAnnotation.class); - } - }.run(); - new Invocation() { - void execute() { - event.addAnnotatedType(String.class, "test"); - } - }.run(); - - } - - @Test - @SpecAssertions({ @SpecAssertion(section = AFTER_TYPE_DISCOVERY, id = "j") }) - public void testAfterTypeDiscoveryEventFails() { - - final AfterTypeDiscovery event = extension.getAfterTypeDiscovery(); - final AnnotatedType type = beanManager.createAnnotatedType(ContainerLifeCycleEventRuntimeInvocationTest.class); - new Invocation() { - void execute() { - event.addAnnotatedType(type, "bar"); - } - }.run(); - new Invocation() { - void execute() { - event.getAlternatives(); - } - }.run(); - new Invocation() { - void execute() { - event.getDecorators(); - } - }.run(); - new Invocation() { - void execute() { - event.getInterceptors(); - } - }.run(); - new Invocation() { - void execute() { - event.addAnnotatedType(String.class, "test"); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = AFTER_BEAN_DISCOVERY, id = "j") }) - public void testAfterBeanDiscoveryEventFails() { - - final AfterBeanDiscovery event = extension.getAfterBeanDiscovery(); - new Invocation() { - void execute() { - event.addBean(beanManager.getBeans(SimpleBean.class).iterator().next()); - } - }.run(); - new Invocation() { - void execute() { - event.addContext(beanManager.getContext(SessionScoped.class)); - } - }.run(); - new Invocation() { - void execute() { - event.addObserverMethod(extension.getProcessObserverMethod().getObserverMethod()); - } - }.run(); - new Invocation() { - void execute() { - event.getAnnotatedType(ContainerLifeCycleEventRuntimeInvocationTest.class, "foo"); - } - }.run(); - new Invocation() { - void execute() { - event.getAnnotatedTypes(ContainerLifeCycleEventRuntimeInvocationTest.class); - } - }.run(); - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - new Invocation() { - void execute() { - event.addBean(); - } - }.run(); - new Invocation() { - void execute() { - event.addObserverMethod(); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = AFTER_DEPLOYMENT_VALIDATION, id = "e") }) - public void testAfterDeploymentValidationEventFails() { - final AfterDeploymentValidation event = extension.getAfterDeploymentValidation(); - new Invocation() { - void execute() { - event.addDeploymentProblem(new NullPointerException()); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_ANNOTATED_TYPE, id = "f") }) - public void testProcessAnnotatedTypeEventFails() { - final ProcessAnnotatedType event = extension.getProcessAnnotatedType(); - final AnnotatedType type = beanManager.createAnnotatedType(SimpleBean.class); - new Invocation() { - void execute() { - event.getAnnotatedType(); - } - }.run(); - - new Invocation() { - void execute() { - event.setAnnotatedType(type); - } - }.run(); - - new Invocation() { - void execute() { - event.configureAnnotatedType(); - } - }.run(); - - new Invocation() { - void execute() { - event.veto(); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_ANNOTATED_TYPE, id = "f") }) - public void testProcessSyntheticAnnotatedTypeEventFails() { - final ProcessSyntheticAnnotatedType event = extension.getProcessSyntheticAnnotatedType(); - final AnnotatedType type = beanManager.createAnnotatedType(SimpleBean.class); - new Invocation() { - void execute() { - event.getAnnotatedType(); - } - }.run(); - - new Invocation() { - void execute() { - event.getSource(); - } - }.run(); - - new Invocation() { - void execute() { - event.setAnnotatedType(type); - } - }.run(); - - new Invocation() { - void execute() { - event.veto(); - } - }.run(); - - new Invocation() { - void execute() { - event.configureAnnotatedType(); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN, id = "o") }) - public void testProcessBeanEventFails() { - final ProcessBean event = extension.getProcessBean(); - new Invocation() { - void execute() { - event.getAnnotated(); - } - }.run(); - - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - - new Invocation() { - void execute() { - event.getBean(); - } - }.run(); - - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN, id = "o") }) - public void testProcessManagedBeanEventFails() { - final ProcessManagedBean event = extension.getProcessManagedBean(); - new Invocation() { - void execute() { - event.getAnnotated(); - } - }.run(); - - new Invocation() { - void execute() { - event.getAnnotatedBeanClass(); - } - }.run(); - - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - - new Invocation() { - void execute() { - event.getBean(); - } - }.run(); - - } - - @Test(groups = { JAVAEE_FULL }) - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN, id = "o") }) - public void testProcessSessionBeanEventFails() { - final ProcessSessionBean event = extension.getProcessSessionBean(); - new Invocation() { - void execute() { - event.getAnnotated(); - } - }.run(); - - new Invocation() { - void execute() { - event.getAnnotatedBeanClass(); - } - }.run(); - - new Invocation() { - void execute() { - event.getEjbName(); - } - }.run(); - - new Invocation() { - void execute() { - event.getSessionBeanType(); - } - }.run(); - - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - - new Invocation() { - void execute() { - event.getBean(); - } - }.run(); - - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN, id = "o") }) - public void testProcessProducerMethodEventFails() { - final ProcessProducerMethod event = extension.getProcessProducerMethod(); - new Invocation() { - void execute() { - event.getAnnotated(); - } - }.run(); - - new Invocation() { - void execute() { - event.getAnnotatedProducerMethod(); - } - }.run(); - - new Invocation() { - void execute() { - event.getAnnotatedDisposedParameter(); - } - }.run(); - - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - - new Invocation() { - void execute() { - event.getBean(); - } - }.run(); - - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN, id = "o") }) - public void testProcessProducerFieldEventFails() { - final ProcessProducerField event = extension.getProcessProducerField(); - new Invocation() { - void execute() { - event.getAnnotated(); - } - }.run(); - - new Invocation() { - void execute() { - event.getAnnotatedProducerField(); - } - }.run(); - - new Invocation() { - void execute() { - event.getAnnotatedDisposedParameter(); - } - }.run(); - - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - - new Invocation() { - void execute() { - event.getBean(); - } - }.run(); - - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN_ATTRIBUTES, id = "f") }) - public void testProcessBeanAttributesEventFails() { - final ProcessBeanAttributes event = extension.getProcessBeanAttributes(); - AnnotatedType type = beanManager.createAnnotatedType(SimpleBean.class); - final BeanAttributes attributes = beanManager.createBeanAttributes(type); - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - new Invocation() { - void execute() { - event.getAnnotated(); - } - }.run(); - new Invocation() { - void execute() { - event.setBeanAttributes(attributes); - } - }.run(); - new Invocation() { - void execute() { - event.getBeanAttributes(); - } - }.run(); - new Invocation() { - void execute() { - event.veto(); - } - }.run(); - new Invocation() { - void execute() { - event.configureBeanAttributes(); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_OBSERVER_METHOD, id = "dc") }) - public void testProcessObserverMethodEventFails() { - final ProcessObserverMethod event = extension.getProcessObserverMethod(); - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - new Invocation() { - void execute() { - event.getAnnotatedMethod(); - } - }.run(); - new Invocation() { - void execute() { - event.getObserverMethod(); - } - }.run(); - new Invocation() { - void execute() { - event.configureObserverMethod(); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_TARGET, id = "g") }) - public void testProcessInjectionTargetEventFails() { - final ProcessInjectionTarget event = extension.getProcessInjectionTarget(); - AnnotatedType type = beanManager.createAnnotatedType(SimpleBean.class); - final InjectionTarget target = beanManager.getInjectionTargetFactory(type).createInjectionTarget(null); - - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - new Invocation() { - void execute() { - event.getAnnotatedType(); - } - }.run(); - new Invocation() { - void execute() { - event.getInjectionTarget(); - } - }.run(); - new Invocation() { - void execute() { - event.setInjectionTarget(target); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_POINT, id = "e") }) - public void testProcessInjectionPointEventFails() { - final ProcessInjectionPoint event = extension.getProcessInjectionPoint(); - AnnotatedType type = beanManager.createAnnotatedType(SimpleBean.class); - AnnotatedField field = type.getFields().iterator().next(); - final InjectionPoint injectionPoint = beanManager.createInjectionPoint(field); - - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - new Invocation() { - void execute() { - event.getInjectionPoint(); - } - }.run(); - new Invocation() { - void execute() { - event.setInjectionPoint(injectionPoint); - } - }.run(); - new Invocation() { - void execute() { - event.configureInjectionPoint(); - } - }.run(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_PRODUCER, id = "i") }) - public void testProcessProducer() { - final ProcessProducer event = extension.getProcessProducer(); - new Invocation() { - void execute() { - event.addDefinitionError(new NullPointerException()); - } - }.run(); - new Invocation() { - void execute() { - event.getProducer(); - } - }.run(); - new Invocation() { - void execute() { - event.getAnnotatedMember(); - } - }.run(); - new Invocation() { - void execute() { - event.setProducer(new Producer() { - @Override - public Integer produce(CreationalContext ctx) { - return new Integer(0); - } - - @Override - public void dispose(Integer instance) { - } - - @Override - public Set getInjectionPoints() { - return Collections.emptySet(); - } - }); - } - }.run(); - } - - private static abstract class Invocation { - void run() { - try { - execute(); - fail("Expected exception not thrown"); - } catch (IllegalStateException expected) { - } - } - - abstract void execute(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/SessionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/SessionBean.java deleted file mode 100644 index 8bf66114c5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/SessionBean.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.events.ejb; - -import jakarta.ejb.Stateless; - -/** - * @author Tomas Remes - */ - -@Stateless -public class SessionBean { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/SimpleAnnotation.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/SimpleAnnotation.java deleted file mode 100644 index 0f90b784cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/SimpleAnnotation.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.events.ejb; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -@Retention(RetentionPolicy.RUNTIME) -public @interface SimpleAnnotation { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/SimpleBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/SimpleBean.java deleted file mode 100644 index 24e6979b7a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/SimpleBean.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.events.ejb; - -import jakarta.enterprise.context.Conversation; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.Produces; -import jakarta.inject.Inject; - -@Dependent -public class SimpleBean { - - @Inject - Conversation conversation; - - @Produces - public Integer numberOfNumbers = new Integer(13); - - @Produces - public Integer create() { - return new Integer(0); - } - - // we need some observer for this bean just for test purposes - public void dummyObserver(@Observes SimpleBean bean) { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/TestExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/TestExtension.java deleted file mode 100644 index 2b6344be0a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/events/ejb/TestExtension.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.events.ejb; - -import static org.testng.Assert.fail; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AfterBeanDiscovery; -import jakarta.enterprise.inject.spi.AfterDeploymentValidation; -import jakarta.enterprise.inject.spi.AfterTypeDiscovery; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.BeforeBeanDiscovery; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessAnnotatedType; -import jakarta.enterprise.inject.spi.ProcessBean; -import jakarta.enterprise.inject.spi.ProcessBeanAttributes; -import jakarta.enterprise.inject.spi.ProcessInjectionPoint; -import jakarta.enterprise.inject.spi.ProcessInjectionTarget; -import jakarta.enterprise.inject.spi.ProcessManagedBean; -import jakarta.enterprise.inject.spi.ProcessObserverMethod; -import jakarta.enterprise.inject.spi.ProcessProducer; -import jakarta.enterprise.inject.spi.ProcessProducerField; -import jakarta.enterprise.inject.spi.ProcessProducerMethod; -import jakarta.enterprise.inject.spi.ProcessSessionBean; -import jakarta.enterprise.inject.spi.ProcessSyntheticAnnotatedType; - -public class TestExtension implements Extension { - - private BeforeBeanDiscovery bbd; - private AfterTypeDiscovery atd; - private AfterBeanDiscovery abd; - private ProcessAnnotatedType pat; - private ProcessSyntheticAnnotatedType psat; - private AfterDeploymentValidation adv; - private ProcessBean pb; - private ProcessBeanAttributes pba; - private ProcessObserverMethod pom; - private ProcessInjectionTarget pit; - private ProcessInjectionPoint pip; - private ProcessProducer pp; - private ProcessManagedBean pmb; - private ProcessSessionBean psb; - private ProcessProducerField ppf; - private ProcessProducerMethod ppm; - - void observesBeforeBeanDiscovery(@Observes BeforeBeanDiscovery event, BeanManager bm) { - this.bbd = event; - bbd.addAnnotatedType(bm.createAnnotatedType(SimpleBean.class), - TestExtension.class.getName() + ":" + SimpleBean.class.getName()); - } - - void observesProcessAnnotatedType(@Observes ProcessAnnotatedType event) { - if (!(event instanceof ProcessSyntheticAnnotatedType)) { - this.pat = event; - } - } - - void observesProcessSyntheticAnnotatedType(@Observes ProcessSyntheticAnnotatedType event) { - this.psat = event; - } - - void observesAfterTypeDiscovery(@Observes AfterTypeDiscovery event) { - this.atd = event; - } - - void observesProcessInjectionTarget(@Observes ProcessInjectionTarget event) { - this.pit = event; - } - - void observesProcessProducer(@Observes ProcessProducer event) { - this.pp = event; - } - - void observesProcessInjectionPoint(@Observes ProcessInjectionPoint event) { - this.pip = event; - } - - void observesProcessBeanAttributes(@Observes ProcessBeanAttributes event) { - this.pba = event; - } - - // Modifying PAT in another lifecycle event should also fail with IllegalStateException - void observesProcessBean(@Observes ProcessBean event, BeanManager bm) { - - this.pb = event; - try { - pat.getAnnotatedType(); - fail("Expected exception not thrown"); - } catch (IllegalStateException expected) { - } - - try { - pat.setAnnotatedType(bm.createAnnotatedType(SimpleBean.class)); - fail("Expected exception not thrown"); - } catch (IllegalStateException expected) { - } - - } - - void observesProcessManagedBean(@Observes ProcessManagedBean event) { - this.pmb = event; - } - - void observesProcessSessionBean(@Observes ProcessSessionBean event) { - this.psb = event; - } - - void observesProcessProducerField(@Observes ProcessProducerField event) { - this.ppf = event; - } - - void observesProcessSessionBean(@Observes ProcessProducerMethod event) { - this.ppm = event; - } - - void observesProcessObserverMethod(@Observes ProcessObserverMethod event) { - this.pom = event; - } - - void observesAfterBeanDiscovery(@Observes AfterBeanDiscovery event) { - this.abd = event; - } - - void observesAfterDeploymentValidation(@Observes AfterDeploymentValidation event) { - this.adv = event; - } - - public BeforeBeanDiscovery getBeforeBeanDiscovery() { - return bbd; - } - - public AfterTypeDiscovery getAfterTypeDiscovery() { - return atd; - } - - public AfterBeanDiscovery getAfterBeanDiscovery() { - return abd; - } - - public AfterDeploymentValidation getAfterDeploymentValidation() { - return adv; - } - - public ProcessBean getProcessBean() { - return pb; - } - - public ProcessAnnotatedType getProcessAnnotatedType() { - return pat; - } - - public ProcessSyntheticAnnotatedType getProcessSyntheticAnnotatedType() { - return psat; - } - - public ProcessBeanAttributes getProcessBeanAttributes() { - return pba; - } - - public ProcessObserverMethod getProcessObserverMethod() { - return pom; - } - - public ProcessInjectionTarget getProcessInjectionTarget() { - return pit; - } - - public ProcessInjectionPoint getProcessInjectionPoint() { - return pip; - } - - public ProcessProducer getProcessProducer() { - return pp; - } - - public ProcessManagedBean getProcessManagedBean() { - return pmb; - } - - public ProcessSessionBean getProcessSessionBean() { - return psb; - } - - public ProcessProducerField getProcessProducerField() { - return ppf; - } - - public ProcessProducerMethod getProcessProducerMethod() { - return ppm; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/builtin/ProcessBeanAttributesNotFiredForBuiltinBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/builtin/ProcessBeanAttributesNotFiredForBuiltinBean.java deleted file mode 100644 index 2e5c5b4360..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/builtin/ProcessBeanAttributesNotFiredForBuiltinBean.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processBeanAttributes.builtin; - -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_BEAN_ATTRIBUTES; -import static org.testng.Assert.assertTrue; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ProcessBeanAttributesNotFiredForBuiltinBean extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ProcessBeanAttributesNotFiredForBuiltinBean.class) - .withExtension(ProcessBeanAttributesObserver.class).build(); - } - - @Inject - ProcessBeanAttributesObserver observer; - - @Test - @SpecAssertion(section = PROCESS_BEAN_ATTRIBUTES, id = "af") - public void testProcessBeanAttributesNotFired() { - assertTrue(observer.getObservedBeanAttributes().isEmpty()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/builtin/ProcessBeanAttributesObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/builtin/ProcessBeanAttributesObserver.java deleted file mode 100644 index 157469d107..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/builtin/ProcessBeanAttributesObserver.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processBeanAttributes.builtin; - -import java.util.ArrayList; -import java.util.List; - -import jakarta.enterprise.context.Conversation; -import jakarta.enterprise.event.Event; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.Default; -import jakarta.enterprise.inject.Instance; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessBeanAttributes; -import jakarta.servlet.http.HttpServletRequest; - -public class ProcessBeanAttributesObserver implements Extension { - - private List> observedBeanAttributes = new ArrayList>(); - - public void observeHttpServletRequestBeanAttributes(@Observes ProcessBeanAttributes event) { - if (event.getBeanAttributes().getQualifiers().contains(Default.Literal.INSTANCE)) { - observedBeanAttributes.add(event); - } - } - - @SuppressWarnings("rawtypes") - public void observeEventBeanAttributes(@Observes ProcessBeanAttributes event) { - if (event.getBeanAttributes().getQualifiers().contains(Default.Literal.INSTANCE)) { - observedBeanAttributes.add(event); - } - } - - @SuppressWarnings("rawtypes") - public void observeInstanceBeanAttributes(@Observes ProcessBeanAttributes event) { - if (event.getBeanAttributes().getQualifiers().contains(Default.Literal.INSTANCE)) { - observedBeanAttributes.add(event); - } - } - - public void observeConversationBeanAttributes(@Observes ProcessBeanAttributes event) { - if (event.getBeanAttributes().getQualifiers().contains(Default.Literal.INSTANCE)) { - observedBeanAttributes.add(event); - } - } - - public void observeBeanManagerBeanAttributes(@Observes ProcessBeanAttributes event) { - if (event.getBeanAttributes().getQualifiers().contains(Default.Literal.INSTANCE)) { - observedBeanAttributes.add(event); - } - } - - public List> getObservedBeanAttributes() { - return observedBeanAttributes; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/ejb/Delta.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/ejb/Delta.java deleted file mode 100644 index 107e72ac53..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/ejb/Delta.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processBeanAttributes.ejb; - -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; -import jakarta.inject.Named; - -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processBeanAttributes.Alpha; - -@Named -@Stateless -public class Delta { - - @SuppressWarnings("unused") - @Inject - private Alpha alpha; - - public void foo() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/ejb/VerifyValuesTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/ejb/VerifyValuesTest.java deleted file mode 100644 index 88ecad999f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/ejb/VerifyValuesTest.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processBeanAttributes.ejb; - -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_BEAN_ATTRIBUTES; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_BEAN_ATTRIBUTES_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; - -import java.lang.annotation.Annotation; - -import jakarta.decorator.Decorator; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Any; -import jakarta.enterprise.inject.Default; -import jakarta.enterprise.inject.spi.Annotated; -import jakarta.enterprise.inject.spi.AnnotatedMethod; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.BeanAttributes; -import jakarta.inject.Inject; -import jakarta.inject.Named; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processBeanAttributes.Alpha; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processBeanAttributes.Bravo; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processBeanAttributes.BravoDecorator; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processBeanAttributes.BravoInterceptor; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processBeanAttributes.BravoInterface; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processBeanAttributes.BravoProducer; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processBeanAttributes.BravoQualifier; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processBeanAttributes.CharlieInterface; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processBeanAttributes.CharlieProducer; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * This test was originally part of Weld test suite. - * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@Test -@SpecVersion(spec = "cdi", version = "2.0") -public class VerifyValuesTest extends AbstractTest { - - @Inject - private VerifyingExtension extension; - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(VerifyValuesTest.class) - .withClasses(Alpha.class, Bravo.class, BravoDecorator.class, BravoInterceptor.class, BravoInterface.class, - BravoProducer.class, BravoQualifier.class, CharlieInterface.class, CharlieProducer.class) - .withBeansXml(new BeansXml(BeanDiscoveryMode.ALL) - .alternatives(Alpha.class, BravoProducer.class, CharlieProducer.class) - .interceptors(BravoInterceptor.class) - .decorators(BravoDecorator.class) - ) - .withExtension(VerifyingExtension.class).build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN_ATTRIBUTES_EE, id = "bab") }) - public void testSessionBeanAnnotated() { - Annotated deltaAnnotated = extension.getAnnotatedMap().get(Delta.class); - assertNotNull(deltaAnnotated); - assertTrue(deltaAnnotated instanceof AnnotatedType); - @SuppressWarnings("unchecked") - AnnotatedType deltaAnnotatedType = (AnnotatedType) deltaAnnotated; - assertEquals(deltaAnnotatedType.getJavaClass(), Delta.class); - assertEquals(deltaAnnotatedType.getMethods().size(), 1); - assertEquals(deltaAnnotatedType.getMethods().iterator().next().getJavaMember().getName(), "foo"); - } - - @SuppressWarnings("unchecked") - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN_ATTRIBUTES, id = "aa"), - @SpecAssertion(section = PROCESS_BEAN_ATTRIBUTES_EE, id = "bab"), - @SpecAssertion(section = PROCESS_BEAN_ATTRIBUTES, id = "bb") }) - public void testSessionBeanAttributes() { - BeanAttributes deltaAttributes = extension.getDeltaAttributes(); - assertNotNull(deltaAttributes); - assertEquals(deltaAttributes.getScope(), Dependent.class); - verifyName(deltaAttributes, "delta"); - assertFalse(deltaAttributes.isAlternative()); - - assertTrue(typeSetMatches(deltaAttributes.getTypes(), Object.class, Delta.class)); - assertTrue(deltaAttributes.getStereotypes().isEmpty()); - assertTrue(annotationSetMatches(deltaAttributes.getQualifiers(), Named.class, Any.class, Default.class)); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN_ATTRIBUTES, id = "bac") }) - public void testProducerMethodAnnotated() { - Annotated bravoAnnotated = extension.getAnnotatedMap().get(Bravo.class); - assertNotNull(bravoAnnotated); - assertTrue(bravoAnnotated instanceof AnnotatedMethod); - @SuppressWarnings("unchecked") - AnnotatedMethod bravoAnnotatedMethod = (AnnotatedMethod) bravoAnnotated; - assertEquals(bravoAnnotatedMethod.getJavaMember().getName(), "createBravo"); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN_ATTRIBUTES, id = "ab"), - @SpecAssertion(section = PROCESS_BEAN_ATTRIBUTES, id = "bb") }) - public void testInterceptorBeanAttributes() { - BeanAttributes attributes = extension.getBravoInterceptorAttributes(); - assertNotNull(attributes); - assertEquals(Dependent.class, attributes.getScope()); - assertFalse(attributes.isAlternative()); - - assertTrue(typeSetMatches(attributes.getTypes(), Object.class, BravoInterceptor.class)); - assertTrue(attributes.getStereotypes().isEmpty()); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN_ATTRIBUTES, id = "ac"), - @SpecAssertion(section = PROCESS_BEAN_ATTRIBUTES, id = "bb") }) - public void testDecoratorBeanAttributes() { - BeanAttributes attributes = extension.getBravoDecoratorAttributes(); - assertNotNull(attributes); - assertEquals(Dependent.class, attributes.getScope()); - assertFalse(attributes.isAlternative()); - - assertTrue(typeSetMatches(attributes.getTypes(), Object.class, BravoDecorator.class, BravoInterface.class)); - assertTrue(attributes.getStereotypes().size() == 1); - assertTrue(attributes.getStereotypes().iterator().next().equals(Decorator.class)); - } - - private void verifyName(BeanAttributes attributes, String name) { - assertEquals(name, attributes.getName()); - for (Annotation qualifier : attributes.getQualifiers()) { - if (Named.class.equals(qualifier.annotationType())) { - assertEquals(name, ((Named) qualifier).value()); - return; - } - } - fail("@Named qualifier not found."); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/ejb/VerifyingExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/ejb/VerifyingExtension.java deleted file mode 100644 index 596e502b54..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processBeanAttributes/ejb/VerifyingExtension.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processBeanAttributes.ejb; - -import java.util.HashMap; -import java.util.Map; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.Annotated; -import jakarta.enterprise.inject.spi.AnnotatedMethod; -import jakarta.enterprise.inject.spi.BeanAttributes; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessBeanAttributes; - -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processBeanAttributes.Bravo; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processBeanAttributes.BravoDecorator; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processBeanAttributes.BravoInterceptor; - -public class VerifyingExtension implements Extension { - - private int alphaAttributesObserved = 0; - private BeanAttributes producedBravoAttributes; - private BeanAttributes bravoInterceptorAttributes; - private BeanAttributes bravoDecoratorAttributes; - private BeanAttributes deltaAttributes; - - private Map, Annotated> annotatedMap = new HashMap, Annotated>(); - - void observeBravo(@Observes ProcessBeanAttributes event) { - if (event.getAnnotated() instanceof AnnotatedMethod) { - // We only want producer method - producedBravoAttributes = event.getBeanAttributes(); - annotatedMap.put(Bravo.class, event.getAnnotated()); - } - } - - void observeBravoInterceptor(@Observes ProcessBeanAttributes event) { - bravoInterceptorAttributes = event.getBeanAttributes(); - } - - void observeBravoDecorator(@Observes ProcessBeanAttributes event) { - bravoDecoratorAttributes = event.getBeanAttributes(); - } - - void observeDelta(@Observes ProcessBeanAttributes event) { - deltaAttributes = event.getBeanAttributes(); - annotatedMap.put(Delta.class, event.getAnnotated()); - } - - public int getAlphaAttributesObserved() { - return alphaAttributesObserved; - } - - protected BeanAttributes getProducedBravoAttributes() { - return producedBravoAttributes; - } - - public BeanAttributes getBravoInterceptorAttributes() { - return bravoInterceptorAttributes; - } - - public BeanAttributes getBravoDecoratorAttributes() { - return bravoDecoratorAttributes; - } - - public BeanAttributes getDeltaAttributes() { - return deltaAttributes; - } - - public Map, Annotated> getAnnotatedMap() { - return annotatedMap; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/ProcessInjectionPointFiredTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/ProcessInjectionPointFiredTest.java deleted file mode 100644 index 815d1b0a83..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/ProcessInjectionPointFiredTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionPoint.ee; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_INJECTION_POINT_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.util.Arrays; - -import jakarta.enterprise.inject.spi.InjectionPoint; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget.Farm; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processInjectionPoint.Alpha; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processInjectionPoint.Bravo; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processInjectionPoint.BravoObserver; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processInjectionPoint.Charlie; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processInjectionPoint.Delta; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processInjectionPoint.InjectingBean; -import org.jboss.cdi.tck.util.HierarchyDiscovery; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * This test was originally part of Weld test suite. - * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ProcessInjectionPointFiredTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ProcessInjectionPointFiredTest.class) - .withClasses(Alpha.class, Bravo.class, BravoObserver.class, Charlie.class, Delta.class, InjectingBean.class, - Farm.class) - .withBeansXml(new BeansXml(BeanDiscoveryMode.ALL)) - .withWebResource("faces-config.xml", "/WEB-INF/faces-config.xml") - .withExtension(VerifyingExtension.class).build(); - } - - @Inject - private VerifyingExtension extension; - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_POINT_EE, id = "a") }) - public void testJavaEEComponentInjectionPoint() { - InjectionPoint servletIp = extension.getServletCharlie(); - assertNotNull(servletIp); - verifyType(servletIp, Charlie.class); - InjectionPoint filterIp = extension.getFilterCharlie(); - assertNotNull(filterIp); - verifyType(filterIp, Charlie.class); - InjectionPoint listenerIp = extension.getListenerCharlie(); - assertNotNull(listenerIp); - verifyType(listenerIp, Charlie.class); - } - - private static void verifyType(InjectionPoint ip, Class rawType, Class... typeParameters) { - assertEquals(getRawType(ip.getType()), rawType); - if (typeParameters.length > 0) { - assertTrue(ip.getType() instanceof ParameterizedType); - assertTrue(Arrays.equals(typeParameters, getActualTypeArguments(ip.getType()))); - } - } - - @SuppressWarnings("unchecked") - private static Class getRawType(Type type) { - if (type instanceof Class) { - return (Class) type; - } else if (type instanceof ParameterizedType) { - if (((ParameterizedType) type).getRawType() instanceof Class) { - return (Class) ((ParameterizedType) type).getRawType(); - } - } - return null; - } - - private static Type[] getActualTypeArguments(Type type) { - Type resolvedType = new HierarchyDiscovery(type).getResolvedType(); - if (resolvedType instanceof ParameterizedType) { - return ((ParameterizedType) resolvedType).getActualTypeArguments(); - } else { - return new Type[] {}; - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/TestFilter.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/TestFilter.java deleted file mode 100644 index 3ab7d2fa2c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/TestFilter.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionPoint.ee; - -import java.io.IOException; - -import jakarta.enterprise.inject.Vetoed; -import jakarta.inject.Inject; -import jakarta.servlet.Filter; -import jakarta.servlet.FilterChain; -import jakarta.servlet.FilterConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.annotation.WebFilter; - -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processInjectionPoint.Charlie; - -@Vetoed -@WebFilter("/TestFilter") -public class TestFilter implements Filter { - - @Inject - Charlie charlie; - - public void destroy() { - } - - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, - ServletException { - } - - public void init(FilterConfig filterConfig) throws ServletException { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/TestListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/TestListener.java deleted file mode 100644 index 27e254133c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/TestListener.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionPoint.ee; - -import jakarta.enterprise.inject.Vetoed; -import jakarta.inject.Inject; -import jakarta.servlet.ServletContextEvent; -import jakarta.servlet.ServletContextListener; -import jakarta.servlet.annotation.WebListener; - -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processInjectionPoint.Charlie; - -@Vetoed -@WebListener -public class TestListener implements ServletContextListener { - - @Inject - Charlie charlie; - - public void contextDestroyed(ServletContextEvent sce) { - } - - public void contextInitialized(ServletContextEvent sce) { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/TestServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/TestServlet.java deleted file mode 100644 index 1f1ab83805..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/TestServlet.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionPoint.ee; - -import jakarta.enterprise.inject.Vetoed; -import jakarta.inject.Inject; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; - -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processInjectionPoint.Charlie; - -@SuppressWarnings("serial") -@Vetoed -@WebServlet("/testServlet") -public class TestServlet extends HttpServlet { - @Inject - Charlie charlie; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/VerifyingExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/VerifyingExtension.java deleted file mode 100644 index fe047a69e8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/VerifyingExtension.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionPoint.ee; - -import static org.testng.Assert.assertNull; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.InjectionPoint; -import jakarta.enterprise.inject.spi.ProcessInjectionPoint; -import jakarta.enterprise.inject.spi.ProcessManagedBean; - -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processInjectionPoint.Alpha; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processInjectionPoint.Bravo; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processInjectionPoint.BravoObserver; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processInjectionPoint.Charlie; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processInjectionPoint.Delta; -import org.jboss.cdi.tck.tests.full.extensions.lifecycle.processInjectionPoint.InjectingBean; - -public class VerifyingExtension implements Extension { - - private InjectionPoint alpha; - private InjectionPoint bravo; - private InjectionPoint charlie; - private InjectionPoint producerAlpha; - private InjectionPoint producerBravo; - - private InjectionPoint servletCharlie; - private InjectionPoint filterCharlie; - private InjectionPoint listenerCharlie; - private InjectionPoint observerCharliIp; - private InjectionPoint observerDeltaIp; - private InjectionPoint disposerDeltaIp; - - private Bean injectingBean; - private Bean producingBean; - - public void observeAlpha(@Observes ProcessInjectionPoint> event) { - assertNull(alpha); - alpha = event.getInjectionPoint(); - } - - public void observeBravo(@Observes ProcessInjectionPoint> event) { - assertNull(bravo); - bravo = event.getInjectionPoint(); - } - - public void observeCharlie(@Observes ProcessInjectionPoint event) { - assertNull(charlie); - charlie = event.getInjectionPoint(); - } - - public void observeProducerAlpha(@Observes ProcessInjectionPoint> event) { - assertNull(producerAlpha); - producerAlpha = event.getInjectionPoint(); - } - - public void observeProducerBravo(@Observes ProcessInjectionPoint> event) { - assertNull(producerBravo); - producerBravo = event.getInjectionPoint(); - } - - public void observeInjectingManagerBean(@Observes ProcessManagedBean event) { - assertNull(injectingBean); - injectingBean = event.getBean(); - } - - public void observeCharlieInjectionPointInObserverMethod(@Observes ProcessInjectionPoint event) { - assertNull(observerCharliIp); - observerCharliIp = event.getInjectionPoint(); - } - - public void observeDeltaInjectionPointInObserverMethod(@Observes ProcessInjectionPoint event) { - assertNull(observerDeltaIp); - observerDeltaIp = event.getInjectionPoint(); - } - - public void observeDeltaInjectionPointInDisposerMethod(@Observes ProcessInjectionPoint event) { - assertNull(disposerDeltaIp); - disposerDeltaIp = event.getInjectionPoint(); - } - - public void observeServletInjectionPoint(@Observes ProcessInjectionPoint event) { - servletCharlie = event.getInjectionPoint(); - } - - public void observeFilterInjectionPoint(@Observes ProcessInjectionPoint event) { - filterCharlie = event.getInjectionPoint(); - } - - public void observeListenerInjectionPoint(@Observes ProcessInjectionPoint event) { - listenerCharlie = event.getInjectionPoint(); - } - - public InjectionPoint getAlpha() { - return alpha; - } - - public InjectionPoint getBravo() { - return bravo; - } - - public InjectionPoint getCharlie() { - return charlie; - } - - public InjectionPoint getProducerAlpha() { - return producerAlpha; - } - - public InjectionPoint getProducerBravo() { - return producerBravo; - } - - public InjectionPoint getServletCharlie() { - return servletCharlie; - } - - public InjectionPoint getFilterCharlie() { - return filterCharlie; - } - - public InjectionPoint getListenerCharlie() { - return listenerCharlie; - } - - public Bean getInjectingBean() { - return injectingBean; - } - - public Bean getProducingBean() { - return producingBean; - } - - public InjectionPoint getObserverCharliIp() { - return observerCharliIp; - } - - public InjectionPoint getObserverDeltaIp() { - return observerDeltaIp; - } - - public InjectionPoint getDisposerDeltaIp() { - return disposerDeltaIp; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/ContainerEventTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/ContainerEventTest.java deleted file mode 100644 index aea90c06c9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/ContainerEventTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_DISCOVERY_STEPS_EE; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_INJECTION_TARGET_EE; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * This test verifies that ProcessInjectionTarget event is fired for various Java EE components. - * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ContainerEventTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ContainerEventTest.class) - .withExtension(ProcessInjectionTargetObserver.class) - .withWebResource("faces-config.xml", "/WEB-INF/faces-config.xml") - .withWebResource("TestLibrary.tld", "WEB-INF/TestLibrary.tld").build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "aac"), - @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "abc"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "bd") }) - public void testProcessInjectionTargetEventFiredForJsfManagedBean() { - assertNotNull(ProcessInjectionTargetObserver.getJsfManagedBeanEvent()); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "aac"), - @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "abc"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "be") }) - public void testProcessInjectionTargetEventFiredForServletListener() { - assertNotNull(ProcessInjectionTargetObserver.getListenerEvent()); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "aad"), - @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "abd"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "bf") }) - public void testProcessInjectionTargetEventFiredForTagHandler() { - assertNotNull(ProcessInjectionTargetObserver.getTagHandlerEvent()); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "aae"), - @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "abe"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "bg") }) - public void testProcessInjectionTargetEventFiredForTagLibraryListener() { - assertNotNull(ProcessInjectionTargetObserver.getTagLibraryListenerEvent()); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "aah"), - @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "abh"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "bj") }) - public void testProcessInjectionTargetEventFiredForServlet() { - assertNotNull(ProcessInjectionTargetObserver.getServletEvent()); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "aai"), - @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "abi"), - @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "bk") }) - public void testProcessInjectionTargetEventFiredForFilter() { - assertNotNull(ProcessInjectionTargetObserver.getFilterEvent()); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "aas"), - @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "aao"), - @SpecAssertion(section = PROCESS_INJECTION_TARGET_EE, id = "aan") }) - public void testTypeOfProcessInjectionTargetParameter() { - assertFalse(ProcessInjectionTargetObserver.isStringObserved()); - assertTrue(ProcessInjectionTargetObserver.isTagHandlerSubTypeObserved()); - assertFalse(ProcessInjectionTargetObserver.isTagHandlerSuperTypeObserved()); - assertFalse(ProcessInjectionTargetObserver.isServletSuperTypeObserved()); - assertTrue(ProcessInjectionTargetObserver.isServletSubTypeObserved()); - assertFalse(ProcessInjectionTargetObserver.isListenerSuperTypeObserved()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/CustomInjectionTarget.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/CustomInjectionTarget.java deleted file mode 100644 index a7f22cc1b0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/CustomInjectionTarget.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget; - -import java.util.Set; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.InjectionPoint; -import jakarta.enterprise.inject.spi.InjectionTarget; - -public class CustomInjectionTarget implements InjectionTarget { - - private InjectionTarget wrappedInjectionTarget; - private Runnable runnable; - - public CustomInjectionTarget(InjectionTarget originalInjectionTarget, Runnable runnable) { - this.wrappedInjectionTarget = originalInjectionTarget; - this.runnable = runnable; - } - - public void inject(T instance, CreationalContext ctx) { - runnable.run(); - wrappedInjectionTarget.inject(instance, ctx); - } - - @Override - public void postConstruct(T instance) { - wrappedInjectionTarget.postConstruct(instance); - } - - @Override - public void preDestroy(T instance) { - wrappedInjectionTarget.preDestroy(instance); - } - - @Override - public Object produce(CreationalContext ctx) { - return wrappedInjectionTarget.produce(ctx); - } - - @Override - public void dispose(T instance) { - wrappedInjectionTarget.dispose(instance); - } - - @Override - public Set getInjectionPoints() { - return wrappedInjectionTarget.getInjectionPoints(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/Farm.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/Farm.java deleted file mode 100644 index b81505f5ae..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/Farm.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Farm { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/Fence.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/Fence.java deleted file mode 100644 index 7c574dd691..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/Fence.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget; - -import jakarta.ejb.Stateful; -import jakarta.inject.Inject; -import jakarta.interceptor.Interceptors; - -@Stateful -@Interceptors(FenceInterceptor.class) -public class Fence { - - @Inject - Sheep sheep; - - private static boolean isWrappedInjectionSuccessfull = false; - - public void ping() { - } - - public static boolean isIsWrappedInjectionSuccessfull() { - return isWrappedInjectionSuccessfull; - } - - public static void setIsWrappedInjectionSuccessfull(boolean isWrappedInjectionSuccessfull) { - Fence.isWrappedInjectionSuccessfull = isWrappedInjectionSuccessfull; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/FenceInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/FenceInterceptor.java deleted file mode 100644 index b9b61e6e29..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/FenceInterceptor.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget; - -import java.io.Serializable; - -import jakarta.inject.Inject; -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -public class FenceInterceptor implements Serializable { - - @Inject - Sheep sheep; - - private static boolean isWrappedInjectionSuccessfull = false; - - @AroundInvoke - public Object visitFence(InvocationContext ctx) throws Exception { - - return ctx.proceed(); - } - - public static boolean isIsWrappedInjectionSuccessfull() { - return isWrappedInjectionSuccessfull; - } - - public static void setIsWrappedInjectionSuccessfull(boolean isWrappedInjectionSuccessfull) { - FenceInterceptor.isWrappedInjectionSuccessfull = isWrappedInjectionSuccessfull; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/ProcessInjectionTargetObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/ProcessInjectionTargetObserver.java deleted file mode 100644 index 5b42f324eb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/ProcessInjectionTargetObserver.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessInjectionTarget; -import jakarta.servlet.ServletContextListener; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.jsp.tagext.SimpleTag; -import jakarta.servlet.jsp.tagext.SimpleTagSupport; - -public class ProcessInjectionTargetObserver implements Extension { - - private static ProcessInjectionTarget servletEvent = null; - private static ProcessInjectionTarget listenerEvent = null; - private static ProcessInjectionTarget filterEvent = null; - private static ProcessInjectionTarget tagLibraryListenerEvent = null; - private static ProcessInjectionTarget tagHandlerEvent = null; - private static ProcessInjectionTarget jsfManagedBeanEvent = null; - - private static boolean servletSuperTypeObserved = false; - private static boolean servletSubTypeObserved = false; - private static boolean listenerSuperTypeObserved = false; - private static boolean tagHandlerSuperTypeObserved = false; - private static boolean tagHandlerSubTypeObserved = false; - private static boolean stringObserved = false; - - public void observeJsfManagedBean(@Observes ProcessInjectionTarget event, BeanManager beanManager) { - jsfManagedBeanEvent = event; - } - - public void observeServlet(@Observes ProcessInjectionTarget event, BeanManager beanManager) { - servletEvent = event; - event.setInjectionTarget(new CustomInjectionTarget(event.getInjectionTarget(), - () -> TestServlet.setIsWrappedInjectionSuccessfull(true))); - } - - public void observeFilter(@Observes ProcessInjectionTarget event, BeanManager beanManager) { - filterEvent = event; - event.setInjectionTarget(new CustomInjectionTarget(event.getInjectionTarget(), - () -> TestFilter.setIsWrappedInjectionSuccessfull(true))); - } - - public void observeListener(@Observes ProcessInjectionTarget event, BeanManager beanManager) { - listenerEvent = event; - event.setInjectionTarget(new CustomInjectionTarget(event.getInjectionTarget(), - () -> TestListener.setIsWrappedInjectionSuccessfull(true))); - } - - public void observeTagHandler(@Observes ProcessInjectionTarget event, BeanManager beanManager) { - tagHandlerEvent = event; - event.setInjectionTarget(new CustomInjectionTarget(event.getInjectionTarget(), - () -> TestTagHandler.setIsWrappedInjectionSuccessfull(true))); - } - - public void observeTagLibraryListener(@Observes ProcessInjectionTarget event, BeanManager beanManager) { - tagLibraryListenerEvent = event; - event.setInjectionTarget(new CustomInjectionTarget(event.getInjectionTarget(), - () -> TagLibraryListener.setIsWrappedInjectionSuccessfull(true))); - } - - public void observeServletSuperType(@Observes ProcessInjectionTarget event) { - servletSuperTypeObserved = true; - } - - public void observeServletSubType(@Observes ProcessInjectionTarget event) { - servletSubTypeObserved = true; - - } - - public void observeListenerSuperType(@Observes ProcessInjectionTarget event) { - listenerSuperTypeObserved = true; - } - - public void tagHandlerSuperType(@Observes ProcessInjectionTarget event) { - tagHandlerSuperTypeObserved = true; - } - - public void tagHandlerSubType(@Observes ProcessInjectionTarget event) { - tagHandlerSubTypeObserved = true; - } - - public void observeSessionBean(@Observes ProcessInjectionTarget event, BeanManager beanManager) { - event.setInjectionTarget(new CustomInjectionTarget(event.getInjectionTarget(), - () -> Fence.setIsWrappedInjectionSuccessfull(true))); - } - - public void observeEJBInterceptor(@Observes ProcessInjectionTarget event, BeanManager beanManager) { - event.setInjectionTarget(new CustomInjectionTarget(event.getInjectionTarget(), - () -> FenceInterceptor.setIsWrappedInjectionSuccessfull(true))); - } - - public void stringObserver(@Observes ProcessInjectionTarget event) { - stringObserved = true; - } - - public static ProcessInjectionTarget getServletEvent() { - return servletEvent; - } - - public static ProcessInjectionTarget getListenerEvent() { - return listenerEvent; - } - - public static ProcessInjectionTarget getFilterEvent() { - return filterEvent; - } - - public static ProcessInjectionTarget getTagLibraryListenerEvent() { - return tagLibraryListenerEvent; - } - - public static ProcessInjectionTarget getTagHandlerEvent() { - return tagHandlerEvent; - } - - public static ProcessInjectionTarget getJsfManagedBeanEvent() { - return jsfManagedBeanEvent; - } - - public static boolean isServletSuperTypeObserved() { - return servletSuperTypeObserved; - } - - public static boolean isServletSubTypeObserved() { - return servletSubTypeObserved; - } - - public static boolean isListenerSuperTypeObserved() { - return listenerSuperTypeObserved; - } - - public static boolean isTagHandlerSuperTypeObserved() { - return tagHandlerSuperTypeObserved; - } - - public static boolean isTagHandlerSubTypeObserved() { - return tagHandlerSubTypeObserved; - } - - public static boolean isStringObserved() { - return stringObserved; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/Sheep.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/Sheep.java deleted file mode 100644 index 9509330341..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/Sheep.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget; - -import java.io.Serializable; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Sheep implements Serializable { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TagLibraryListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TagLibraryListener.java deleted file mode 100644 index 5eb2b1c452..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TagLibraryListener.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget; - -import jakarta.enterprise.inject.Vetoed; -import jakarta.inject.Inject; -import jakarta.servlet.ServletContextEvent; -import jakarta.servlet.ServletContextListener; - -@Vetoed -public class TagLibraryListener implements ServletContextListener { - - @Inject - private Sheep sheep; - private boolean initializerCalled = false; - private static boolean isWrappedInjectionSuccessfull = false; - - @Inject - public void initialize(Sheep sheep) { - initializerCalled = sheep != null; - } - - public void contextDestroyed(ServletContextEvent sce) { - } - - public void contextInitialized(ServletContextEvent sce) { - sce.getServletContext().setAttribute("tag.library.listener.injected", sheep != null); - sce.getServletContext().setAttribute("tag.library.listener.initializer.called", initializerCalled); - } - - public static boolean isIsWrappedInjectionSuccessfull() { - return isWrappedInjectionSuccessfull; - } - - public static void setIsWrappedInjectionSuccessfull(boolean isWrappedInjectionSuccessfull) { - TagLibraryListener.isWrappedInjectionSuccessfull = isWrappedInjectionSuccessfull; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestFilter.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestFilter.java deleted file mode 100644 index f7a4344976..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestFilter.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget; - -import java.io.IOException; - -import jakarta.enterprise.inject.Vetoed; -import jakarta.inject.Inject; -import jakarta.servlet.Filter; -import jakarta.servlet.FilterChain; -import jakarta.servlet.FilterConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.annotation.WebFilter; - -@Vetoed -@WebFilter("/test") -public class TestFilter implements Filter { - - @Inject - private Sheep sheep; - - private static boolean isWrappedInjectionSuccessfull = false; - - @Inject - public void initialize(Sheep sheep) { - } - - public void destroy() { - } - - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, - ServletException { - - chain.doFilter(request, response); - } - - public void init(FilterConfig filterConfig) throws ServletException { - } - - public static boolean isIsWrappedInjectionSuccessfull() { - return isWrappedInjectionSuccessfull; - } - - public static void setIsWrappedInjectionSuccessfull(boolean isWrappedInjectionSuccessfull) { - TestFilter.isWrappedInjectionSuccessfull = isWrappedInjectionSuccessfull; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestListener.java deleted file mode 100644 index 625492646b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestListener.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget; - -import jakarta.enterprise.inject.Vetoed; -import jakarta.inject.Inject; -import jakarta.servlet.ServletContextEvent; -import jakarta.servlet.ServletContextListener; -import jakarta.servlet.annotation.WebListener; - -@Vetoed -@WebListener -public class TestListener implements ServletContextListener { - - @Inject - private Sheep sheep; - - private static boolean isWrappedInjectionSuccessfull = false; - - public void contextDestroyed(ServletContextEvent sce) { - } - - public void contextInitialized(ServletContextEvent sce) { - sce.getServletContext().setAttribute("initialized", sheep); - } - - public static boolean isIsWrappedInjectionSuccessfull() { - return isWrappedInjectionSuccessfull; - } - - public static void setIsWrappedInjectionSuccessfull(boolean isWrappedInjectionSuccessfull) { - TestListener.isWrappedInjectionSuccessfull = isWrappedInjectionSuccessfull; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestServlet.java deleted file mode 100644 index c0381aa82d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestServlet.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget; - -import java.io.IOException; -import java.io.PrintWriter; - -import jakarta.enterprise.inject.Vetoed; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@Vetoed -@WebServlet("/test") -public class TestServlet extends HttpServlet { - - private static final long serialVersionUID = -7672096092047821010L; - private static boolean isWrappedInjectionSuccessfull = false; - - Sheep sheep; - - @Inject - Fence fence; - - @Inject - public void initialize(Sheep sheep) { - this.sheep = sheep; - } - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - PrintWriter writer = resp.getWriter(); - - // to invoke interceptor - fence.ping(); - String param = req.getParameter("type"); - if (param.equals("servlet")) { - writer.append(String.valueOf(isWrappedInjectionSuccessfull)); - } - if (param.equals("interceptor")) { - writer.append(String.valueOf(FenceInterceptor.isIsWrappedInjectionSuccessfull())); - } - if (param.equals("filter")) { - writer.append(String.valueOf(TestFilter.isIsWrappedInjectionSuccessfull())); - } - if (param.equals("sessionbean")) { - writer.append(String.valueOf(Fence.isIsWrappedInjectionSuccessfull())); - } - if (param.equals("listener")) { - writer.append(String.valueOf(TestListener.isIsWrappedInjectionSuccessfull())); - } - if (param.equals("taglibrary")) { - writer.append(String.valueOf(TagLibraryListener.isIsWrappedInjectionSuccessfull())); - } - - writer.append("\n" + req.getServletContext().getAttribute("initialized").toString() + "\n"); - } - - public static void setIsWrappedInjectionSuccessfull(boolean isWrappedInjectionSuccessfull) { - TestServlet.isWrappedInjectionSuccessfull = isWrappedInjectionSuccessfull; - } - - public static boolean isIsWrappedInjectionSuccessfull() { - return isWrappedInjectionSuccessfull; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestTagHandler.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestTagHandler.java deleted file mode 100644 index 5f3fa8e324..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestTagHandler.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget; - -import java.io.IOException; - -import jakarta.enterprise.inject.Vetoed; -import jakarta.inject.Inject; -import jakarta.servlet.jsp.tagext.SimpleTagSupport; - -@Vetoed -public class TestTagHandler extends SimpleTagSupport { - - @Inject - private Sheep sheep; - - private static boolean isWrappedInjectionSuccessfull = false; - - @Inject - public void initialize(Sheep sheep) { - } - - @Override - public void doTag() throws IOException { - getJspContext().getOut().write(String.valueOf(isWrappedInjectionSuccessfull)); - } - - public static boolean isIsWrappedInjectionSuccessfull() { - return isWrappedInjectionSuccessfull; - } - - public static void setIsWrappedInjectionSuccessfull(boolean isWrappedInjectionSuccessfull) { - TestTagHandler.isWrappedInjectionSuccessfull = isWrappedInjectionSuccessfull; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/Elephant.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/Elephant.java deleted file mode 100644 index 5551e521a7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/Elephant.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.processBean.ejb; - -import jakarta.ejb.Stateless; - -@Stateless(name = "Rosie") -public class Elephant implements ElephantLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/ElephantLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/ElephantLocal.java deleted file mode 100644 index fb82a0984d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/ElephantLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.processBean.ejb; - -import jakarta.ejb.Local; - -@Local -public interface ElephantLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/ProcessSessionBeanObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/ProcessSessionBeanObserver.java deleted file mode 100644 index 741072d41d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/ProcessSessionBeanObserver.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.processBean.ejb; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.Annotated; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessBean; -import jakarta.enterprise.inject.spi.ProcessBeanAttributes; -import jakarta.enterprise.inject.spi.ProcessSessionBean; -import jakarta.enterprise.inject.spi.SessionBeanType; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class ProcessSessionBeanObserver implements Extension { - - private static Bean elephantBean; - private static AnnotatedType elephantAnnotatedType; - private static Annotated elephantAnnotated; - private static String elephantName; - private static SessionBeanType elephantType; - - private static int elephantProcessBeanCount; - - private static ActionSequence elephantActionSeq = new ActionSequence(); - - public void observeElephantSessionBean(@Observes ProcessSessionBean event) { - elephantBean = event.getBean(); - elephantAnnotatedType = event.getAnnotatedBeanClass(); - elephantAnnotated = event.getAnnotated(); - elephantName = event.getEjbName(); - elephantType = event.getSessionBeanType(); - elephantActionSeq.add(ProcessSessionBean.class.getName()); - } - - public void observeElephantBean(@Observes ProcessBean event) { - ProcessSessionBeanObserver.elephantProcessBeanCount++; - } - - public void observeElephantBeanAttributes(@Observes ProcessBeanAttributes event) { - elephantActionSeq.add(ProcessBeanAttributes.class.getName()); - } - - public static int getElephantProcessBeanCount() { - return elephantProcessBeanCount; - } - - public static ActionSequence getElephantActionSeq() { - return elephantActionSeq; - } - - public static Bean getElephantBean() { - return elephantBean; - } - - public static AnnotatedType getElephantAnnotatedType() { - return elephantAnnotatedType; - } - - public static Annotated getElephantAnnotated() { - return elephantAnnotated; - } - - public static String getElephantName() { - return elephantName; - } - - public static SessionBeanType getElephantType() { - return elephantType; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/ProcessSessionBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/ProcessSessionBeanTest.java deleted file mode 100644 index f508f80f52..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ejb/ProcessSessionBeanTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.processBean.ejb; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_DISCOVERY_STEPS_EE; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_BEAN_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.util.Arrays; - -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.ProcessBeanAttributes; -import jakarta.enterprise.inject.spi.ProcessSessionBean; -import jakarta.enterprise.inject.spi.SessionBeanType; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author David Allen - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ProcessSessionBeanTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(ProcessSessionBeanTest.class) - .withClasses(Elephant.class, ElephantLocal.class, ProcessSessionBeanObserver.class) - .withExtension(ProcessSessionBeanObserver.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN_EE, id = "ca"), - @SpecAssertion(section = PROCESS_BEAN_EE, id = "cb"), - @SpecAssertion(section = PROCESS_BEAN_EE, id = "edb"), @SpecAssertion(section = PROCESS_BEAN_EE, id = "efb"), - @SpecAssertion(section = PROCESS_BEAN_EE, id = "fb"), @SpecAssertion(section = PROCESS_BEAN_EE, id = "hb"), - @SpecAssertion(section = PROCESS_BEAN_EE, id = "hc"), @SpecAssertion(section = PROCESS_BEAN_EE, id = "m"), - @SpecAssertion(section = PROCESS_BEAN_EE, id = "k"), @SpecAssertion(section = BEAN_DISCOVERY_STEPS_EE, id = "fb") }) - public void testProcessSessionBeanEvent() { - - assertEquals(ProcessSessionBeanObserver.getElephantBean().getBeanClass(), Elephant.class); - assertEquals(ProcessSessionBeanObserver.getElephantProcessBeanCount(), 0); - assertEquals(ProcessSessionBeanObserver.getElephantName(), "Rosie"); - assertEquals(ProcessSessionBeanObserver.getElephantType(), SessionBeanType.STATELESS); - assertTrue(ProcessSessionBeanObserver.getElephantAnnotated() instanceof AnnotatedType); - assertEquals(ProcessSessionBeanObserver.getElephantAnnotatedType().getBaseType(), Elephant.class); - - assertEquals(ProcessSessionBeanObserver.getElephantActionSeq().getData(), - Arrays.asList(ProcessBeanAttributes.class.getName(), ProcessSessionBean.class.getName())); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ProducerProcessor.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ProducerProcessor.java deleted file mode 100644 index 1b3c9c7d52..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ProducerProcessor.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.producer.remote; - -import java.util.Set; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.InjectionPoint; -import jakarta.enterprise.inject.spi.ProcessProducer; -import jakarta.enterprise.inject.spi.ProcessProducerField; -import jakarta.enterprise.inject.spi.Producer; - -public class ProducerProcessor implements Extension { - - static boolean isOverriddenServiceProducerCalled = false; - static boolean isServiceProducerFieldObserved = false; - - public void processServiceProducer(@Observes ProcessProducer producerEvent) { - final Producer producer = producerEvent.getProducer(); - producerEvent.setProducer(new Producer() { - - public void dispose(ServiceRemote instance) { - producer.dispose(instance); - } - - public Set getInjectionPoints() { - return producer.getInjectionPoints(); - } - - public ServiceRemote produce(CreationalContext ctx) { - isOverriddenServiceProducerCalled = true; - return producer.produce(ctx); - } - }); - } - - public void processServiceProducerField(@Observes ProcessProducerField event) { - isServiceProducerFieldObserved = true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/RemoteProducerTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/RemoteProducerTest.java deleted file mode 100644 index d7253ef267..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/RemoteProducerTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.producer.remote; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_BEAN; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_PRODUCER; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Producer extension tests. - * - * @author David Allen - * @author Martin Kouba - */ -@Test(groups = JAVAEE_FULL) // The test archive contains a remote EJB -@SpecVersion(spec = "cdi", version = "2.0") -public class RemoteProducerTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(RemoteProducerTest.class).withExtension(ProducerProcessor.class) - .build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_PRODUCER, id = "ac"), - @SpecAssertion(section = PROCESS_PRODUCER, id = "e"), - @SpecAssertion(section = PROCESS_PRODUCER, id = "gb") }) - public void testProduceCallsOverridenResourceProducerMethod() { - assertEquals(getContextualReference(ServiceRemote.class).ping(), "pong"); - assertTrue(ProducerProcessor.isOverriddenServiceProducerCalled); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PROCESS_BEAN, id = "ec") }) - public void testResourceAreConsideredToBeProducerField() { - assertTrue(ProducerProcessor.isServiceProducerFieldObserved); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ServiceBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ServiceBean.java deleted file mode 100644 index 34403ec2e9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ServiceBean.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.producer.remote; - -import jakarta.ejb.Stateless; - -@Stateless -public class ServiceBean implements ServiceRemote { - - @Override - public String ping() { - return "pong"; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ServiceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ServiceProducer.java deleted file mode 100644 index 852d2333ed..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ServiceProducer.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.producer.remote; - -import jakarta.ejb.EJB; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class ServiceProducer { - - @Produces - @EJB - public ServiceRemote service; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ServiceRemote.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ServiceRemote.java deleted file mode 100644 index 6a438eedfa..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/producer/remote/ServiceRemote.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.producer.remote; - -import jakarta.ejb.Remote; - -@Remote -public interface ServiceRemote { - - public String ping(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/AnotherBeanClassToRegister.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/AnotherBeanClassToRegister.java deleted file mode 100644 index 6a44b5ca4e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/AnotherBeanClassToRegister.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -import jakarta.inject.Inject; - -public class AnotherBeanClassToRegister { - @Inject - private BeanClassToRegister collaborator; - - public BeanClassToRegister getCollaborator() { - return collaborator; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/AnotherManualBeanRegistrationExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/AnotherManualBeanRegistrationExtension.java deleted file mode 100644 index 56db2ac62a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/AnotherManualBeanRegistrationExtension.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.BeforeBeanDiscovery; -import jakarta.enterprise.inject.spi.Extension; - -import org.jboss.cdi.tck.util.AddForwardingAnnotatedTypeAction; - -/** - * An extension which registers a bean programmatically. - * - * @author Dan Allen - */ -public class AnotherManualBeanRegistrationExtension implements Extension { - public void registerBeans(@Observes BeforeBeanDiscovery event, final BeanManager bm) { - - new AddForwardingAnnotatedTypeAction() { - - @Override - public String getBaseId() { - return AnotherManualBeanRegistrationExtension.class.getName(); - } - - @Override - public AnnotatedType delegate() { - return bm.createAnnotatedType(AnotherBeanClassToRegister.class); - } - }.perform(event); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanClassToRegister.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanClassToRegister.java deleted file mode 100644 index 05d824bf3a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanClassToRegister.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -/** - * A valid bean class which will be registered manually using a CDI extension rather than auto-discovered by inclusion in a bean - * archive. - * - * @author Jason Porter - * @author Dan Allen - */ -public class BeanClassToRegister { - public boolean isInvokable() { - return true; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanRegistrationByExtensionInEarLibraryTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanRegistrationByExtensionInEarLibraryTest.java deleted file mode 100644 index 65a72f7a8b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanRegistrationByExtensionInEarLibraryTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Tomas Remes - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class BeanRegistrationByExtensionInEarLibraryTest extends AbstractTest { - - @Inject - BeanClassToRegister bean; - - @Deployment - public static EnterpriseArchive createTestArchive() { - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder() - .withTestClass(BeanRegistrationByExtensionInEarLibraryTest.class) - .withClasses(DummyObserverExtension.class, EarExtensionsCheck.class).withExtension(DummyObserverExtension.class) - .withLibrary(BeanClassToRegister.class, ManualBeanRegistrationExtension.class).noDefaultWebModule().build(); - - WebArchive webArchive = new WebArchiveBuilder().withExtension(WarDummyObserverExtension.class).notTestArchive() - .withClasses(WarDummyObserverExtension.class) - .withDefaultEjbModuleDependency() - .build(); - enterpriseArchive.addAsModule(webArchive); - - return enterpriseArchive; - } - - @Test(groups = { INTEGRATION, JAVAEE_FULL }) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE, id = "n") }) - public void shouldFindBeanReference() { - assertNotNull(bean); - } - - @Test(groups = { INTEGRATION, JAVAEE_FULL }) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE, id = "n") }) - public void shouldRegisterExtensions() { - assertTrue(EarExtensionsCheck.extensionInEjbJarRegistered); - assertTrue(EarExtensionsCheck.extensionInWarRegistered); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanRegistrationByExtensionInNonBeanArchiveTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanRegistrationByExtensionInNonBeanArchiveTest.java deleted file mode 100644 index bd9596f2f2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanRegistrationByExtensionInNonBeanArchiveTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE; -import static org.jboss.cdi.tck.cdi.Sections.BEFORE_BEAN_DISCOVERY; -import static org.jboss.cdi.tck.cdi.Sections.INIT_EVENTS; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * Validates that a bean can be registered by an extension that resides in a non-bean archive. - * - *

- * This test was originally part of Seam Compatibility project. - *

- * - * @author Jason Porter - * @author Dan Allen - * @author Martin Kouba - * @see GLASSFISH-14808 (resolved) - */ -@SpecVersion(spec = "cdi", version = "2.0") -@Test(groups = INTEGRATION) -public class BeanRegistrationByExtensionInNonBeanArchiveTest extends AbstractTest { - - @Inject - BeanClassToRegister bean; - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(BeanRegistrationByExtensionInNonBeanArchiveTest.class) - .withLibrary(BeanClassToRegister.class, ManualBeanRegistrationExtension.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = INIT_EVENTS, id = "b"), @SpecAssertion(section = INIT_EVENTS, id = "bb"), - @SpecAssertion(section = BEFORE_BEAN_DISCOVERY, id = "af"), @SpecAssertion(section = BEAN_ARCHIVE, id = "n") }) - public void shouldFindBeanReference() { - Assert.assertNotNull(bean); - Assert.assertTrue(bean.isInvokable()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanRegistrationByExtensionInWarLibraryTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanRegistrationByExtensionInWarLibraryTest.java deleted file mode 100644 index cbd5cbc521..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanRegistrationByExtensionInWarLibraryTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE; -import static org.testng.Assert.assertNotNull; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Tomas Remes - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class BeanRegistrationByExtensionInWarLibraryTest extends AbstractTest { - - @Inject - BeanClassToRegister bean; - - @Inject - AnotherBeanClassToRegister anotherBean; - - @Deployment - public static WebArchive createTestArchive() { - WebArchive webArchive = new WebArchiveBuilder() - .withTestClass(BeanRegistrationByExtensionInWarLibraryTest.class) - .withLibrary(BeanClassToRegister.class, ManualBeanRegistrationExtension.class, - AnotherBeanClassToRegister.class, AnotherManualBeanRegistrationExtension.class) - .build(); - - return webArchive; - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = BEAN_ARCHIVE, id = "n") }) - public void shouldFindBeanReference() { - assertNotNull(bean); - assertNotNull(anotherBean); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/Beanie.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/Beanie.java deleted file mode 100644 index 309f5c8566..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/Beanie.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -/** - * - * @author rsmeral - */ -@BeanieType("basic") -public class Beanie { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanieType.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanieType.java deleted file mode 100644 index 35fb19a2f3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanieType.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -@Qualifier -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface BeanieType { - String value(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanieTypeLiteral.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanieTypeLiteral.java deleted file mode 100644 index 57cc9773df..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/BeanieTypeLiteral.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -import jakarta.enterprise.util.AnnotationLiteral; - -public abstract class BeanieTypeLiteral extends AnnotationLiteral implements BeanieType { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/DummyObserverExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/DummyObserverExtension.java deleted file mode 100644 index 41e68b7944..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/DummyObserverExtension.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AfterDeploymentValidation; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.Extension; - -public class DummyObserverExtension implements Extension { - - public void registerBeans(@Observes AfterDeploymentValidation event, final BeanManager bm) { - EarExtensionsCheck.extensionInEjbJarRegistered = true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/EarExtensionsCheck.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/EarExtensionsCheck.java deleted file mode 100644 index 5287a92af3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/EarExtensionsCheck.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -public class EarExtensionsCheck { - - public static boolean extensionInWarRegistered = false; - public static boolean extensionInEjbJarRegistered = false; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/ManualBeanRegistrationExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/ManualBeanRegistrationExtension.java deleted file mode 100644 index e1e6778331..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/ManualBeanRegistrationExtension.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.BeforeBeanDiscovery; -import jakarta.enterprise.inject.spi.Extension; - -import org.jboss.cdi.tck.util.AddForwardingAnnotatedTypeAction; - -/** - * An extension which registers a bean programmatically. - * - * @author Jason Porter - * @author Dan Allen - */ -public class ManualBeanRegistrationExtension implements Extension { - public void registerBeans(@Observes BeforeBeanDiscovery event, final BeanManager bm) { - - new AddForwardingAnnotatedTypeAction() { - - @Override - public String getBaseId() { - return ManualBeanRegistrationExtension.class.getName(); - } - - @Override - public AnnotatedType delegate() { - return bm.createAnnotatedType(BeanClassToRegister.class); - } - }.perform(event); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/TwoBeansOneClassExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/TwoBeansOneClassExtension.java deleted file mode 100644 index c575473415..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/TwoBeansOneClassExtension.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.BeforeBeanDiscovery; -import jakarta.enterprise.inject.spi.Extension; - -import org.jboss.cdi.tck.util.AddForwardingAnnotatedTypeAction; -import org.jboss.cdi.tck.util.annotated.AnnotatedTypeWrapper; - -// This test extension expects that AddForwardingAnnotatedTypeAction distinguishes -// annotated types by more that just the baseId and delegate class -public class TwoBeansOneClassExtension implements Extension { - public void registerBeans(@Observes BeforeBeanDiscovery event, final BeanManager bm) { - - // add basic Beanie - new AddForwardingAnnotatedTypeAction() { - - final AnnotatedType delegate = bm.createAnnotatedType(Beanie.class); - - @Override - public String getBaseId() { - return "basic"; - } - - @Override - public AnnotatedType delegate() { - return delegate; - } - }.perform(event); - - // add @BeanieType("propeller")Beanie - new AddForwardingAnnotatedTypeAction() { - - final AnnotatedType delegate = new AnnotatedTypeWrapper(bm.createAnnotatedType(Beanie.class), false, - new BeanieTypeLiteral() { - - @Override - public String value() { - return "propeller"; - } - }); - - @Override - public String getBaseId() { - return "propeller"; - } - - @Override - public AnnotatedType delegate() { - return delegate; - } - }.perform(event); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/TwoBeansOneClassTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/TwoBeansOneClassTest.java deleted file mode 100644 index 07c8e9e252..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/TwoBeansOneClassTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE; -import static org.jboss.cdi.tck.cdi.Sections.BEFORE_BEAN_DISCOVERY; -import static org.jboss.cdi.tck.cdi.Sections.INIT_EVENTS; -import static org.testng.Assert.assertEquals; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class TwoBeansOneClassTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(TwoBeansOneClassTest.class) - .withLibrary(TwoBeansOneClassExtension.class, Beanie.class, BeanieType.class, BeanieTypeLiteral.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ - @SpecAssertion(section = INIT_EVENTS, id = "b"), - @SpecAssertion(section = INIT_EVENTS, id = "bb"), - @SpecAssertion(section = BEAN_ARCHIVE, id = "n"), - @SpecAssertion(section = BEFORE_BEAN_DISCOVERY, id = "af"), - @SpecAssertion(section = BEFORE_BEAN_DISCOVERY, id = "afa") }) - public void testTwoBeansWithOneBaseClass() { - assertEquals(beanManager.getBeans(Beanie.class).size(), 0); - assertEquals(beanManager.getBeans(Beanie.class, new BeanieTypeLiteral() { - @Override - public String value() { - return "basic"; - } - }).size(), 1); - - assertEquals(beanManager.getBeans(Beanie.class, new BeanieTypeLiteral() { - @Override - public String value() { - return "propeller"; - } - }).size(), 1); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/VisibilityOfBeanRegisteredByExtensionFromNonBeanLibraryTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/VisibilityOfBeanRegisteredByExtensionFromNonBeanLibraryTest.java deleted file mode 100644 index 963b9d3fcb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/VisibilityOfBeanRegisteredByExtensionFromNonBeanLibraryTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BEFORE_BEAN_DISCOVERY; -import static org.jboss.cdi.tck.cdi.Sections.INIT_EVENTS; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * Validates that a class in one non-bean archive can be registered as a bean by an extension in another non-bean archive and - * that the bean is visible to the web (bean) archive. - * - *

- * This test was originally part of Seam Compatibility project. - *

- * - * @author Dan Allen - * @author Martin Kouba - * @see GLASSFISH-15721 - */ -@SpecVersion(spec = "cdi", version = "2.0") -@Test(groups = INTEGRATION) -public class VisibilityOfBeanRegisteredByExtensionFromNonBeanLibraryTest extends AbstractTest { - - @Inject - AnotherBeanClassToRegister bean; - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(VisibilityOfBeanRegisteredByExtensionFromNonBeanLibraryTest.class) - .withLibrary(BeanClassToRegister.class) - .withLibrary(AnotherBeanClassToRegister.class, ManualBeanRegistrationExtension.class, - AnotherManualBeanRegistrationExtension.class) - .build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = INIT_EVENTS, id = "b"), @SpecAssertion(section = INIT_EVENTS, id = "bb"), - @SpecAssertion(section = BEFORE_BEAN_DISCOVERY, id = "af") }) - public void shouldFindBeanReference() { - Assert.assertNotNull(bean); - Assert.assertNotNull(bean.getCollaborator()); - Assert.assertTrue(bean.getCollaborator().isInvokable()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/WarDummyObserverExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/WarDummyObserverExtension.java deleted file mode 100644 index 5d6efb4c85..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/extensions/registration/WarDummyObserverExtension.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.extensions.registration; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AfterDeploymentValidation; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.Extension; - -public class WarDummyObserverExtension implements Extension { - - public void registerBeans(@Observes AfterDeploymentValidation event, final BeanManager bm) { - EarExtensionsCheck.extensionInWarRegistered = true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/BuiltInBeansTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/BuiltInBeansTest.java deleted file mode 100644 index 3233280b7f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/BuiltInBeansTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.TestGroups.REWRITE; -import static org.jboss.cdi.tck.cdi.Sections.ADDITIONAL_BUILTIN_BEANS; -import static org.testng.Assert.assertNotNull; - -import java.security.Principal; - -import javax.security.auth.login.LoginException; - -import jakarta.transaction.SystemException; -import jakarta.transaction.UserTransaction; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Pete Muir - * @author Martin Kouba - */ -@Test(groups = JAVAEE_FULL) -@SpecVersion(spec = "cdi", version = "2.0") -public class BuiltInBeansTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - return new EnterpriseArchiveBuilder().withTestClassPackage(BuiltInBeansTest.class).build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = ADDITIONAL_BUILTIN_BEANS, id = "a") }) - public void testUserTransactionBean() throws SystemException { - UserTransaction userTransaction = getContextualReference(UserTransactionInjectedBeanLocal.class).getUserTransaction(); - assertNotNull(userTransaction); - // Check that the UserTransaction is at least queryable - userTransaction.getStatus(); - } - - /** - * - * @throws SystemException - * @throws LoginException - */ - @Test(groups = REWRITE) - // PLM We should check the Principal somehow - @SpecAssertions({ @SpecAssertion(section = ADDITIONAL_BUILTIN_BEANS, id = "b") }) - public void testPrincipalBean() throws SystemException, LoginException { - PrincipalInjectedBeanLocal instance = getContextualReference(PrincipalInjectedBeanLocal.class); - instance.login(); - Principal principal = instance.getPrincipal(); - // Not much we can check on the Princiapl easily - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/MockLoginModule.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/MockLoginModule.java deleted file mode 100644 index 787bce607b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/MockLoginModule.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin; - -import java.security.Principal; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import javax.security.auth.Subject; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.login.LoginException; -import javax.security.auth.spi.LoginModule; - -public class MockLoginModule implements LoginModule { - - protected Set roles = new HashSet(); - - protected Subject subject; - protected Map options; - protected CallbackHandler callbackHandler; - - public MockLoginModule() { - } - - public boolean abort() throws LoginException { - return true; - } - - public boolean commit() throws LoginException { - subject.getPrincipals().add(new Principal() { - - public String getName() { - return "default"; - } - }); - return true; - } - - public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, - Map options) { - this.subject = subject; - this.options = options; - this.callbackHandler = callbackHandler; - } - - public boolean login() throws LoginException { - return true; - } - - public boolean logout() throws LoginException { - return true; - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/PrincipalInjectedBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/PrincipalInjectedBean.java deleted file mode 100644 index 5e313677af..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/PrincipalInjectedBean.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin; - -import java.security.Principal; -import java.util.HashMap; - -import javax.security.auth.login.AppConfigurationEntry; -import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag; -import javax.security.auth.login.LoginContext; -import javax.security.auth.login.LoginException; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Instance; -import jakarta.inject.Inject; - -/** - * @author pmuir - * - */ -@Stateful -public class PrincipalInjectedBean implements PrincipalInjectedBeanLocal { - - static final String DEFAULT_JAAS_CONFIG_NAME = "default"; - - @Inject - Instance principal; - - public Principal getPrincipal() { - return principal.get(); - } - - public void login() throws LoginException { - LoginContext lc = new LoginContext(DEFAULT_JAAS_CONFIG_NAME, null, null, createConfiguration()); - lc.login(); - } - - protected AppConfigurationEntry createAppConfigurationEntry() { - return new AppConfigurationEntry(MockLoginModule.class.getName(), LoginModuleControlFlag.REQUIRED, - new HashMap()); - } - - protected javax.security.auth.login.Configuration createConfiguration() { - return new javax.security.auth.login.Configuration() { - private AppConfigurationEntry[] aces = { createAppConfigurationEntry() }; - - @Override - public AppConfigurationEntry[] getAppConfigurationEntry(String name) { - return DEFAULT_JAAS_CONFIG_NAME.equals(name) ? aces : null; - } - - @Override - public void refresh() { - } - }; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/PrincipalInjectedBeanLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/PrincipalInjectedBeanLocal.java deleted file mode 100644 index 2a2dce6d5c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/PrincipalInjectedBeanLocal.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin; - -import java.security.Principal; - -import javax.security.auth.login.LoginException; - -import jakarta.ejb.Local; - -/** - * @author pmuir - * - */ -@Local -public interface PrincipalInjectedBeanLocal { - - public Principal getPrincipal(); - - public void login() throws LoginException; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/UserTransactionInjectedBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/UserTransactionInjectedBean.java deleted file mode 100644 index aa880fb4c2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/UserTransactionInjectedBean.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin; - -import static jakarta.ejb.TransactionManagementType.BEAN; - -import jakarta.ejb.Stateful; -import jakarta.ejb.TransactionManagement; -import jakarta.inject.Inject; -import jakarta.transaction.UserTransaction; - -/** - * @author pmuir - * @author Martin Kouba - */ -@Stateful -@TransactionManagement(BEAN) -public class UserTransactionInjectedBean implements UserTransactionInjectedBeanLocal { - - @Inject - transient UserTransaction userTransaction; - - public UserTransaction getUserTransaction() { - return userTransaction; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/UserTransactionInjectedBeanLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/UserTransactionInjectedBeanLocal.java deleted file mode 100644 index e2ee34b4b1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/UserTransactionInjectedBeanLocal.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin; - -import jakarta.ejb.Local; -import jakarta.transaction.UserTransaction; - -/** - * @author pmuir - * - */ -@Local -public interface UserTransactionInjectedBeanLocal { - - public UserTransaction getUserTransaction(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/broken/transaction/ContainerManagedTransactionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/broken/transaction/ContainerManagedTransactionBean.java deleted file mode 100644 index 1e09838f90..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/broken/transaction/ContainerManagedTransactionBean.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin.broken.transaction; - -import static jakarta.ejb.TransactionManagementType.CONTAINER; - -import jakarta.ejb.Stateful; -import jakarta.ejb.TransactionManagement; -import jakarta.inject.Inject; -import jakarta.transaction.UserTransaction; - -/** - * - * @author Martin Kouba - */ -@Stateful -@TransactionManagement(CONTAINER) -public class ContainerManagedTransactionBean { - - @Inject - private UserTransaction userTransaction; - - public UserTransaction getUserTransaction() { - return userTransaction; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/broken/transaction/UserTransactionInvalidInjectionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/broken/transaction/UserTransactionInvalidInjectionTest.java deleted file mode 100644 index cd47ae5d94..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/broken/transaction/UserTransactionInvalidInjectionTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.builtin.broken.transaction; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.ADDITIONAL_BUILTIN_BEANS; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test Java EE component class that has an injection point of type UserTransaction and qualifier Default, and may not validly - * make use of the JTA UserTransaction according to the specification. - * - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class UserTransactionInvalidInjectionTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(UserTransactionInvalidInjectionTest.class).build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = ADDITIONAL_BUILTIN_BEANS, id = "e") }) - public void testUserTransactionInjection() throws Exception { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/BuiltinMetadataEEBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/BuiltinMetadataEEBeanTest.java deleted file mode 100644 index 91fa4d9ff3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/BuiltinMetadataEEBeanTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2016, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin.metadata.ee; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_METADATA_EE; - -import java.io.IOException; -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * @author Tomas Remes - */ -@Test(groups = JAVAEE_FULL) -@RunAsClient -@SpecVersion(spec = "cdi", version = "2.0") -public class BuiltinMetadataEEBeanTest extends AbstractTest { - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(BuiltinMetadataEEBeanTest.class).build(); - } - - @ArquillianResource - URL servletContextPath; - - @Test - @SpecAssertion(section = BEAN_METADATA_EE, id = "a") - public void interceptedBeanForEEComponentIsNullInInterceptor() throws IOException { - WebClient webClient = new WebClient(); - - String servletResponse = webClient.getPage(servletContextPath + "test").getWebResponse().getContentAsString(); - Assert.assertTrue(servletResponse.contains(String.valueOf(1))); - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/Counter.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/Counter.java deleted file mode 100644 index ceb704d9ea..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/Counter.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2016, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin.metadata.ee; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class Counter { - - public int getCount() { - return i; - } - - public void increment() { - i++; - } - - private int i = 0; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/InterceptorBinding.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/InterceptorBinding.java deleted file mode 100644 index cf12cef63f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/InterceptorBinding.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2016, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin.metadata.ee; - -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; - -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Documented -@jakarta.interceptor.InterceptorBinding -public @interface InterceptorBinding { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/ServletInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/ServletInterceptor.java deleted file mode 100644 index 3435cb9118..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/ServletInterceptor.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2016, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin.metadata.ee; - -import jakarta.annotation.Priority; -import jakarta.enterprise.inject.Intercepted; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.inject.Inject; -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@Interceptor -@InterceptorBinding -@Priority(2510) -public class ServletInterceptor { - - @Inject - @Intercepted - Bean interceptedBean; - - @Inject - Counter counter; - - @AroundInvoke - public Object aroundInvoke(InvocationContext invocationContext) throws Exception { - if (interceptedBean == null) { - counter.increment(); - } - return invocationContext.proceed(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/TestServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/TestServlet.java deleted file mode 100644 index 103b33f6f6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/ee/TestServlet.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2016, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.builtin.metadata.ee; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; - -@WebServlet("/test") -public class TestServlet extends HttpServlet { - - @Inject - Counter status; - - @InterceptorBinding - public void service(ServletRequest req, ServletResponse resp) throws ServletException, IOException { - resp.setContentType("text/plain"); - resp.getWriter().write(String.valueOf(status.getCount())); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/BakeryProduct.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/BakeryProduct.java deleted file mode 100644 index 1b4f61c79b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/BakeryProduct.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin.metadata.session; - -import jakarta.ejb.Local; - -@Local -public interface BakeryProduct { - - BakeryProductDecorator getDecoratorInstance(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/BakeryProductDecorator.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/BakeryProductDecorator.java deleted file mode 100644 index 49adb8f0cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/BakeryProductDecorator.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin.metadata.session; - -import jakarta.decorator.Delegate; -import jakarta.enterprise.inject.Decorated; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.Decorator; -import jakarta.inject.Inject; - -@jakarta.decorator.Decorator -@SuppressWarnings({ "unused", "serial" }) -public class BakeryProductDecorator implements BakeryProduct { - - @Inject - @Delegate - private BakeryProduct delegate; - - @Inject - private Bean bean; - - @Inject - private Decorator decorator; - - @Inject - @Decorated - private Bean decoratedBean; - - public Bean getBean() { - return bean; - } - - public Decorator getDecorator() { - return decorator; - } - - public Bean getDecoratedBean() { - return decoratedBean; - } - - public BakeryProductDecorator getDecoratorInstance() { - return this; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/Bread.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/Bread.java deleted file mode 100644 index 57d0a9c807..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/Bread.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin.metadata.session; - -import jakarta.ejb.Stateless; - -@Stateless -public class Bread implements BakeryProduct { - - public BakeryProductDecorator getDecoratorInstance() { - return null; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/BuiltinMetadataSessionBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/BuiltinMetadataSessionBeanTest.java deleted file mode 100644 index 2258d3be06..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/BuiltinMetadataSessionBeanTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin.metadata.session; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_METADATA; -import static org.testng.Assert.assertEquals; - -import java.lang.reflect.Type; -import java.util.Collections; - -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.Decorator; -import jakarta.enterprise.inject.spi.InterceptionType; -import jakarta.enterprise.inject.spi.Interceptor; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Tomas Remes - */ -@Test(groups = JAVAEE_FULL) -@SpecVersion(spec = "cdi", version = "2.0") -public class BuiltinMetadataSessionBeanTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(BuiltinMetadataSessionBeanTest.class) - .withClasses(YoghurtInterceptor.class, Frozen.class) - .withBeansXml( - new BeansXml().interceptors(YoghurtInterceptor.class).decorators(BakeryProductDecorator.class)) - .build(); - } - - @Inject - private Yoghurt yoghurt; - - @Inject - private BakeryProduct bakery; - - @Test - @SpecAssertions({ @SpecAssertion(section = BEAN_METADATA, id = "b"), @SpecAssertion(section = BEAN_METADATA, id = "d"), - @SpecAssertion(section = BEAN_METADATA, id = "f") }) - public void testInterceptorMetadata() { - - Interceptor interceptor = getCurrentManager() - .resolveInterceptors(InterceptionType.AROUND_INVOKE, new Frozen.Literal()).iterator().next(); - Bean sessionBean = getUniqueBean(Yoghurt.class); - YoghurtInterceptor fatYoghurtInterceptor = yoghurt.getInterceptorInstance(); - assertEquals(interceptor, fatYoghurtInterceptor.getBean()); - assertEquals(interceptor, fatYoghurtInterceptor.getInterceptor()); - assertEquals(sessionBean, fatYoghurtInterceptor.getInterceptedBean()); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = BEAN_METADATA, id = "c"), @SpecAssertion(section = BEAN_METADATA, id = "e"), - @SpecAssertion(section = BEAN_METADATA, id = "f") }) - public void testDecoratorMetadata() { - Bean sessionBean = getUniqueBean(BakeryProduct.class); - Decorator decoratorInstance = getCurrentManager() - .resolveDecorators(Collections. singleton(BakeryProduct.class)) - .iterator().next(); - BakeryProductDecorator bakeryDecorator = bakery.getDecoratorInstance(); - assertEquals(decoratorInstance, bakeryDecorator.getBean()); - assertEquals(decoratorInstance, bakeryDecorator.getDecorator()); - assertEquals(sessionBean, bakeryDecorator.getDecoratedBean()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/Frozen.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/Frozen.java deleted file mode 100644 index 3ea6f8c1d5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/Frozen.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin.metadata.session; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.util.AnnotationLiteral; -import jakarta.interceptor.InterceptorBinding; - -@InterceptorBinding -@Inherited -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -public @interface Frozen { - - @SuppressWarnings("all") - public static class Literal extends AnnotationLiteral implements Frozen { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/Yoghurt.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/Yoghurt.java deleted file mode 100644 index 6b1550b4a0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/Yoghurt.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin.metadata.session; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.inject.Inject; - -@Stateless -public class Yoghurt { - - @Inject - private Bean bean; - - public Bean getBeanBean() { - return bean; - } - - @Frozen - public YoghurtInterceptor getInterceptorInstance() { - return null; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/YoghurtInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/YoghurtInterceptor.java deleted file mode 100644 index 185350f6f0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/metadata/session/YoghurtInterceptor.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin.metadata.session; - -import java.io.Serializable; - -import jakarta.enterprise.inject.Intercepted; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.Interceptor; -import jakarta.inject.Inject; -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -@SuppressWarnings("serial") -@jakarta.interceptor.Interceptor -@Frozen -public class YoghurtInterceptor implements Serializable { - - @Inject - private Bean bean; - @Inject - private Interceptor interceptor; - @Inject - @Intercepted - private Bean interceptedBean; - - @AroundInvoke - public Object intercept(InvocationContext ctx) throws Exception { - return this; - } - - public Bean getBean() { - return bean; - } - - public Interceptor getInterceptor() { - return interceptor; - } - - public Bean getInterceptedBean() { - return interceptedBean; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/servlet/LowercaseConverter.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/servlet/LowercaseConverter.java deleted file mode 100644 index 8caf1660ee..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/servlet/LowercaseConverter.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin.servlet; - -import java.io.Serializable; - -import jakarta.enterprise.context.SessionScoped; -import jakarta.inject.Inject; -import jakarta.servlet.ServletContext; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpSession; - -@SuppressWarnings("serial") -@SessionScoped -public class LowercaseConverter implements Serializable { - - protected static final String TEXT = "text"; - - private long id = System.currentTimeMillis(); - - @Inject - private HttpServletRequest httpServletRequest; - - @Inject - private HttpSession httpSession; - - @Inject - private ServletContext servletContext; - - /** - * - * @param text - * @return - */ - public String convert(String text) { - if (text == null) { - // Request - text = httpServletRequest.getParameter(TEXT); - if (text == null) { - // Session - text = (String) httpSession.getAttribute(TEXT); - if (text == null) { - // Servlet context - text = (String) servletContext.getAttribute(TEXT); - } - } - } - return text != null ? text.toLowerCase() : null; - } - - public ServletContext getServletContext() { - return servletContext; - } - - public HttpServletRequest getHttpServletRequest() { - return httpServletRequest; - } - - public HttpSession getHttpSession() { - return httpSession; - } - - public long getId() { - return id; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/servlet/LowercaseConverterServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/servlet/LowercaseConverterServlet.java deleted file mode 100644 index 2a67422201..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/servlet/LowercaseConverterServlet.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin.servlet; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@WebServlet("/") -@SuppressWarnings("serial") -public class LowercaseConverterServlet extends HttpServlet { - - @Inject - LowercaseConverter lowercaseConverter; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - req.getSession().setAttribute(LowercaseConverter.TEXT, null); - req.getSession().getServletContext().setAttribute(LowercaseConverter.TEXT, "ServletCONTEXT"); - - if (req.getRequestURI().contains("/convert-request")) { - resp.getWriter().append(lowercaseConverter.convert(null)); - } else if (req.getRequestURI().contains("/convert-session")) { - req.getSession().setAttribute(LowercaseConverter.TEXT, "SesSion"); - resp.getWriter().append(lowercaseConverter.convert(null)); - } else if (req.getRequestURI().contains("/convert-context")) { - req.getSession().getServletContext().setAttribute(LowercaseConverter.TEXT, "ServletCONTEXT"); - resp.getWriter().append(lowercaseConverter.convert(null)); - } - resp.setContentType("text/plain"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/servlet/ServletContainerBuiltinBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/servlet/ServletContainerBuiltinBeanTest.java deleted file mode 100644 index 4d0ac3c283..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/builtin/servlet/ServletContainerBuiltinBeanTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.builtin.servlet; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.ADDITIONAL_BUILTIN_BEANS; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.net.URL; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.RunAsClient; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * Test that servlet container built-in beans are available for injection. - * - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class ServletContainerBuiltinBeanTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ServletContainerBuiltinBeanTest.class).build(); - } - - @Inject - LowercaseConverter lowercaseConverter; - - @Test - @SpecAssertions({ @SpecAssertion(section = ADDITIONAL_BUILTIN_BEANS, id = "da"), - @SpecAssertion(section = ADDITIONAL_BUILTIN_BEANS, id = "db"), - @SpecAssertion(section = ADDITIONAL_BUILTIN_BEANS, id = "dc") }) - public void testBuiltinBeansAvailableForInjection() { - - String result = lowercaseConverter.convert("Foo"); - assertEquals(result, "foo"); - - assertNotNull(lowercaseConverter.getHttpServletRequest()); - assertNotNull(lowercaseConverter.getHttpServletRequest().getRequestURL()); - assertNotNull(lowercaseConverter.getHttpSession()); - assertNotNull(lowercaseConverter.getHttpSession().getId()); - assertNotNull(lowercaseConverter.getServletContext()); - assertTrue(lowercaseConverter.getServletContext().getMajorVersion() >= 2); - } - - @RunAsClient - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = ADDITIONAL_BUILTIN_BEANS, id = "da"), - @SpecAssertion(section = ADDITIONAL_BUILTIN_BEANS, id = "db"), - @SpecAssertion(section = ADDITIONAL_BUILTIN_BEANS, id = "dc") }) - public void testBuiltinBeansFromClient(@ArquillianResource URL contextPath) throws Exception { - - WebClient client = new WebClient(); - - TextPage requestPage = client.getPage(contextPath + "/convert-request?text=BaR"); - assertEquals(requestPage.getContent(), "bar"); - - TextPage sessionPage = client.getPage(contextPath + "/convert-session"); - assertEquals(sessionPage.getContent(), "session"); - - TextPage contextPage = client.getPage(contextPath + "/convert-context"); - assertEquals(contextPage.getContent(), "servletcontext"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/Apple.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/Apple.java deleted file mode 100644 index 4d56453c32..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/Apple.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.broken.enterprise.methodOnSessionBean; - -public class Apple { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/AppleTree.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/AppleTree.java deleted file mode 100644 index 92e3f518d9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/AppleTree.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.broken.enterprise.methodOnSessionBean; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.inject.Disposes; -import jakarta.enterprise.inject.Produces; - -@Stateless -public class AppleTree implements AppleTreeLocal { - @Produces - public Apple getApple() { - return new Apple(); - } - - public void recycle(@Disposes Apple apple) { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/AppleTreeLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/AppleTreeLocal.java deleted file mode 100644 index 6dc2b4b2d1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/AppleTreeLocal.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.broken.enterprise.methodOnSessionBean; - -import jakarta.ejb.Local; - -@Local -public interface AppleTreeLocal { - - public Apple getApple(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/DisposalMethodOnSessionBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/DisposalMethodOnSessionBeanTest.java deleted file mode 100644 index e626e713c8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/methodOnSessionBean/DisposalMethodOnSessionBeanTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.broken.enterprise.methodOnSessionBean; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_DISPOSER_METHOD_EE; -import static org.jboss.cdi.tck.cdi.Sections.DISPOSER_METHOD_EE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class DisposalMethodOnSessionBeanTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(DisposalMethodOnSessionBeanTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = DISPOSER_METHOD_EE, id = "a"), - @SpecAssertion(section = DECLARING_DISPOSER_METHOD_EE, id = "a") }) - public void testDisposalMethodNotBusinessOrStatic() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/Foo.java deleted file mode 100644 index a56c80b00e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/Foo.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2016, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.broken.enterprise.remoteMethod; - -public class Foo { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/FooDisposal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/FooDisposal.java deleted file mode 100644 index 608dc813ee..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/FooDisposal.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2016, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.broken.enterprise.remoteMethod; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Disposes; -import jakarta.enterprise.inject.Produces; - -@Stateful -public class FooDisposal implements FooDisposalRemote { - - @Produces - static Foo foo = new Foo(); - - @Override - public void disposeFoo(@Disposes Foo foo) { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/FooDisposalRemote.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/FooDisposalRemote.java deleted file mode 100644 index 05761682a5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/FooDisposalRemote.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.broken.enterprise.remoteMethod; - -import jakarta.ejb.Remote; - -@Remote -public interface FooDisposalRemote { - - void disposeFoo(Foo foo); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/RemoteBusinessDisposalMethodTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/RemoteBusinessDisposalMethodTest.java deleted file mode 100644 index b3ced848b9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/enterprise/remoteMethod/RemoteBusinessDisposalMethodTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2016, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.broken.enterprise.remoteMethod; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_DISPOSER_METHOD_EE; -import static org.jboss.cdi.tck.cdi.Sections.DISPOSER_METHOD_EE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class RemoteBusinessDisposalMethodTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(RemoteBusinessDisposalMethodTest.class).build(); - } - - @Test(groups = { INTEGRATION, JAVAEE_FULL }) - @SpecAssertion(section = DISPOSER_METHOD_EE, id = "a") - @SpecAssertion(section = DECLARING_DISPOSER_METHOD_EE, id = "a") - public void disposalMethodOnSessionBeanCannotBeRemoteBusinessMethod() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/observes/async/BrokenFoodProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/observes/async/BrokenFoodProducer.java deleted file mode 100644 index a34c1013ce..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/observes/async/BrokenFoodProducer.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.broken.observes.async; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.ObservesAsync; -import jakarta.enterprise.inject.Disposes; -import jakarta.ws.rs.Produces; - -@Dependent -public class BrokenFoodProducer { - - @Produces - public Food cookSomething() { - return new Food(); - } - - public void eatFood(@Disposes @ObservesAsync Food food) { - - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/observes/async/DisposerMethodWithAsyncObservesTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/observes/async/DisposerMethodWithAsyncObservesTest.java deleted file mode 100644 index 14aedcd38c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/observes/async/DisposerMethodWithAsyncObservesTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.broken.observes.async; - -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_DISPOSER_METHOD; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class DisposerMethodWithAsyncObservesTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(DisposerMethodWithAsyncObservesTest.class).build(); - } - - @Test - @SpecAssertion(section = DECLARING_DISPOSER_METHOD, id = "fa") - public void testObserverParameterUnallowed() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/observes/async/Food.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/observes/async/Food.java deleted file mode 100644 index a3aca25f46..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/broken/observes/async/Food.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2015, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.broken.observes.async; - -public class Food { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Chicken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Chicken.java deleted file mode 100644 index 58e1b36396..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Chicken.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.inheritance.ejb; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Any; -import jakarta.enterprise.inject.Disposes; -import jakarta.enterprise.inject.Produces; - -import org.jboss.cdi.tck.tests.implementation.disposal.method.definition.inheritance.Yummy; - -@Stateful -public class Chicken { - - @Produces - @Yummy - public Egg produceYummyEgg() { - return new Egg(this); - } - - public void disposeEgg(@Disposes @Any Egg egg) { - Egg.disposedBy.add(getOriginClass()); - } - - public Class getOriginClass() { - return Chicken.class; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Code.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Code.java deleted file mode 100644 index 4ec513aaf2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Code.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.inheritance.ejb; - -import java.util.ArrayList; -import java.util.List; - -public class Code { - - public static List> disposedBy = new ArrayList>(); - - private Programmer programmer; - - public Code(Programmer programmer) { - this.programmer = programmer; - } - - public Programmer getProgrammer() { - return programmer; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/CzechChicken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/CzechChicken.java deleted file mode 100644 index 32c6143585..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/CzechChicken.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.inheritance.ejb; - -import jakarta.ejb.Stateful; - -/** - * @author Martin Kouba - */ -@Stateful -public class CzechChicken extends Chicken { - - @Override - public Class getOriginClass() { - return CzechChicken.class; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/DisposerMethodInheritanceTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/DisposerMethodInheritanceTest.java deleted file mode 100644 index 889163948c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/DisposerMethodInheritanceTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.inheritance.ejb; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.MEMBER_LEVEL_INHERITANCE_EE; -import static org.testng.Assert.assertEquals; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.implementation.disposal.method.definition.inheritance.Yummy; -import org.jboss.cdi.tck.util.DependentInstance; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class DisposerMethodInheritanceTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(DisposerMethodInheritanceTest.class) - .withClasses(Yummy.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "de"), - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "dk") }) - public void testSessionBeanDisposerMethodNotInherited() { - - DependentInstance eggInstance = new DependentInstance(getCurrentManager(), Egg.class); - Egg egg = eggInstance.get(); - ; - // The producer method for @Default Egg is defined on Sumavanka - assertEquals(egg.getChicken().getOriginClass(), Sumavanka.class); - eggInstance.destroy(); - // Disposer method is not inherited - assertEquals(Egg.disposedBy.size(), 0); - - DependentInstance codeInstance = new DependentInstance(getCurrentManager(), Code.class); - Code code = codeInstance.get(); - // The producer method for @Default Code is defined on Guru - assertEquals(code.getProgrammer().getOriginClass(), Guru.class); - codeInstance.destroy(); - // Disposer method is not inherited - assertEquals(Code.disposedBy.size(), 0); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Egg.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Egg.java deleted file mode 100644 index 8598b92934..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Egg.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.inheritance.ejb; - -import java.util.ArrayList; -import java.util.List; - -public class Egg { - - public static List> disposedBy = new ArrayList>(); - - private Chicken chicken; - - public Egg(Chicken chicken) { - this.chicken = chicken; - } - - public Chicken getChicken() { - return chicken; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Guru.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Guru.java deleted file mode 100644 index 4b1797c005..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Guru.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.inheritance.ejb; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Produces; - -/** - * Test that {@link Programmer#disposeCode(Code)} is not inherited. - */ -@Stateful -public class Guru extends Programmer { - - @Produces - public Code produceDefaultCode() { - return new Code(this); - } - - public Class getOriginClass() { - return Guru.class; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Programmer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Programmer.java deleted file mode 100644 index 24ab3c80b1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Programmer.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.inheritance.ejb; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Any; -import jakarta.enterprise.inject.Disposes; -import jakarta.enterprise.inject.Produces; - -import org.jboss.cdi.tck.tests.implementation.disposal.method.definition.inheritance.Yummy; - -@Stateful -public class Programmer { - - @Produces - @Yummy - public Code produceYummyCode() { - return new Code(this); - } - - public void disposeCode(@Disposes @Any Code code) { - Code.disposedBy.add(this.getClass()); - } - - public Class getOriginClass() { - return Programmer.class; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Sumavanka.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Sumavanka.java deleted file mode 100644 index 50f973e84a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/disposal/method/definition/inheritance/ejb/Sumavanka.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.disposal.method.definition.inheritance.ejb; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Produces; - -/** - * @author Martin Kouba - */ -@Stateful -public class Sumavanka extends CzechChicken { - - @Produces - public Egg produceDefaultEgg() { - return new Egg(this); - } - - @Override - public Class getOriginClass() { - return Sumavanka.class; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/genericStateless/DingoLocal_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/genericStateless/DingoLocal_Broken.java deleted file mode 100644 index b31fec1006..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/genericStateless/DingoLocal_Broken.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.genericStateless; - -import jakarta.ejb.Local; - -@Local -public interface DingoLocal_Broken { - void remove(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/genericStateless/Dingo_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/genericStateless/Dingo_Broken.java deleted file mode 100644 index 44518e8ff0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/genericStateless/Dingo_Broken.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.genericStateless; - -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.RequestScoped; - -@Stateful -@RequestScoped -public class Dingo_Broken implements DingoLocal_Broken { - @Remove - public void remove() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/genericStateless/GenericStatelessSessionBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/genericStateless/GenericStatelessSessionBeanTest.java deleted file mode 100644 index 6304d0094a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/genericStateless/GenericStatelessSessionBeanTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.genericStateless; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEANS; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class GenericStatelessSessionBeanTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(GenericStatelessSessionBeanTest.class).build(); - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = SESSION_BEANS, id = "i") - // WELD-433 - public void testRequestScopedGenericStatelessSessionBean() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithConversationScope/Husky_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithConversationScope/Husky_Broken.java deleted file mode 100644 index 8d6e5f4508..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithConversationScope/Husky_Broken.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.singletonWithConversationScope; - -import jakarta.ejb.Singleton; -import jakarta.enterprise.context.ConversationScoped; - -@Singleton -@ConversationScoped -public class Husky_Broken { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithConversationScope/SingletonWithConversationScopeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithConversationScope/SingletonWithConversationScopeTest.java deleted file mode 100644 index e193ad1dce..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithConversationScope/SingletonWithConversationScopeTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.singletonWithConversationScope; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEANS; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SingletonWithConversationScopeTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SingletonWithConversationScopeTest.class).build(); - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = SESSION_BEANS, id = "da") - public void testSingletonWithConversationScopeFails() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/Greyhound_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/Greyhound_Broken.java deleted file mode 100644 index 32fcdf5fb9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/Greyhound_Broken.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.singletonWithRequestScope; - -import jakarta.ejb.Singleton; -import jakarta.enterprise.context.RequestScoped; - -@Singleton -@RequestScoped -public class Greyhound_Broken { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/SingletonWithRequestScopeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/SingletonWithRequestScopeTest.java deleted file mode 100644 index 278ff90261..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/SingletonWithRequestScopeTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.singletonWithRequestScope; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEANS; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SingletonWithRequestScopeTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SingletonWithRequestScopeTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = SESSION_BEANS, id = "da") - public void testSingletonWithRequestScopeFails() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/IrishTerrier_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/IrishTerrier_Broken.java deleted file mode 100644 index 2e5f66d435..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/IrishTerrier_Broken.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.singletonWithSessionScope; - -import java.io.Serializable; - -import jakarta.ejb.Singleton; -import jakarta.enterprise.context.SessionScoped; - -@Singleton -@SessionScoped -public class IrishTerrier_Broken implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -1628520203303413522L; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/SingletonWithSessionScopeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/SingletonWithSessionScopeTest.java deleted file mode 100644 index fefbd91788..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/SingletonWithSessionScopeTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.singletonWithSessionScope; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEANS; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SingletonWithSessionScopeTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SingletonWithSessionScopeTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = SESSION_BEANS, id = "da") - public void testSingletonWithSessionScopeFails() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/BulldogLocal_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/BulldogLocal_Broken.java deleted file mode 100644 index f64547fee6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/BulldogLocal_Broken.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessDecorator; - -import jakarta.ejb.Local; - -@Local -public interface BulldogLocal_Broken { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/Bulldog_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/Bulldog_Broken.java deleted file mode 100644 index fce2137031..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/Bulldog_Broken.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessDecorator; - -import jakarta.decorator.Decorator; -import jakarta.decorator.Delegate; -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; - -@Stateless -@Decorator -public class Bulldog_Broken implements BulldogLocal_Broken, Dog { - @Inject - @Delegate - private Dog delegate; - - public void foo() { - delegate.foo(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/Colie.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/Colie.java deleted file mode 100644 index 4d43ea174c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/Colie.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessDecorator; - -public class Colie implements Dog { - public void foo() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/DecoratorAnnotatedStatelessSessionBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/DecoratorAnnotatedStatelessSessionBeanTest.java deleted file mode 100644 index 1b8d8af725..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/DecoratorAnnotatedStatelessSessionBeanTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessDecorator; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEANS; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class DecoratorAnnotatedStatelessSessionBeanTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(DecoratorAnnotatedStatelessSessionBeanTest.class).build(); - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = SESSION_BEANS, id = "h") - public void testStatelessSessionBeanNotAllowedToBeDecorator() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/Dog.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/Dog.java deleted file mode 100644 index de683d0aa9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessDecorator/Dog.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessDecorator; - -public interface Dog extends BulldogLocal_Broken { - void foo(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessInterceptor/DalmatianLocal_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessInterceptor/DalmatianLocal_Broken.java deleted file mode 100644 index 43dcb6624d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessInterceptor/DalmatianLocal_Broken.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessInterceptor; - -import jakarta.ejb.Local; - -@Local -public interface DalmatianLocal_Broken { - void foo(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessInterceptor/Dalmatian_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessInterceptor/Dalmatian_Broken.java deleted file mode 100644 index cb6ccc1fed..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessInterceptor/Dalmatian_Broken.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessInterceptor; - -import jakarta.ejb.Stateless; -import jakarta.interceptor.Interceptor; - -@Stateless -@Interceptor -public class Dalmatian_Broken implements DalmatianLocal_Broken { - - public void foo() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessInterceptor/InterceptorAnnotatedStatelessSessionBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessInterceptor/InterceptorAnnotatedStatelessSessionBeanTest.java deleted file mode 100644 index 4f842415fd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessInterceptor/InterceptorAnnotatedStatelessSessionBeanTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessInterceptor; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEANS; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class InterceptorAnnotatedStatelessSessionBeanTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(InterceptorAnnotatedStatelessSessionBeanTest.class).build(); - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = SESSION_BEANS, id = "g") - public void testStatelessSessionBeanNotAllowedToBeInterceptor() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/DachshundLocal_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/DachshundLocal_Broken.java deleted file mode 100644 index 302e6f6593..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/DachshundLocal_Broken.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessWithApplicationScope; - -import jakarta.ejb.Local; - -@Local -public interface DachshundLocal_Broken { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/Dachshund_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/Dachshund_Broken.java deleted file mode 100644 index 860c974386..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/Dachshund_Broken.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessWithApplicationScope; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.context.ApplicationScoped; - -@Stateless -@ApplicationScoped -public class Dachshund_Broken implements DachshundLocal_Broken { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/StatelessWithApplicationScopeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/StatelessWithApplicationScopeTest.java deleted file mode 100644 index fe76b2ac07..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/StatelessWithApplicationScopeTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessWithApplicationScope; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEANS; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class StatelessWithApplicationScopeTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(StatelessWithApplicationScopeTest.class).build(); - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = SESSION_BEANS, id = "da") - public void testStatelessWithSessionScopeFails() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/BoxerLocal_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/BoxerLocal_Broken.java deleted file mode 100644 index 5c0e4699c6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/BoxerLocal_Broken.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessWithConversationScope; - -import jakarta.ejb.Local; - -@Local -public interface BoxerLocal_Broken { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/Boxer_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/Boxer_Broken.java deleted file mode 100644 index ec27cbaf47..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/Boxer_Broken.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessWithConversationScope; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.context.ConversationScoped; - -@Stateless -@ConversationScoped -public class Boxer_Broken implements BoxerLocal_Broken { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/StatelessWithConversationScopeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/StatelessWithConversationScopeTest.java deleted file mode 100644 index 420c2eddd6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/StatelessWithConversationScopeTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessWithConversationScope; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEANS; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class StatelessWithConversationScopeTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(StatelessWithConversationScopeTest.class).build(); - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = SESSION_BEANS, id = "da") - public void testStatelessWithConversationScopeFails() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/BeagleLocal_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/BeagleLocal_Broken.java deleted file mode 100644 index 05ea212c36..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/BeagleLocal_Broken.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessWithRequestScope; - -import jakarta.ejb.Local; - -@Local -public interface BeagleLocal_Broken { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/Beagle_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/Beagle_Broken.java deleted file mode 100644 index 14b16fe476..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/Beagle_Broken.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessWithRequestScope; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.context.RequestScoped; - -@Stateless -@RequestScoped -public class Beagle_Broken implements BeagleLocal_Broken { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/StatelessWithRequestScopeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/StatelessWithRequestScopeTest.java deleted file mode 100644 index f6e580da70..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/StatelessWithRequestScopeTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessWithRequestScope; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEANS; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class StatelessWithRequestScopeTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(StatelessWithRequestScopeTest.class).build(); - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = SESSION_BEANS, id = "da") - public void testStatelessWithRequestScopeFails() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/BullmastiffLocal_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/BullmastiffLocal_Broken.java deleted file mode 100644 index acee0e1f71..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/BullmastiffLocal_Broken.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessWithSessionScope; - -import jakarta.ejb.Local; - -@Local -public interface BullmastiffLocal_Broken { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/Bullmastiff_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/Bullmastiff_Broken.java deleted file mode 100644 index 892ac0cb87..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/Bullmastiff_Broken.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessWithSessionScope; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.context.SessionScoped; - -@Stateless -@SessionScoped -public class Bullmastiff_Broken implements BullmastiffLocal_Broken { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/StatelessWithSessionScopeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/StatelessWithSessionScopeTest.java deleted file mode 100644 index 760faa5cd4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/StatelessWithSessionScopeTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.broken.statelessWithSessionScope; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEANS; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class StatelessWithSessionScopeTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(StatelessWithSessionScopeTest.class).build(); - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = SESSION_BEANS, id = "da") - public void testStatelessWithSessionScopeFails() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Ape.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Ape.java deleted file mode 100644 index ab3df2183a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Ape.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Stateless; - -@Stateless -@Tame -public class Ape implements ApeLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ApeLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ApeLocal.java deleted file mode 100644 index b640027412..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ApeLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Local; - -@Local -public interface ApeLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Dog.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Dog.java deleted file mode 100644 index ea6d868ea2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Dog.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -public class Dog { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/DogLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/DogLocal.java deleted file mode 100644 index b527e3f7e1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/DogLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Local; - -@Local -public interface DogLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Elephant.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Elephant.java deleted file mode 100644 index e7040d7367..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Elephant.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -public class Elephant implements ElephantLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ElephantLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ElephantLocal.java deleted file mode 100644 index 8a902562a4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ElephantLocal.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -public interface ElephantLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java deleted file mode 100644 index 4049da3123..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_SESSION_BEAN; -import static org.jboss.cdi.tck.cdi.Sections.INSTANTIATION_EE; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEANS; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEAN_NAME; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEAN_TYPES; -import static org.testng.Assert.assertTrue; - -import java.lang.annotation.Annotation; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Nicklas Karlsson - * @author Martin Kouba - */ -@Test(groups = { INTEGRATION }) -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseBeanDefinitionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EnterpriseBeanDefinitionTest.class) - .withBeansXml(new BeansXml(BeanDiscoveryMode.ALL)) - .build(); - } - - @Test - @SpecAssertion(section = SESSION_BEANS, id = "b") - public void testStatelessMustBeDependentScoped() { - assert getBeans(GiraffeLocal.class).size() == 1; - assert getBeans(GiraffeLocal.class).iterator().next().getScope().equals(Dependent.class); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = INSTANTIATION_EE, id = "a"), - @SpecAssertion(section = INSTANTIATION_EE, id = "ab") }) - public void testConstructorAnnotatedInjectCalled() { - ExplicitConstructor bean = getContextualReference(ExplicitConstructor.class); - assert bean.getConstructorCalls() == 1; - assert bean.getInjectedSimpleBean() instanceof SimpleBean; - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = INSTANTIATION_EE, id = "bb") - public void testConstructorWithNoParamsUsed(NoParamConstructorSessionBean noParamConstructorSessionBean) { - noParamConstructorSessionBean.ping(); - assertTrue(NoParamConstructorSessionBean.constructedCorrectly); - } - - @Test - @SpecAssertion(section = SESSION_BEANS, id = "c") - public void testSingletonWithDependentScopeOK() { - assert getBeans(Labrador.class).size() == 1; - } - - @Test - @SpecAssertion(section = SESSION_BEANS, id = "c") - public void testSingletonWithApplicationScopeOK() { - assert getBeans(Laika.class).size() == 1; - } - - @Test - @SpecAssertions({ @SpecAssertion(section = SESSION_BEAN_TYPES, id = "aa"), - @SpecAssertion(section = DECLARING_SESSION_BEAN, id = "c") }) - public void testBeanTypesAreLocalInterfacesWithoutWildcardTypesOrTypeVariablesWithSuperInterfaces() { - Bean dogBean = getBeans(DogLocal.class).iterator().next(); - assert dogBean.getTypes().contains(DogLocal.class); - assert dogBean.getTypes().contains(PitbullLocal.class); - assert !dogBean.getTypes().contains(Pitbull.class); - } - - @Test - @SpecAssertion(section = SESSION_BEAN_TYPES, id = "ba") - public void testEnterpriseBeanClassLocalView() { - Bean dogBean = getUniqueBean(Retriever.class); - assert dogBean.getTypes().contains(Retriever.class); - assert dogBean.getTypes().contains(Dog.class); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = SESSION_BEAN_TYPES, id = "c"), - @SpecAssertion(section = DECLARING_SESSION_BEAN, id = "aa") }) - public void testObjectIsInAPITypes() { - assert getBeans(GiraffeLocal.class).size() == 1; - assert getBeans(GiraffeLocal.class).iterator().next().getTypes().contains(Object.class); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = DECLARING_SESSION_BEAN, id = "ba"), - @SpecAssertion(section = SESSION_BEANS, id = "e") }) - public void testBeanWithScopeAnnotation() { - Bean lionBean = getBeans(LionLocal.class).iterator().next(); - assert lionBean.getScope().equals(RequestScoped.class); - } - - @Test - @SpecAssertion(section = DECLARING_SESSION_BEAN, id = "bb") - public void testBeanWithNamedAnnotation() { - Bean monkeyBean = getBeans(MonkeyLocal.class).iterator().next(); - assert monkeyBean.getName().equals("Monkey"); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = DECLARING_SESSION_BEAN, id = "bd"), - @SpecAssertion(section = SESSION_BEAN_NAME, id = "a") }) - public void testBeanWithStereotype() { - Bean polarBearBean = getBeans(PolarBearLocal.class).iterator().next(); - assert polarBearBean.getScope().equals(RequestScoped.class); - assert polarBearBean.getName().equals("polarBear"); - } - - @Test - @SpecAssertion(section = DECLARING_SESSION_BEAN, id = "be") - public void testBeanWithQualifiers() { - Annotation tame = new Tame.Literal(); - Bean apeBean = getBeans(ApeLocal.class, tame).iterator().next(); - assert apeBean.getQualifiers().contains(tame); - } - - @Test - @SpecAssertion(section = SESSION_BEAN_NAME, id = "a") - public void testDefaultName() { - assert getBeans(PitbullLocal.class).size() == 1; - assert getBeans(PitbullLocal.class).iterator().next().getName().equals("pitbull"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java deleted file mode 100644 index dde88a11ab..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEAN_TYPES; -import static org.jboss.cdi.tck.cdi.Sections.WHAT_CLASSES_ARE_BEANS_EE; - -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * These tests are any that involve ejb-jar.xml resources. - * - * @author David Allen - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseBeanViaXmlTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - return new EnterpriseArchiveBuilder() - .withTestClassPackage(EnterpriseBeanViaXmlTest.class) - .withBeansXml(new BeansXml(BeanDiscoveryMode.ALL)) - .withEjbJarXml("ejb-jar.xml") - .build(); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = WHAT_CLASSES_ARE_BEANS_EE, id = "b"), - @SpecAssertion(section = SESSION_BEAN_TYPES, id = "ba") }) - public void testEjbDeclaredInXmlNotSimpleBean() { - Bean elephantBean = getBeans(ElephantLocal.class).iterator().next(); - // The interface is a known type but the class should not be - assert elephantBean.getTypes().contains(ElephantLocal.class); - assert !elephantBean.getTypes().contains(Elephant.class); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ExplicitConstructor.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ExplicitConstructor.java deleted file mode 100644 index f1a11f241c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ExplicitConstructor.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Local; - -@Local -public interface ExplicitConstructor { - public int getConstructorCalls(); - - public void setConstructorCalls(int numCalls); - - public SimpleBean getInjectedSimpleBean(); - - public void setInjectedSimpleBean(SimpleBean injectedSimpleBean); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ExplicitConstructorSessionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ExplicitConstructorSessionBean.java deleted file mode 100644 index f751e3ffdd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ExplicitConstructorSessionBean.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; - -@Stateless -public class ExplicitConstructorSessionBean implements ExplicitConstructor { - - private static int constructorCalls = 0; - private static SimpleBean injectedSimpleBean; - - public ExplicitConstructorSessionBean() { - } - - @Inject - public ExplicitConstructorSessionBean(SimpleBean bean) { - constructorCalls++; - injectedSimpleBean = bean; - } - - public int getConstructorCalls() { - return constructorCalls; - } - - public void setConstructorCalls(int numCalls) { - constructorCalls = numCalls; - } - - public SimpleBean getInjectedSimpleBean() { - return injectedSimpleBean; - } - - public void setInjectedSimpleBean(SimpleBean injectedSimpleBean) { - ExplicitConstructorSessionBean.injectedSimpleBean = injectedSimpleBean; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Giraffe.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Giraffe.java deleted file mode 100644 index 2abf136ddb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Giraffe.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Stateless; - -@Stateless -public class Giraffe implements GiraffeLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/GiraffeLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/GiraffeLocal.java deleted file mode 100644 index d8f60a1a21..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/GiraffeLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Local; - -@Local -public interface GiraffeLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Labrador.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Labrador.java deleted file mode 100644 index afb56d3933..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Labrador.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Singleton; -import jakarta.enterprise.context.Dependent; - -@Singleton -@Dependent -public class Labrador { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Laika.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Laika.java deleted file mode 100644 index d74edadc87..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Laika.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Singleton; -import jakarta.enterprise.context.ApplicationScoped; - -@Singleton -@ApplicationScoped -public class Laika { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Lion.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Lion.java deleted file mode 100644 index 585acf794f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Lion.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.RequestScoped; - -@Stateful -@RequestScoped -public class Lion implements LionLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/LionLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/LionLocal.java deleted file mode 100644 index 9691b5c37a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/LionLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Local; - -@Local -public interface LionLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Monkey.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Monkey.java deleted file mode 100644 index 948fc45b12..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Monkey.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.inject.Default; -import jakarta.inject.Named; - -@Stateless -@Named("Monkey") -@Default -public class Monkey implements MonkeyLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/MonkeyLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/MonkeyLocal.java deleted file mode 100644 index 54f561cb7b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/MonkeyLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Local; - -@Local -public interface MonkeyLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/NoParamConstructorSessionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/NoParamConstructorSessionBean.java deleted file mode 100644 index fc44478785..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/NoParamConstructorSessionBean.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Stateless; - -/** - * @author Martin Kouba - */ -@Stateless -public class NoParamConstructorSessionBean { - - public static boolean constructedCorrectly = false; - - public NoParamConstructorSessionBean() { - constructedCorrectly = true; - } - - public NoParamConstructorSessionBean(String name) { - } - - public void ping() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Pitbull.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Pitbull.java deleted file mode 100644 index d25e1ada88..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Pitbull.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.inject.Default; -import jakarta.inject.Named; - -@Stateful -@ApplicationScoped -@Named -@Default -public class Pitbull extends Dog implements PitbullLocal, DogLocal { - - public static boolean destructorCalled = false; - - @Remove - public void bye() { - destructorCalled = true; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/PitbullLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/PitbullLocal.java deleted file mode 100644 index 6e3cd8836d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/PitbullLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Local; - -@Local -public interface PitbullLocal { - void bye(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Polar.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Polar.java deleted file mode 100644 index 551520784c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Polar.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.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 jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.inject.Stereotype; -import jakarta.inject.Named; - -@Stereotype -@Target({ TYPE, METHOD, FIELD }) -@Retention(RUNTIME) -@RequestScoped -@Named -public @interface Polar { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/PolarBear.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/PolarBear.java deleted file mode 100644 index 576226b310..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/PolarBear.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Stateful; - -@Stateful -@Polar -public class PolarBear implements PolarBearLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/PolarBearLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/PolarBearLocal.java deleted file mode 100644 index 30d9e727df..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/PolarBearLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Local; - -@Local -public interface PolarBearLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Retriever.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Retriever.java deleted file mode 100644 index fe1023dcc9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Retriever.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -import jakarta.ejb.Stateful; - -/** - * @author pmuir - * - */ -@Stateful -public class Retriever extends Dog { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/SimpleBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/SimpleBean.java deleted file mode 100644 index 96dafdb942..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/SimpleBean.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -public class SimpleBean { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Tame.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Tame.java deleted file mode 100644 index cc854e2252..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/Tame.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Tame { - class Literal extends AnnotationLiteral implements Tame { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Bar.java deleted file mode 100644 index 5900a1705b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Bar.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition.remote; - -public interface Bar extends SuperBar { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Collie.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Collie.java deleted file mode 100644 index ec568037d4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Collie.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition.remote; - -import jakarta.ejb.Singleton; - -@Tame -@Singleton -public class Collie implements DoggieRemote { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/DogLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/DogLocal.java deleted file mode 100644 index a44a24e6aa..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/DogLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition.remote; - -import jakarta.ejb.Local; - -@Local -public interface DogLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/DogRemote.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/DogRemote.java deleted file mode 100644 index e22acb3753..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/DogRemote.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition.remote; - -import jakarta.ejb.Remote; - -@Remote -public interface DogRemote extends Bar, Foo { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/DoggieRemote.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/DoggieRemote.java deleted file mode 100644 index ed6cac702e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/DoggieRemote.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition.remote; - -import jakarta.ejb.Remote; - -@Remote -public interface DoggieRemote extends Bar, Foo { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Foo.java deleted file mode 100644 index 51615ca203..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Foo.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition.remote; - -public interface Foo { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Pitbull.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Pitbull.java deleted file mode 100644 index 387f764d8d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Pitbull.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition.remote; - -import jakarta.ejb.Local; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Named; - -@Stateful -@ApplicationScoped -@Named -@Local({ org.jboss.cdi.tck.tests.implementation.enterprise.definition.remote.Bar.class, - org.jboss.cdi.tck.tests.implementation.enterprise.definition.remote.DogLocal.class }) -public class Pitbull implements DogRemote { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/RemoteInterfaceNotInAPITypesTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/RemoteInterfaceNotInAPITypesTest.java deleted file mode 100644 index 24b2b2c361..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/RemoteInterfaceNotInAPITypesTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition.remote; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEAN_TYPES; -import static org.jboss.cdi.tck.util.Assert.assertTypeSetMatches; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Matus Abaffy - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class RemoteInterfaceNotInAPITypesTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(RemoteInterfaceNotInAPITypesTest.class).build(); - } - - @SuppressWarnings("serial") - @Test(groups = { JAVAEE_FULL }) // The test archive contains a remote EJB - @SpecAssertions({ @SpecAssertion(section = SESSION_BEAN_TYPES, id = "d"), - @SpecAssertion(section = SESSION_BEAN_TYPES, id = "c"), @SpecAssertion(section = SESSION_BEAN_TYPES, id = "aa") }) - public void testRemoteInterfacesAreNotInAPITypes() { - // only remote view - Bean collieBean = getUniqueBean(Object.class, new Tame.Literal()); - assertNotNull(collieBean); - assertTypeSetMatches(collieBean.getTypes(), Object.class); - - Bean pitbullBean = getUniqueBean(DogLocal.class); - assertNotNull(pitbullBean); - // DogLocal, Bar, SuperBar, Object - assertEquals(pitbullBean.getTypes().size(), 4); - assertTypeSetMatches(pitbullBean.getTypes(), Object.class, DogLocal.class, Bar.class, SuperBar.class); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/SuperBar.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/SuperBar.java deleted file mode 100644 index 2426d5a94b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/SuperBar.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition.remote; - -public interface SuperBar { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Tame.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Tame.java deleted file mode 100644 index 590fab246a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/definition/remote/Tame.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.definition.remote; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Tame { - class Literal extends AnnotationLiteral implements Tame { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/AlteStadt.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/AlteStadt.java deleted file mode 100644 index 9f3334cfc5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/AlteStadt.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.ejb.Local; - -@Local -public interface AlteStadt { - public String getPlaceOfInterest(); - - public void performPostConstructChecks(); - - public void initializeBean(GutenbergMuseum pointOfInterest); - - public GutenbergMuseum getAnotherPlaceOfInterest(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessor.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessor.java deleted file mode 100644 index b62f323529..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessor.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.ejb.Stateful; - -@Stateful -public class DirectOrderProcessor extends OrderProcessor implements DirectOrderProcessorLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessorLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessorLocal.java deleted file mode 100644 index ae2b294450..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessorLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.ejb.Local; - -@Local -public interface DirectOrderProcessorLocal { - void order(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java deleted file mode 100644 index de6a9cde4a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE_EE; -import static org.jboss.cdi.tck.cdi.Sections.CONTEXTUAL_REFERENCE; -import static org.jboss.cdi.tck.cdi.Sections.DEPENDENT_OBJECTS_DESTRUCTION_EE; -import static org.jboss.cdi.tck.cdi.Sections.INITIALIZER_METHODS_EE; -import static org.jboss.cdi.tck.cdi.Sections.MEMBER_LEVEL_INHERITANCE_EE; -import static org.jboss.cdi.tck.cdi.Sections.PASSIVATION_CAPABLE_DEPENDENCY_EE; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEAN_EJB_REMOVE_METHOD; -import static org.jboss.cdi.tck.cdi.Sections.STATEFUL_LIFECYCLE; -import static org.jboss.cdi.tck.cdi.Sections.STATELESS_LIFECYCLE; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.enterprise.context.spi.Context; -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Sections - * - * 6.5. Lifecycle of stateful session beans 6.6. Lifecycle of stateless session and singleton beans 6.11. Lifecycle of EJBs - * - * Mostly overlapping with other tests... - * - * @author Nicklas Karlsson - * @author David Allen - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseBeanLifecycleTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(EnterpriseBeanLifecycleTest.class) - .withBeansXml(new BeansXml(BeanDiscoveryMode.ALL)) - .build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = STATEFUL_LIFECYCLE, id = "bb"), - @SpecAssertion(section = CONTEXTUAL_REFERENCE, id = "b"), - @SpecAssertion(section = BEAN_ARCHIVE_EE, id = "ja") }) - public void testCreateSFSB() throws Exception { - GrossStadt frankfurt = getContextualReference(GrossStadt.class); - Bean stadtBean = getBeans(KleinStadt.class).iterator().next(); - assert stadtBean != null : "Expected a bean for stateful session bean Kassel"; - KleinStadt stadtInstance = getContextualReference(KleinStadt.class, new Important.Literal()); - assert stadtInstance != null : "Expected instance to be created by container"; - assert frankfurt.isKleinStadtCreated() : "PostConstruct should be invoked when bean instance is created"; - frankfurt.resetCreatedFlags(); - - // Create a second one to make sure create always does create a new session bean - KleinStadt anotherStadtInstance = getContextualReference(KleinStadt.class, new Important.Literal()); - assert anotherStadtInstance != null : "Expected second instance of session bean"; - assert frankfurt.isKleinStadtCreated(); - assert anotherStadtInstance != stadtInstance : "create() should not return same bean as before"; - - stadtInstance.setName("hometown"); - assert "hometown".equals(stadtInstance.getName()); - - // Verify that the instance returned is a proxy by checking for all local interfaces - assert getCurrentConfiguration().getBeans().isProxy(stadtInstance); - assert stadtInstance instanceof KleinStadt; - assert stadtInstance instanceof SchoeneStadt; - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = PASSIVATION_CAPABLE_DEPENDENCY_EE, id = "ac") }) - public void testSerializeSFSB() throws Exception { - - KleinStadt stadtInstance = getContextualReference(KleinStadt.class, new Important.Literal()); - - byte[] bytes = passivate(stadtInstance); - Object object = activate(bytes); - stadtInstance = (KleinStadt) object; - assert getCurrentConfiguration().getBeans().isProxy(stadtInstance); - - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = STATEFUL_LIFECYCLE, id = "bc"), - @SpecAssertion(section = STATELESS_LIFECYCLE, id = "c") }) - public void testDestroyRemovesSFSB() throws Exception { - GrossStadt frankfurt = getContextualReference(GrossStadt.class); - Bean stadtBean = getBeans(KleinStadt.class).iterator().next(); - assert stadtBean != null : "Expected a bean for stateful session bean Kassel"; - Context requestContext = getCurrentManager().getContext(RequestScoped.class); - CreationalContext creationalContext = getCurrentManager().createCreationalContext(stadtBean); - KleinStadt kassel = stadtBean.create(creationalContext); - kassel.ping(); - stadtBean.destroy(kassel, creationalContext); - - assert frankfurt.isKleinStadtDestroyed() : "Expected SFSB bean to be destroyed"; - kassel = requestContext.get(stadtBean); - assert kassel == null : "SFSB bean should not exist after being destroyed"; - // frankfurt.dispose(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = STATELESS_LIFECYCLE, id = "c"), - @SpecAssertion(section = SESSION_BEAN_EJB_REMOVE_METHOD, id = "dba") }) - public void testRemovedEjbIgnored() { - KleinStadt stadtInstance = getContextualReference(KleinStadt.class, new Important.Literal()); - assert stadtInstance != null : "Expected instance to be created by container"; - stadtInstance.setName("Kassel-Wilhelmshoehe"); - stadtInstance.zustandVergessen(); - - // Now make sure that the container does not return this instance again - KleinStadt newStadtInstance = getContextualReference(KleinStadt.class); - assert newStadtInstance != null : "Failed to get SFSB instance the second time"; - assert !"Kassel-Wilhelmshoehe".equals(newStadtInstance.getName()) : "The destroyed SFSB was not ignored"; - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = STATELESS_LIFECYCLE, id = "b") }) - public void testCreateSLSB() { - Bean stadtBean = getBeans(NeueStadt.class).iterator().next(); - assert stadtBean != null : "Expected a bean for stateful session bean Kassel"; - CreationalContext creationalContext = getCurrentManager().createCreationalContext(stadtBean); - NeueStadt stadtInstance = stadtBean.create(creationalContext); - assert stadtInstance != null : "Expected instance to be created by container"; - - // Verify that the instance returned is a proxy by checking for all local interfaces - assert stadtInstance instanceof NeueStadt; - assert stadtInstance instanceof GeschichtslosStadt; - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = INITIALIZER_METHODS_EE, id = "f") - public void testInitializerMethodsCalledWithCurrentParameterValues() { - AlteStadt alteStadt = getContextualReference(AlteStadt.class); - assert alteStadt != null : "Could not find the AlteStadt bean"; - assert alteStadt.getAnotherPlaceOfInterest() != null; - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = DEPENDENT_OBJECTS_DESTRUCTION_EE, id = "a") - public void testDependentObjectsDestroyed() { - Bean uniStadtBean = getBeans(UniStadt.class).iterator().next(); - CreationalContext creationalContext = getCurrentManager().createCreationalContext(uniStadtBean); - UniStadt marburg = uniStadtBean.create(creationalContext); - assert marburg != null : "Couldn't find the main SFSB"; - uniStadtBean.destroy(marburg, creationalContext); - GrossStadt frankfurt = getContextualReference(GrossStadt.class); - assert frankfurt.isSchlossDestroyed(); - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "bab") - public void testDirectSubClassInheritsPostConstructOnSuperclass() throws Exception { - OrderProcessor.postConstructCalled = false; - assert getBeans(DirectOrderProcessorLocal.class).size() == 1; - getContextualReference(DirectOrderProcessorLocal.class).order(); - assert OrderProcessor.postConstructCalled; - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "bad") - public void testIndirectSubClassInheritsPostConstructOnSuperclass() throws Exception { - OrderProcessor.postConstructCalled = false; - assert getBeans(OrderProcessorLocal.class).size() == 1; - getContextualReference(OrderProcessorLocal.class).order(); - assert OrderProcessor.postConstructCalled; - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "bbb") - public void testSubClassInheritsPreDestroyOnSuperclass() throws Exception { - OrderProcessor.preDestroyCalled = false; - assert getBeans(DirectOrderProcessorLocal.class).size() == 1; - Bean bean = getBeans(DirectOrderProcessorLocal.class).iterator().next(); - CreationalContext creationalContext = getCurrentManager().createCreationalContext(bean); - DirectOrderProcessorLocal instance = bean.create(creationalContext); - bean.destroy(instance, creationalContext); - assert OrderProcessor.preDestroyCalled; - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "bbd") - public void testIndirectSubClassInheritsPreDestroyOnSuperclass() throws Exception { - OrderProcessor.preDestroyCalled = false; - assert getBeans(OrderProcessorLocal.class).size() == 1; - Bean bean = getBeans(OrderProcessorLocal.class).iterator().next(); - CreationalContext creationalContext = getCurrentManager().createCreationalContext(bean); - OrderProcessorLocal instance = bean.create(creationalContext); - bean.destroy(instance, creationalContext); - assert OrderProcessor.preDestroyCalled; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/FrankfurtAmMain.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/FrankfurtAmMain.java deleted file mode 100644 index 79aa1dd532..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/FrankfurtAmMain.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.RequestScoped; - -@Stateful -@RequestScoped -public class FrankfurtAmMain implements GrossStadt { - - private boolean kleinStadtCreated = false; - private boolean kleinStadtDestroyed = false; - - public boolean isKleinStadtCreated() { - return kleinStadtCreated; - } - - public boolean isKleinStadtDestroyed() { - return kleinStadtDestroyed; - } - - public void kleinStadtCreated() { - kleinStadtCreated = true; - } - - public void kleinStadtDestroyed() { - kleinStadtDestroyed = true; - } - - public void resetCreatedFlags() { - kleinStadtCreated = false; - } - - public void resetDestroyedFlags() { - kleinStadtDestroyed = false; - } - - @Remove - public void dispose() { - } - - private boolean schlossDestroyed = false; - - public boolean isSchlossDestroyed() { - return schlossDestroyed; - } - - public void schlossDestroyed() { - schlossDestroyed = true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/GeschichtslosStadt.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/GeschichtslosStadt.java deleted file mode 100644 index e6a70a50fe..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/GeschichtslosStadt.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.ejb.Local; - -@Local -public interface GeschichtslosStadt { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Giessen.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Giessen.java deleted file mode 100644 index d868e41a17..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Giessen.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.ejb.Stateless; - -@Stateless -public class Giessen implements NeueStadt, GeschichtslosStadt { - - public void mehrBauen() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/GrossStadt.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/GrossStadt.java deleted file mode 100644 index 262906c92b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/GrossStadt.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.ejb.Local; - -@Local -public interface GrossStadt { - public void kleinStadtCreated(); - - public void kleinStadtDestroyed(); - - public boolean isKleinStadtCreated(); - - public boolean isKleinStadtDestroyed(); - - public void resetCreatedFlags(); - - public void resetDestroyedFlags(); - - public void dispose(); - - public void schlossDestroyed(); - - public boolean isSchlossDestroyed(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/GutenbergMuseum.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/GutenbergMuseum.java deleted file mode 100644 index ad4aee278d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/GutenbergMuseum.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -public class GutenbergMuseum { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Heidelburg.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Heidelburg.java deleted file mode 100644 index 8965144050..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Heidelburg.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.inject.Inject; - -@Stateful -@Important -public class Heidelburg implements KleinStadt, SchoeneStadt { - private String name; - - @Inject - private GrossStadt grossStadt; - - @PostConstruct - public void begruendet() { - grossStadt.kleinStadtCreated(); - name = "Heidelburg"; - } - - @Remove - public void zustandVergessen() { - } - - @PreDestroy - public void zustandVerloren() { - grossStadt.kleinStadtDestroyed(); - } - - public void ping() { - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Important.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Important.java deleted file mode 100644 index 633047b165..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Important.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -/** - * @author Dan Allen - */ -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -@Inherited -public @interface Important { - class Literal extends AnnotationLiteral implements Important { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/IndirectOrderProcessor.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/IndirectOrderProcessor.java deleted file mode 100644 index a7c1ddec46..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/IndirectOrderProcessor.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.ejb.Stateful; - -@Stateful -public class IndirectOrderProcessor extends IntermediateOrderProcessor implements OrderProcessorLocal { - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/IntermediateOrderProcessor.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/IntermediateOrderProcessor.java deleted file mode 100644 index fb14367c81..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/IntermediateOrderProcessor.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -public class IntermediateOrderProcessor extends OrderProcessor { - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Kassel.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Kassel.java deleted file mode 100644 index a0ab2212bc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Kassel.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; - -@Stateful -@RequestScoped -public class Kassel implements KleinStadt, SchoeneStadt { - private String name; - - @Inject - private GrossStadt grossStadt; - - @PostConstruct - public void begruendet() { - grossStadt.kleinStadtCreated(); - name = "Kassel"; - } - - @Remove - public void zustandVergessen() { - } - - @PreDestroy - public void zustandVerloren() { - grossStadt.kleinStadtDestroyed(); - } - - public void ping() { - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java deleted file mode 100644 index 914b3d4b3e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.ejb.Local; - -@Local -public interface KleinStadt { - public void begruendet(); - - public void zustandVergessen(); - - public void zustandVerloren(); - - public String getName(); - - public void setName(String name); - - public void ping(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/LandgraffenSchloss.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/LandgraffenSchloss.java deleted file mode 100644 index 742a90b896..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/LandgraffenSchloss.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.annotation.PreDestroy; -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Stateful -@Dependent -public class LandgraffenSchloss implements Schloss { - @Inject - private GrossStadt biggerCity; - - @PreDestroy - public void destructionCallback() { - biggerCity.schlossDestroyed(); - } - - @Remove - public void remove() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Mainz.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Mainz.java deleted file mode 100644 index b8a4785964..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Mainz.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.annotation.PostConstruct; -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; - -@Stateless -public class Mainz implements AlteStadt { - @Inject - private RoemerPassage placeOfInterest; - - private GutenbergMuseum anotherPlaceOfInterest; - - private String name; - - public String getPlaceOfInterest() { - return name; - } - - @PostConstruct - public void performPostConstructChecks() { - if (placeOfInterest != null) - name = placeOfInterest.getName(); - } - - @Inject - public void initializeBean(GutenbergMuseum pointOfInterest) { - this.anotherPlaceOfInterest = pointOfInterest; - } - - public GutenbergMuseum getAnotherPlaceOfInterest() { - return anotherPlaceOfInterest; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Marburg.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Marburg.java deleted file mode 100644 index 44d4085647..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Marburg.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.inject.Inject; - -@Stateful -public class Marburg implements UniStadt { - @Inject - private Schloss theCastle; - - @Remove - public void removeBean() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/NeueStadt.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/NeueStadt.java deleted file mode 100644 index bb974d7971..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/NeueStadt.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.ejb.Local; - -@Local -public interface NeueStadt { - public void mehrBauen(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/OrderProcessor.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/OrderProcessor.java deleted file mode 100644 index a45bd7f844..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/OrderProcessor.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; - -public class OrderProcessor { - public static boolean postConstructCalled = false; - - public static boolean preDestroyCalled = true; - - @PostConstruct - public void postConstruct() { - postConstructCalled = true; - } - - @PreDestroy - public void preDestroy() { - preDestroyCalled = true; - } - - public void order() { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/OrderProcessorLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/OrderProcessorLocal.java deleted file mode 100644 index d0576fcd60..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/OrderProcessorLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.ejb.Local; - -@Local -public interface OrderProcessorLocal { - void order(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/RoemerPassage.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/RoemerPassage.java deleted file mode 100644 index f06f2423bc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/RoemerPassage.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -public class RoemerPassage { - public final static String name = "RoemerPassage"; - - public String getName() { - return name; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Schloss.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Schloss.java deleted file mode 100644 index 7524265e7d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/Schloss.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.ejb.Local; - -@Local -public interface Schloss { - public void destructionCallback(); - - public void remove(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/SchoeneStadt.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/SchoeneStadt.java deleted file mode 100644 index 76bb706747..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/SchoeneStadt.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.ejb.Local; - -@Local -public interface SchoeneStadt { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/UniStadt.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/UniStadt.java deleted file mode 100644 index 844e9534b2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/lifecycle/UniStadt.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.lifecycle; - -import jakarta.ejb.Local; - -@Local -public interface UniStadt { - public void removeBean(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/DependentSessionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/DependentSessionBean.java deleted file mode 100644 index 0ed965d50d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/DependentSessionBean.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.remove; - -import jakarta.annotation.PreDestroy; -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Default; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -@Stateful -public class DependentSessionBean implements DependentSessionInterface { - @Inject - private StateKeeper stateKeeper; - - @Remove - public void remove() { - stateKeeper.setRemoveCalled(true); - } - - @Remove - public void anotherRemoveWithParameters(String reason, @Default BeanManager manager) { - stateKeeper.setRemoveCalled(true); - assert manager == null; - } - - @PreDestroy - public void markDestroyed() { - stateKeeper.setBeanDestroyed(true); - } - - public void businessMethod() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java deleted file mode 100644 index 531dfc1b01..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/DependentSessionInterface.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.remove; - -import jakarta.ejb.Local; -import jakarta.enterprise.inject.spi.BeanManager; - -@Local -public interface DependentSessionInterface { - public void remove(); - - public void anotherRemoveWithParameters(String reason, BeanManager manager); - - public void businessMethod(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java deleted file mode 100644 index 9b697be0f0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.remove; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEAN_EJB_REMOVE_METHOD; - -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Nicklas Karlsson - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseBeanRemoveMethodTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EnterpriseBeanRemoveMethodTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = SESSION_BEAN_EJB_REMOVE_METHOD, id = "a") - public void testApplicationMayCallAnyRemoveMethodOnDependentScopedSessionEnterpriseBeans() throws Exception { - Bean bean = getCurrentManager().getBeans(StateKeeper.class).iterator().next(); - StateKeeper stateKeeper = (StateKeeper) getCurrentManager().getReference(bean, StateKeeper.class, - getCurrentManager().createCreationalContext(bean)); - stateKeeper.setRemoveCalled(false); - - DependentSessionInterface sessionBean = getContextualReference(DependentSessionInterface.class); - sessionBean.remove(); - assert stateKeeper.isRemoveCalled(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = SESSION_BEAN_EJB_REMOVE_METHOD, id = "da") - public void testApplicationMayCallRemoveMethodOnDependentScopedSessionEnterpriseBeansButNoParametersArePassed() - throws Exception { - DependentSessionInterface sessionBean = getContextualReference(DependentSessionInterface.class); - sessionBean.anotherRemoveWithParameters("required", null); - StateKeeper stateKeeper = getContextualReference(StateKeeper.class); - assert stateKeeper.isRemoveCalled(); - } - - @Test(groups = INTEGRATION, expectedExceptions = UnsupportedOperationException.class) - @SpecAssertion(section = SESSION_BEAN_EJB_REMOVE_METHOD, id = "b") - public void testApplicationCannotCallRemoveMethodOnNonDependentScopedSessionEnterpriseBean() { - SessionScopedSessionInterface sessionBean = getContextualReference(SessionScopedSessionInterface.class); - sessionBean.remove(); - assert false : "Should never reach this assertion"; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/SessionScopedSessionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/SessionScopedSessionBean.java deleted file mode 100644 index 438f93510a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/SessionScopedSessionBean.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.remove; - -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.SessionScoped; - -@SuppressWarnings("serial") -@Stateful -@SessionScoped -public class SessionScopedSessionBean implements SessionScopedSessionInterface { - - @Remove - public void remove() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/SessionScopedSessionInterface.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/SessionScopedSessionInterface.java deleted file mode 100644 index 2cde237540..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/SessionScopedSessionInterface.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.remove; - -import java.io.Serializable; - -import jakarta.ejb.Local; - -@Local -public interface SessionScopedSessionInterface extends Serializable { - public void remove(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/StateKeeper.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/StateKeeper.java deleted file mode 100644 index df9d2cfaf4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/enterprise/remove/StateKeeper.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.enterprise.remove; - -import java.io.Serializable; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class StateKeeper implements Serializable { - /** - * - */ - private static final long serialVersionUID = -7168331316716402245L; - private boolean removeCalled = false; - private boolean beanDestroyed = false; - - public boolean isRemoveCalled() { - return removeCalled; - } - - public void setRemoveCalled(boolean removeCalled) { - this.removeCalled = removeCalled; - } - - public boolean isBeanDestroyed() { - return beanDestroyed; - } - - public void setBeanDestroyed(boolean beanDestroyed) { - this.beanDestroyed = beanDestroyed; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/initializer/ejb/AndalusianChicken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/initializer/ejb/AndalusianChicken.java deleted file mode 100644 index b11bfd902b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/initializer/ejb/AndalusianChicken.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.initializer.ejb; - -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; - -@Stateless -public class AndalusianChicken implements LocalChicken { - - public static boolean nonBusinessMethodCalled = false; - - public void firstBusinessMethod() { - } - - @Inject - public void nonBusinessMethod() { - nonBusinessMethodCalled = true; - } - - public void cluck() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/initializer/ejb/EjbInitializerMethodTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/initializer/ejb/EjbInitializerMethodTest.java deleted file mode 100644 index 1a6133176f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/initializer/ejb/EjbInitializerMethodTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.initializer.ejb; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.INITIALIZER_METHODS_EE; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EjbInitializerMethodTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EjbInitializerMethodTest.class) - .build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = INITIALIZER_METHODS_EE, id = "e") }) - // This DOES NOT TEST initializer methods on Java EE component classes PLM - public void testInitializerMethodNotABusinessMethod() { - AndalusianChicken.nonBusinessMethodCalled = false; - getContextualReference(LocalChicken.class).cluck(); - assert AndalusianChicken.nonBusinessMethodCalled; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/initializer/ejb/LocalChicken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/initializer/ejb/LocalChicken.java deleted file mode 100644 index a8d0b6250d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/initializer/ejb/LocalChicken.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.initializer.ejb; - -import jakarta.ejb.Local; - -@Local -public interface LocalChicken { - public void firstBusinessMethod(); - - public void cluck(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/FooLocal_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/FooLocal_Broken.java deleted file mode 100644 index d528e5e4a7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/FooLocal_Broken.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.field.definition.broken.enterprise.nonstatic; - -import jakarta.ejb.Local; - -@Local -public interface FooLocal_Broken { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/Foo_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/Foo_Broken.java deleted file mode 100644 index 85c55472fb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/Foo_Broken.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.field.definition.broken.enterprise.nonstatic; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.inject.Produces; - -@Stateless -public class Foo_Broken implements FooLocal_Broken { - @Produces - @Number - Integer zero = 0; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/NonStaticFieldOfSessionBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/NonStaticFieldOfSessionBeanTest.java deleted file mode 100644 index 5ae9aa4ad8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/NonStaticFieldOfSessionBeanTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.field.definition.broken.enterprise.nonstatic; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_PRODUCER_FIELD_EE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class NonStaticFieldOfSessionBeanTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(NonStaticFieldOfSessionBeanTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = DECLARING_PRODUCER_FIELD_EE, id = "a") - public void testNonStaticFieldOfSessionBeanCannotBeProducerField() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/Number.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/Number.java deleted file mode 100644 index 066f4fc92e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/broken/enterprise/nonstatic/Number.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.field.definition.broken.enterprise.nonstatic; - -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.Retention; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Qualifier -public @interface Number { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/Chicken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/Chicken.java deleted file mode 100644 index 8e8b64f008..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/Chicken.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.field.definition.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Produces; - -@Stateful -public class Chicken implements ChickenLocal { - - public static final int SIZE = 5; - - @Produces - @Foo - private static Egg egg = new Egg(SIZE); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/ChickenLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/ChickenLocal.java deleted file mode 100644 index 03d1178e6b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/ChickenLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.field.definition.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface ChickenLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/Egg.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/Egg.java deleted file mode 100644 index 42597099fd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/Egg.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.field.definition.enterprise; - -public class Egg { - - private final int size; - - public Egg(int size) { - super(); - this.size = size; - } - - /** - * @return the size - */ - public int getSize() { - return size; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/EnterpriseProducerFieldDefinitionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/EnterpriseProducerFieldDefinitionTest.java deleted file mode 100644 index 3113be2cc0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/EnterpriseProducerFieldDefinitionTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.field.definition.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PRODUCER_FIELD; -import static org.jboss.cdi.tck.cdi.Sections.PRODUCER_FIELD_EE; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseProducerFieldDefinitionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EnterpriseProducerFieldDefinitionTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = PRODUCER_FIELD, id = "a"), - @SpecAssertion(section = PRODUCER_FIELD_EE, id = "a") }) - public void testStaticProducerField() { - assert getContextualReference(Egg.class, new Foo.Literal()) != null; - assert getContextualReference(Egg.class, new Foo.Literal()).getSize() == Chicken.SIZE; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/Foo.java deleted file mode 100644 index b3a9c0be60..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/field/definition/enterprise/Foo.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.field.definition.enterprise; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Foo { - class Literal extends AnnotationLiteral implements Foo { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/Foo.java deleted file mode 100644 index fda519750f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/Foo.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.broken.enterprise.nonbusiness; - -public class Foo { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/FooProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/FooProducer.java deleted file mode 100644 index 3cce5809ee..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/FooProducer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.broken.enterprise.nonbusiness; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Produces; - -@Stateful -public class FooProducer implements FooProducerLocal { - @Produces - Foo createFoo() { - return new Foo(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/FooProducerLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/FooProducerLocal.java deleted file mode 100644 index ef951fd4c0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/FooProducerLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.broken.enterprise.nonbusiness; - -import jakarta.ejb.Local; - -@Local -public interface FooProducerLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/ProducerMethodNotBusinessMethodTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/ProducerMethodNotBusinessMethodTest.java deleted file mode 100644 index 091059dbf8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/ProducerMethodNotBusinessMethodTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.broken.enterprise.nonbusiness; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_PRODUCER_METHOD_EE; -import static org.jboss.cdi.tck.cdi.Sections.PRODUCER_METHOD_EE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class ProducerMethodNotBusinessMethodTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ProducerMethodNotBusinessMethodTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = DECLARING_PRODUCER_METHOD_EE, id = "a"), - @SpecAssertion(section = PRODUCER_METHOD_EE, id = "a") }) - public void testProducerMethodOnSessionBeanMustBeBusinessMethod() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/Foo.java deleted file mode 100644 index 8c25b298af..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/Foo.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2016, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.broken.enterprise.remoteMethod; - -public class Foo { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/FooProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/FooProducer.java deleted file mode 100644 index b9f3357e1b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/FooProducer.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2016, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.broken.enterprise.remoteMethod; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Produces; - -@Stateful -public class FooProducer implements FooProducerRemote { - - @Produces - public Foo createFoo() { - return new Foo(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/FooProducerRemote.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/FooProducerRemote.java deleted file mode 100644 index 617b15e6d5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/FooProducerRemote.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.broken.enterprise.remoteMethod; - -import jakarta.ejb.Remote; - -@Remote -public interface FooProducerRemote { - - Foo createFoo(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/RemoteBusinessProducerMethodTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/RemoteBusinessProducerMethodTest.java deleted file mode 100644 index 9086b72bb6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/broken/enterprise/remoteMethod/RemoteBusinessProducerMethodTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2016, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.broken.enterprise.remoteMethod; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_PRODUCER_METHOD_EE; -import static org.jboss.cdi.tck.cdi.Sections.PRODUCER_METHOD_EE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class RemoteBusinessProducerMethodTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(RemoteBusinessProducerMethodTest.class).build(); - } - - @Test(groups = { INTEGRATION, JAVAEE_FULL }) - @SpecAssertion(section = DECLARING_PRODUCER_METHOD_EE, id = "a") - @SpecAssertion(section = PRODUCER_METHOD_EE, id = "a") - public void producerMethodOnSessionBeanCannotBeRemoteBusinessMethod() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChicken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChicken.java deleted file mode 100644 index 8ea2a5c486..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChicken.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Specializes; - -@Stateful -@Specializes -public class AndalusianChicken extends Chicken implements AndalusianChickenLocal, ChickenLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChickenLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChickenLocal.java deleted file mode 100644 index 091e7bb98b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AndalusianChickenLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface AndalusianChickenLocal extends ChickenLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Apple.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Apple.java deleted file mode 100644 index 8639925075..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Apple.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -public class Apple { - private AppleTree tree; - - public Apple(AppleTree tree) { - this.tree = tree; - } - - public AppleTree getTree() { - return tree; - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AppleTree.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AppleTree.java deleted file mode 100644 index 52a5c958f1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AppleTree.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Produces; - -@Stateful -public class AppleTree implements AppleTreeLocal { - @Produces - @Yummy - public Apple produceApple() { - return new Apple(this); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AppleTreeLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AppleTreeLocal.java deleted file mode 100644 index dacc5f7f06..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/AppleTreeLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface AppleTreeLocal { - public Apple produceApple(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Chicken.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Chicken.java deleted file mode 100644 index 769870e6ce..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Chicken.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Produces; - -@Stateful -public class Chicken implements ChickenLocal { - - @Produces - @Yummy - public Egg produceEgg() { - return new Egg(this); - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/ChickenLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/ChickenLocal.java deleted file mode 100644 index 8b3d49dd19..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/ChickenLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface ChickenLocal { - public Egg produceEgg(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Egg.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Egg.java deleted file mode 100644 index 5653568fe9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Egg.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -public class Egg { - private final Chicken mother; - - public Egg(Chicken mother) { - this.mother = mother; - } - - public Chicken getMother() { - return mother; - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/EnterpriseProducerMethodDefinitionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/EnterpriseProducerMethodDefinitionTest.java deleted file mode 100644 index 458f37e59c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/EnterpriseProducerMethodDefinitionTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.MEMBER_LEVEL_INHERITANCE_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.util.Set; - -import jakarta.enterprise.inject.UnsatisfiedResolutionException; -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseProducerMethodDefinitionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EnterpriseProducerMethodDefinitionTest.class).build(); - } - - @Test(groups = INTEGRATION, expectedExceptions = UnsatisfiedResolutionException.class) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "dd") - public void testNonStaticProducerMethodNotInheritedBySpecializingSubclass() { - assertEquals(getBeans(Egg.class, new Yummy.Literal()).size(), 0); - getContextualReference(Egg.class, new Yummy.Literal()).getMother(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "dd") - public void testNonStaticProducerMethodNotInherited() { - assertEquals(getBeans(Apple.class, new Yummy.Literal()).size(), 1); - assertTrue(getContextualReference(Apple.class, new Yummy.Literal()).getTree() instanceof AppleTree); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "dj") - public void testNonStaticProducerMethodNotIndirectlyInherited() { - Set> beans = getBeans(Pear.class, new Yummy.Literal()); - assertEquals(beans.size(), 2); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/GrannySmithAppleTree.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/GrannySmithAppleTree.java deleted file mode 100644 index b4d1e246a6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/GrannySmithAppleTree.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class GrannySmithAppleTree extends AppleTree implements AppleTreeLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/LightYellow.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/LightYellow.java deleted file mode 100644 index 26cb6e1114..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/LightYellow.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface LightYellow { - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/LightYellowPearTree.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/LightYellowPearTree.java deleted file mode 100644 index cac978afd3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/LightYellowPearTree.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Produces; - -@Stateful -public class LightYellowPearTree extends YellowPearTree implements LightYellowPearTreeLocal { - @Produces - @Yummy - @LightYellow - public Pear produceLightYellowPear() { - return new Pear("lightYellow"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/LightYellowPearTreeLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/LightYellowPearTreeLocal.java deleted file mode 100644 index 64f989db7b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/LightYellowPearTreeLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface LightYellowPearTreeLocal extends PearTreeLocal { - Pear produceLightYellowPear(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Pear.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Pear.java deleted file mode 100644 index bb5f167898..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Pear.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -public class Pear { - private String colour; - - public Pear(String colour) { - this.colour = colour; - } - - public String getColour() { - return colour; - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/PearTree.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/PearTree.java deleted file mode 100644 index 5586b48e49..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/PearTree.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Produces; - -@Stateful -public class PearTree implements PearTreeLocal { - @Produces - @Yummy - public Pear producePear() { - return new Pear("green"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/PearTreeLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/PearTreeLocal.java deleted file mode 100644 index 2176dbf36b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/PearTreeLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface PearTreeLocal { - Pear producePear(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/YellowPearTree.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/YellowPearTree.java deleted file mode 100644 index 4cce8d66ab..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/YellowPearTree.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -import jakarta.ejb.Stateful; - -@Stateful -public class YellowPearTree extends PearTree { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Yummy.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Yummy.java deleted file mode 100644 index 2791da7086..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/producer/method/definition/enterprise/Yummy.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.producer.method.definition.enterprise; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Yummy { - class Literal extends AnnotationLiteral implements Yummy { - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/EnterpriseBeanNotDiscoveredAsManagedBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/EnterpriseBeanNotDiscoveredAsManagedBeanTest.java deleted file mode 100644 index eef9624d24..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/EnterpriseBeanNotDiscoveredAsManagedBeanTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.definition.ee; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.WHAT_CLASSES_ARE_BEANS_EE; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.implementation.simple.definition.ClovenHoved; -import org.jboss.cdi.tck.tests.implementation.simple.definition.Sheep; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseBeanNotDiscoveredAsManagedBeanTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(EnterpriseBeanNotDiscoveredAsManagedBeanTest.class) - .withClasses(EnterpriseBeanObserver.class, Sheep.class, MockEnterpriseBean.class, ClovenHoved.class) - .withExtension(EnterpriseBeanObserver.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = WHAT_CLASSES_ARE_BEANS_EE, id = "a") - public void testClassesImplementingEnterpriseBeanInterfaceNotDiscoveredAsSimpleBean() { - assert !EnterpriseBeanObserver.observedEnterpriseBean; - assert EnterpriseBeanObserver.observedAnotherBean; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/EnterpriseBeanObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/EnterpriseBeanObserver.java deleted file mode 100644 index 69ff24d7cf..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/EnterpriseBeanObserver.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.definition.ee; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessManagedBean; - -import org.jboss.cdi.tck.tests.implementation.simple.definition.Sheep; - -public class EnterpriseBeanObserver implements Extension { - - public static boolean observedEnterpriseBean; - public static boolean observedAnotherBean; - - public void observeAnotherBean(@Observes ProcessManagedBean event) { - observedAnotherBean = true; - } - - public void observeEnterpriseBean(@Observes ProcessManagedBean event) { - observedEnterpriseBean = true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockEnterpriseBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockEnterpriseBean.java deleted file mode 100644 index 2e6e1fc587..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockEnterpriseBean.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.definition.ee; - -import jakarta.ejb.EnterpriseBean; -import jakarta.ejb.Stateless; - -/** - * This mock originally implemented {@link EnterpriseBean} - does not correspond to relevant assertion. - */ -@Stateless -public class MockEnterpriseBean { - - /** - * - */ - private static final long serialVersionUID = -2903748486907540813L; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockServlet.java deleted file mode 100644 index 1e1918bd44..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockServlet.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.definition.ee; - -import java.io.IOException; - -import jakarta.servlet.Servlet; -import jakarta.servlet.ServletConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; - -public class MockServlet implements Servlet { - - public void destroy() { - - } - - public ServletConfig getServletConfig() { - return null; - } - - public String getServletInfo() { - return null; - } - - public void init(ServletConfig arg0) throws ServletException { - - } - - public void service(ServletRequest arg0, ServletResponse arg1) throws ServletException, IOException { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockServletContextListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockServletContextListener.java deleted file mode 100644 index 7d376ea7b6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockServletContextListener.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.definition.ee; - -import jakarta.servlet.ServletContextEvent; -import jakarta.servlet.ServletContextListener; - -public class MockServletContextListener implements ServletContextListener { - - public void contextDestroyed(ServletContextEvent arg0) { - - } - - public void contextInitialized(ServletContextEvent arg0) { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockServletRequestListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockServletRequestListener.java deleted file mode 100644 index 4e79f86157..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockServletRequestListener.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.definition.ee; - -import jakarta.servlet.ServletRequestEvent; -import jakarta.servlet.ServletRequestListener; - -public class MockServletRequestListener implements ServletRequestListener { - - public void requestDestroyed(ServletRequestEvent arg0) { - - } - - public void requestInitialized(ServletRequestEvent arg0) { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockUIComponent.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockUIComponent.java deleted file mode 100644 index 4f0dc7502c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/definition/ee/MockUIComponent.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.definition.ee; - -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import jakarta.faces.component.UIComponent; -import jakarta.faces.context.FacesContext; -import jakarta.faces.el.ValueBinding; -import jakarta.faces.event.AbortProcessingException; -import jakarta.faces.event.FacesEvent; -import jakarta.faces.event.FacesListener; -import jakarta.faces.render.Renderer; - -public class MockUIComponent extends UIComponent { - - @Override - protected void addFacesListener(FacesListener arg0) { - - } - - @Override - public void broadcast(FacesEvent arg0) throws AbortProcessingException { - - } - - @Override - public void decode(FacesContext arg0) { - - } - - @Override - public void encodeBegin(FacesContext arg0) throws IOException { - - } - - @Override - public void encodeChildren(FacesContext arg0) throws IOException { - - } - - @Override - public void encodeEnd(FacesContext arg0) throws IOException { - - } - - @Override - public UIComponent findComponent(String arg0) { - return null; - } - - @Override - public Map getAttributes() { - return null; - } - - @Override - public int getChildCount() { - return 0; - } - - @Override - public List getChildren() { - return null; - } - - @Override - public String getClientId(FacesContext arg0) { - return null; - } - - @Override - protected FacesContext getFacesContext() { - return null; - } - - @Override - protected FacesListener[] getFacesListeners(Class arg0) { - return null; - } - - @Override - public UIComponent getFacet(String arg0) { - return null; - } - - @Override - public Map getFacets() { - return null; - } - - @Override - public Iterator getFacetsAndChildren() { - return null; - } - - @Override - public String getFamily() { - return null; - } - - @Override - public String getId() { - return null; - } - - @Override - public UIComponent getParent() { - return null; - } - - @Override - protected Renderer getRenderer(FacesContext arg0) { - return null; - } - - @Override - public String getRendererType() { - return null; - } - - @Override - public boolean getRendersChildren() { - return false; - } - - @Override - public ValueBinding getValueBinding(String arg0) { - return null; - } - - @Override - public boolean isRendered() { - return false; - } - - @Override - public void processDecodes(FacesContext arg0) { - - } - - @Override - public void processRestoreState(FacesContext arg0, Object arg1) { - - } - - @Override - public Object processSaveState(FacesContext arg0) { - return null; - } - - @Override - public void processUpdates(FacesContext arg0) { - - } - - @Override - public void processValidators(FacesContext arg0) { - - } - - @Override - public void queueEvent(FacesEvent arg0) { - - } - - @Override - protected void removeFacesListener(FacesListener arg0) { - - } - - @Override - public void setId(String arg0) { - - } - - @Override - public void setParent(UIComponent arg0) { - - } - - @Override - public void setRendered(boolean arg0) { - - } - - @Override - public void setRendererType(String arg0) { - - } - - @Override - public void setValueBinding(String arg0, ValueBinding arg1) { - - } - - public boolean isTransient() { - return false; - } - - public void restoreState(FacesContext arg0, Object arg1) { - - } - - public Object saveState(FacesContext arg0) { - return null; - } - - public void setTransient(boolean arg0) { - - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/IntrospectServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/IntrospectServlet.java deleted file mode 100644 index 8fd44fda0a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/IntrospectServlet.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.ee.components; - -import java.io.IOException; -import java.util.UUID; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.Event; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.Any; -import jakarta.enterprise.inject.Default; -import jakarta.enterprise.inject.Disposes; -import jakarta.enterprise.inject.Instance; -import jakarta.enterprise.inject.Produces; -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.jboss.cdi.tck.tests.implementation.simple.ee.components.Tame.TameLiteral; -import org.jboss.cdi.tck.tests.implementation.simple.ee.components.Wild.WildLiteral; -import org.jboss.cdi.tck.util.ActionSequence; - -/** - * This servlet is also registered as dependent bean with producer method, field, observer method and disposer method. - */ -@SuppressWarnings("serial") -@WebServlet("/test") -@Dependent -public class IntrospectServlet extends HttpServlet { - - public static final String MODE_INJECT = "inject"; - - public static final String MODE_PRODUCER_METHOD = "pm"; - - public static final String MODE_PRODUCER_FIELD = "pf"; - - public static final String MODE_DISPOSER_METHOD = "dm"; - - public static final String MODE_OBSERVER_METHOD = "om"; - - private String id = null; - - @Inject - @Any - Instance pingInstance; - - @Inject - @Any - Event pingEvent; - - @Produces - @Wild - @Dependent - Ping ping; - - @PostConstruct - public void init() { - // Both, servlet component and CDI bean support PostConstruct callback - id = UUID.randomUUID().toString(); - // Init producer field - ping = new Ping(id); - } - - @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - resp.setContentType("text/text"); - String mode = req.getParameter("mode"); - - if (MODE_INJECT.equals(mode)) { - resp.getWriter().println(pingInstance.select(Default.Literal.INSTANCE).get().pong() + ":" + getId()); - } else if (MODE_PRODUCER_METHOD.equals(mode)) { - resp.getWriter().println(pingInstance.select(TameLiteral.INSTANCE).get().getTestServletId() + ":" + getId()); - } else if (MODE_PRODUCER_FIELD.equals(mode)) { - resp.getWriter().println(pingInstance.select(WildLiteral.INSTANCE).get().getTestServletId() + ":" + getId()); - } else if (MODE_OBSERVER_METHOD.equals(mode)) { - pingEvent.select(Default.Literal.INSTANCE).fire(new Ping()); - resp.getWriter().println(ActionSequence.getSequenceData().get(0) + ":" + getId()); - } else if (MODE_DISPOSER_METHOD.equals(mode)) { - pingEvent.select(WildLiteral.INSTANCE).fire(new Ping()); - resp.getWriter().println(ActionSequence.getSequenceData().get(0) + ":" + getId()); - } else { - throw new ServletException("Unknown mode"); - } - } - - @Tame - @Produces - @Dependent - public Ping procudeTamePing() { - return new Ping(getId()); - } - - public void disposeTamePing(@Disposes @Tame Ping ping) { - storeCdiBeanId(); - } - - public void observePing(@Observes Ping ping) { - storeCdiBeanId(); - } - - /** - * - * @param ping - * @param tamePing Destroyed after observer method invocation - */ - public void observeWildPing(@Observes @Wild Ping ping, @Tame Ping tamePing) { - // Simple auxiliary observer to test the disposer method - } - - /** - * @return id of servlet component or CDI bean - */ - public String getId() { - return id; - } - - private void storeCdiBeanId() { - ActionSequence.reset(); - ActionSequence.addAction(this.id); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/JavaEEComponentsTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/JavaEEComponentsTest.java deleted file mode 100644 index d80fb46dae..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/JavaEEComponentsTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.ee.components; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.JAVAEE_COMPONENTS; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotEquals; - -import java.net.URL; -import java.util.Arrays; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - * Right now only Servlet Java EE component is tested. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -@Test(groups = INTEGRATION) -public class JavaEEComponentsTest extends AbstractTest { - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(JavaEEComponentsTest.class).build(); - } - - @ArquillianResource - private URL contextPath; - - @Test - @SpecAssertions({ @SpecAssertion(section = JAVAEE_COMPONENTS, id = "a") }) - public void testComponentInject() throws Exception { - assertComponentInstancesNotEqual(IntrospectServlet.MODE_INJECT); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = JAVAEE_COMPONENTS, id = "b") }) - public void testComponentProducerMethod() throws Exception { - assertComponentInstancesNotEqual(IntrospectServlet.MODE_PRODUCER_METHOD); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = JAVAEE_COMPONENTS, id = "c") }) - public void testComponentProducerField() throws Exception { - assertComponentInstancesNotEqual(IntrospectServlet.MODE_PRODUCER_FIELD); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = JAVAEE_COMPONENTS, id = "d") }) - public void testComponentObserverMethod() throws Exception { - assertComponentInstancesNotEqual(IntrospectServlet.MODE_OBSERVER_METHOD); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = JAVAEE_COMPONENTS, id = "e") }) - public void testComponentDisposerMethod() throws Exception { - assertComponentInstancesNotEqual(IntrospectServlet.MODE_DISPOSER_METHOD); - } - - private void assertComponentInstancesNotEqual(String mode) throws Exception { - WebClient webClient = new WebClient(); - TextPage page = webClient.getPage(contextPath + "test?mode=" + mode); - String[] ids = page.getContent().split(":"); - System.out.println(Arrays.toString(ids)); - assertEquals(ids.length, 2); - assertNotEquals(ids[0], ids[1]); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/Ping.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/Ping.java deleted file mode 100644 index dcb231a9cf..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/Ping.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.ee.components; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; - -@RequestScoped -public class Ping { - - private String testServletId; - - @Inject - IntrospectServlet servlet; - - public Ping() { - } - - public Ping(String testServletId) { - this.testServletId = testServletId; - } - - public String pong() { - return servlet.getId(); - } - - public String getTestServletId() { - return testServletId; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/Tame.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/Tame.java deleted file mode 100644 index 360977dece..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/Tame.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.ee.components; - -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.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Qualifier -public @interface Tame { - - @SuppressWarnings("all") - public static class TameLiteral extends AnnotationLiteral implements Tame { - - private static final long serialVersionUID = 1L; - - public static final Tame INSTANCE = new TameLiteral(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/Wild.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/Wild.java deleted file mode 100644 index 5245308e76..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/ee/components/Wild.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.ee.components; - -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.Retention; -import java.lang.annotation.Target; - -import jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Qualifier -public @interface Wild { - - @SuppressWarnings("all") - public static class WildLiteral extends AnnotationLiteral implements Wild { - - private static final long serialVersionUID = 1L; - - public static final Wild INSTANCE = new WildLiteral(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/name/Another.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/name/Another.java deleted file mode 100644 index 56a63ce499..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/name/Another.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.name; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Another { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/name/ResourceDefinitionWithNameTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/name/ResourceDefinitionWithNameTest.java deleted file mode 100644 index 1bab2e6244..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/name/ResourceDefinitionWithNameTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.name; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_RESOURCE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class ResourceDefinitionWithNameTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ResourceDefinitionWithNameTest.class).build(); - } - - @Test - @SpecAssertion(section = DECLARING_RESOURCE, id = "i") - public void testDeployment() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/name/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/name/ResourceProducer.java deleted file mode 100644 index 9cd6e6f263..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/name/ResourceProducer.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.name; - -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Named; - -@Dependent -public class ResourceProducer { - - @SuppressWarnings("unused") - @Named - @Another - @Produces - @Resource(lookup = "java:comp/BeanManager") - private BeanManager manager; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/Another.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/Another.java deleted file mode 100644 index 89a4691340..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/Another.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Another { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ResourceDefinitionWithDifferentTypeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ResourceDefinitionWithDifferentTypeTest.java deleted file mode 100644 index 55d3f22894..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ResourceDefinitionWithDifferentTypeTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_RESOURCE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -@Test(groups = { INTEGRATION }) -public class ResourceDefinitionWithDifferentTypeTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ResourceDefinitionWithDifferentTypeTest.class).build(); - } - - @Test - @SpecAssertion(section = DECLARING_RESOURCE, id = "j") - public void testDeployment() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ResourceProducer.java deleted file mode 100644 index d02c52a4b7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ResourceProducer.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type; - -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class ResourceProducer { - - @SuppressWarnings("unused") - @Another - @Produces - @Resource(lookup = "java:comp/BeanManager") - private String manager; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/Bean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/Bean.java deleted file mode 100644 index bd7528f9cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/Bean.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type.ejb; - -import jakarta.ejb.Stateful; - -@Stateful(name = "Bean") -public class Bean implements BeanRemote { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/BeanRemote.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/BeanRemote.java deleted file mode 100644 index 72dbdb19b9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/BeanRemote.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type.ejb; - -import jakarta.ejb.Remote; - -@Remote -public interface BeanRemote { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/Lazy.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/Lazy.java deleted file mode 100644 index 731f51e399..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/Lazy.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type.ejb; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Lazy { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/ResourceDefinitionWithDifferentTypeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/ResourceDefinitionWithDifferentTypeTest.java deleted file mode 100644 index 1ec52a0486..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/ResourceDefinitionWithDifferentTypeTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type.ejb; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_RESOURCE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ResourceDefinitionWithDifferentTypeTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withName("ResourceDefinitionWithDifferentTypeTestEJB.war") - .withTestClassPackage(ResourceDefinitionWithDifferentTypeTest.class).build(); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = DECLARING_RESOURCE, id = "j") - public void testDeployment() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/ResourceProducer.java deleted file mode 100644 index 9df80273b1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/ejb/ResourceProducer.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type.ejb; - -import jakarta.ejb.EJB; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class ResourceProducer { - - @Produces - @EJB(lookup = "java:global/ResourceDefinitionWithDifferentTypeTestEJB/Bean!org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type.ejb.BeanRemote") - @Lazy - Integer remoteBean; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/env/Greeting.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/env/Greeting.java deleted file mode 100644 index 07764b157b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/env/Greeting.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type.env; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Greeting { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/env/ResourceDefinitionWithDifferentTypeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/env/ResourceDefinitionWithDifferentTypeTest.java deleted file mode 100644 index fdc248cdd3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/env/ResourceDefinitionWithDifferentTypeTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type.env; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_RESOURCE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ResourceDefinitionWithDifferentTypeTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(ResourceDefinitionWithDifferentTypeTest.class) - .withWebXml( - Descriptors.create(WebAppDescriptor.class).createEnvEntry().envEntryName("greeting") - .envEntryType("java.lang.String").envEntryValue("Hello!").up()) - .build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = DECLARING_RESOURCE, id = "j") - public void testDeployment() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/env/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/env/ResourceProducer.java deleted file mode 100644 index 9dfe363fcc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/env/ResourceProducer.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type.env; - -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class ResourceProducer { - - @Produces - @Greeting - @Resource(name = "greeting") - Double greeting; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/context/Database.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/context/Database.java deleted file mode 100644 index a7cfcc02d5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/context/Database.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type.persistence.context; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Database { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/context/ResourceDefinitionWithDifferentTypeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/context/ResourceDefinitionWithDifferentTypeTest.java deleted file mode 100644 index b888ed07b2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/context/ResourceDefinitionWithDifferentTypeTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type.persistence.context; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_RESOURCE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ResourceDefinitionWithDifferentTypeTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ResourceDefinitionWithDifferentTypeTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = DECLARING_RESOURCE, id = "j") - public void testDeployment() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/context/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/context/ResourceProducer.java deleted file mode 100644 index 08366bed41..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/context/ResourceProducer.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type.persistence.context; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; -import jakarta.persistence.PersistenceContext; - -import org.jboss.cdi.tck.tests.implementation.simple.resource.persistenceContext.Database; - -@Dependent -public class ResourceProducer { - - @Produces - @Database - @PersistenceContext - String persistenceContext; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/unit/Database.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/unit/Database.java deleted file mode 100644 index 3db6e74e72..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/unit/Database.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type.persistence.unit; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Database { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/unit/ResourceDefinitionWithDifferentTypeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/unit/ResourceDefinitionWithDifferentTypeTest.java deleted file mode 100644 index cfb5ebb812..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/unit/ResourceDefinitionWithDifferentTypeTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type.persistence.unit; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_RESOURCE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ResourceDefinitionWithDifferentTypeTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ResourceDefinitionWithDifferentTypeTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = DECLARING_RESOURCE, id = "j") - public void testDeployment() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/unit/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/unit/ResourceProducer.java deleted file mode 100644 index 50e98c7f4f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/broken/type/persistence/unit/ResourceProducer.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.broken.type.persistence.unit; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; -import jakarta.persistence.PersistenceUnit; - -import org.jboss.cdi.tck.tests.implementation.simple.resource.persistenceContext.Database; - -@Dependent -public class ResourceProducer { - - @Produces - @Database - @PersistenceUnit - Number persistenceUnit; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/AnotherInterface.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/AnotherInterface.java deleted file mode 100644 index b86e12eedc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/AnotherInterface.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.ejb; - -public interface AnotherInterface { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/Bean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/Bean.java deleted file mode 100644 index fef36d85e9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/Bean.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.ejb; - -import jakarta.annotation.PreDestroy; -import jakarta.annotation.Resource; -import jakarta.ejb.Remove; -import jakarta.ejb.Stateful; -import jakarta.ejb.TransactionManagement; -import jakarta.ejb.TransactionManagementType; -import jakarta.inject.Inject; -import jakarta.transaction.SystemException; -import jakarta.transaction.UserTransaction; - -@Stateful -@TransactionManagement(TransactionManagementType.BEAN) -public class Bean implements BeanRemote { - private int knocks = 0; - - private @Inject Monitor monitor; - - private @Resource UserTransaction transaction; - - public String knockKnock() { - knocks++; - return "We're home"; - } - - public int getKnocks() { - return knocks; - } - - public boolean isUserTransactionInjected() { - try { - if (transaction != null) { - transaction.getStatus(); - return true; - } - } catch (SystemException e) { - } - return false; - } - - @PreDestroy - public void cleanup() { - monitor.remoteEjbDestroyed(); - } - - @Remove - public void dispose() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/BeanRemote.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/BeanRemote.java deleted file mode 100644 index c9cb3e253b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/BeanRemote.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.ejb; - -import jakarta.ejb.Remote; - -@Remote -public interface BeanRemote extends AnotherInterface { - public String knockKnock(); - - public int getKnocks(); - - public boolean isUserTransactionInjected(); - - public void cleanup(); - - public void dispose(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/EjbInjectionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/EjbInjectionTest.java deleted file mode 100644 index ac6aee568a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/EjbInjectionTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.simple.resource.ejb; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_RESOURCE; -import static org.jboss.cdi.tck.cdi.Sections.RESOURCE_LIFECYCLE; -import static org.jboss.cdi.tck.cdi.Sections.RESOURCE_TYPES; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * EJB injection tests for simple beans. - * - * @author David Allen - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EjbInjectionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EjbInjectionTest.class).build(); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = DECLARING_RESOURCE, id = "ee"), - @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "ld"), - @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "mg") }) - public void testInjectionOfEjbs() { - Bean managedBean = getBeans(ManagedBean.class).iterator().next(); - CreationalContext creationalContext = getCurrentManager().createCreationalContext(managedBean); - ManagedBean instance = managedBean.create(creationalContext); - assert instance.getMyEjb() != null : "EJB reference was not produced and injected into bean"; - assert instance.getMyEjb().knockKnock().equals("We're home"); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "mh") }) - public void testPassivationOfEjbs() throws Exception { - Bean managedBean = getBeans(ManagedBean.class).iterator().next(); - CreationalContext creationalContext = getCurrentManager().createCreationalContext(managedBean); - ManagedBean instance = managedBean.create(creationalContext); - instance = (ManagedBean) activate(passivate(instance)); - assert instance.getMyEjb() != null : "EJB reference was not produced and injected into bean"; - assert instance.getMyEjb().knockKnock().equals("We're home"); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = RESOURCE_TYPES, id = "ad") }) - public void testResourceBeanTypes() { - @SuppressWarnings("serial") - Bean beanRemote = getBeans(BeanRemote.class, new Lazy.Literal()).iterator().next(); - assert beanRemote.getTypes().size() == 3; - assert typeSetMatches(beanRemote.getTypes(), BeanRemote.class, Object.class, AnotherInterface.class); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/Lazy.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/Lazy.java deleted file mode 100644 index a7af3770f5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/Lazy.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.ejb; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Lazy { - class Literal extends AnnotationLiteral implements Lazy { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/ManagedBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/ManagedBean.java deleted file mode 100644 index ed2ef2f831..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/ManagedBean.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.ejb; - -import java.io.Serializable; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Dependent -public class ManagedBean implements Serializable { - @Inject - @Lazy - private BeanRemote myEjb; - - public BeanRemote getMyEjb() { - return myEjb; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/Monitor.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/Monitor.java deleted file mode 100644 index 5144a31b65..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/Monitor.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.ejb; - -import java.io.Serializable; - -import jakarta.enterprise.context.RequestScoped; - -@RequestScoped -public class Monitor implements Serializable { - /** - * - */ - private static final long serialVersionUID = 4495864336368063408L; - private boolean remoteEjbDestroyed = false; - - public void remoteEjbDestroyed() { - remoteEjbDestroyed = true; - } - - public boolean isRemoteEjbDestroyed() { - return remoteEjbDestroyed; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/ResourceProducer.java deleted file mode 100644 index b4ebd5215e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/ResourceProducer.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.ejb; - -import jakarta.ejb.EJB; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class ResourceProducer { - - @EJB - @Lazy - @Produces - private BeanRemote remoteEjb; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/Bean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/Bean.java deleted file mode 100644 index 0ddb0dbf87..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/Bean.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.ejb.staticProducer; - -import jakarta.ejb.Stateful; - -@Stateful -public class Bean { - - public String knockKnock() { - return "We're home"; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/EjbInjectionStaticProducerFieldTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/EjbInjectionStaticProducerFieldTest.java deleted file mode 100644 index ee014ba01d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/EjbInjectionStaticProducerFieldTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.simple.resource.ejb.staticProducer; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_RESOURCE; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EjbInjectionStaticProducerFieldTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EjbInjectionStaticProducerFieldTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = DECLARING_RESOURCE, id = "ee") - public void testInjectionOfEjbs() { - Bean managedBean = getUniqueBean(ManagedBean.class); - CreationalContext creationalContext = getCurrentManager().createCreationalContext(managedBean); - ManagedBean instance = managedBean.create(creationalContext); - assert instance.getMyEjb() != null : "EJB reference was not produced and injected into bean"; - assert instance.getMyEjb().knockKnock().equals("We're home"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/Lazy.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/Lazy.java deleted file mode 100644 index f8b35f1b22..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/Lazy.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.ejb.staticProducer; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Lazy { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/ManagedBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/ManagedBean.java deleted file mode 100644 index f18769b686..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/ManagedBean.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.ejb.staticProducer; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Dependent -public class ManagedBean { - @Inject - @Lazy - private Bean myEjb; - - public Bean getMyEjb() { - return myEjb; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/ResourceProducer.java deleted file mode 100644 index 698efe6871..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/staticProducer/ResourceProducer.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.ejb.staticProducer; - -import jakarta.ejb.EJB; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class ResourceProducer { - @Produces - @EJB - @Lazy - private static Bean ejb; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/BooleanResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/BooleanResourceProducer.java deleted file mode 100644 index 2de8d8bcea..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/BooleanResourceProducer.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2019, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.env; - -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class BooleanResourceProducer { - @Produces - @Greeting - @Resource(name = "check") - private Boolean check; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/EnvInjectionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/EnvInjectionTest.java deleted file mode 100644 index 75b2b5e76c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/EnvInjectionTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.env; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_RESOURCE; -import static org.jboss.cdi.tck.cdi.Sections.RESOURCE_LIFECYCLE; -import static org.jboss.cdi.tck.cdi.Sections.RESOURCE_TYPES; - -import java.util.ArrayList; -import java.util.Arrays; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Environment variable injection tests for simple beans. - * - * @author Dan Allen - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class EnvInjectionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EnvInjectionTest.class).withBeansXml("beans.xml") - .withWebXml("web.xml").build(); - } - - @Test - @SpecAssertion(section = DECLARING_RESOURCE, id = "bb") - public void testInjectionOfEnv() { - Bean greetingBean = getBeans(GreetingBean.class).iterator().next(); - CreationalContext greetingBeanCc = getCurrentManager().createCreationalContext(greetingBean); - GreetingBean instance = greetingBean.create(greetingBeanCc); - assert instance.greet() != null; - assert instance.greet().equals("Hello there my friend"); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "la"), - @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "ma"), - @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "o") }) - public void testProduceEnvProxy() { - @SuppressWarnings("serial") - Bean greetingEnvBean = getBeans(String.class, new Greeting.Literal()).iterator().next(); - CreationalContext greetingEnvCc = getCurrentManager().createCreationalContext(greetingEnvBean); - String greeting = greetingEnvBean.create(greetingEnvCc); - assert greeting != null; - assert greeting.equals("Hello there my friend"); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = RESOURCE_TYPES, id = "aa") }) - public void testResourceBeanTypes() { - @SuppressWarnings("serial") - Bean check = getBeans(Boolean.class, new Greeting.Literal()).iterator().next(); - - // Build the expected types from the JVM Boolean.class to avoid issues as the java.lang types evolve - ArrayList> classes = new ArrayList<>(); - classes.addAll(Arrays.asList(Boolean.class.getInterfaces())); - classes.addAll(Arrays.asList(Boolean.class.getSuperclass())); - classes.add(Boolean.class); - Class[] expectedClasses = new Class[classes.size()]; - classes.toArray(expectedClasses); - - assert check.getTypes().size() == expectedClasses.length - : "Bean has " + expectedClasses.length + " types: " + check.getTypes(); - assert rawTypeSetMatches(check.getTypes(), expectedClasses) : "Expected classes are: " + classes; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/Greeting.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/Greeting.java deleted file mode 100644 index bc7342fc14..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/Greeting.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.env; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Greeting { - class Literal extends AnnotationLiteral implements Greeting { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/GreetingBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/GreetingBean.java deleted file mode 100644 index 1d63cf0df8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/GreetingBean.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.env; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Dependent -public class GreetingBean { - @Inject - @Greeting - private String phrase; - - public String greet() { - return phrase; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/ResourceProducer.java deleted file mode 100644 index e901fb63bf..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/ResourceProducer.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.env; - -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class ResourceProducer { - @Produces - @Greeting - @Resource(name = "greeting") - private String greeting; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/EnvInjectionStaticProducerFieldTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/EnvInjectionStaticProducerFieldTest.java deleted file mode 100644 index 88865b7067..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/EnvInjectionStaticProducerFieldTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.env.staticProducer; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_RESOURCE; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnvInjectionStaticProducerFieldTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(EnvInjectionStaticProducerFieldTest.class) - .withWebXml( - Descriptors - .create(WebAppDescriptor.class) - .createEnvEntry() - .envEntryName("greeting") - .envEntryType("java.lang.String") - .envEntryValue("Hello there my friend").up()) - .build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = DECLARING_RESOURCE, id = "bb") - public void testInjectionOfEnv() { - Bean greetingBean = getBeans(GreetingBean.class).iterator().next(); - CreationalContext greetingBeanCc = getCurrentManager().createCreationalContext(greetingBean); - GreetingBean instance = greetingBean.create(greetingBeanCc); - assert instance.greet() != null; - assert instance.greet().equals("Hello there my friend"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/Greeting.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/Greeting.java deleted file mode 100644 index 41c2c24748..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/Greeting.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.env.staticProducer; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Greeting { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/GreetingBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/GreetingBean.java deleted file mode 100644 index 4fbd3f8410..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/GreetingBean.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.env.staticProducer; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Dependent -public class GreetingBean { - @Inject - @Greeting - private String phrase; - - public String greet() { - return phrase; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/ResourceProducer.java deleted file mode 100644 index 7b00dcb53e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/env/staticProducer/ResourceProducer.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.env.staticProducer; - -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class ResourceProducer { - @Produces - @Greeting - @Resource(name = "greeting") - private static String greeting; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/Database.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/Database.java deleted file mode 100644 index 2a4021ccd7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/Database.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.persistenceContext; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Database { - class Literal extends AnnotationLiteral implements Database { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ManagedBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ManagedBean.java deleted file mode 100644 index 4fb2478c10..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ManagedBean.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.persistenceContext; - -import java.io.Serializable; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; -import jakarta.persistence.EntityManager; -import jakarta.persistence.EntityManagerFactory; - -@Dependent -public class ManagedBean implements Serializable { - @Inject - @Database - private EntityManager persistenceContext; - - @Inject - @Database - private EntityManagerFactory persistenceUnit; - - public EntityManager getPersistenceContext() { - return persistenceContext; - } - - public EntityManagerFactory getPersistenceUnit() { - return persistenceUnit; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java deleted file mode 100644 index cee0ffef9c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.persistenceContext; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.PERSISTENCE; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_RESOURCE; -import static org.jboss.cdi.tck.cdi.Sections.RESOURCE_LIFECYCLE; -import static org.jboss.cdi.tck.cdi.Sections.RESOURCE_TYPES; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.Any; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.persistence.EntityManager; -import jakarta.persistence.EntityManagerFactory; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Injection of persistence related objects. - * - * @author David Allen - * @author Martin Kouba - */ -@Test(groups = { INTEGRATION, PERSISTENCE }) -@SpecVersion(spec = "cdi", version = "2.0") -public class PersistenceContextInjectionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(PersistenceContextInjectionTest.class).withBeansXml("beans.xml") - .withDefaultPersistenceXml().build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = DECLARING_RESOURCE, id = "cc"), - @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "lb"), - @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "mc") }) - public void testInjectionOfPersistenceContext() { - ServiceBean serviceBean = getContextualReference(ServiceBean.class); - ManagedBean managedBean = serviceBean.getManagedBean(); - assert managedBean.getPersistenceContext() != null : "Persistence context was not injected into bean"; - assert serviceBean.validateEntityManager(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = DECLARING_RESOURCE, id = "dd"), - @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "lc"), - @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "me") }) - public void testInjectionOfPersistenceUnit() { - Bean managedBeanBean = getBeans(ManagedBean.class).iterator().next(); - CreationalContext managedBeanCc = getCurrentManager().createCreationalContext(managedBeanBean); - ManagedBean managedBean = managedBeanBean.create(managedBeanCc); - assert managedBean.getPersistenceUnit() != null : "Persistence unit was not injected into bean"; - assert managedBean.getPersistenceUnit().isOpen() : "Persistence unit not open injected into bean"; - } - - @Test - @SpecAssertions({ @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "md") }) - public void testPassivationOfPersistenceContext() throws Exception { - Bean managedBeanBean = getBeans(ManagedBean.class).iterator().next(); - CreationalContext managedBeanCc = getCurrentManager().createCreationalContext(managedBeanBean); - ManagedBean managedBean = managedBeanBean.create(managedBeanCc); - managedBean = (ManagedBean) activate(passivate(managedBean)); - assert managedBean.getPersistenceContext() != null : "Persistence context was not injected into bean"; - assert managedBean.getPersistenceContext().getDelegate() != null : "Persistence context not deserialized correctly"; - } - - @Test - @SpecAssertions({ @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "lc"), - @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "mf") }) - public void testPassivationOfPersistenceUnit() throws Exception { - Bean managedBeanBean = getBeans(ManagedBean.class).iterator().next(); - CreationalContext managedBeanCc = getCurrentManager().createCreationalContext(managedBeanBean); - ManagedBean managedBean = managedBeanBean.create(managedBeanCc); - managedBean = (ManagedBean) activate(passivate(managedBean)); - assert managedBean.getPersistenceUnit() != null : "Persistence unit was not injected into bean"; - assert managedBean.getPersistenceUnit().isOpen() : "Persistence unit not open injected into bean"; - } - - @Test - @SpecAssertions({ @SpecAssertion(section = DECLARING_RESOURCE, id = "hh"), - @SpecAssertion(section = RESOURCE_TYPES, id = "ab") }) - public void testBeanTypesAndBindingTypesOfPersistenceContext() { - Bean manager = getBeans(EntityManager.class, new Database.Literal()).iterator().next(); - assert manager.getTypes().size() == 3; - assert typeSetMatches(manager.getTypes(), EntityManager.class, Object.class, AutoCloseable.class); - assert manager.getQualifiers().size() == 2; - assert annotationSetMatches(manager.getQualifiers(), Any.class, Database.class); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = RESOURCE_TYPES, id = "ac") }) - public void testBeanTypesOfPersistenceUnit() { - Bean factory = getBeans(EntityManagerFactory.class, new Database.Literal()).iterator().next(); - assert factory.getTypes().size() == 3; - assert typeSetMatches(factory.getTypes(), EntityManagerFactory.class, Object.class, AutoCloseable.class); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ResourceProducer.java deleted file mode 100644 index a88734c605..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ResourceProducer.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.persistenceContext; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; -import jakarta.persistence.EntityManager; -import jakarta.persistence.EntityManagerFactory; -import jakarta.persistence.PersistenceContext; -import jakarta.persistence.PersistenceUnit; - -@Dependent -public class ResourceProducer { - @Produces - @Database - @PersistenceUnit - private EntityManagerFactory persistenceUnit; - - @Produces - @Database - @PersistenceContext - private EntityManager persistenceContext; - - /** - * @return the persistenceContext - */ - public EntityManager getPersistenceContext() { - return persistenceContext; - } - - /** - * @return the persistenceUnit - */ - public EntityManagerFactory getPersistenceUnit() { - return persistenceUnit; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ServiceBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ServiceBean.java deleted file mode 100644 index d9ced52963..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ServiceBean.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.simple.resource.persistenceContext; - -import jakarta.ejb.Local; - -/** - * @author Marius Bogoevici - */ -@Local -public interface ServiceBean { - public boolean validateEntityManager(); - - public ManagedBean getManagedBean(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ServiceBeanImpl.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ServiceBeanImpl.java deleted file mode 100644 index 21f0a178dd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/ServiceBeanImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.simple.resource.persistenceContext; - -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; -import jakarta.persistence.EntityManager; - -/** - * @author Marius Bogoevici - */ -@Stateless -public class ServiceBeanImpl implements ServiceBean { - @Inject - ManagedBean managedBean; - - public ManagedBean getManagedBean() { - return managedBean; - } - - public boolean validateEntityManager() { - boolean entityManagerValid = true; - EntityManager entityManager = managedBean.getPersistenceContext(); - assert entityManager != null; - Object delegate = entityManager.getDelegate(); - assert delegate != null; - try { - entityManager.getTransaction(); - entityManagerValid = false; - } catch (IllegalStateException e) { - // an IllegalStateException is the expected result if this is a JTA entityManager - } - try { - entityManager.close(); - entityManagerValid = false; - } catch (IllegalStateException e) { - // an IllegalStateException is the expected result if the entityManager is container-managed - } - return entityManagerValid; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/Database.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/Database.java deleted file mode 100644 index f52b951d2f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/Database.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.persistenceContext.staticProducer; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Database { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ManagedBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ManagedBean.java deleted file mode 100644 index eb123d7f21..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ManagedBean.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.persistenceContext.staticProducer; - -import java.io.Serializable; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; -import jakarta.persistence.EntityManager; -import jakarta.persistence.EntityManagerFactory; - -@Dependent -public class ManagedBean implements Serializable { - @Inject - @Database - private EntityManager persistenceContext; - - @Inject - @Database - private EntityManagerFactory persistenceUnit; - - public EntityManager getPersistenceContext() { - return persistenceContext; - } - - public EntityManagerFactory getPersistenceUnit() { - return persistenceUnit; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/PersistenceInjectionStaticProducerFieldTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/PersistenceInjectionStaticProducerFieldTest.java deleted file mode 100644 index eef87f3bca..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/PersistenceInjectionStaticProducerFieldTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.persistenceContext.staticProducer; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.PERSISTENCE; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_RESOURCE; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test producer fields with injection of persistence related objects. - * - * @author David Allen - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class PersistenceInjectionStaticProducerFieldTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(PersistenceInjectionStaticProducerFieldTest.class) - .withDefaultPersistenceXml().build(); - } - - @Test(groups = { INTEGRATION, PERSISTENCE }) - @SpecAssertion(section = DECLARING_RESOURCE, id = "cc") - public void testInjectionOfPersistenceContext() { - ServiceBean serviceBean = getContextualReference(ServiceBean.class); - ManagedBean managedBean = serviceBean.getManagedBean(); - assert managedBean.getPersistenceContext() != null : "Persistence context was not injected into bean"; - assert serviceBean.validateEntityManager(); - } - - @Test(groups = { INTEGRATION, PERSISTENCE }) - @SpecAssertion(section = DECLARING_RESOURCE, id = "dd") - public void testInjectionOfPersistenceUnit() { - Bean managedBeanBean = getBeans(ManagedBean.class).iterator().next(); - CreationalContext managedBeanCc = getCurrentManager().createCreationalContext(managedBeanBean); - ManagedBean managedBean = managedBeanBean.create(managedBeanCc); - assert managedBean.getPersistenceUnit() != null : "Persistence unit was not injected into bean"; - assert managedBean.getPersistenceUnit().isOpen() : "Persistence unit not open injected into bean"; - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ResourceProducer.java deleted file mode 100644 index 34e1cc8a28..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ResourceProducer.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.persistenceContext.staticProducer; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; -import jakarta.persistence.EntityManager; -import jakarta.persistence.EntityManagerFactory; -import jakarta.persistence.PersistenceContext; -import jakarta.persistence.PersistenceUnit; - -@Dependent -public class ResourceProducer { - @Produces - @Database - @PersistenceUnit - private static EntityManagerFactory persistenceUnit; - - @Produces - @Database - @PersistenceContext - private static EntityManager persistenceContext; - - /** - * @return the persistenceContext - */ - public EntityManager getPersistenceContext() { - return persistenceContext; - } - - /** - * @return the persistenceUnit - */ - public EntityManagerFactory getPersistenceUnit() { - return persistenceUnit; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ServiceBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ServiceBean.java deleted file mode 100644 index dc5bd51f41..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ServiceBean.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.simple.resource.persistenceContext.staticProducer; - -import jakarta.ejb.Local; - -/** - * @author Marius Bogoevici - */ -@Local -public interface ServiceBean { - public boolean validateEntityManager(); - - public ManagedBean getManagedBean(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ServiceBeanImpl.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ServiceBeanImpl.java deleted file mode 100644 index 27b110cba6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/staticProducer/ServiceBeanImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.implementation.simple.resource.persistenceContext.staticProducer; - -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; -import jakarta.persistence.EntityManager; - -/** - * @author Marius Bogoevici - */ -@Stateless -public class ServiceBeanImpl implements ServiceBean { - @Inject - ManagedBean managedBean; - - public ManagedBean getManagedBean() { - return managedBean; - } - - public boolean validateEntityManager() { - boolean entityManagerValid = true; - EntityManager entityManager = managedBean.getPersistenceContext(); - assert entityManager != null; - Object delegate = entityManager.getDelegate(); - assert delegate != null; - try { - entityManager.getTransaction(); - entityManagerValid = false; - } catch (IllegalStateException e) { - // an IllegalStateException is the expected result if this is a JTA entityManager - } - try { - entityManager.close(); - entityManagerValid = false; - } catch (IllegalStateException e) { - // an IllegalStateException is the expected result if the entityManager is container-managed - } - return entityManagerValid; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/Another.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/Another.java deleted file mode 100644 index cc8ccb6d9b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/Another.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.resource; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Another { - class Literal extends AnnotationLiteral implements Another { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/InjectionOfResourceTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/InjectionOfResourceTest.java deleted file mode 100644 index 26f750ef4a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/InjectionOfResourceTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.resource; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_RESOURCE; -import static org.jboss.cdi.tck.cdi.Sections.RESOURCE_LIFECYCLE; -import static org.jboss.cdi.tck.cdi.Sections.RESOURCE_TYPES; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.BeanContainer; -import jakarta.enterprise.inject.spi.BeanManager; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class InjectionOfResourceTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(InjectionOfResourceTest.class).withBeansXml("beans.xml").build(); - } - - @Test - @SpecAssertion(section = DECLARING_RESOURCE, id = "bb") - public void testInjectionOfResource() { - Bean managedBeanBean = getBeans(ManagedBean.class).iterator().next(); - CreationalContext managedBeanCc = getCurrentManager().createCreationalContext(managedBeanBean); - ManagedBean managedBean = managedBeanBean.create(managedBeanCc); - assert managedBean.getBeanManager() != null : "@Another Manager not found"; - } - - @Test - @SpecAssertions({ @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "la"), - @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "ma"), - @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "o") }) - public void testProduceResourceProxy() { - Bean beanManagerBean = getBeans(BeanManager.class, new Another.Literal()).iterator().next(); - CreationalContext beanManagerCc = getCurrentManager().createCreationalContext(beanManagerBean); - BeanManager beanManager = beanManagerBean.create(beanManagerCc); - assert beanManager != null; - } - - @Test - @SpecAssertions({ @SpecAssertion(section = RESOURCE_LIFECYCLE, id = "mb") }) - public void testPassivatingResource() throws Exception { - Bean managedBeanBean = getBeans(ManagedBean.class).iterator().next(); - CreationalContext managedBeanCc = getCurrentManager().createCreationalContext(managedBeanBean); - ManagedBean managedBean = managedBeanBean.create(managedBeanCc); - managedBean = (ManagedBean) activate(passivate(managedBean)); - assert managedBean.getBeanManager() != null; - } - - @Test - @SpecAssertions({ @SpecAssertion(section = RESOURCE_TYPES, id = "aa") }) - public void testResourceBeanTypes() { - Bean beanRemote = getBeans(BeanManager.class, new Another.Literal()).iterator().next(); - assert beanRemote.getTypes().size() == 3; - assert beanRemote.getTypes().contains(BeanManager.class); - assert beanRemote.getTypes().contains(BeanContainer.class); - assert beanRemote.getTypes().contains(Object.class); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/ManagedBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/ManagedBean.java deleted file mode 100644 index 95cdb5181f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/ManagedBean.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.resource; - -import java.io.Serializable; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -@Dependent -public class ManagedBean implements Serializable { - @Inject - @Another - private BeanManager beanManager; - - public BeanManager getBeanManager() { - return beanManager; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/ResourceProducer.java deleted file mode 100644 index ad2305bb59..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/ResourceProducer.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.resource; - -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; -import jakarta.enterprise.inject.spi.BeanManager; - -@Dependent -public class ResourceProducer { - @Produces - @Another - @Resource(lookup = "java:comp/BeanManager") - private BeanManager manager; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/Another.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/Another.java deleted file mode 100644 index 7a476999ae..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/Another.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.resource.staticProducer; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Another { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/InjectionOfResourceStaticProducerFieldTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/InjectionOfResourceStaticProducerFieldTest.java deleted file mode 100644 index c2edc620d3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/InjectionOfResourceStaticProducerFieldTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.resource.staticProducer; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_RESOURCE; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class InjectionOfResourceStaticProducerFieldTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(InjectionOfResourceStaticProducerFieldTest.class).build(); - } - - @Test - @SpecAssertion(section = DECLARING_RESOURCE, id = "bb") - public void testInjectionOfResource() { - Bean managedBeanBean = getBeans(ManagedBean.class).iterator().next(); - CreationalContext managedBeanCc = getCurrentManager().createCreationalContext(managedBeanBean); - ManagedBean managedBean = managedBeanBean.create(managedBeanCc); - assert managedBean.getBeanManager() != null : "@Another Manager not found"; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/ManagedBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/ManagedBean.java deleted file mode 100644 index 9d98983069..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/ManagedBean.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.resource.staticProducer; - -import java.io.Serializable; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -@Dependent -public class ManagedBean implements Serializable { - @Inject - @Another - private BeanManager beanManager; - - public BeanManager getBeanManager() { - return beanManager; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/ResourceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/ResourceProducer.java deleted file mode 100644 index 35112f6ca9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/staticProducer/ResourceProducer.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.implementation.simple.resource.resource.staticProducer; - -import jakarta.annotation.Resource; -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; -import jakarta.enterprise.inject.spi.BeanManager; - -@Dependent -public class ResourceProducer { - @Produces - @Another - @Resource(lookup = "java:comp/BeanManager") - private static BeanManager manager; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/AppleEjb.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/AppleEjb.java deleted file mode 100644 index fd64c5d30d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/AppleEjb.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.initializer; - -import java.math.BigDecimal; - -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; - -@FirstLevel -@Stateless -public class AppleEjb extends FruitEjb { - - @Inject - public void setPrice(@Expensive BigDecimal price) { - this.price = price; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Cheap.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Cheap.java deleted file mode 100644 index e298cbb82f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Cheap.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.initializer; - -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.Retention; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Qualifier -public @interface Cheap { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Citrus.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Citrus.java deleted file mode 100644 index 92a54711ac..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Citrus.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.initializer; - -@FirstLevel -public class Citrus extends Fruit { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/CitrusEjb.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/CitrusEjb.java deleted file mode 100644 index 1e37b0056b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/CitrusEjb.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.initializer; - -import jakarta.ejb.Stateless; - -@FirstLevel -@Stateless -public class CitrusEjb extends FruitEjb { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Expensive.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Expensive.java deleted file mode 100644 index 3e0dcee153..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Expensive.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.initializer; - -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.Retention; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Qualifier -public @interface Expensive { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/FirstLevel.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/FirstLevel.java deleted file mode 100644 index 5499184a7a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/FirstLevel.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.initializer; - -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.Retention; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Qualifier -public @interface FirstLevel { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Fruit.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Fruit.java deleted file mode 100644 index ad3b4617c0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Fruit.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.initializer; - -import java.math.BigDecimal; - -import jakarta.inject.Inject; - -public class Fruit { - - protected BigDecimal price; - - @Inject - public void setPrice(@Cheap BigDecimal price) { - this.price = price; - } - - public BigDecimal getPrice() { - return price; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/FruitEjb.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/FruitEjb.java deleted file mode 100644 index d08e1789a7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/FruitEjb.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.initializer; - -import java.math.BigDecimal; - -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; - -@Stateless -public class FruitEjb { - - protected BigDecimal price; - - @Inject - public void setPrice(@Cheap BigDecimal price) { - this.price = price; - } - - public BigDecimal getPrice() { - return price; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/InitializerMethodInheritanceTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/InitializerMethodInheritanceTest.java deleted file mode 100644 index 1c5b8bedc9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/InitializerMethodInheritanceTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.initializer; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.MEMBER_LEVEL_INHERITANCE; -import static org.jboss.cdi.tck.cdi.Sections.MEMBER_LEVEL_INHERITANCE_EE; -import static org.testng.Assert.assertEquals; - -import java.math.BigDecimal; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class InitializerMethodInheritanceTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(InitializerMethodInheritanceTest.class) - .withBeansXml(new BeansXml(BeanDiscoveryMode.ALL)) - .build(); - } - - @Inject - @Cheap - BigDecimal cheap; - - @Inject - @Expensive - BigDecimal expensive; - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE, id = "dm") - public void testManagedBeanDirectlyInheritsInitializer(@FirstLevel Citrus citrus) { - assertEquals(citrus.getPrice(), cheap); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE, id = "do") - public void testManagedBeanIndirectlyInheritsInitializer(@SecondLevel Orange orange, @SecondLevel Lemon lemon) { - assertEquals(orange.getPrice(), cheap); - assertEquals(lemon.getPrice(), expensive); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "dn") - public void testSessionBeanDirectlyInheritsInitializer(@FirstLevel CitrusEjb citrus, @FirstLevel AppleEjb apple) { - assertEquals(citrus.getPrice(), cheap); - assertEquals(apple.getPrice(), expensive); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "dp") - public void testSessionBeanIndirectlyInheritsInitializer(@SecondLevel OrangeEjb orange) { - assertEquals(orange.getPrice(), cheap); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Lemon.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Lemon.java deleted file mode 100644 index 2cb471a808..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Lemon.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.initializer; - -import java.math.BigDecimal; - -import jakarta.inject.Inject; - -@SecondLevel -public class Lemon extends Citrus { - - @Inject - public void setPrice(@Expensive BigDecimal price) { - this.price = price; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Orange.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Orange.java deleted file mode 100644 index 360f4eca54..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/Orange.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.initializer; - -@SecondLevel -public class Orange extends Citrus { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/OrangeEjb.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/OrangeEjb.java deleted file mode 100644 index 83d15df975..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/OrangeEjb.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.initializer; - -import jakarta.ejb.Stateless; - -@SecondLevel -@Stateless -public class OrangeEjb extends CitrusEjb { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/PriceProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/PriceProducer.java deleted file mode 100644 index 83f4d3ebce..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/PriceProducer.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.initializer; - -import java.math.BigDecimal; - -import jakarta.enterprise.inject.Produces; - -public class PriceProducer { - - @Produces - @Cheap - public BigDecimal cheap = BigDecimal.ONE; - - @Produces - @Expensive - public BigDecimal expensive = BigDecimal.TEN; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/SecondLevel.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/SecondLevel.java deleted file mode 100644 index 1be3d08f63..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/initializer/SecondLevel.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.initializer; - -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.Retention; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Qualifier -public @interface SecondLevel { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Animal.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Animal.java deleted file mode 100644 index 81aeb82eb0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Animal.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -public interface Animal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Building.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Building.java deleted file mode 100644 index 874b1b450d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Building.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Produces; - -@Stateful -public class Building implements BuildingLocal { - - @Produces - public Waste getWaste() { - return new Waste(getClassName()); - } - - public String getClassName() { - return Building.class.getName(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/BuildingLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/BuildingLocal.java deleted file mode 100644 index 32d598606c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/BuildingLocal.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface BuildingLocal { - - String getClassName(); - - public Waste getWaste(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java deleted file mode 100644 index bf44e8b94c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DIRECT_AND_INDIRECT_SPECIALIZATION_EE; -import static org.jboss.cdi.tck.cdi.Sections.SPECIALIZE_SESSION_BEAN; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; -import java.util.Set; - -import jakarta.enterprise.inject.Any; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.inject.Named; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseBeanSpecializationTest extends AbstractTest { - - @SuppressWarnings("serial") - private static Annotation LANDOWNER_LITERAL = new Landowner.Literal(); - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EnterpriseBeanSpecializationTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = DIRECT_AND_INDIRECT_SPECIALIZATION_EE, id = "ia"), - @SpecAssertion(section = SPECIALIZE_SESSION_BEAN, id = "aa") }) - public void testDirectSpecialization() { - - Set> farmerBeans = getBeans(LazyFarmerLocal.class, LANDOWNER_LITERAL); - assertEquals(farmerBeans.size(), 1); - Bean lazyFarmerBean = farmerBeans.iterator().next(); - assertEquals(lazyFarmerBean.getBeanClass(), LazyFarmer.class); - - // Types of specializing bean - Set lazyFarmerBeanTypes = lazyFarmerBean.getTypes(); - assertEquals(lazyFarmerBeanTypes.size(), 3); - assertTrue(typeSetMatches(lazyFarmerBeanTypes, Object.class, FarmerLocal.class, LazyFarmerLocal.class)); - } - - @SuppressWarnings("unchecked") - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = DIRECT_AND_INDIRECT_SPECIALIZATION_EE, id = "j") }) - public void testSpecializingBeanHasBindingsOfSpecializedAndSpecializingBean() { - Set> farmerBeans = getBeans(LazyFarmerLocal.class, LANDOWNER_LITERAL); - assertEquals(farmerBeans.size(), 1); - Bean lazyFarmerBean = farmerBeans.iterator().next(); - assertEquals(lazyFarmerBean.getQualifiers().size(), 4); - // LazyFarmer inherits LandOwner and Named from Farmer - assertTrue(annotationSetMatches(lazyFarmerBean.getQualifiers(), Landowner.class, Lazy.class, Any.class, Named.class)); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = DIRECT_AND_INDIRECT_SPECIALIZATION_EE, id = "k") }) - public void testSpecializingBeanHasNameOfSpecializedBean() { - String expectedName = "farmer"; - Set> beans = getCurrentManager().getBeans(expectedName); - assertEquals(beans.size(), 1); - Bean farmerBean = beans.iterator().next(); - assertEquals(farmerBean.getName(), expectedName); - assertEquals(farmerBean.getBeanClass(), LazyFarmer.class); - } - - @Test(groups = { INTEGRATION }, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = SPECIALIZE_SESSION_BEAN, id = "ca") }) - public void testSpecializedBeanNotInstantiated(@Landowner FarmerLocal farmer) throws Exception { - assertEquals(farmer.getClassName(), LazyFarmer.class.getName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/FarmEquipment.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/FarmEquipment.java deleted file mode 100644 index 4742f7e66b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/FarmEquipment.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -import jakarta.inject.Named; - -@Named("plough") -public class FarmEquipment { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Farmer.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Farmer.java deleted file mode 100644 index 759875f5e0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Farmer.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.inject.Named; - -@Landowner -@Named -@Stateful -public class Farmer implements FarmerLocal { - - public String getClassName() { - return Farmer.class.getName(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/FarmerLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/FarmerLocal.java deleted file mode 100644 index f2a951b328..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/FarmerLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface FarmerLocal { - public String getClassName(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Landowner.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Landowner.java deleted file mode 100644 index 7b99809fa7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Landowner.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Landowner { - class Literal extends AnnotationLiteral implements Landowner { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Lazy.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Lazy.java deleted file mode 100644 index 12b6f477c3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Lazy.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Lazy { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/LazyFarmer.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/LazyFarmer.java deleted file mode 100644 index 110a92bfc2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/LazyFarmer.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Specializes; - -@Specializes -@Lazy -@Stateful -public class LazyFarmer extends Farmer implements LazyFarmerLocal, FarmerLocal { - - @Override - public String getClassName() { - return LazyFarmer.class.getName(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/LazyFarmerLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/LazyFarmerLocal.java deleted file mode 100644 index 2fd0f6c3a7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/LazyFarmerLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface LazyFarmerLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Office.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Office.java deleted file mode 100644 index 8b975b0a9a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Office.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Specializes; - -@Stateful -@Specializes -public class Office extends Building implements OfficeLocal { - - @Override - public String getClassName() { - return Office.class.getName(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/OfficeLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/OfficeLocal.java deleted file mode 100644 index 1a1067d04c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/OfficeLocal.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface OfficeLocal extends BuildingLocal { - - public String getClassName(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/TractorLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/TractorLocal.java deleted file mode 100644 index a7f442609f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/TractorLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface TractorLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Waste.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Waste.java deleted file mode 100644 index 7332feeb33..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Waste.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -public class Waste { - - private String from; - - public String getFrom() { - return from; - } - - public Waste(String from) { - super(); - this.from = from; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Yard.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Yard.java deleted file mode 100644 index 3cf9b0cdf3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/Yard.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.inject.Named; - -@Named("backyard") -@Stateful -public class Yard implements YardInterface { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/YardInterface.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/YardInterface.java deleted file mode 100644 index 3a0c24ed0a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/YardInterface.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface YardInterface { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/DirectlyExtendsSimpleBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/DirectlyExtendsSimpleBeanTest.java deleted file mode 100644 index 743a163ec5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/DirectlyExtendsSimpleBeanTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.extend.managedbean; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SPECIALIZE_SESSION_BEAN; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class DirectlyExtendsSimpleBeanTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(DirectlyExtendsSimpleBeanTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = SPECIALIZE_SESSION_BEAN, id = "da") - public void testSpecializingClassDirectlyExtendsSimpleBean() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/FarmEquipment.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/FarmEquipment.java deleted file mode 100644 index 1874a86d63..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/FarmEquipment.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.extend.managedbean; - -import jakarta.inject.Named; - -@Named("plough") -public class FarmEquipment { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/TractorLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/TractorLocal.java deleted file mode 100644 index 40715310fe..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/TractorLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.extend.managedbean; - -import jakarta.ejb.Local; - -@Local -public interface TractorLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/Tractor_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/Tractor_Broken.java deleted file mode 100644 index 994ba16b91..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/Tractor_Broken.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.extend.managedbean; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Specializes; - -@Specializes -@Stateful -public class Tractor_Broken extends FarmEquipment implements TractorLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/nothing/CowLocal_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/nothing/CowLocal_Broken.java deleted file mode 100644 index 3a2673d71a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/nothing/CowLocal_Broken.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.extend.nothing; - -import jakarta.ejb.Local; - -@Local -public interface CowLocal_Broken { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/nothing/Cow_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/nothing/Cow_Broken.java deleted file mode 100644 index 397d4fa632..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/nothing/Cow_Broken.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.extend.nothing; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Specializes; - -@Specializes -@Stateful -public class Cow_Broken implements CowLocal_Broken { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/nothing/DirectlyExtendsNothingTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/nothing/DirectlyExtendsNothingTest.java deleted file mode 100644 index b174e6691a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/nothing/DirectlyExtendsNothingTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.extend.nothing; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SPECIALIZE_SESSION_BEAN; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class DirectlyExtendsNothingTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(DirectlyExtendsNothingTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = SPECIALIZE_SESSION_BEAN, id = "da") - public void testSpecializingClassDirectlyExtendsNothing() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/LoginAction.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/LoginAction.java deleted file mode 100644 index 2f7ec9ac9e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/LoginAction.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.extend.sessionbean; - -import jakarta.ejb.Local; - -@Local -public interface LoginAction { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/LoginActionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/LoginActionBean.java deleted file mode 100644 index 21b8e01974..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/LoginActionBean.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.extend.sessionbean; - -import jakarta.ejb.Stateless; - -@Stateless -public class LoginActionBean implements LoginAction { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/Mock.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/Mock.java deleted file mode 100644 index 3ff841709c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/Mock.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.extend.sessionbean; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Mock { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/MockLoginActionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/MockLoginActionBean.java deleted file mode 100644 index 64db8ff2d2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/MockLoginActionBean.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.extend.sessionbean; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.inject.Specializes; - -@Stateless -@Mock -@Specializes -public class MockLoginActionBean extends LoginActionBean { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/SessionBeanSpecializingSessionBeanWithClientViewTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/SessionBeanSpecializingSessionBeanWithClientViewTest.java deleted file mode 100644 index 9f42c66b82..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/sessionbean/SessionBeanSpecializingSessionBeanWithClientViewTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.extend.sessionbean; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DIRECT_AND_INDIRECT_SPECIALIZATION; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Bean types of LoginActionBean are LoginAction, Object (all local interfaces of the bean and their superinterfaces). - * Bean types of MockLoginActionBean are MockLoginActionBean, LoginActionBean, Object (the bean class and all superclasses). - * Specializing bean must have all bean types of the specialized bean. - * - * @author Matus Abaffy - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionBeanSpecializingSessionBeanWithClientViewTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SessionBeanSpecializingSessionBeanWithClientViewTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = DIRECT_AND_INDIRECT_SPECIALIZATION, id = "l") - public void testDeployment() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/FarmYard_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/FarmYard_Broken.java deleted file mode 100644 index e10b5947e1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/FarmYard_Broken.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.name; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Specializes; -import jakarta.inject.Named; - -@Specializes -@Stateful -@Named -public class FarmYard_Broken extends Yard { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/SameNameTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/SameNameTest.java deleted file mode 100644 index 082cadbea1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/SameNameTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.name; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DIRECT_AND_INDIRECT_SPECIALIZATION_EE; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SameNameTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SameNameTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = DIRECT_AND_INDIRECT_SPECIALIZATION_EE, id = "lc") - public void testSpecializingAndSpecializedBeanHasName() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/Yard.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/Yard.java deleted file mode 100644 index 2d77b9c918..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/Yard.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.name; - -import jakarta.ejb.Stateful; -import jakarta.inject.Named; - -@Named("backyard") -@Stateful -public class Yard implements YardInterface { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/YardInterface.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/YardInterface.java deleted file mode 100644 index 2b3f4067dc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/name/YardInterface.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.name; - -import jakarta.ejb.Local; - -@Local -public interface YardInterface { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/Farmer.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/Farmer.java deleted file mode 100644 index 96755b9bc9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/Farmer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.twobeans; - -import jakarta.ejb.Stateful; - -@Landowner -// @Named -@Stateful -public class Farmer implements FarmerInterface { - public String getClassName() { - return Farmer.class.getName(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/FarmerInterface.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/FarmerInterface.java deleted file mode 100644 index b55e399d5d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/FarmerInterface.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.twobeans; - -import jakarta.ejb.Local; - -@Local -public interface FarmerInterface { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/FishFarmer_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/FishFarmer_Broken.java deleted file mode 100644 index 8954d2fb1a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/FishFarmer_Broken.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.twobeans; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Specializes; - -@Specializes -@Stateful -public class FishFarmer_Broken extends Farmer implements FarmerInterface { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/Landowner.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/Landowner.java deleted file mode 100644 index 24be892bf9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/Landowner.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.twobeans; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Landowner { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/SheepFarmer_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/SheepFarmer_Broken.java deleted file mode 100644 index 78e07eb860..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/SheepFarmer_Broken.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.twobeans; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Specializes; - -@Specializes -@Stateful -public class SheepFarmer_Broken extends Farmer implements FarmerInterface { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/TwoBeansSpecializeTheSameBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/TwoBeansSpecializeTheSameBeanTest.java deleted file mode 100644 index 96c59ee503..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/twobeans/TwoBeansSpecializeTheSameBeanTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.enterprise.broken.twobeans; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.INCONSISTENT_SPECIALIZATION; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class TwoBeansSpecializeTheSameBeanTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(TwoBeansSpecializeTheSameBeanTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = INCONSISTENT_SPECIALIZATION, id = "a") - public void testTwoSessionBeansSpecializeTheSameBean() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/EnterpriseProducerMethodSpecializationTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/EnterpriseProducerMethodSpecializationTest.java deleted file mode 100644 index 807eadf005..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/EnterpriseProducerMethodSpecializationTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.producer.method.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_PRODUCER_METHOD_EE; -import static org.jboss.cdi.tck.cdi.Sections.DIRECT_AND_INDIRECT_SPECIALIZATION_EE; -import static org.jboss.cdi.tck.cdi.Sections.PRODUCER_METHOD_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; -import java.util.Set; - -import jakarta.enterprise.inject.Any; -import jakarta.enterprise.inject.Default; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.inject.Named; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseProducerMethodSpecializationTest extends AbstractTest { - - @SuppressWarnings("serial") - private static Annotation EXPENSIVE_LITERAL = new Expensive.Literal(); - @SuppressWarnings("serial") - private static Annotation SPARKLY_LITERAL = new Sparkly.Literal(); - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(EnterpriseProducerMethodSpecializationTest.class).build(); - } - - @SuppressWarnings("unchecked") - @Test - @SpecAssertions({ @SpecAssertion(section = DIRECT_AND_INDIRECT_SPECIALIZATION_EE, id = "ia"), - @SpecAssertion(section = DECLARING_PRODUCER_METHOD_EE, id = "c"), - @SpecAssertion(section = PRODUCER_METHOD_EE, id = "aa") }) - public void testSpecializingProducerMethod() { - - Set> expensiveNecklaceBeans = getBeans(Necklace.class, EXPENSIVE_LITERAL); - // There is only one bean for type Necklace and qualifier Expensive - assertEquals(expensiveNecklaceBeans.size(), 1); - - Bean expensiveNecklaceBean = expensiveNecklaceBeans.iterator().next(); - - // Check types of specializing bean - Set expensiveNecklaceBeanTypes = expensiveNecklaceBean.getTypes(); - assertEquals(expensiveNecklaceBeanTypes.size(), 3); - assertTrue(typeSetMatches(expensiveNecklaceBeanTypes, Object.class, Product.class, Necklace.class)); - - // Check qualifiers of specializing bean - Set expensiveNecklaceQualifiers = expensiveNecklaceBean.getQualifiers(); - assertEquals(expensiveNecklaceQualifiers.size(), 4); - assertTrue(annotationSetMatches(expensiveNecklaceQualifiers, Expensive.class, Sparkly.class, Any.class, Named.class)); - - // There is only one bean for type Necklace and qualifier Sparkly - Set> sparklyNecklaceBeans = getBeans(Necklace.class, SPARKLY_LITERAL); - assertEquals(sparklyNecklaceBeans.size(), 1); - Bean sparklyBean = sparklyNecklaceBeans.iterator().next(); - // Check EL name of specializing bean - assertEquals(sparklyBean.getName(), "expensiveGift"); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = DIRECT_AND_INDIRECT_SPECIALIZATION_EE, id = "ia") }) - public void testSpecializingBeanInjection(@Expensive Product expensiveProduct, @Default Product plainProduct) { - assertTrue(expensiveProduct instanceof Necklace); - assertEquals(expensiveProduct.getPrice(), 10); - assertEquals(plainProduct.getPrice(), 0); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Expensive.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Expensive.java deleted file mode 100644 index 7cb8dae91e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Expensive.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.producer.method.enterprise; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Expensive { - class Literal extends AnnotationLiteral implements Expensive { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/JewelryShop.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/JewelryShop.java deleted file mode 100644 index 3279a821fa..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/JewelryShop.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.producer.method.enterprise; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.inject.Produces; -import jakarta.enterprise.inject.Specializes; - -@Stateless -public class JewelryShop extends Shop { - - @Override - @Produces - @Specializes - @Sparkly - public Necklace getExpensiveGift() { - return new Necklace(10); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Necklace.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Necklace.java deleted file mode 100644 index cf1c47e696..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Necklace.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.producer.method.enterprise; - -public class Necklace extends Product { - - public Necklace(int price) { - super(); - setPrice(price); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Product.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Product.java deleted file mode 100644 index 08b1883b3e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Product.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.producer.method.enterprise; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Product { - - private int price = 0; - - public int getPrice() { - return price; - } - - public void setPrice(int price) { - this.price = price; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Shop.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Shop.java deleted file mode 100644 index 429d4e38ff..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Shop.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.producer.method.enterprise; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; -import jakarta.inject.Named; - -@Dependent -public class Shop { - - @Produces - @Expensive - @Named - public Necklace getExpensiveGift() { - return new Necklace(5); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Sparkly.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Sparkly.java deleted file mode 100644 index f5bd63ce33..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/producer/method/enterprise/Sparkly.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.producer.method.enterprise; - -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 jakarta.enterprise.util.AnnotationLiteral; -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Sparkly { - class Literal extends AnnotationLiteral implements Sparkly { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/FarmEquipment.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/FarmEquipment.java deleted file mode 100644 index 61e79cb944..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/FarmEquipment.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.simple.broken.extendejb; - -import jakarta.ejb.Stateful; -import jakarta.inject.Named; - -@Named("plough") -@Stateful -public class FarmEquipment implements FarmEquipmentLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/FarmEquipmentLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/FarmEquipmentLocal.java deleted file mode 100644 index bf9f8842e8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/FarmEquipmentLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.simple.broken.extendejb; - -import jakarta.ejb.Local; - -@Local -public interface FarmEquipmentLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/SpecializingBeanExtendsEnterpriseBeanTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/SpecializingBeanExtendsEnterpriseBeanTest.java deleted file mode 100644 index a1eac58ed3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/SpecializingBeanExtendsEnterpriseBeanTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.simple.broken.extendejb; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SPECIALIZE_SESSION_BEAN; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SpecializingBeanExtendsEnterpriseBeanTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SpecializingBeanExtendsEnterpriseBeanTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = SPECIALIZE_SESSION_BEAN, id = "da") - public void testSpecializingClassDirectlyExtendsEnterpriseBean() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/Tractor_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/Tractor_Broken.java deleted file mode 100644 index fdf6a04184..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/Tractor_Broken.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.inheritance.specialization.simple.broken.extendejb; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Specializes; - -@Specializes -@Dependent -public class Tractor_Broken extends FarmEquipment { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalClassMethodLevelInterceptorTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalClassMethodLevelInterceptorTest.java deleted file mode 100644 index d346db3ded..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalClassMethodLevelInterceptorTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.broken.finalClassInterceptor.ee; - -import static org.jboss.cdi.tck.cdi.Sections.BINDING_INTERCEPTOR_TO_BEAN; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.interceptors.definition.broken.finalClassInterceptor.FinalClassMethodLevelIPBean; -import org.jboss.cdi.tck.tests.interceptors.definition.broken.finalClassInterceptor.FinalClassMethodLevelMissile; -import org.jboss.cdi.tck.tests.interceptors.definition.broken.finalClassInterceptor.FooBinding; -import org.jboss.cdi.tck.tests.interceptors.definition.broken.finalClassInterceptor.MissileInterceptor; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Ondrej Skutka - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class FinalClassMethodLevelInterceptorTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassDefinition(FinalClassMethodLevelInterceptorTest.class) - .withClasses(FooBinding.class, MissileInterceptor.class, FinalClassMethodLevelMissile.class, - FinalClassMethodLevelIPBean.class) - .withBeansXml(new BeansXml().interceptors(MissileInterceptor.class)).build(); - } - - @Test - @SpecAssertion(section = BINDING_INTERCEPTOR_TO_BEAN, id = "d") - public void testFinalClassWithMethodLevelInterceptor() throws Exception { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodClassLevelInterceptorTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodClassLevelInterceptorTest.java deleted file mode 100644 index 944a2d43f1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodClassLevelInterceptorTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.broken.finalClassInterceptor.ee; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BINDING_INTERCEPTOR_TO_BEAN; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.BeansXmlVersion; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Ondrej Skutka - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class FinalMethodClassLevelInterceptorTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassDefinition(FinalMethodClassLevelInterceptorTest.class) - .withClasses(FooBinding.class, MissileInterceptor.class, FinalMethodClassLevelMissile.class, - FinalMethodClassLevelMissileLocal.class) - .withBeansXml(new BeansXml().interceptors(MissileInterceptor.class) - .setBeansXmlVersion(BeansXmlVersion.v11) - ) - .build(); - } - - //TODO disable due to https://issues.jboss.org/browse/CDI-496 - @Test(groups = INTEGRATION, enabled = false) - @SpecAssertion(section = BINDING_INTERCEPTOR_TO_BEAN, id = "d") - public void testFinalMethodWithClassLevelInterceptor() throws Exception { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodClassLevelMissile.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodClassLevelMissile.java deleted file mode 100644 index 335b1f8da4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodClassLevelMissile.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.broken.finalClassInterceptor.ee; - -import jakarta.ejb.Stateful; - -import org.jboss.cdi.tck.tests.interceptors.definition.broken.finalClassInterceptor.FooBinding; - -@Stateful -@FooBinding -public class FinalMethodClassLevelMissile implements FinalMethodClassLevelMissileLocal { - public void fire() { - } - - public final void finalManeuver() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodClassLevelMissileLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodClassLevelMissileLocal.java deleted file mode 100644 index 06cfb3f10e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodClassLevelMissileLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.broken.finalClassInterceptor.ee; - -import jakarta.ejb.Local; - -@Local -public interface FinalMethodClassLevelMissileLocal { - void fire(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodMethodLevelInterceptorTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodMethodLevelInterceptorTest.java deleted file mode 100644 index f9ebc09e83..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodMethodLevelInterceptorTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.broken.finalClassInterceptor.ee; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BINDING_INTERCEPTOR_TO_BEAN; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Ondrej Skutka - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class FinalMethodMethodLevelInterceptorTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassDefinition(FinalMethodMethodLevelInterceptorTest.class) - .withClasses(FooBinding.class, MissileInterceptor.class, FinalMethodMethodLevelMissile.class, - FinalMethodMethodLevelMissileLocal.class) - .withBeansXml(new BeansXml().interceptors(MissileInterceptor.class)) - .build(); - } - - //TODO disable due to https://issues.jboss.org/browse/CDI-496 - @Test(groups = INTEGRATION, enabled = false) - @SpecAssertion(section = BINDING_INTERCEPTOR_TO_BEAN, id = "d") - public void testFinalMethodWithMethodLevelInterceptor() throws Exception { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodMethodLevelMissile.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodMethodLevelMissile.java deleted file mode 100644 index 5fe0a768bc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodMethodLevelMissile.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.broken.finalClassInterceptor.ee; - -import jakarta.ejb.Stateful; - -import org.jboss.cdi.tck.tests.interceptors.definition.broken.finalClassInterceptor.FooBinding; - -@Stateful -public class FinalMethodMethodLevelMissile implements FinalMethodMethodLevelMissileLocal { - @FooBinding - public final void fire() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodMethodLevelMissileLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodMethodLevelMissileLocal.java deleted file mode 100644 index 66abc4f21b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FinalMethodMethodLevelMissileLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.broken.finalClassInterceptor.ee; - -import jakarta.ejb.Local; - -@Local -public interface FinalMethodMethodLevelMissileLocal { - void fire(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FooBinding.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FooBinding.java deleted file mode 100644 index 9ac9f8fee1..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/FooBinding.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.broken.finalClassInterceptor.ee; - -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 jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Documented -@InterceptorBinding -public @interface FooBinding { -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/MissileInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/MissileInterceptor.java deleted file mode 100644 index 600250ac75..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/broken/finalClassInterceptor/ee/MissileInterceptor.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.broken.finalClassInterceptor.ee; - -import java.io.Serializable; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@Interceptor -@FooBinding -public class MissileInterceptor implements Serializable { - public static boolean intercepted = false; - - @AroundInvoke - public Object alwaysReturnThis(InvocationContext ctx) throws Exception { - intercepted = true; - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/Airborne.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/Airborne.java deleted file mode 100644 index 71848f54fd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/Airborne.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.interceptorOrder; - -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 jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Documented -@InterceptorBinding -public @interface Airborne { - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/Missile.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/Missile.java deleted file mode 100644 index 42480a137e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/Missile.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.interceptorOrder; - -import jakarta.ejb.Stateful; -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptors; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Stateful -@Airborne -@Interceptors(RadarInterceptor.class) -public class Missile implements MissileLocal { - - public void fire() { - } - - @AroundInvoke - public Object intercept(InvocationContext ctx) throws Exception { - ActionSequence.addAction(Missile.class.getName()); - return ctx.proceed(); - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/MissileInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/MissileInterceptor.java deleted file mode 100644 index 03ee670efb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/MissileInterceptor.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.interceptorOrder; - -import java.io.Serializable; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Interceptor -@Airborne -public class MissileInterceptor implements Serializable { - - private static final long serialVersionUID = 1L; - - @AroundInvoke - public Object alwaysReturnThis(InvocationContext ctx) throws Exception { - ActionSequence.addAction(MissileInterceptor.class.getName()); - return ctx.proceed(); - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/MissileLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/MissileLocal.java deleted file mode 100644 index ef65e1874b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/MissileLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.interceptorOrder; - -import jakarta.ejb.Local; - -@Local -public interface MissileLocal { - void fire(); -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/RadarInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/RadarInterceptor.java deleted file mode 100644 index a40f98935e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/RadarInterceptor.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.interceptorOrder; - -import java.io.Serializable; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class RadarInterceptor implements Serializable { - - private static final long serialVersionUID = 1L; - - @AroundInvoke - public Object alwaysReturnThis(InvocationContext ctx) throws Exception { - ActionSequence.addAction(RadarInterceptor.class.getName()); - return ctx.proceed(); - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/SessionBeanInterceptorOrderTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/SessionBeanInterceptorOrderTest.java deleted file mode 100644 index 13befdff72..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/SessionBeanInterceptorOrderTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.interceptorOrder; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.ENABLED_INTERCEPTORS; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import java.util.List; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionBeanInterceptorOrderTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SessionBeanInterceptorOrderTest.class).withBeansXml("beans.xml") - .build(); - } - - @Test(groups = INTEGRATION, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = ENABLED_INTERCEPTORS, id = "g"), - @SpecAssertion(section = ENABLED_INTERCEPTORS, id = "h") }) - public void testInterceptorsDeclaredUsingInterceptorsCalledBeforeInterceptorBinding(MissileLocal missile) { - - assertNotNull(missile); - ActionSequence.reset(); - - missile.fire(); - - List sequence = ActionSequence.getSequenceData(); - assertEquals(sequence.size(), 3); - assertEquals(sequence.get(0), RadarInterceptor.class.getName()); - assertEquals(sequence.get(1), MissileInterceptor.class.getName()); - assertEquals(sequence.get(2), Missile.class.getName()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/MessageDrivenBeanInterceptorInvocationTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/MessageDrivenBeanInterceptorInvocationTest.java deleted file mode 100644 index 85c77f6d8e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/MessageDrivenBeanInterceptorInvocationTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.jms; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.TestGroups.JMS; -import static org.jboss.cdi.tck.cdi.Sections.BIZ_METHOD_EE; -import static org.jboss.cdi.tck.shrinkwrap.descriptors.ejb.EjbJarDescriptorBuilder.MessageDriven.newMessageDriven; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.util.concurrent.TimeUnit; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.impl.ConfigurationFactory; -import org.jboss.cdi.tck.shrinkwrap.descriptors.ejb.EjbJarDescriptorBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.ejbjar31.EjbJarDescriptor; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test that invocations of message listener methods of message-driven beans during message delivery are business method - * invocations. - * - * Note that basic JMS configuration is required for this test. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class MessageDrivenBeanInterceptorInvocationTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - - EjbJarDescriptor ejbJarDescriptor = new EjbJarDescriptorBuilder().messageDrivenBeans( - newMessageDriven("TestQueue", MessageDrivenMissile.class.getName()) - .addActivationConfigProperty("acknowledgeMode", "Auto-acknowledge") - .addActivationConfigProperty("destinationType", "jakarta.jms.Queue") - .addActivationConfigProperty("destinationLookup", ConfigurationFactory.get().getTestJmsQueue())) - .build(); - - return new WebArchiveBuilder() - .withTestClassPackage(MessageDrivenBeanInterceptorInvocationTest.class) - .withEjbJarXml(ejbJarDescriptor) - .withBeansXml(new BeansXml().interceptors(MissileInterceptor.class)).build(); - } - - @Inject - SimpleMessageProducer producer; - - @Test(groups = { JAVAEE_FULL, JMS }) - @SpecAssertions(@SpecAssertion(section = BIZ_METHOD_EE, id = "la")) - public void testMessageDrivenBeanMethodIntercepted() throws Exception { - - MissileInterceptor.reset(); - - producer.sendQueueMessage(); - - assertEquals(MessageDrivenMissile.class.getName(), MessageDrivenMissile.MESSAGES.poll(5, TimeUnit.SECONDS)); - assertTrue(MissileInterceptor.METHOD_INTERCEPTED.get()); - assertTrue(MissileInterceptor.lifecycleCallbackIntercepted); - assertTrue(MissileInterceptor.aroundConstructInterceptorCalled); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/MessageDrivenMissile.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/MessageDrivenMissile.java deleted file mode 100644 index 7f895688b9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/MessageDrivenMissile.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.jms; - -import java.util.concurrent.LinkedBlockingDeque; - -import jakarta.jms.Message; -import jakarta.jms.MessageListener; - -@Missile -public class MessageDrivenMissile implements MessageListener { - - static final LinkedBlockingDeque MESSAGES = new LinkedBlockingDeque(); - - @Override - public void onMessage(Message message) { - MESSAGES.add(MessageDrivenMissile.class.getName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/Missile.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/Missile.java deleted file mode 100644 index f88b3dc6ea..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/Missile.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.jms; - -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 jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE }) -@Retention(RUNTIME) -@Documented -@InterceptorBinding -public @interface Missile { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/MissileInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/MissileInterceptor.java deleted file mode 100644 index 576d7a8046..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/MissileInterceptor.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.jms; - -import java.util.concurrent.atomic.AtomicBoolean; - -import jakarta.annotation.PostConstruct; -import jakarta.interceptor.AroundConstruct; -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@Interceptor -@Missile -public class MissileInterceptor { - - static final AtomicBoolean METHOD_INTERCEPTED = new AtomicBoolean(false); - - public static boolean lifecycleCallbackIntercepted = false; - public static boolean aroundConstructInterceptorCalled = false; - - @AroundInvoke - public Object alwaysReturnThis(InvocationContext ctx) throws Exception { - METHOD_INTERCEPTED.set(true); - return ctx.proceed(); - } - - @AroundConstruct - public Object aroundConstruct(InvocationContext ctx) throws Exception { - aroundConstructInterceptorCalled = true; - return ctx.proceed(); - } - - @PostConstruct - public void postConstruct(InvocationContext ctx) { - lifecycleCallbackIntercepted = true; - try { - ctx.proceed(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public static void reset() { - METHOD_INTERCEPTED.set(false); - lifecycleCallbackIntercepted = false; - aroundConstructInterceptorCalled = false; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/SimpleMessageProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/SimpleMessageProducer.java deleted file mode 100644 index c10aa42edc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/jms/SimpleMessageProducer.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.jms; - -import jakarta.annotation.PostConstruct; -import jakarta.enterprise.context.Dependent; -import jakarta.jms.Connection; -import jakarta.jms.ConnectionFactory; -import jakarta.jms.JMSException; -import jakarta.jms.MessageProducer; -import jakarta.jms.Queue; -import jakarta.jms.Session; -import jakarta.jms.TextMessage; -import jakarta.jms.Topic; - -import org.jboss.cdi.tck.impl.ConfigurationFactory; -import org.jboss.cdi.tck.util.JndiLookupUtils; -import org.jboss.cdi.tck.util.SimpleLogger; - -@Dependent -public class SimpleMessageProducer { - - private static final SimpleLogger simpleLogger = new SimpleLogger(SimpleMessageProducer.class); - - private ConnectionFactory connectionFactory; - - private Queue queue; - - private Topic topic; - - @PostConstruct - public void init() { - this.connectionFactory = (ConnectionFactory) JndiLookupUtils - .lookup(ConfigurationFactory.get().getTestJmsConnectionFactory()); - this.queue = (Queue) JndiLookupUtils.lookup(ConfigurationFactory.get().getTestJmsQueue()); - this.topic = (Topic) JndiLookupUtils.lookup(ConfigurationFactory.get().getTestJmsTopic()); - } - - public void sendQueueMessage() { - - Connection connection = null; - Session session = null; - MessageProducer messageProducer = null; - TextMessage message = null; - - try { - connection = connectionFactory.createConnection(); - session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - - messageProducer = session.createProducer(queue); - message = session.createTextMessage(); - message.setText(SimpleMessageProducer.class.getName()); - messageProducer.send(message); - - } catch (JMSException e) { - throw new RuntimeException("Cannot send message", e); - } finally { - if (connection != null) { - try { - connection.close(); - } catch (JMSException e) { - simpleLogger.log(e); - } - } - } - } - - public void sendTopicMessage() { - - Connection connection = null; - Session session = null; - MessageProducer messageProducer = null; - TextMessage message = null; - - try { - connection = connectionFactory.createConnection(); - session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - - messageProducer = session.createProducer(topic); - message = session.createTextMessage(); - message.setText(SimpleMessageProducer.class.getName()); - messageProducer.send(message); - - } catch (JMSException e) { - throw new RuntimeException("Cannot send message", e); - } finally { - if (connection != null) { - try { - connection.close(); - } catch (JMSException e) { - simpleLogger.log(e); - } - } - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Airborne.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Airborne.java deleted file mode 100644 index 983b8fc068..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Airborne.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.nonContextualReference; - -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 jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Documented -@InterceptorBinding -public @interface Airborne { - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Anchor.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Anchor.java deleted file mode 100644 index 4520cf1535..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Anchor.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.nonContextualReference; - -import jakarta.ejb.Stateless; - -@Stateless -@Waterborne -public class Anchor { - public void throwOut() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/AnchorInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/AnchorInterceptor.java deleted file mode 100644 index 6b2d4a7dc2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/AnchorInterceptor.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.nonContextualReference; - -import java.io.Serializable; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@SuppressWarnings("serial") -@Interceptor -@Waterborne -public class AnchorInterceptor implements Serializable { - public static boolean intercepted = false; - - @AroundInvoke - public Object alwaysReturnThat(InvocationContext ctx) throws Exception { - intercepted = true; - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Cruiser.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Cruiser.java deleted file mode 100644 index ec6b118f8e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Cruiser.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.nonContextualReference; - -import jakarta.ejb.EJB; - -public class Cruiser implements Ship { - - @EJB - MissileLocal missile; - - Anchor anchor; - - public void defend() { - missile.fire(); - } - - public void stop() { - anchor.throwOut(); - } - - @EJB - public void setAnchor(Anchor anchor) { - this.anchor = anchor; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Missile.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Missile.java deleted file mode 100644 index 8094086e96..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Missile.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.nonContextualReference; - -import jakarta.ejb.Stateful; - -@Stateful -@Airborne -public class Missile implements MissileLocal { - public void fire() { - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/MissileInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/MissileInterceptor.java deleted file mode 100644 index 515000fff3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/MissileInterceptor.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.nonContextualReference; - -import java.io.Serializable; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@SuppressWarnings("serial") -@Interceptor -@Airborne -public class MissileInterceptor implements Serializable { - public static boolean intercepted = false; - - @AroundInvoke - public Object alwaysReturnThis(InvocationContext ctx) throws Exception { - intercepted = true; - return ctx.proceed(); - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/MissileLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/MissileLocal.java deleted file mode 100644 index 51619dc178..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/MissileLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.nonContextualReference; - -import jakarta.ejb.Local; - -@Local -public interface MissileLocal { - void fire(); -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/SessionBeanInterceptorOnNonContextualEjbReferenceTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/SessionBeanInterceptorOnNonContextualEjbReferenceTest.java deleted file mode 100644 index ac0c290351..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/SessionBeanInterceptorOnNonContextualEjbReferenceTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.nonContextualReference; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BIZ_METHOD; -import static org.jboss.cdi.tck.cdi.Sections.BIZ_METHOD_EE; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionBeanInterceptorOnNonContextualEjbReferenceTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SessionBeanInterceptorOnNonContextualEjbReferenceTest.class) - .withBeansXml("beans.xml").build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = BIZ_METHOD_EE, id = "h"), @SpecAssertion(section = BIZ_METHOD, id = "ab") }) - public void testNonContextualSessionBeanReferenceIsIntercepted() { - MissileInterceptor.intercepted = false; - AnchorInterceptor.intercepted = false; - - Ship cruiser = getContextualReference(Ship.class); - cruiser.defend(); - cruiser.stop(); - - assert MissileInterceptor.intercepted; - assert AnchorInterceptor.intercepted; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Ship.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Ship.java deleted file mode 100644 index 4f5ed2b34f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Ship.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.nonContextualReference; - -public interface Ship { - void defend(); - - void stop(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Waterborne.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Waterborne.java deleted file mode 100644 index 6dffc4b041..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/Waterborne.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.nonContextualReference; - -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 jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Documented -@InterceptorBinding -public @interface Waterborne { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/Airborne.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/Airborne.java deleted file mode 100644 index 18a189ff57..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/Airborne.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.simpleInterception; - -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 jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Documented -@InterceptorBinding -public @interface Airborne { - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/Missile.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/Missile.java deleted file mode 100644 index 9e04fa9758..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/Missile.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.simpleInterception; - -import jakarta.ejb.Stateful; - -@Stateful -@Airborne -public class Missile implements MissileLocal { - public void fire() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/MissileInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/MissileInterceptor.java deleted file mode 100644 index 0a99862a17..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/MissileInterceptor.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.simpleInterception; - -import java.io.Serializable; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@SuppressWarnings("serial") -@Interceptor -@Airborne -public class MissileInterceptor implements Serializable { - - public static boolean intercepted = false; - - @AroundInvoke - public Object alwaysReturnThis(InvocationContext ctx) throws Exception { - intercepted = true; - return ctx.proceed(); - } - - public static void reset() { - intercepted = false; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/MissileLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/MissileLocal.java deleted file mode 100644 index 6a1dcd6ab3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/MissileLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.simpleInterception; - -import jakarta.ejb.Local; - -@Local -public interface MissileLocal { - void fire(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/Rocket.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/Rocket.java deleted file mode 100644 index da1d9f8412..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/Rocket.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.simpleInterception; - -import jakarta.ejb.Stateless; - -@Airborne -@Stateless -public class Rocket { - public void fire() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/SessionBeanInterceptorDefinitionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/SessionBeanInterceptorDefinitionTest.java deleted file mode 100644 index 5e163983d9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/simpleInterception/SessionBeanInterceptorDefinitionTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.enterprise.simpleInterception; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BIZ_METHOD; -import static org.jboss.cdi.tck.cdi.Sections.BIZ_METHOD_EE; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionBeanInterceptorDefinitionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(SessionBeanInterceptorDefinitionTest.class) - .withBeansXml(new BeansXml().interceptors(MissileInterceptor.class)).build(); - } - - @Inject - MissileLocal missile; - - @Inject - Rocket rocket; - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = BIZ_METHOD_EE, id = "c"), @SpecAssertion(section = BIZ_METHOD, id = "aa") }) - public void testSessionBeanIsIntercepted() { - - assertNotNull(missile); - MissileInterceptor.reset(); - missile.fire(); - assertTrue(MissileInterceptor.intercepted); - - assertNotNull(rocket); - MissileInterceptor.reset(); - rocket.fire(); - assertTrue(MissileInterceptor.intercepted); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Cactus.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Cactus.java deleted file mode 100644 index 03bd938956..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Cactus.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -import jakarta.ejb.Stateful; - -@Stateful -public class Cactus extends PongPlant { - - @Override - public void pong() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Culinary.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Culinary.java deleted file mode 100644 index 82be690241..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Culinary.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -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.Retention; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Qualifier -public @interface Culinary { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/European.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/European.java deleted file mode 100644 index 5ff2d3f9d0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/European.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -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.Retention; -import java.lang.annotation.Target; - -import jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Qualifier -public @interface European { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Flower.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Flower.java deleted file mode 100644 index 7857e4dea4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Flower.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -import jakarta.ejb.Stateless; - -@GuardedBySquirrel -@GuardedByWoodpecker -@Stateless -public class Flower extends Plant { - - public void pong() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/ForgetMeNot.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/ForgetMeNot.java deleted file mode 100644 index daed7c93a0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/ForgetMeNot.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -import jakarta.ejb.Stateless; - -@Stateless -public class ForgetMeNot extends Flower { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Grass.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Grass.java deleted file mode 100644 index 346f7b46c6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Grass.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -import jakarta.ejb.Stateful; - -@Stateful -public class Grass extends PongPlant { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/GuardedBySquirrel.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/GuardedBySquirrel.java deleted file mode 100644 index 465dae60ff..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/GuardedBySquirrel.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Inherited -@Documented -@InterceptorBinding -public @interface GuardedBySquirrel { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/GuardedByWoodpecker.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/GuardedByWoodpecker.java deleted file mode 100644 index 0cf43c9d03..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/GuardedByWoodpecker.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -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 jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Documented -@InterceptorBinding -public @interface GuardedByWoodpecker { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/InterceptorBindingInheritanceTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/InterceptorBindingInheritanceTest.java deleted file mode 100644 index 936c56c53c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/InterceptorBindingInheritanceTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.MEMBER_LEVEL_INHERITANCE; -import static org.jboss.cdi.tck.cdi.Sections.MEMBER_LEVEL_INHERITANCE_EE; -import static org.jboss.cdi.tck.cdi.Sections.TYPE_LEVEL_INHERITANCE_EE; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test interceptor binding inheritance. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class InterceptorBindingInheritanceTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(InterceptorBindingInheritanceTest.class) - .withBeansXml(new BeansXml(BeanDiscoveryMode.ALL) - .interceptors(SquirrelInterceptor.class, WoodpeckerInterceptor.class)) - .build(); - } - - private String squirrel = SquirrelInterceptor.class.getName(); - private String woodpecker = WoodpeckerInterceptor.class.getName(); - - @Test(groups = INTEGRATION, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "an"), - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "ana") }) - public void testInterceptorBindingDirectlyInheritedFromSessionBean(ForgetMeNot forgetMeNot) throws Exception { - forgetMeNot.pong(); - assertTrue(forgetMeNot.inspectedBy(squirrel)); - assertFalse(forgetMeNot.inspectedBy(woodpecker)); - } - - @Test(groups = INTEGRATION, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "ar"), - @SpecAssertion(section = TYPE_LEVEL_INHERITANCE_EE, id = "ara") }) - public void testInterceptorBindingIndirectlyInheritedFromSessionBean(@European ForgetMeNot woodForgetMeNot) - throws Exception { - woodForgetMeNot.pong(); - assertTrue(woodForgetMeNot instanceof WoodForgetMeNot); - assertTrue(woodForgetMeNot.inspectedBy(squirrel)); - assertFalse(woodForgetMeNot.inspectedBy(woodpecker)); - } - - @Test(groups = INTEGRATION, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "kb") - public void testMethodInterceptorBindingDirectlyInheritedFromSessionBean(Grass grass) { - grass.pong(); - assertTrue(grass.inspectedBy(squirrel)); - } - - @Test(groups = INTEGRATION, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "kd") - public void testMethodInterceptorBindingIndirectlyInheritedFromSessionBean(@Culinary Grass waterChestnut) { - waterChestnut.pong(); - assertTrue(waterChestnut instanceof WaterChestnut); - assertTrue(waterChestnut.inspectedBy(squirrel)); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE, id = "ka") - public void testMethodInterceptorBindingDirectlyNotInheritedFromManagedBean(Shrub shrub) { - shrub.pong(); - assertFalse(shrub.inspectedBy(squirrel)); - } - - @Test(groups = INTEGRATION, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "kb") - public void testMethodInterceptorBindingDirectlyNotInheritedFromSessionBean(Cactus cactus) { - cactus.pong(); - assertFalse(cactus.inspectedBy(squirrel)); - } - - @Test(groups = INTEGRATION, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "kd") - public void testMethodInterceptorBindingIndirectlyNotInheritedFromSessionBean(@Culinary Cactus opuncia) { - opuncia.pong(); - assertTrue(opuncia instanceof Opuncia); - assertFalse(opuncia.inspectedBy(squirrel)); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Opuncia.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Opuncia.java deleted file mode 100644 index a0235d3893..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Opuncia.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -import jakarta.ejb.Stateful; - -@Culinary -@Stateful -public class Opuncia extends Cactus { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Ping.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Ping.java deleted file mode 100644 index 544670141f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Ping.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -public interface Ping { - - public void pong(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Plant.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Plant.java deleted file mode 100644 index 276e8d7387..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Plant.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -import java.util.ArrayList; -import java.util.List; - -public abstract class Plant implements Ping { - - private List inspections = new ArrayList(); - - public void inspect(String id) { - inspections.add(id); - } - - public boolean inspectedBy(String id) { - return inspections.contains(id); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/PongPlant.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/PongPlant.java deleted file mode 100644 index 6558d6c329..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/PongPlant.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -public class PongPlant extends Plant { - - @GuardedBySquirrel - @Override - public void pong() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Shrub.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Shrub.java deleted file mode 100644 index d282b3877c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Shrub.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -public class Shrub extends PongPlant { - - @Override - public void pong() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/SquirrelInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/SquirrelInterceptor.java deleted file mode 100644 index fa73cd760e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/SquirrelInterceptor.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@Interceptor -@GuardedBySquirrel -public class SquirrelInterceptor { - - @AroundInvoke - public Object intercept(InvocationContext ctx) throws Exception { - - Object target = ctx.getTarget(); - - if (target instanceof Plant) { - ((Plant) target).inspect(SquirrelInterceptor.class.getName()); - } - return ctx.proceed(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Tree.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Tree.java deleted file mode 100644 index 77445e1039..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/Tree.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -@GuardedBySquirrel -@GuardedByWoodpecker -public class Tree extends Plant { - - @Override - public void pong() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/WaterChestnut.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/WaterChestnut.java deleted file mode 100644 index 605455bd43..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/WaterChestnut.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -import jakarta.ejb.Stateful; - -@Culinary -@Stateful -public class WaterChestnut extends Grass { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/WoodForgetMeNot.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/WoodForgetMeNot.java deleted file mode 100644 index 7dff5aba87..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/WoodForgetMeNot.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -import jakarta.ejb.Stateless; - -@European -@Stateless -public class WoodForgetMeNot extends ForgetMeNot { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/WoodpeckerInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/WoodpeckerInterceptor.java deleted file mode 100644 index d4442b422f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance_ee/WoodpeckerInterceptor.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.inheritance_ee; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@Interceptor -@GuardedByWoodpecker -public class WoodpeckerInterceptor { - - @AroundInvoke - public Object intercept(InvocationContext ctx) throws Exception { - - Object target = ctx.getTarget(); - - if (target instanceof Plant) { - ((Plant) target).inspect(WoodpeckerInterceptor.class.getName()); - } - return ctx.proceed(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/Airborne.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/Airborne.java deleted file mode 100644 index 251b335cf9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/Airborne.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.lifecycle.enterprise.order; - -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 jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE }) -@Retention(RUNTIME) -@Documented -@InterceptorBinding -public @interface Airborne { - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/AnotherInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/AnotherInterceptor.java deleted file mode 100644 index 54415794e8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/AnotherInterceptor.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.lifecycle.enterprise.order; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class AnotherInterceptor { - - @PreDestroy - public void preDestroy(InvocationContext ctx) { - ActionSequence.addAction("preDestroy", AnotherInterceptor.class.getName()); - try { - ctx.proceed(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - - @PostConstruct - public void postConstruct(InvocationContext ctx) { - ActionSequence.addAction("postConstruct", AnotherInterceptor.class.getName()); - try { - ctx.proceed(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/EnterpriseLifecycleInterceptorDefinitionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/EnterpriseLifecycleInterceptorDefinitionTest.java deleted file mode 100644 index aa87923dde..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/EnterpriseLifecycleInterceptorDefinitionTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.lifecycle.enterprise.order; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.ENABLED_INTERCEPTORS; -import static org.testng.Assert.assertEquals; - -import java.util.List; - -import jakarta.enterprise.context.spi.CreationalContext; -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseLifecycleInterceptorDefinitionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(EnterpriseLifecycleInterceptorDefinitionTest.class) - .withBeansXml( - new BeansXml().interceptors(MissileInterceptor.class)) - .build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = ENABLED_INTERCEPTORS, id = "g"), - @SpecAssertion(section = ENABLED_INTERCEPTORS, id = "h") }) - public void testLifecycleInterception() { - - ActionSequence.reset(); - - Bean bean = getUniqueBean(Missile.class); - CreationalContext ctx = getCurrentManager().createCreationalContext(bean); - Missile missile = bean.create(ctx); - missile.fire(); - bean.destroy(missile, ctx); - - List postConstruct = ActionSequence.getSequenceData("postConstruct"); - assertEquals(postConstruct.size(), 4); - assertEquals(postConstruct.get(0), AnotherInterceptor.class.getName()); - assertEquals(postConstruct.get(1), MissileInterceptor.class.getName()); - assertEquals(postConstruct.get(2), Weapon.class.getName()); - assertEquals(postConstruct.get(3), Missile.class.getName()); - - List preDestroy = ActionSequence.getSequenceData("preDestroy"); - assertEquals(preDestroy.size(), 4); - assertEquals(postConstruct.get(0), AnotherInterceptor.class.getName()); - assertEquals(postConstruct.get(1), MissileInterceptor.class.getName()); - assertEquals(postConstruct.get(2), Weapon.class.getName()); - assertEquals(postConstruct.get(3), Missile.class.getName()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/Missile.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/Missile.java deleted file mode 100644 index 6454f63827..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/Missile.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.lifecycle.enterprise.order; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.ejb.Stateful; -import jakarta.interceptor.Interceptors; - -import org.jboss.cdi.tck.util.ActionSequence; - -@Interceptors(AnotherInterceptor.class) -@Airborne -@Stateful -public class Missile extends Weapon { - - public void fire() { - } - - @PostConstruct - public void postConstructMissile() { - ActionSequence.addAction("postConstruct", Missile.class.getName()); - } - - @PreDestroy - public void preDestroyMissile() { - ActionSequence.addAction("preDestroy", Missile.class.getName()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/MissileInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/MissileInterceptor.java deleted file mode 100644 index dc5dd38d31..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/MissileInterceptor.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.definition.lifecycle.enterprise.order; - -import java.io.Serializable; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -@SuppressWarnings("serial") -@Airborne -@Interceptor -public class MissileInterceptor implements Serializable { - - @PreDestroy - public void preDestroy(InvocationContext ctx) { - ActionSequence.addAction("preDestroy", MissileInterceptor.class.getName()); - try { - ctx.proceed(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - - @PostConstruct - public void postConstruct(InvocationContext ctx) { - ActionSequence.addAction("postConstruct", MissileInterceptor.class.getName()); - try { - ctx.proceed(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/Weapon.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/Weapon.java deleted file mode 100644 index d7408f1fea..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/lifecycle/enterprise/order/Weapon.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.definition.lifecycle.enterprise.order; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; - -import org.jboss.cdi.tck.util.ActionSequence; - -public class Weapon { - - @PostConstruct - public void postConstructWeapon() { - ActionSequence.addAction("postConstruct", Weapon.class.getName()); - } - - @PreDestroy - public void preDestroyWeapon() { - ActionSequence.addAction("preDestroy", Weapon.class.getName()); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ejb/InterceptorInvocationTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ejb/InterceptorInvocationTest.java deleted file mode 100644 index fa23c11b18..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ejb/InterceptorInvocationTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.ejb; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.BIZ_METHOD_EE; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import java.util.concurrent.TimeUnit; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.interceptors.invocation.AlmightyBinding; -import org.jboss.cdi.tck.tests.interceptors.invocation.AlmightyInterceptor; -import org.jboss.cdi.tck.util.Timer; -import org.jboss.cdi.tck.util.Timer.StopCondition; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class InterceptorInvocationTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(InterceptorInvocationTest.class) - .withClasses(AlmightyBinding.class, AlmightyInterceptor.class) - .withBeansXml(new BeansXml().interceptors(AlmightyInterceptor.class)) - .build(); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER, groups = JAVAEE_FULL) - @SpecAssertion(section = BIZ_METHOD_EE, id = "ig") - public void testTimeoutMethodIntercepted(Timing timing) throws Exception { - - timing.createTimer(); - - new Timer().setDelay(10, TimeUnit.SECONDS).addStopCondition(new StopCondition() { - public boolean isSatisfied() { - return Timing.timeoutAt != null; - } - }).start(); - - assertNotNull(Timing.timeoutAt); - assertTrue(AlmightyInterceptor.timeoutIntercepted); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ejb/Timing.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ejb/Timing.java deleted file mode 100644 index 63642c0790..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ejb/Timing.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.ejb; - -import jakarta.annotation.Resource; -import jakarta.ejb.SessionContext; -import jakarta.ejb.Stateless; -import jakarta.ejb.Timeout; -import jakarta.ejb.Timer; - -import org.jboss.cdi.tck.tests.interceptors.invocation.AlmightyBinding; - -@AlmightyBinding -@Stateless -public class Timing { - - public static Long timeoutAt = null; - - @Resource - private SessionContext ctx; - - public void createTimer() { - ctx.getTimerService().createTimer(1l, null); - } - - @Timeout - public void handleTimeout(Timer timer) { - timeoutAt = System.currentTimeMillis(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/AbstractInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/AbstractInterceptor.java deleted file mode 100644 index bdc5127469..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/AbstractInterceptor.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -import org.jboss.cdi.tck.util.ActionSequence; - -public abstract class AbstractInterceptor { - - @AroundInvoke - public Object aroundInvoke(InvocationContext ctx) throws Exception { - ActionSequence.addAction(getClass().getName()); - return ctx.proceed(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/Dao.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/Dao.java deleted file mode 100644 index b0ff12375a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/Dao.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -import jakarta.enterprise.context.Dependent; - -@Transactional -@Dependent -public class Dao { - - public void ping() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/DummyDao.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/DummyDao.java deleted file mode 100644 index 7ac0fe7b75..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/DummyDao.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -import jakarta.ejb.Stateless; - -import org.jboss.cdi.tck.shrinkwrap.ee.DummySessionBean; - -/** - * - * @see DummySessionBean - */ -@Stateless -public class DummyDao { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/EnterpriseInterceptorOrderingTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/EnterpriseInterceptorOrderingTest.java deleted file mode 100644 index bf571ffa15..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/EnterpriseInterceptorOrderingTest.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.ENABLED_INTERCEPTORS; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import java.util.ArrayList; -import java.util.List; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.spec.se.manifest.ManifestDescriptor; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Matus Abaffy - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseInterceptorOrderingTest extends AbstractTest { - - /** - * Modules: - *
    - *
  • A - EJB jar: Dao, LegacyInterceptor2
  • - *
  • B - lib: Transactional, GloballyEnabledInterceptor3
  • - *
  • C - lib: AbstractDecorator
  • - *
  • D - EJB jar: GloballyEnabledInterceptor2, GloballyEnabledInterceptor5, LegacyInterceptor3
  • - *
  • E - web archive - *
      - *
    • F - WEB-INF/classes: GloballyEnabledInterceptor1, LegacyInterceptor1
    • - *
    • G - WEB-INF/lib: GloballyEnabledInterceptor4
    • - *
    - *
  • - *
- * - * @return test archive - */ - @Deployment - public static EnterpriseArchive createTestArchive() { - final String ejbJar = "ejb.jar"; - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - //A - default test-ejb.jar - .withTestClassDefinition(EnterpriseInterceptorOrderingTest.class) - .withClasses(Dao.class, LegacyInterceptor2.class) - .withBeansXml(new BeansXml().interceptors(LegacyInterceptor2.class)) - //B - .withBeanLibrary(Transactional.class, GloballyEnabledInterceptor3.class) - //C - .withLibrary(AbstractInterceptor.class) - .build(); - - //D - JavaArchive ejbArchive = ShrinkWrap - .create(JavaArchive.class, ejbJar) - .addClasses(DummyDao.class, GloballyEnabledInterceptor2.class, GloballyEnabledInterceptor5.class, - LegacyInterceptor3.class) - .addAsManifestResource(new BeansXml().interceptors(LegacyInterceptor3.class), "beans.xml") - .setManifest( - new StringAsset(Descriptors.create(ManifestDescriptor.class) - .addToClassPath(EnterpriseArchiveBuilder.DEFAULT_EJB_MODULE_NAME) - .exportAsString())); - enterpriseArchive.addAsModule(ejbArchive); - - //E - WebArchive webArchive = new WebArchiveBuilder() - .notTestArchive() - //F - .withClasses(EnterpriseInterceptorOrderingTest.class, GloballyEnabledInterceptor1.class, - LegacyInterceptor1.class) - .withBeansXml(new BeansXml().interceptors(LegacyInterceptor1.class)) - //G - .withBeanLibrary(GloballyEnabledInterceptor4.class) - .build() - .setManifest( - new StringAsset(Descriptors.create(ManifestDescriptor.class) - .addToClassPath(EnterpriseArchiveBuilder.DEFAULT_EJB_MODULE_NAME) - .addToClassPath(ejbJar) - .exportAsString())); - enterpriseArchive.addAsModule(webArchive); - - return enterpriseArchive; - } - - @Test(groups = JAVAEE_FULL, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = ENABLED_INTERCEPTORS, id = "f"), - @SpecAssertion(section = ENABLED_INTERCEPTORS, id = "i") }) - public void testDecoratorsInWebInfClasses(Dao dao) { - - assertNotNull(dao); - ActionSequence.reset(); - dao.ping(); - - List expected = new ArrayList(); - // 800 - expected.add(GloballyEnabledInterceptor5.class.getName()); - // 995 - expected.add(GloballyEnabledInterceptor1.class.getName()); - // 1005 - expected.add(GloballyEnabledInterceptor2.class.getName()); - // 1015 - expected.add(GloballyEnabledInterceptor3.class.getName()); - // 1025 - expected.add(GloballyEnabledInterceptor4.class.getName()); - // Interceptors enabled using beans.xml - //LegacyInterceptor1 enabled only in F - expected.add(LegacyInterceptor2.class.getName()); - //LegacyInterceptor3 enabled only in D - // Bean itself - - assertEquals(ActionSequence.getSequenceData(), expected); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GlobalInterceptorOrderingTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GlobalInterceptorOrderingTest.java deleted file mode 100644 index 7393fc33b7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GlobalInterceptorOrderingTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.ENABLED_INTERCEPTORS; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import java.util.ArrayList; -import java.util.List; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.util.ActionSequence; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test interceptor enablement and ordering. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class GlobalInterceptorOrderingTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(GlobalInterceptorOrderingTest.class) - // WEB-INF/classes - .withClasses(Dao.class, LegacyInterceptor1.class, LegacyInterceptor2.class, LegacyInterceptor3.class, - WebApplicationGlobalInterceptor1.class) - .withBeansXml(new BeansXml().interceptors(LegacyInterceptor1.class, LegacyInterceptor2.class, - LegacyInterceptor3.class)) - .withBeanLibrary(Transactional.class, AbstractInterceptor.class, Service.class, - GloballyEnabledInterceptor1.class, GloballyEnabledInterceptor3.class, - GloballyEnabledInterceptor4.class, GloballyEnabledInterceptor5.class) - .withBeanLibrary(GloballyEnabledInterceptor2.class).build(); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = ENABLED_INTERCEPTORS, id = "f") }) - public void testOrderingInWebInfClasses(Dao dao) { - - assertNotNull(dao); - ActionSequence.reset(); - dao.ping(); - - List sequence = new ArrayList(); - sequence.add(GloballyEnabledInterceptor5.class.getName()); - sequence.add(GloballyEnabledInterceptor1.class.getName()); - sequence.add(GloballyEnabledInterceptor2.class.getName()); - sequence.add(WebApplicationGlobalInterceptor1.class.getName()); - sequence.add(GloballyEnabledInterceptor3.class.getName()); - sequence.add(GloballyEnabledInterceptor4.class.getName()); - // Interceptors enabled using beans.xml - sequence.add(LegacyInterceptor1.class.getName()); - sequence.add(LegacyInterceptor2.class.getName()); - sequence.add(LegacyInterceptor3.class.getName()); - - assertEquals(ActionSequence.getSequenceData(), sequence); - } - - @Test(groups = INTEGRATION, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = ENABLED_INTERCEPTORS, id = "i") }) - public void testOrderingInLib(Service service) { - - assertNotNull(service); - ActionSequence.reset(); - service.ping(); - - List sequence = new ArrayList(); - sequence.add(GloballyEnabledInterceptor5.class.getName()); - sequence.add(GloballyEnabledInterceptor1.class.getName()); - sequence.add(GloballyEnabledInterceptor2.class.getName()); - sequence.add(WebApplicationGlobalInterceptor1.class.getName()); - sequence.add(GloballyEnabledInterceptor3.class.getName()); - sequence.add(GloballyEnabledInterceptor4.class.getName()); - - assertEquals(ActionSequence.getSequenceData(), sequence); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor1.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor1.java deleted file mode 100644 index 38d8218dc7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor1.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -import jakarta.annotation.Priority; -import jakarta.interceptor.Interceptor; - -@Priority(995) -@Transactional -@Interceptor -public class GloballyEnabledInterceptor1 extends AbstractInterceptor { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor2.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor2.java deleted file mode 100644 index 8e7144ea76..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor2.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -import jakarta.annotation.Priority; -import jakarta.interceptor.Interceptor; - -@Priority(1005) -@Transactional -@Interceptor -public class GloballyEnabledInterceptor2 extends AbstractInterceptor { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor3.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor3.java deleted file mode 100644 index ca8f28cf98..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor3.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -import jakarta.annotation.Priority; -import jakarta.interceptor.Interceptor; - -@Priority(1015) -@Transactional -@Interceptor -public class GloballyEnabledInterceptor3 extends AbstractInterceptor { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor4.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor4.java deleted file mode 100644 index 9433b49e99..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor4.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -import jakarta.annotation.Priority; -import jakarta.interceptor.Interceptor; - -@Priority(1025) -@Transactional -@Interceptor -public class GloballyEnabledInterceptor4 extends AbstractInterceptor { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor5.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor5.java deleted file mode 100644 index d76020dd76..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/GloballyEnabledInterceptor5.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -import jakarta.annotation.Priority; -import jakarta.interceptor.Interceptor; - -@Priority(800) -@Transactional -@Interceptor -public class GloballyEnabledInterceptor5 extends AbstractInterceptor { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/LegacyInterceptor1.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/LegacyInterceptor1.java deleted file mode 100644 index 2372b792d4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/LegacyInterceptor1.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -import jakarta.interceptor.Interceptor; - -@Transactional -@Interceptor -public class LegacyInterceptor1 extends AbstractInterceptor { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/LegacyInterceptor2.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/LegacyInterceptor2.java deleted file mode 100644 index fd63fd776f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/LegacyInterceptor2.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -import jakarta.interceptor.Interceptor; - -@Transactional -@Interceptor -public class LegacyInterceptor2 extends AbstractInterceptor { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/LegacyInterceptor3.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/LegacyInterceptor3.java deleted file mode 100644 index 658c79a418..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/LegacyInterceptor3.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -import jakarta.interceptor.Interceptor; - -@Transactional -@Interceptor -public class LegacyInterceptor3 extends AbstractInterceptor { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/Service.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/Service.java deleted file mode 100644 index f6bcdb0fda..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/Service.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -import jakarta.enterprise.context.Dependent; - -@Transactional -@Dependent -public class Service { - - public void ping() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/Transactional.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/Transactional.java deleted file mode 100644 index e9306677a2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/Transactional.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -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.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.interceptor.InterceptorBinding; - -@InterceptorBinding -@Inherited -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -@Documented -public @interface Transactional { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/WebApplicationGlobalInterceptor1.java b/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/WebApplicationGlobalInterceptor1.java deleted file mode 100644 index 56cf3ca064..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/interceptors/ordering/global/WebApplicationGlobalInterceptor1.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.interceptors.ordering.global; - -import jakarta.annotation.Priority; -import jakarta.interceptor.Interceptor; - -@Priority(1008) -@Transactional -@Interceptor -public class WebApplicationGlobalInterceptor1 extends AbstractInterceptor { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/Car.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/Car.java deleted file mode 100644 index 3e6ccc00a4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/Car.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.clientProxy.incontainer; - -import java.io.Serializable; - -import jakarta.enterprise.context.RequestScoped; - -@RequestScoped -public class Car implements Serializable { - private static final long serialVersionUID = -5928715726257481259L; - private String make = "unknown"; - - public String getMake() { - return make; - } - - public void setMake(String name) { - this.make = name; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/ClientProxyTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/ClientProxyTest.java deleted file mode 100644 index a63fbdebc5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/ClientProxyTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.clientProxy.incontainer; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.CLIENT_PROXIES; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.WebClient; - -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class ClientProxyTest extends AbstractTest { - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ClientProxyTest.class).build(); - } - - @Test - @SpecAssertion(section = CLIENT_PROXIES, id = "d") - public void testInvocationIsProcessedOnCurrentInstance() throws Exception { - WebClient webClient = new WebClient(); - String response; - response = webClient.getPage(contextPath + "Test/Garage?make=Honda").getWebResponse().getContentAsString(); - assert response.contains("Honda"); - response = webClient.getPage(contextPath + "Test/Garage?make=Toyota").getWebResponse().getContentAsString(); - assert response.contains("Toyota"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/Garage.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/Garage.java deleted file mode 100644 index 59380a3a92..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/Garage.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.clientProxy.incontainer; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; - -@ApplicationScoped -public class Garage { - @Inject - private Car car; - - public String getMakeOfTheParkedCar() { - return car.getMake(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/TestServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/TestServlet.java deleted file mode 100644 index fdce6e6670..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/TestServlet.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.clientProxy.incontainer; - -import java.io.IOException; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletException; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -@WebServlet(name = "TestServlet", loadOnStartup = 1, urlPatterns = { "/Test/*" }) -public class TestServlet extends HttpServlet { - private static final long serialVersionUID = -4722487503814381947L; - @Inject - private Car car; - @Inject - private Garage garage; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - if (car.getMake().equals("unknown")) { - // set the make of the car - car.setMake(req.getParameter("make")); - // make sure that the garage contains the current instance - resp.getWriter().append(garage.getMakeOfTheParkedCar()); - resp.setContentType("text/plain"); - resp.setStatus(200); - } else { - resp.setStatus(500); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/ClientProxyTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/ClientProxyTest.java deleted file mode 100644 index 2da5fde106..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/ClientProxyTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.clientProxy.integration; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.CLIENT_PROXIES; -import static org.jboss.cdi.tck.cdi.Sections.CLIENT_PROXY_INVOCATION; -import static org.jboss.cdi.tck.cdi.Sections.CONTEXTUAL_REFERENCE_VALIDITY; - -import java.io.IOException; - -import jakarta.enterprise.context.ContextNotActiveException; -import jakarta.enterprise.context.spi.Context; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class ClientProxyTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(ClientProxyTest.class).build(); - } - - @Test - @SpecAssertion(section = CLIENT_PROXIES, id = "b") - public void testClientProxyUsedForNormalScope() { - Tuna tuna = getContextualReference(Tuna.class); - assert getCurrentConfiguration().getBeans().isProxy(tuna); - } - - @Test - @SpecAssertion(section = CLIENT_PROXIES, id = "c") - public void testSimpleBeanClientProxyIsSerializable() throws IOException, ClassNotFoundException { - TunedTuna tuna = getContextualReference(TunedTuna.class); - assert getCurrentConfiguration().getBeans().isProxy(tuna); - byte[] bytes = passivate(tuna); - tuna = (TunedTuna) activate(bytes); - assert getCurrentConfiguration().getBeans().isProxy(tuna); - assert tuna.getState().equals("tuned"); - } - - @Test - @SpecAssertion(section = CLIENT_PROXY_INVOCATION, id = "aa") - public void testClientProxyInvocation() { - TunedTuna tuna = getContextualReference(TunedTuna.class); - assert getCurrentConfiguration().getBeans().isProxy(tuna); - assert tuna.getState().equals("tuned"); - } - - @Test(groups = INTEGRATION, expectedExceptions = { ContextNotActiveException.class, IllegalStateException.class }) - @SpecAssertions({ @SpecAssertion(section = CLIENT_PROXY_INVOCATION, id = "ab"), - @SpecAssertion(section = CONTEXTUAL_REFERENCE_VALIDITY, id = "a") }) - public void testInactiveScope() throws Exception { - assert getCurrentConfiguration().getContexts().getRequestContext().isActive(); - Context ctx = getCurrentConfiguration().getContexts().getRequestContext(); - setContextInactive(ctx); - assert !getCurrentConfiguration().getContexts().getRequestContext().isActive(); - try { - getContextualReference(TunedTuna.class).getState(); - } finally { - // need to set request scope active again, some other tests will fail otherwise - setContextActive(ctx); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/Fox.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/Fox.java deleted file mode 100644 index c7d572e881..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/Fox.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.clientProxy.integration; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Fox { - - public String getName() { - return "gavin"; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/Tuna.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/Tuna.java deleted file mode 100644 index 2492463a84..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/Tuna.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.clientProxy.integration; - -import jakarta.enterprise.context.RequestScoped; - -@RequestScoped -public class Tuna { - - public String getName() { - return "Ophir"; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/TunedTuna.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/TunedTuna.java deleted file mode 100644 index 2803edea0e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/clientProxy/integration/TunedTuna.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.clientProxy.integration; - -import jakarta.enterprise.context.RequestScoped; - -@RequestScoped -public class TunedTuna { - public String getState() { - return "tuned"; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Animal.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Animal.java deleted file mode 100644 index 464a6278b0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Animal.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.dependency.resolution.broken.ambiguous.ear; - -public interface Animal { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Bar.java deleted file mode 100644 index 3a208c40e2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Bar.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.dependency.resolution.broken.ambiguous.ear; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Dependent -public class Bar { - - @Inject - private Animal animal; -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Cat.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Cat.java deleted file mode 100644 index 7a31a2ed3d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Cat.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.dependency.resolution.broken.ambiguous.ear; - -import jakarta.ejb.Stateful; - -@Stateful(name = "Cat") -public class Cat implements Animal { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Dog.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Dog.java deleted file mode 100644 index 92ce259b28..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/Dog.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.dependency.resolution.broken.ambiguous.ear; - -import jakarta.ejb.Stateful; - -@Stateful(name = "Dog") -public class Dog implements Animal { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/MultiModuleSessionBeanAmbiguousDependencyTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/MultiModuleSessionBeanAmbiguousDependencyTest.java deleted file mode 100644 index 539a66146e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/dependency/resolution/broken/ambiguous/ear/MultiModuleSessionBeanAmbiguousDependencyTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.dependency.resolution.broken.ambiguous.ear; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.UNSATISFIED_AND_AMBIG_DEPENDENCIES; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test that ambiguous dependency is detected when multiple beans eligible for injection to the injection point are deployed in - * different modules. See WELD-1586 for more info. - * - * @author Matus Abaffy - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class MultiModuleSessionBeanAmbiguousDependencyTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder() - .notTestArchive() - .withClasses(Animal.class, Dog.class) - .noDefaultWebModule() - .build(); - - WebArchive barArchive = new WebArchiveBuilder().notTestArchive().withName("test.war") - .withClasses(Bar.class, Cat.class) - .withDefaultEjbModuleDependency() - .build(); - enterpriseArchive.addAsModule(barArchive); - - return enterpriseArchive; - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = UNSATISFIED_AND_AMBIG_DEPENDENCIES, id = "ae") - public void testAmbiguousDependencyDetected() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/el/integration/IntegrationWithUnifiedELTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/el/integration/IntegrationWithUnifiedELTest.java deleted file mode 100644 index 03de97cd0c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/el/integration/IntegrationWithUnifiedELTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.el.integration; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.EL; -import static org.jboss.cdi.tck.cdi.Sections.NAMES_EE; -import static org.jboss.cdi.tck.cdi.Sections.NAME_RESOLUTION; -import static org.jboss.cdi.tck.cdi.Sections.NAME_RESOLUTION_EE; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.WebClient; - -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class IntegrationWithUnifiedELTest extends AbstractTest { - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(IntegrationWithUnifiedELTest.class).withWebXml("web.xml") - .withWebResource("JSFTestPage.xhtml", "JSFTestPage.xhtml") - .withWebResource("JSPTestPage.jsp", "JSPTestPage.jsp") - .withWebResource("faces-config.xml", "/WEB-INF/faces-config.xml").build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = EL, id = "a"), @SpecAssertion(section = NAME_RESOLUTION, id = "d"), - @SpecAssertion(section = NAME_RESOLUTION_EE, id = "a"), @SpecAssertion(section = NAMES_EE, id = "a") }) - public void testELResolverRegisteredWithJsf() throws Exception { - WebClient webclient = new WebClient(); - String content = webclient.getPage(contextPath + "JSFTestPage.xhtml").getWebResponse().getContentAsString(); - assert content.contains("Dolly"); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = EL, id = "a"), @SpecAssertion(section = NAME_RESOLUTION, id = "d"), - @SpecAssertion(section = NAME_RESOLUTION_EE, id = "a"), @SpecAssertion(section = NAMES_EE, id = "a") }) - public void testELResolverRegisteredWithServletContainer() throws Exception { - WebClient webclient = new WebClient(); - String content = webclient.getPage(contextPath + "JSPTestPage.jsp").getWebResponse().getContentAsString(); - assert content.contains("Dolly"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/el/integration/Sheep.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/el/integration/Sheep.java deleted file mode 100644 index 7cad0dba6d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/el/integration/Sheep.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.el.integration; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Named; - -@Named -@Dependent -public class Sheep { - private String name = "Dolly"; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/InjectionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/InjectionTest.java deleted file mode 100644 index bce3f7fe17..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/InjectionTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.FIELDS_INITIALIZER_METHODS; -import static org.jboss.cdi.tck.cdi.Sections.FIELDS_INITIALIZER_METHODS_EE; -import static org.jboss.cdi.tck.cdi.Sections.INJECTION; -import static org.jboss.cdi.tck.cdi.Sections.MEMBER_LEVEL_INHERITANCE; -import static org.jboss.cdi.tck.cdi.Sections.PERFORMING_TYPESAFE_RESOLUTION; -import static org.jboss.cdi.tck.cdi.Sections.PRIMITIVE_TYPES_AND_NULL_VALUES; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.lookup.injection.ejb.DeluxeHenHouse; -import org.jboss.cdi.tck.tests.lookup.injection.ejb.HenHouse; -import org.jboss.cdi.tck.tests.lookup.injection.ejb.SessionBean; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class InjectionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(InjectionTest.class) - .withClasses(DeluxeHenHouse.class, HenHouse.class, SessionBean.class) - .withWebXml( - Descriptors.create(WebAppDescriptor.class).createEnvEntry().envEntryName("greeting") - .envEntryType("java.lang.String").envEntryValue("Hello").up().createEnvEntry() - .envEntryName("game").envEntryType("java.lang.String").envEntryValue("poker").up()) - .build(); - } - - @Test - @SpecAssertion(section = PRIMITIVE_TYPES_AND_NULL_VALUES, id = "aa") - public void testInjectionPerformsBoxingIfNecessary() throws Exception { - assert getBeans(SpiderNest.class).size() == 1; - SpiderNest spiderNest = getContextualReference(SpiderNest.class); - assert spiderNest.numberOfSpiders != null; - assert spiderNest.numberOfSpiders.equals(4); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = PERFORMING_TYPESAFE_RESOLUTION, id = "kc"), - @SpecAssertion(section = INJECTION, id = "b"), @SpecAssertion(section = FIELDS_INITIALIZER_METHODS, id = "ac") }) - public void testInjectionOfNamedBean() { - WolfPack wolfPack = getContextualReference(WolfPack.class); - assert wolfPack.getAlphaWolf() != null; - } - - @Test(groups = INTEGRATION, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE, id = "aa"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS, id = "bg"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS, id = "bh"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS, id = "bk"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS, id = "bl"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "bi"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "bj") }) - public void testInjectionFieldsAndInitializerMethods(DeluxeHenHouse henHouse) throws Exception { - assertNotNull(henHouse.fox); - assertEquals(henHouse.fox.getName(), "gavin"); - assertTrue(henHouse.initializerCalledAfterInjectionPointsInit); - assertTrue(henHouse.postConstructCalledAfterInitializers); - } - - @Test - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE, id = "ac") - public void testFieldDeclaredInIndirectSuperclassInjected() throws Exception { - MegaPoorHenHouse henHouse = getContextualReference(MegaPoorHenHouse.class); - assert henHouse.fox != null; - assert henHouse.fox.getName().equals("gavin"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/MegaPoorHenHouse.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/MegaPoorHenHouse.java deleted file mode 100644 index 131c7d58cb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/MegaPoorHenHouse.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class MegaPoorHenHouse extends PoorHenHouse { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/PoorHenHouse.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/PoorHenHouse.java deleted file mode 100644 index 70fb910121..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/PoorHenHouse.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection; - -import jakarta.enterprise.context.Dependent; - -import org.jboss.cdi.tck.tests.lookup.injection.ejb.HenHouse; - -@Dependent -public class PoorHenHouse extends HenHouse { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/ejb/DeluxeHenHouse.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/ejb/DeluxeHenHouse.java deleted file mode 100644 index 8383c4e14a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/ejb/DeluxeHenHouse.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.ejb; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.Resource; -import jakarta.ejb.EJB; -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -import org.jboss.cdi.tck.tests.lookup.injection.Wolf; - -@Dependent -public class DeluxeHenHouse extends HenHouse { - - @Resource(name = "greeting") - String greeting; - - @Inject - Wolf wolf; - - private String game; - - private SessionBean sessionBean; - - public boolean initializerCalledAfterInjectionPointsInit = false; - - public boolean postConstructCalledAfterInitializers = false; - - @Inject - public void initialize() { - initializerCalledAfterInjectionPointsInit = (fox != null && wolf != null && "Hello".equals(greeting) - && "Hello".equals(superGreeting) - && game.equals("poker") && superGame.equals("poker") && sessionBean.ping() && superSessionBean.ping()); - } - - @PostConstruct - public void postConstruct() { - postConstructCalledAfterInitializers = (initializerCalledAfterInjectionPointsInit && hen != null); - } - - @Resource(name = "game") - private void setGame(String game) { - this.game = game; - } - - @EJB - private void setSessionBean(SessionBean sessionBean) { - this.sessionBean = sessionBean; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/ejb/HenHouse.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/ejb/HenHouse.java deleted file mode 100644 index 20f4c0fab9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/ejb/HenHouse.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.ejb; - -import jakarta.annotation.Resource; -import jakarta.ejb.EJB; -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -import org.jboss.cdi.tck.tests.lookup.injection.Fox; -import org.jboss.cdi.tck.tests.lookup.injection.Hen; - -@Dependent -public class HenHouse { - - @Resource(name = "greeting") - protected String superGreeting; - - protected String superGame; - - @Inject - public Fox fox; - - protected Hen hen; - - protected SessionBean superSessionBean; - - @Inject - public void initializeHenHouse() { - this.hen = (fox != null ? new Hen() : null); - } - - @Resource(name = "game") - private void setSuperGame(String superGame) { - this.superGame = superGame; - } - - @EJB - public void setSuperSessionBean(SessionBean superSessionBean) { - this.superSessionBean = superSessionBean; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/ejb/SessionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/ejb/SessionBean.java deleted file mode 100644 index df59fb2570..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/ejb/SessionBean.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.ejb; - -import jakarta.ejb.Stateless; - -@Stateless -public class SessionBean { - - public boolean ping() { - return true; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/DeluxeHenHouse.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/DeluxeHenHouse.java deleted file mode 100644 index 213c67b937..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/DeluxeHenHouse.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import jakarta.ejb.Stateless; - -@Stateless -public class DeluxeHenHouse extends HenHouse implements DeluxeHenHouseLocal { - public Fox getFox() { - return fox; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/DeluxeHenHouseLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/DeluxeHenHouseLocal.java deleted file mode 100644 index 2a9767183f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/DeluxeHenHouseLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface DeluxeHenHouseLocal { - Fox getFox(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/Farm.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/Farm.java deleted file mode 100644 index 8482c5e6b3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/Farm.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import jakarta.annotation.PostConstruct; -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; -import jakarta.interceptor.Interceptors; - -@Stateless -public class Farm implements FarmLocal { - @Inject - private Sheep sheepField; - - private boolean initializerCalledAfterInjection = false; - private boolean injectionPerformedCorrectly = false; - - @Inject - public void initialize(Sheep sheep) { - initializerCalledAfterInjection = (sheepField != null) && (sheep != null); - } - - @Interceptors(FarmInterceptor.class) - public int getAnimalCount() { - return 1; - } - - @PostConstruct - public void postConstruct() { - injectionPerformedCorrectly = initializerCalledAfterInjection; - } - - public boolean isInjectionPerformedCorrectly() { - return injectionPerformedCorrectly; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/FarmInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/FarmInterceptor.java deleted file mode 100644 index d7e44b4b88..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/FarmInterceptor.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import jakarta.inject.Inject; -import jakarta.interceptor.AroundInvoke; -import jakarta.interceptor.InvocationContext; - -public class FarmInterceptor { - - @Inject - private Sheep sheep; - private boolean initializerCalled = false; - - @Inject - public void initialize(Sheep sheep) { - initializerCalled = sheep != null; - } - - @AroundInvoke - public Object intercept(InvocationContext invocation) throws Exception { - if ((sheep != null) && initializerCalled) { - return (Integer) invocation.proceed() + 1; - } else { - throw new RuntimeException("Sheep not injected."); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/FarmLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/FarmLocal.java deleted file mode 100644 index 8f8226f9a2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/FarmLocal.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface FarmLocal { - int getAnimalCount(); - - boolean isInjectionPerformedCorrectly(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/Fox.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/Fox.java deleted file mode 100644 index 19f75f099d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/Fox.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import java.io.Serializable; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Fox implements Serializable { - - public String getName() { - return "gavin"; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/HenHouse.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/HenHouse.java deleted file mode 100644 index 43ebe1c034..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/HenHouse.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Dependent -public class HenHouse { - - @Inject - public Fox fox; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/InjectedSessionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/InjectedSessionBean.java deleted file mode 100644 index 273de5e60c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/InjectedSessionBean.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import jakarta.ejb.EJB; -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; - -@Stateless -public class InjectedSessionBean extends SuperInjectedSessionBean implements InjectedSessionBeanLocal { - @EJB - private FarmLocal farm; - private boolean initializerCalledAfterResourceInjection = false; - - public FarmLocal getFarm() { - return farm; - } - - @Inject - public void initialize() { - initializerCalledAfterResourceInjection = (farm != null && deluxeHenHouse != null); - } - - public boolean isInitializerCalledAfterResourceInjection() { - return initializerCalledAfterResourceInjection; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/InjectedSessionBeanLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/InjectedSessionBeanLocal.java deleted file mode 100644 index 99d12878a5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/InjectedSessionBeanLocal.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface InjectedSessionBeanLocal { - FarmLocal getFarm(); - - boolean isInitializerCalledAfterResourceInjection(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/MegaPoorHenHouse.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/MegaPoorHenHouse.java deleted file mode 100644 index e1e00b8a33..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/MegaPoorHenHouse.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import jakarta.annotation.PostConstruct; -import jakarta.ejb.Stateful; - -@Stateful -public class MegaPoorHenHouse extends PoorHenHouse implements MegaPoorHenHouseLocal { - private boolean postConstructCalledAfterSuperclassInitializer = false; - - public Fox getFox() { - return fox; - } - - @PostConstruct - public void postConstruct() { - postConstructCalledAfterSuperclassInitializer = initializerCalledAfterSuperclassInjection; - } - - public boolean isPostConstructCalledAfterSuperclassInitializer() { - return postConstructCalledAfterSuperclassInitializer; - } - - @Override - public boolean isInitializerCalledAfterSuperclassInjection() { - return initializerCalledAfterSuperclassInjection; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/MegaPoorHenHouseLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/MegaPoorHenHouseLocal.java deleted file mode 100644 index 285352d72f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/MegaPoorHenHouseLocal.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import jakarta.ejb.Local; - -@Local -public interface MegaPoorHenHouseLocal { - Fox getFox(); - - boolean isPostConstructCalledAfterSuperclassInitializer(); - - boolean isInitializerCalledAfterSuperclassInjection(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/PoorHenHouse.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/PoorHenHouse.java deleted file mode 100644 index 409ad7ed1b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/PoorHenHouse.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Dependent -public class PoorHenHouse extends HenHouse { - protected boolean initializerCalledAfterSuperclassInjection = false; - - @Inject - public void initialize() { - initializerCalledAfterSuperclassInjection = fox != null; - } - - public boolean isInitializerCalledAfterSuperclassInjection() { - return initializerCalledAfterSuperclassInjection; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/SessionBeanInjectionOrderingTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/SessionBeanInjectionOrderingTest.java deleted file mode 100644 index 5ee84e4120..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/SessionBeanInjectionOrderingTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.FIELDS_INITIALIZER_METHODS_EE; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionBeanInjectionOrderingTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SessionBeanInjectionOrderingTest.class).build(); - } - - @Test - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "bb") - public void testInitializerCalledAfterFieldInjectionOfSuperclass() { - MegaPoorHenHouseLocal house = getContextualReference(MegaPoorHenHouseLocal.class); - assert house.isInitializerCalledAfterSuperclassInjection(); - } - - @Test - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "bf") - public void testPostConstructCalledAfterInitializerOfSuperclass() { - assert getContextualReference(MegaPoorHenHouseLocal.class).isPostConstructCalledAfterSuperclassInitializer(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "bc"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "bd") }) - public void testInitializerCalledAfterResourceInjection() { - assert getContextualReference(InjectedSessionBeanLocal.class).isInitializerCalledAfterResourceInjection(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/SessionBeanInjectionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/SessionBeanInjectionTest.java deleted file mode 100644 index 6cdc3348b5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/SessionBeanInjectionTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.FIELDS_INITIALIZER_METHODS_EE; -import static org.jboss.cdi.tck.cdi.Sections.INJECTION_EE; -import static org.jboss.cdi.tck.cdi.Sections.MEMBER_LEVEL_INHERITANCE_EE; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionBeanInjectionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SessionBeanInjectionTest.class).build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = INJECTION_EE, id = "a"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "aa"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "ab"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "ba"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "be") }) - public void testInjectionOnContextualSessionBean() { - assert getContextualReference(FarmLocal.class).isInjectionPerformedCorrectly(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = INJECTION_EE, id = "c"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "ak"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "al") }) - public void testInjectionOnNonContextualSessionBean() { - assert getContextualReference(InjectedSessionBeanLocal.class).getFarm().isInjectionPerformedCorrectly(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = INJECTION_EE, id = "ed"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "ao"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "ap") }) - public void testInjectionOnEJBInterceptor() { - // Test interceptor that intercepts contextual Session Bean - assert getContextualReference(FarmLocal.class).getAnimalCount() == 2; - // Test interceptor that intercepts non-contextual Session Bean - assert getContextualReference(InjectedSessionBeanLocal.class).getFarm().getAnimalCount() == 2; - } - - @Test - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "ab") - public void testFieldDeclaredInSuperclassInjected() { - DeluxeHenHouseLocal henHouse = getContextualReference(DeluxeHenHouseLocal.class); - assert henHouse.getFox() != null; - assert henHouse.getFox().getName().equals("gavin"); - } - - @Test - @SpecAssertion(section = MEMBER_LEVEL_INHERITANCE_EE, id = "ad") - public void testFieldDeclaredInSuperclassIndirectlyInjected() { - MegaPoorHenHouseLocal henHouse = getContextualReference(MegaPoorHenHouseLocal.class); - assert henHouse.getFox() != null; - assert henHouse.getFox().getName().equals("gavin"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/Sheep.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/Sheep.java deleted file mode 100644 index e0cb402a3f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/Sheep.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Sheep { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/SuperInjectedSessionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/SuperInjectedSessionBean.java deleted file mode 100644 index 8248454e33..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/SuperInjectedSessionBean.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.enterprise; - -import jakarta.ejb.EJB; -import jakarta.ejb.Stateless; - -@Stateless -public class SuperInjectedSessionBean { - - @EJB - protected DeluxeHenHouseLocal deluxeHenHouse; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Bar.java deleted file mode 100644 index d4844f8cc5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Bar.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.injection.enterprise.chain; - -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; - -@Stateless -public class Bar { - - @Inject - Foo foo; - - public Foo getFoo() { - return foo; - } - - public int ping(int base) { - return foo.ping(++base); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Baz.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Baz.java deleted file mode 100644 index a4cf5500d8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Baz.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.injection.enterprise.chain; - -import jakarta.ejb.EJB; -import jakarta.ejb.Stateless; -import jakarta.inject.Inject; - -@Stateless -public class Baz { - - @EJB - Bar bar; - - @Inject - Qux qux; - - public Bar getBar() { - return bar; - } - - public Qux getQux() { - return qux; - } - - public int ping(int base) { - return bar.ping(++base); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Foo.java deleted file mode 100644 index fb4d6449f0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Foo.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.injection.enterprise.chain; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; - -@RequestScoped -public class Foo { - - @Inject - Baz baz; - - public Baz getBaz() { - return baz; - } - - public int ping(int base) { - return ++base; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Qux.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Qux.java deleted file mode 100644 index 9be498ab20..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/Qux.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.injection.enterprise.chain; - -import jakarta.ejb.EJB; -import jakarta.ejb.Stateful; -import jakarta.enterprise.context.RequestScoped; - -@RequestScoped -@Stateful -public class Qux { - - @EJB - Baz baz; - - public Baz getBaz() { - return baz; - } - - public int ping(int base) { - return baz.ping(++base); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/SessionBeanInjectionChainTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/SessionBeanInjectionChainTest.java deleted file mode 100644 index ea899db342..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/enterprise/chain/SessionBeanInjectionChainTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.injection.enterprise.chain; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.INJECTION_AND_RESOLUTION; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Martin Kouba - * @see CDITCK-15 - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class SessionBeanInjectionChainTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(SessionBeanInjectionChainTest.class).build(); - } - - @Inject - Qux qux; - - @Test - @SpecAssertion(section = INJECTION_AND_RESOLUTION, id = "b") - public void testChainOfSessionBeans() { - assertNotNull(qux); - assertEquals(qux.ping(0), 4); - assertEquals(qux.getBaz().ping(0), 3); - Foo foo = qux.getBaz().getBar().getFoo(); - assertNotNull(foo); - assertEquals(foo.getBaz().ping(0), 3); - assertEquals(foo.getBaz().getBar().ping(0), 2); - assertEquals(foo.getBaz().getQux().ping(0), 4); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/ContainerEventTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/ContainerEventTest.java deleted file mode 100644 index 0d9b2d1095..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/ContainerEventTest.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.TYPE_BEAN_DISCOVERY_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; - -import java.io.Serializable; -import java.util.EventListener; - -import jakarta.enterprise.inject.Any; -import jakarta.enterprise.inject.spi.AnnotatedField; -import jakarta.enterprise.inject.spi.AnnotatedMethod; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.inject.Inject; -import jakarta.servlet.Filter; -import jakarta.servlet.GenericServlet; -import jakarta.servlet.Servlet; -import jakarta.servlet.ServletConfig; -import jakarta.servlet.ServletContextListener; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.jsp.tagext.JspTag; -import jakarta.servlet.jsp.tagext.SimpleTag; -import jakarta.servlet.jsp.tagext.SimpleTagSupport; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * This test verifies that ProcessAnnotatedType event is fired for various Java EE components and tests the AnnotatedType - * implementation. - * - * It's placed in this package because it works with the same Java EE components as - * {@link InjectionIntoNonContextualComponentTest} does. - * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class ContainerEventTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(ContainerEventTest.class) - .withWebXml("web.xml") - .withClasses(Farm.class, ProcessAnnotatedTypeObserver.class, Sheep.class, TagLibraryListener.class, - TestFilter.class, TestListener.class, TestServlet.class, TestTagHandler.class, SessionBean.class) - .withExtension(ProcessAnnotatedTypeObserver.class) - .withWebResource("ManagedBeanTestPage.xhtml", "ManagedBeanTestPage.xhtml") - .withWebResource("TagPage.jsp", "TagPage.jsp").withWebResource("faces-config.xml", "/WEB-INF/faces-config.xml") - .withWebResource("TestLibrary.tld", "WEB-INF/TestLibrary.tld") - .withDefaultPersistenceXml() - .withBeansXml(new BeansXml(BeanDiscoveryMode.ALL)) - .build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_BEAN_DISCOVERY_EE, id = "bb") - public void testProcessAnnotatedTypeEventFiredForSessionBean() { - AnnotatedType annotatedType = ProcessAnnotatedTypeObserver.getSessionBeanEvent(); - assertNotNull(annotatedType); - assertEquals(annotatedType.getBaseType(), SessionBean.class); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_BEAN_DISCOVERY_EE, id = "be") - public void testProcessAnnotatedTypeEventFiredForServletListener() { - assertNotNull(ProcessAnnotatedTypeObserver.getListenerEvent()); - validateServletListenerAnnotatedType(ProcessAnnotatedTypeObserver.getListenerEvent()); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_BEAN_DISCOVERY_EE, id = "bf") - public void testProcessAnnotatedTypeEventFiredForTagHandler() { - assertNotNull(ProcessAnnotatedTypeObserver.getTagHandlerEvent()); - validateTagHandlerAnnotatedType(ProcessAnnotatedTypeObserver.getTagHandlerEvent()); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_BEAN_DISCOVERY_EE, id = "bg") - public void testProcessAnnotatedTypeEventFiredForTagLibraryListener() { - assertNotNull(ProcessAnnotatedTypeObserver.getTagLibraryListenerEvent()); - validateTagLibraryListenerAnnotatedType(ProcessAnnotatedTypeObserver.getTagLibraryListenerEvent()); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_BEAN_DISCOVERY_EE, id = "bj") - public void testProcessAnnotatedTypeEventFiredForServlet() { - assertNotNull(ProcessAnnotatedTypeObserver.getServletEvent()); - validateServletAnnotatedType(ProcessAnnotatedTypeObserver.getServletEvent()); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_BEAN_DISCOVERY_EE, id = "bk") - public void testProcessAnnotatedTypeEventFiredForFilter() { - assertNotNull(ProcessAnnotatedTypeObserver.getFilterEvent()); - validateFilterAnnotatedType(ProcessAnnotatedTypeObserver.getFilterEvent()); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = TYPE_BEAN_DISCOVERY_EE, id = "bd") - public void testProcessAnnotatedTypeEventFiredForJsfManagedBean() { - assertNotNull(ProcessAnnotatedTypeObserver.getJsfManagedBeanEvent()); - validateJsfManagedBeanAnnotatedType(ProcessAnnotatedTypeObserver.getJsfManagedBeanEvent()); - } - - private void validateServletListenerAnnotatedType(AnnotatedType type) { - assertEquals(type.getBaseType(), TestListener.class); - assertTrue(type.getAnnotations().isEmpty()); - assertEquals(type.getFields().size(), 2); - assertTrue(type.getMethods().stream().anyMatch(m -> m.getJavaMember().getName().equals("contextInitialized"))); - - int initializers = 0; - for (AnnotatedMethod method : type.getMethods()) { - assertEquals(method.getParameters().size(), 1); - assertEquals(method.getBaseType(), void.class); - if (method.isAnnotationPresent(Inject.class)) { - initializers++; - } - } - assertEquals(initializers, 1); - } - - private void validateTagHandlerAnnotatedType(AnnotatedType type) { - assertEquals(type.getBaseType(), TestTagHandler.class); - assertTrue(typeSetMatches(type.getTypeClosure(), TestTagHandler.class, SimpleTagSupport.class, SimpleTag.class, - JspTag.class, Object.class)); - assertEquals(type.getAnnotations().size(), 1); - assertTrue(type.isAnnotationPresent(Any.class)); - } - - private void validateTagLibraryListenerAnnotatedType(AnnotatedType type) { - assertEquals(type.getBaseType(), TagLibraryListener.class); - assertTrue(typeSetMatches(type.getTypeClosure(), TagLibraryListener.class, ServletContextListener.class, - EventListener.class, Object.class)); - assertEquals(type.getFields().size(), 2); - assertEquals(type.getConstructors().size(), 1); - assertTrue(type.getMethods().stream().anyMatch(m -> m.getJavaMember().getName().equals("contextInitialized"))); - } - - private void validateServletAnnotatedType(AnnotatedType type) { - assertEquals(type.getBaseType(), TestServlet.class); - assertTrue(typeSetMatches(type.getTypeClosure(), TestServlet.class, HttpServlet.class, GenericServlet.class, - Servlet.class, ServletConfig.class, Serializable.class, Object.class)); - assertTrue(type.getAnnotations().isEmpty()); - } - - private void validateFilterAnnotatedType(AnnotatedType type) { - assertEquals(type.getBaseType(), TestFilter.class); - assertTrue(typeSetMatches(type.getTypeClosure(), TestFilter.class, Filter.class, Object.class)); - assertEquals(type.getFields().size(), 12); - assertEquals(type.getConstructors().size(), 1); - assertTrue(type.getConstructors().iterator().next().getParameters().isEmpty()); - assertTrue(type.getMethods().stream().anyMatch(m -> m.getJavaMember().getName().equals("doFilter"))); - } - - private void validateJsfManagedBeanAnnotatedType(AnnotatedType type) { - assert type.getFields().size() == 2; - for (AnnotatedField field : type.getFields()) { - if (field.getJavaMember().getName().equals("sheep")) { - assertTrue(field.isAnnotationPresent(Inject.class)); - assertFalse(field.isStatic()); - } else if (field.getJavaMember().getName().equals("initializerCalled")) { - assertFalse(field.isStatic()); - assertTrue(field.getBaseType().equals(boolean.class)); - } else { - fail(); // there is no other field - } - } - assertEquals(type.getMethods().size(), 3); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/CreationalContextForNonContextualTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/CreationalContextForNonContextualTest.java deleted file mode 100644 index a2b0295e7d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/CreationalContextForNonContextualTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual; - -import static org.jboss.cdi.tck.cdi.Sections.BM_OBTAIN_CREATIONALCONTEXT; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class CreationalContextForNonContextualTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(CreationalContextForNonContextualTest.class).build(); - } - - @Test - @SpecAssertion(section = BM_OBTAIN_CREATIONALCONTEXT, id = "b") - public void testCreationalContext() { - assert getCurrentManager().createCreationalContext(null) != null; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/Farm.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/Farm.java deleted file mode 100644 index 010a37358b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/Farm.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; -import jakarta.inject.Named; - -@Dependent -@Named("farm") -public class Farm { - @Inject - private Sheep sheep; - private boolean initializerCalled = false; - - @Inject - public void initialize(Sheep sheep) { - initializerCalled = sheep != null; - } - - public boolean isInitializerCalled() { - return initializerCalled; - } - - public boolean isSheepInjected() { - return sheep != null; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/InjectionIntoNonContextualComponentTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/InjectionIntoNonContextualComponentTest.java deleted file mode 100644 index fb973c23ba..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/InjectionIntoNonContextualComponentTest.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.PERSISTENCE; -import static org.jboss.cdi.tck.cdi.Sections.FIELDS_INITIALIZER_METHODS_EE; -import static org.jboss.cdi.tck.cdi.Sections.INITIALIZER_METHODS_EE; -import static org.jboss.cdi.tck.cdi.Sections.INJECTED_FIELDS_EE; -import static org.jboss.cdi.tck.cdi.Sections.INJECTION; -import static org.jboss.cdi.tck.cdi.Sections.INJECTION_EE; - -import java.net.URL; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.WebResponse; - -@SpecVersion(spec = "cdi", version = "2.0") -public class InjectionIntoNonContextualComponentTest extends AbstractTest { - - @ArquillianResource - private URL contextPath; - - @Deployment(testable = false) - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(InjectionIntoNonContextualComponentTest.class) - .withClasses(Farm.class, ProcessAnnotatedTypeObserver.class, SessionBean.class, Sheep.class, - TagLibraryListener.class, - TestFilter.class, TestListener.class, TestServlet.class, TestTagHandler.class) - .withWebXml("web2.xml") - .withWebResource("ManagedBeanTestPage.xhtml", "ManagedBeanTestPage.xhtml") - .withWebResource("TagPage.jsp", "TagPage.jsp") - .withWebResource("TestLibrary.tld", "WEB-INF/TestLibrary.tld") - .withDefaultPersistenceXml().build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = INJECTION_EE, id = "ef"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "ae"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "bn"), - @SpecAssertion(section = INJECTED_FIELDS_EE, id = "b") }) - public void testInjectionIntoServlet() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "Test/Servlet?test=injection"); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "af"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "bm"), - @SpecAssertion(section = INITIALIZER_METHODS_EE, id = "b") }) - public void testServletInitializerMethodCalled() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "Test/Servlet?test=initializer"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "bo") - public void testServletInitCalledAfterResourceInjection() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "Test/Servlet?test=resource"); - webClient.getPage(contextPath + "Test/Servlet?test=ejb"); - } - - @Test(groups = { INTEGRATION, PERSISTENCE }) - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "bo") - public void testServletInitCalledAfterPersistenceResourceInjection() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "Test/Servlet?test=persistence"); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = INJECTION_EE, id = "eg"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "ag"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "bq"), - @SpecAssertion(section = INJECTED_FIELDS_EE, id = "b") }) - public void testInjectionIntoFilter() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "TestFilter?test=injection"); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "ah"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "bp"), - @SpecAssertion(section = INITIALIZER_METHODS_EE, id = "b") }) - public void testFilterInitializerMethodCalled() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "TestFilter?test=initializer"); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "br") - public void testFilterInitCalledAfterResourceInjection() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "TestFilter?test=resource"); - webClient.getPage(contextPath + "TestFilter?test=ejb"); - } - - @Test(groups = { INTEGRATION, PERSISTENCE }) - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "br") - public void testFilterInitCalledAfterPersistenceResourceInjection() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "TestFilter?test=persistence"); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = INJECTION_EE, id = "ea"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "ai"), - @SpecAssertion(section = INJECTED_FIELDS_EE, id = "b") }) - public void testInjectionIntoServletListener() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "Test/ServletListener?test=injection"); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "aj"), - @SpecAssertion(section = INITIALIZER_METHODS_EE, id = "b") }) - public void testServletListenerInitializerMethodCalled() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "Test/ServletListener?test=initializer"); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = INJECTION_EE, id = "eb"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "am"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "an"), - @SpecAssertion(section = INJECTED_FIELDS_EE, id = "b") }) - public void testInjectionIntoTagHandler() throws Exception { - WebClient webClient = new WebClient(); - WebResponse response = webClient.getPage(contextPath + "TagPage.jsp").getWebResponse(); - assert response.getStatusCode() == 200; - assert response.getContentAsString().contains(TestTagHandler.INJECTION_SUCCESS); - assert response.getContentAsString().contains(TestTagHandler.INITIALIZER_SUCCESS); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = INJECTION_EE, id = "ec"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "as"), - @SpecAssertion(section = INJECTED_FIELDS_EE, id = "b") }) - public void testInjectionIntoTagLibraryListener() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "Test/TagLibraryListener?test=injection"); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "at"), - @SpecAssertion(section = INITIALIZER_METHODS_EE, id = "b") }) - public void testTagLibraryListenerInitializerMethodCalled() throws Exception { - WebClient webClient = new WebClient(); - webClient.getPage(contextPath + "Test/TagLibraryListener?test=initializer"); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = INJECTION, id = "d"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "au"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "av"), - @SpecAssertion(section = INJECTED_FIELDS_EE, id = "b") }) - public void testInjectionIntoJSFManagedBean() throws Exception { - WebClient webclient = new WebClient(); - String content = webclient.getPage(contextPath + "ManagedBeanTestPage.jsf").getWebResponse().getContentAsString(); - assert content.contains("Injection works"); - assert content.contains("Initializer works"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/ProcessAnnotatedTypeObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/ProcessAnnotatedTypeObserver.java deleted file mode 100644 index eee15529c7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/ProcessAnnotatedTypeObserver.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.BeforeShutdown; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessAnnotatedType; - -public class ProcessAnnotatedTypeObserver implements Extension { - private static AnnotatedType servletEvent = null; - private static AnnotatedType listenerEvent = null; - private static AnnotatedType filterEvent = null; - private static AnnotatedType tagLibraryListenerEvent = null; - private static AnnotatedType tagHandlerEvent = null; - private static AnnotatedType jsfManagedBeanEvent = null; - private static AnnotatedType sessionBeanEvent = null; - - public void cleanup(@Observes BeforeShutdown shutdown) { - servletEvent = null; - listenerEvent = null; - filterEvent = null; - tagLibraryListenerEvent = null; - tagHandlerEvent = null; - jsfManagedBeanEvent = null; - sessionBeanEvent = null; - } - - public void observeServlet(@Observes ProcessAnnotatedType event) { - servletEvent = event.getAnnotatedType(); - } - - public void observeSessionBean(@Observes ProcessAnnotatedType event) { - sessionBeanEvent = event.getAnnotatedType(); - } - - public void observeFilter(@Observes ProcessAnnotatedType event) { - filterEvent = event.getAnnotatedType(); - } - - public void observeListener(@Observes ProcessAnnotatedType event) { - listenerEvent = event.getAnnotatedType(); - } - - public void observeTagHandler(@Observes ProcessAnnotatedType event) { - tagHandlerEvent = event.getAnnotatedType(); - } - - public void observeTagLibraryListener(@Observes ProcessAnnotatedType event) { - tagLibraryListenerEvent = event.getAnnotatedType(); - } - - public void observeJsfManagedBean(@Observes ProcessAnnotatedType event) { - jsfManagedBeanEvent = event.getAnnotatedType(); - } - - public static AnnotatedType getServletEvent() { - return servletEvent; - } - - public static AnnotatedType getListenerEvent() { - return listenerEvent; - } - - public static AnnotatedType getFilterEvent() { - return filterEvent; - } - - public static AnnotatedType getTagLibraryListenerEvent() { - return tagLibraryListenerEvent; - } - - public static AnnotatedType getTagHandlerEvent() { - return tagHandlerEvent; - } - - public static AnnotatedType getJsfManagedBeanEvent() { - return jsfManagedBeanEvent; - } - - public static AnnotatedType getSessionBeanEvent() { - return sessionBeanEvent; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/SessionBean.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/SessionBean.java deleted file mode 100644 index 6441150131..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/SessionBean.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual; - -import jakarta.ejb.Stateless; - -@Stateless -public class SessionBean { - - public boolean ping() { - return true; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/Sheep.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/Sheep.java deleted file mode 100644 index 5b5a3c1300..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/Sheep.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Sheep { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TagLibraryListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TagLibraryListener.java deleted file mode 100644 index 363bfccb0b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TagLibraryListener.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletContextEvent; -import jakarta.servlet.ServletContextListener; - -public class TagLibraryListener implements ServletContextListener { - @Inject - private Sheep sheep; - private boolean initializerCalled = false; - - @Inject - public void initialize(Sheep sheep) { - initializerCalled = sheep != null; - } - - public void contextDestroyed(ServletContextEvent sce) { - } - - public void contextInitialized(ServletContextEvent sce) { - sce.getServletContext().setAttribute("tag.library.listener.injected", sheep != null); - sce.getServletContext().setAttribute("tag.library.listener.initializer.called", initializerCalled); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestFilter.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestFilter.java deleted file mode 100644 index 646270eb2a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestFilter.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual; - -import java.io.IOException; - -import jakarta.annotation.Resource; -import jakarta.ejb.EJB; -import jakarta.inject.Inject; -import jakarta.persistence.EntityManager; -import jakarta.persistence.EntityManagerFactory; -import jakarta.persistence.PersistenceContext; -import jakarta.persistence.PersistenceUnit; -import jakarta.servlet.Filter; -import jakarta.servlet.FilterChain; -import jakarta.servlet.FilterConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.ServletResponse; -import jakarta.servlet.http.HttpServletResponse; - -public class TestFilter implements Filter { - - @Inject - private Sheep sheep; - - @Resource(name = "greeting") - String greeting; - - String game; - - SessionBean sessionBean; - - EntityManager persistenceContext; - - EntityManagerFactory persistenceUnit; - - private boolean injectionPerformedCorrectly = false; - private boolean initializerCalled = false; - private boolean initCalledAfterInitializer = false; - private boolean initCalledAfterResourceInjection = false; - private boolean initCalledAfterEJBResourceInjection = false; - private boolean initCalledAfterPersistenceResourceInjection = false; - - @Inject - public void initialize(Sheep sheep) { - initializerCalled = sheep != null; - } - - public void destroy() { - } - - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, - ServletException { - HttpServletResponse resp = (HttpServletResponse) response; - - if (request.getParameter("test").equals("injection")) { - // Return 200 if injection into Filter occurred, 500 otherwise - resp.setStatus(injectionPerformedCorrectly ? 200 : 500); - } else if (request.getParameter("test").equals("initializer")) { - // Return 200 if the initializer was called, 500 otherwise - resp.setStatus(initCalledAfterInitializer ? 200 : 500); - } else if (request.getParameter("test").equals("resource")) { - // Return 200 if the resource was injected before init, 500 otherwise - resp.setStatus(initCalledAfterResourceInjection ? 200 : 500); - } else if (request.getParameter("test").equals("ejb")) { - // Return 200 if the resource was injected before init, 500 otherwise - resp.setStatus(initCalledAfterEJBResourceInjection ? 200 : 500); - } else if (request.getParameter("test").equals("persistence")) { - // Return 200 if the resource was injected before init, 500 otherwise - resp.setStatus(initCalledAfterPersistenceResourceInjection ? 200 : 500); - } else { - resp.setStatus(404); - } - } - - public void init(FilterConfig filterConfig) throws ServletException { - injectionPerformedCorrectly = sheep != null; - initCalledAfterInitializer = initializerCalled; - initCalledAfterResourceInjection = "Hello".equals(greeting) && "poker".equals(game); - initCalledAfterEJBResourceInjection = sessionBean.ping(); - initCalledAfterPersistenceResourceInjection = (persistenceContext != null) && (persistenceUnit != null); - } - - @Resource(name = "game") - private void setGame(String game) { - this.game = game; - } - - @EJB - private void setSessionBean(SessionBean sessionBean) { - this.sessionBean = sessionBean; - } - - @PersistenceContext - private void setPersistenceContext(EntityManager persistenceContext) { - this.persistenceContext = persistenceContext; - } - - @PersistenceUnit - private void setPersistenceUnit(EntityManagerFactory persistenceUnit) { - this.persistenceUnit = persistenceUnit; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestListener.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestListener.java deleted file mode 100644 index a4aa916af9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestListener.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual; - -import jakarta.inject.Inject; -import jakarta.servlet.ServletContextEvent; -import jakarta.servlet.ServletContextListener; - -public class TestListener implements ServletContextListener { - @Inject - private Sheep sheep; - private boolean initializerCalled = false; - - @Inject - public void initialize(Sheep sheep) { - initializerCalled = sheep != null; - } - - public void contextDestroyed(ServletContextEvent sce) { - } - - public void contextInitialized(ServletContextEvent sce) { - sce.getServletContext().setAttribute("listener.injected", sheep != null); - sce.getServletContext().setAttribute("listener.initializer.called", initializerCalled); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestServlet.java deleted file mode 100644 index 38134e9fbc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestServlet.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual; - -import java.io.IOException; - -import jakarta.annotation.Resource; -import jakarta.ejb.EJB; -import jakarta.inject.Inject; -import jakarta.persistence.EntityManager; -import jakarta.persistence.EntityManagerFactory; -import jakarta.persistence.PersistenceContext; -import jakarta.persistence.PersistenceUnit; -import jakarta.servlet.ServletConfig; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -public class TestServlet extends HttpServlet { - - @Inject - private Sheep sheep; - - @Resource(name = "greeting") - String greeting; - - String game; - - SessionBean sessionBean; - - EntityManager persistenceContext; - - EntityManagerFactory persistenceUnit; - - private boolean injectionPerformedCorrectly = false; - private boolean initializerCalled = false; - private boolean initCalledAfterInitializer = false; - private boolean initCalledAfterResourceInjection = false; - private boolean initCalledAfterEJBResourceInjection = false; - private boolean initCalledAfterPersistenceResourceInjection = false; - - private static final long serialVersionUID = -7672096092047821010L; - - @Inject - public void initialize(Sheep sheep) { - initializerCalled = sheep != null; - } - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - if (req.getRequestURI().endsWith("Servlet")) { - testServlet(req, resp); - } else if (req.getRequestURI().endsWith("ServletListener")) { - testListener(req, resp); - } else if (req.getRequestURI().endsWith("TagLibraryListener")) { - testTagLibraryListener(req, resp); - } else { - resp.setStatus(404); - } - } - - private void testServlet(HttpServletRequest req, HttpServletResponse resp) { - if (req.getParameter("test").equals("injection")) { - // Return 200 if injection into Servlet occurred, 500 otherwise - resp.setStatus(injectionPerformedCorrectly ? 200 : 500); - } else if (req.getParameter("test").equals("initializer")) { - // Return 200 if the initializer was called, 500 otherwise - resp.setStatus(initCalledAfterInitializer ? 200 : 500); - } else if (req.getParameter("test").equals("resource")) { - // Return 200 if the resource was injected before init, 500 otherwise - resp.setStatus(initCalledAfterResourceInjection ? 200 : 500); - } else if (req.getParameter("test").equals("ejb")) { - // Return 200 if the resource was injected before init, 500 otherwise - resp.setStatus(initCalledAfterEJBResourceInjection ? 200 : 500); - } else if (req.getParameter("test").equals("persistence")) { - // Return 200 if the resource was injected before init, 500 otherwise - resp.setStatus(initCalledAfterPersistenceResourceInjection ? 200 : 500); - } else { - resp.setStatus(404); - } - } - - private void testListener(HttpServletRequest req, HttpServletResponse resp) { - if (req.getParameter("test").equals("injection")) { - // Return 200 if injection into Listener occurred, 500 otherwise - boolean result = (Boolean) req.getSession().getServletContext().getAttribute("listener.injected"); - resp.setStatus((result) ? 200 : 500); - } else if (req.getParameter("test").equals("initializer")) { - // Return 200 if the initializer was called, 500 otherwise - boolean result = (Boolean) req.getSession().getServletContext().getAttribute("listener.initializer.called"); - resp.setStatus((result) ? 200 : 500); - } else { - resp.setStatus(404); - } - } - - private void testTagLibraryListener(HttpServletRequest req, HttpServletResponse resp) { - if (req.getParameter("test").equals("injection")) { - // Return 200 if injection into TagLibrary Listener occurred, 500 otherwise - boolean result = (Boolean) req.getSession().getServletContext().getAttribute("tag.library.listener.injected"); - resp.setStatus((result) ? 200 : 500); - } else if (req.getParameter("test").equals("initializer")) { - // Return 200 if the initializer was called, 500 otherwise - boolean result = (Boolean) req.getSession().getServletContext() - .getAttribute("tag.library.listener.initializer.called"); - resp.setStatus((result) ? 200 : 500); - } else { - resp.setStatus(404); - } - } - - @Override - public void init() throws ServletException { - injectionPerformedCorrectly = sheep != null; - initCalledAfterInitializer = initializerCalled; - initCalledAfterResourceInjection = "Hello".equals(greeting) && "poker".equals(game); - initCalledAfterEJBResourceInjection = sessionBean.ping(); - initCalledAfterPersistenceResourceInjection = (persistenceContext != null) && (persistenceUnit != null); - } - - @Override - public void init(ServletConfig config) throws ServletException { - init(); - } - - @Resource(name = "game") - private void setGame(String game) { - this.game = game; - } - - @EJB - private void setSessionBean(SessionBean sessionBean) { - this.sessionBean = sessionBean; - } - - @PersistenceContext - private void setPersistenceContext(EntityManager persistenceContext) { - this.persistenceContext = persistenceContext; - } - - @PersistenceUnit - private void setPersistenceUnit(EntityManagerFactory persistenceUnit) { - this.persistenceUnit = persistenceUnit; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestTagHandler.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestTagHandler.java deleted file mode 100644 index 2c02ef176c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestTagHandler.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual; - -import java.io.IOException; - -import jakarta.enterprise.inject.Any; -import jakarta.inject.Inject; -import jakarta.servlet.jsp.JspException; -import jakarta.servlet.jsp.tagext.SimpleTagSupport; - -@Any -public class TestTagHandler extends SimpleTagSupport { - private static final long serialVersionUID = -3048065065359948044L; - public static final String INJECTION_SUCCESS = "Injection works."; - public static final String INITIALIZER_SUCCESS = "Initializer works."; - - @Inject - private Sheep sheep; - private boolean initializerCalled = false; - - @Inject - public void initialize(Sheep sheep) { - initializerCalled = sheep != null; - } - - @Override - public void doTag() throws JspException, IOException { - if (sheep != null) { - getJspContext().getOut().write(INJECTION_SUCCESS); - } - if (initializerCalled) { - getJspContext().getOut().append(INITIALIZER_SUCCESS); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/AmbiguousInjectionIntoNonContextualComponentTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/AmbiguousInjectionIntoNonContextualComponentTest.java deleted file mode 100644 index 9cdd64f13e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/AmbiguousInjectionIntoNonContextualComponentTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual.broken.ambiguous; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.UNSATISFIED_AND_AMBIG_DEPENDENCIES_EE; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class AmbiguousInjectionIntoNonContextualComponentTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(AmbiguousInjectionIntoNonContextualComponentTest.class).build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = UNSATISFIED_AND_AMBIG_DEPENDENCIES_EE, id = "ah") }) - public void testInjectionIntoServlet() throws Exception { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/Animal.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/Animal.java deleted file mode 100644 index a57b8ae982..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/Animal.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual.broken.ambiguous; - -public class Animal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/Cow.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/Cow.java deleted file mode 100644 index 3ac69e75cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/Cow.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual.broken.ambiguous; - -public class Cow extends Animal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/TestServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/TestServlet.java deleted file mode 100644 index f3a3f4fc7b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/ambiguous/TestServlet.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual.broken.ambiguous; - -import jakarta.inject.Inject; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; - -@WebServlet("/test") -public class TestServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - @Inject - Animal animal; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/unsatisfied/TestServlet.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/unsatisfied/TestServlet.java deleted file mode 100644 index be08fc2682..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/unsatisfied/TestServlet.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual.broken.unsatisfied; - -import java.io.File; - -import jakarta.inject.Inject; -import jakarta.servlet.annotation.WebServlet; -import jakarta.servlet.http.HttpServlet; - -@WebServlet("/test") -public class TestServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - @Inject - public void initialize(File file) { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/unsatisfied/UnsatisfiedInjectionIntoNonContextualComponentTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/unsatisfied/UnsatisfiedInjectionIntoNonContextualComponentTest.java deleted file mode 100644 index b2e005cde4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/broken/unsatisfied/UnsatisfiedInjectionIntoNonContextualComponentTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.non.contextual.broken.unsatisfied; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.UNSATISFIED_AND_AMBIG_DEPENDENCIES_EE; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class UnsatisfiedInjectionIntoNonContextualComponentTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(UnsatisfiedInjectionIntoNonContextualComponentTest.class).build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = UNSATISFIED_AND_AMBIG_DEPENDENCIES_EE, id = "ad") }) - public void testInjectionIntoServlet() throws Exception { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/persistence/PersistenceResourceInjectionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/persistence/PersistenceResourceInjectionTest.java deleted file mode 100644 index ff1b80774b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/persistence/PersistenceResourceInjectionTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.persistence; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.PERSISTENCE; -import static org.jboss.cdi.tck.cdi.Sections.FIELDS_INITIALIZER_METHODS_EE; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class PersistenceResourceInjectionTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(PersistenceResourceInjectionTest.class) - .withDefaultPersistenceXml().build(); - } - - @Test(groups = { PERSISTENCE, INTEGRATION }, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "bi"), - @SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "bj") }) - public void testInitializerMethodsAfterEEResourcePersistenceInjection(SpecialPersistor sp) throws Exception { - assertNotNull(sp); - assertTrue(sp.initializerCalledAfterResourceInjection); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/persistence/Persistor.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/persistence/Persistor.java deleted file mode 100644 index e001e20df7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/persistence/Persistor.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.persistence; - -import jakarta.enterprise.context.Dependent; -import jakarta.persistence.EntityManager; -import jakarta.persistence.EntityManagerFactory; -import jakarta.persistence.PersistenceContext; -import jakarta.persistence.PersistenceUnit; - -@Dependent -public class Persistor { - - @PersistenceContext - protected EntityManager superPersistenceContextField; - - protected EntityManager superPersistenceContext; - - @PersistenceUnit - protected EntityManagerFactory superPersistenceUnitField; - - protected EntityManagerFactory superPersistenceUnit; - - @PersistenceContext - private void setSuperPersistenceContext(EntityManager superPersistenceContext) { - this.superPersistenceContext = superPersistenceContext; - } - - @PersistenceUnit - private void setSuperPersistenceUnit(EntityManagerFactory superPersistenceUnit) { - this.superPersistenceUnit = superPersistenceUnit; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/persistence/SpecialPersistor.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/persistence/SpecialPersistor.java deleted file mode 100644 index d3a6c773d5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injection/persistence/SpecialPersistor.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2014, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injection.persistence; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; -import jakarta.persistence.EntityManager; -import jakarta.persistence.EntityManagerFactory; -import jakarta.persistence.PersistenceContext; -import jakarta.persistence.PersistenceUnit; - -@Dependent -public class SpecialPersistor extends Persistor { - - @PersistenceContext - EntityManager persistenceContextField; - - EntityManager persistenceContext; - - @PersistenceUnit - EntityManagerFactory persistenceUnitField; - - EntityManagerFactory persistenceUnit; - - public boolean initializerCalledAfterResourceInjection = false; - - @Inject - public void initialize() { - initializerCalledAfterResourceInjection = (persistenceContextField != null && persistenceContext != null - && superPersistenceContextField != null && superPersistenceContext != null - && persistenceUnitField != null && persistenceUnit != null - && superPersistenceUnitField != null && superPersistenceUnit != null); - } - - @PersistenceContext - private void setPersistenceContext(EntityManager persistenceContext) { - this.persistenceContext = persistenceContext; - } - - @PersistenceUnit - private void setPersistenceUnit(EntityManagerFactory persistenceUnit) { - this.persistenceUnit = persistenceUnit; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointTest.java deleted file mode 100644 index 7fb9526556..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/broken/not/bean/InjectionPointTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injectionpoint.broken.not.bean; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.INJECTION_POINT; - -import jakarta.enterprise.inject.spi.DefinitionException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class InjectionPointTest extends AbstractTest { - - @ShouldThrowException(DefinitionException.class) - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(InjectionPointTest.class).withWebXml("web.xml").build(); - } - - @Test - @SpecAssertion(section = INJECTION_POINT, id = "h") - public void testDefinitionErrorDetected() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/broken/not/bean/TestServlet_Broken.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/broken/not/bean/TestServlet_Broken.java deleted file mode 100644 index da22ea45f0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/broken/not/bean/TestServlet_Broken.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.injectionpoint.broken.not.bean; - -import jakarta.enterprise.inject.spi.InjectionPoint; -import jakarta.inject.Inject; -import jakarta.servlet.http.HttpServlet; - -@SuppressWarnings("serial") -public class TestServlet_Broken extends HttpServlet { - @SuppressWarnings("unused") - @Inject - private InjectionPoint ip; - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/Bar.java deleted file mode 100644 index c1555e7578..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/Bar.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.injectionpoint.non.contextual; - -import jakarta.ejb.Stateful; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - */ -@Stateful(name = "Bar") -public class Bar { - - @Inject - private Foo foo; - - public Foo getFoo() { - return foo; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/Baz.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/Baz.java deleted file mode 100644 index 9e80cf52c6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/Baz.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.injectionpoint.non.contextual; - -import jakarta.ejb.Stateful; -import jakarta.inject.Inject; - -/** - * @author Jozef Hartinger - */ -@Stateful -public class Baz { - - @Inject - private Foo foo; - - public Foo getFoo() { - return foo; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/Foo.java deleted file mode 100644 index c0e60c1f3f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/Foo.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.injectionpoint.non.contextual; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.spi.InjectionPoint; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - * - */ -@Dependent -public class Foo { - - @Inject - private InjectionPoint injectionPoint; - - public InjectionPoint getInjectionPoint() { - return injectionPoint; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/NonContextualInjectionPointTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/NonContextualInjectionPointTest.java deleted file mode 100644 index c200298784..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/injectionpoint/non/contextual/NonContextualInjectionPointTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.injectionpoint.non.contextual; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.INJECTION_POINT; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertNull; - -import javax.naming.InitialContext; - -import jakarta.enterprise.inject.Instance; -import jakarta.enterprise.inject.spi.Bean; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class NonContextualInjectionPointTest extends AbstractTest { - - @Inject - private Instance baz; - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClassPackage(NonContextualInjectionPointTest.class).build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = INJECTION_POINT, id = "aaa") - public void testNonContextualEjbInjectionPointGetBean() throws Exception { - Bar bar = (Bar) new InitialContext().lookup("java:module/Bar"); - Bean bean = bar.getFoo().getInjectionPoint().getBean(); - assertNull(bean); - } - - @Test(groups = INTEGRATION) - @SpecAssertion(section = INJECTION_POINT, id = "aa") - public void testContextualEjbInjectionPointGetBean() throws Exception { - Bean bean = baz.get().getFoo().getInjectionPoint().getBean(); - assertNotNull(bean); - assertEquals(bean.getBeanClass(), Baz.class); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/jndi/JndiBeanManagerInjected.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/jndi/JndiBeanManagerInjected.java deleted file mode 100644 index 170c56847d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/jndi/JndiBeanManagerInjected.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.jndi; - -import javax.naming.NamingException; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.spi.BeanManager; - -import org.jboss.cdi.tck.util.JndiLookupUtils; - -/** - * @author pmuir - * - */ -@Stateful -public class JndiBeanManagerInjected { - - public BeanManager getManagerFromJndi() throws NamingException { - return (BeanManager) JndiLookupUtils.lookup("java:comp/BeanManager"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/jndi/ManagerTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/jndi/ManagerTest.java deleted file mode 100644 index 88135c80b9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/jndi/ManagerTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.jndi; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PROVIDER_EE; -import static org.testng.Assert.assertNotNull; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class ManagerTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(ManagerTest.class).withClasses(JndiBeanManagerInjected.class).build(); - } - - @Inject - JndiBeanManagerInjected jndiBeanManagerInjected; - - @Test(groups = INTEGRATION) - @SpecAssertion(section = PROVIDER_EE, id = "d") - public void testManagerLookupInJndi() throws Exception { - assertNotNull(jndiBeanManagerInjected); - assertNotNull(jndiBeanManagerInjected.getManagerFromJndi()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/jndi/ManagerTestEar.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/jndi/ManagerTestEar.java deleted file mode 100644 index e3fca414ff..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/jndi/ManagerTestEar.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.jndi; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.PROVIDER_EE; -import static org.testng.Assert.assertNotNull; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class ManagerTestEar extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - return new EnterpriseArchiveBuilder().withTestClass(ManagerTestEar.class).withClasses(JndiBeanManagerInjected.class) - .build(); - } - - @Inject - JndiBeanManagerInjected jndiBeanManagerInjected; - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = PROVIDER_EE, id = "d") - public void testManagerLookupInJndi() throws Exception { - assertNotNull(jndiBeanManagerInjected); - assertNotNull(jndiBeanManagerInjected.getManagerFromJndi()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/AfterDeploymentValidationObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/AfterDeploymentValidationObserver.java deleted file mode 100644 index 1ed5190ff0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/AfterDeploymentValidationObserver.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.provider.init; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AfterDeploymentValidation; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.CDI; -import jakarta.enterprise.inject.spi.Extension; - -public class AfterDeploymentValidationObserver implements Extension { - - private BeanManager beanManager; - - public void observeDeploymentValidation(@Observes AfterDeploymentValidation event) { - beanManager = CDI.current().getBeanManager(); - } - - public BeanManager getBeanManager() { - return beanManager; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Alpha.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Alpha.java deleted file mode 100644 index 9bfa1a93a6..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Alpha.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.provider.init; - -import jakarta.enterprise.inject.Alternative; - -@Alternative -public class Alpha implements Marker { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Bar.java deleted file mode 100644 index 441e64df14..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Bar.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.provider.init; - -public class Bar { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Baz.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Baz.java deleted file mode 100644 index 449446fc85..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Baz.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.provider.init; - -public class Baz { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Bravo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Bravo.java deleted file mode 100644 index 2a37baa46e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Bravo.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.provider.init; - -import jakarta.enterprise.inject.Alternative; - -@Alternative -public class Bravo implements Marker { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/CDIProviderInitTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/CDIProviderInitTest.java deleted file mode 100644 index 595390783d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/CDIProviderInitTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.provider.init; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_ARCHIVE; -import static org.jboss.cdi.tck.cdi.Sections.PROVIDER; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import jakarta.enterprise.inject.spi.CDI; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.full.extensions.alternative.deployment.Bar; -import org.jboss.cdi.tck.tests.full.extensions.alternative.deployment.Foo; -import org.jboss.shrinkwrap.api.BeanDiscoveryMode; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test {@link CDI} after the container fires the BeforeBeanDiscovery container lifecycle event until the application - * initialization is completed. - * - *

- * This test was originally part of Weld test suite. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class CDIProviderInitTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(CDIProviderInitTest.class) - .withClasses(Alpha.class, MarkerObtainerWar.class, Foo.class, Marker.class, - AfterDeploymentValidationObserver.class) - .withExtension(AfterDeploymentValidationObserver.class) - .withBeansXml(new BeansXml(BeanDiscoveryMode.ALL).alternatives(Alpha.class)) - .withBeanLibrary( - new BeansXml(BeanDiscoveryMode.ALL).alternatives(Bravo.class), - Bravo.class, MarkerObtainerBda1.class, Bar.class) - .withBeanLibrary( - new BeansXml(BeanDiscoveryMode.ALL).alternatives(Charlie.class), - Charlie.class, MarkerObtainerBda2.class, Baz.class) - .withLibrary(MarkerObtainerNonBda.class, NonBdaAfterDeploymentValidationObserver.class).build(); - } - - @Inject - AfterDeploymentValidationObserver bdaExtension; - - @Inject - NonBdaAfterDeploymentValidationObserver nonbdaExtension; - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = PROVIDER, id = "aa"), @SpecAssertion(section = BEAN_ARCHIVE, id = "n") }) - public void testAccessingBeanManager() { - - // War itself - assertNotNull(bdaExtension.getBeanManager()); - assertEquals(bdaExtension.getBeanManager(), getCurrentManager()); - - assertEquals(MarkerObtainerWar.getBeans(Marker.class).size(), 1); - assertEquals(MarkerObtainerWar.getBeans(Marker.class).iterator().next().getBeanClass(), Alpha.class); - assertEquals(MarkerObtainerWar.getBeans(Foo.class).size(), 1); - assertEquals(MarkerObtainerWar.getBeans(Bar.class).size(), 1); - // BDA 1 - assertEquals(MarkerObtainerBda1.getBeans(Marker.class).size(), 1); - assertEquals(MarkerObtainerBda1.getBeans(Marker.class).iterator().next().getBeanClass(), Bravo.class); - assertEquals(MarkerObtainerBda1.getBeans(Foo.class).size(), 1); - assertEquals(MarkerObtainerBda1.getBeans(Bar.class).size(), 1); - // BDA 2 - assertEquals(MarkerObtainerBda2.getBeans(Marker.class).size(), 1); - assertEquals(MarkerObtainerBda2.getBeans(Marker.class).iterator().next().getBeanClass(), Charlie.class); - assertEquals(MarkerObtainerBda2.getBeans(Baz.class).size(), 1); - assertEquals(MarkerObtainerBda2.getBeans(Bar.class).size(), 1); - - // non-bda - assertNotNull(nonbdaExtension.getBeanManager()); - assertEquals(nonbdaExtension.getBeanManager().getBeans(Marker.class).size(), 0); - assertEquals(MarkerObtainerNonBda.getBeans(Marker.class).size(), 0); - assertEquals(MarkerObtainerNonBda.getBeans(Foo.class).size(), 1); - assertEquals(MarkerObtainerNonBda.getBeans(Bar.class).size(), 1); - assertEquals(MarkerObtainerNonBda.getBeans(Baz.class).size(), 1); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Charlie.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Charlie.java deleted file mode 100644 index 75d7314c93..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Charlie.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.provider.init; - -import jakarta.enterprise.inject.Alternative; - -@Alternative -public class Charlie implements Marker { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Foo.java deleted file mode 100644 index e83b1f11fb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Foo.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.provider.init; - -public class Foo { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Marker.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Marker.java deleted file mode 100644 index 36ab24b80c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/Marker.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.provider.init; - -public interface Marker { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerBda1.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerBda1.java deleted file mode 100644 index afaf523f40..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerBda1.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.provider.init; - -import java.util.Set; - -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.CDI; - -public class MarkerObtainerBda1 { - - public static Set> getBeans(Class clazz) { - return CDI.current().getBeanManager().getBeans(clazz); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerBda2.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerBda2.java deleted file mode 100644 index 93327c0226..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerBda2.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.provider.init; - -import java.util.Set; - -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.CDI; - -public class MarkerObtainerBda2 { - - public static Set> getBeans(Class clazz) { - return CDI.current().getBeanManager().getBeans(clazz); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerNonBda.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerNonBda.java deleted file mode 100644 index f1fbaa3636..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerNonBda.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.provider.init; - -import java.util.Set; - -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.CDI; - -public class MarkerObtainerNonBda { - - public static Set> getBeans(Class clazz) { - return CDI.current().getBeanManager().getBeans(clazz); - } - - public static BeanManager getBeanManager() { - return CDI.current().getBeanManager(); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerWar.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerWar.java deleted file mode 100644 index 63922560c7..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/MarkerObtainerWar.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.provider.init; - -import java.util.Set; - -import jakarta.enterprise.inject.spi.Bean; -import jakarta.enterprise.inject.spi.CDI; - -public class MarkerObtainerWar { - - public static Set> getBeans(Class clazz) { - return CDI.current().getBeanManager().getBeans(clazz); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/NonBdaAfterDeploymentValidationObserver.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/NonBdaAfterDeploymentValidationObserver.java deleted file mode 100644 index 7ad50e743a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/init/NonBdaAfterDeploymentValidationObserver.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.provider.init; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AfterDeploymentValidation; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.CDI; -import jakarta.enterprise.inject.spi.Extension; - -public class NonBdaAfterDeploymentValidationObserver implements Extension { - - private BeanManager beanManager; - - public void observeDeploymentValidation(@Observes AfterDeploymentValidation event) { - beanManager = CDI.current().getBeanManager(); - } - - public BeanManager getBeanManager() { - return beanManager; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/Alpha.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/Alpha.java deleted file mode 100644 index 93a03fd6bc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/Alpha.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.manager.provider.runtime; - -import jakarta.enterprise.context.Dependent; - -/** - * @author Martin Kouba - * - */ -@Powerful -@Dependent -public class Alpha { - - public boolean ping() { - return true; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/AlphaLocator.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/AlphaLocator.java deleted file mode 100644 index 2c3d809201..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/AlphaLocator.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.manager.provider.runtime; - -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.CDI; - -/** - * @author Martin Kouba - * - */ -public final class AlphaLocator { - - public static BeanManager getBeanManager() { - return CDI.current().getBeanManager(); - } - - public static Alpha lookupAlpha() { - return CDI.current().select(Alpha.class, PowerfulLiteral.INSTANCE).get(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/Bravo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/Bravo.java deleted file mode 100644 index 631ae47cd5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/Bravo.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.manager.provider.runtime; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Alternative; -import jakarta.inject.Inject; - -/** - * @author Martin Kouba - * - */ -@Alternative -@Dependent -public class Bravo { - - @Powerful - @Inject - Alpha alpha; - - public boolean ping() { - return alpha.ping(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/BravoLocator.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/BravoLocator.java deleted file mode 100644 index 1a54964874..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/BravoLocator.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.manager.provider.runtime; - -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.CDI; - -/** - * @author Martin Kouba - * - */ -public final class BravoLocator { - - private BravoLocator() { - } - - public static BeanManager getBeanManager() { - return CDI.current().getBeanManager(); - } - - public static Bravo lookupBravo() { - return CDI.current().select(Bravo.class).get(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/BravoMarker.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/BravoMarker.java deleted file mode 100644 index d36b3639ce..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/BravoMarker.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.manager.provider.runtime; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.spi.BeanManager; - -/** - * @author Martin Kouba - * - */ -@Dependent -public class BravoMarker { - - public BeanManager getBeanManager() { - return BravoLocator.getBeanManager(); - } - - public Bravo lookupBravo() { - return BravoLocator.lookupBravo(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/CDIProviderRuntimeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/CDIProviderRuntimeTest.java deleted file mode 100644 index 1856728182..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/CDIProviderRuntimeTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.manager.provider.runtime; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PROVIDER; -import static org.jboss.cdi.tck.cdi.Sections.PROVIDER_EE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.CDI; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test {@link CDI} after the application initialization is completed until the application shutdown starts. - * - * @author Martin Kouba - */ -@Test(groups = INTEGRATION) -@SpecVersion(spec = "cdi", version = "2.0") -public class CDIProviderRuntimeTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(CDIProviderRuntimeTest.class) - // BDA01 - .withClasses(Alpha.class, Powerful.class, PowerfulLiteral.class, AlphaLocator.class) - // BDA01 - .withBeanLibrary( - new BeansXml().alternatives(Bravo.class), - Bravo.class, BravoLocator.class, BravoMarker.class) - .build(); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = PROVIDER, id = "ab") }) - public void testGetBeanManager(BravoMarker bravoMarker) { - - // Test BDA01 - BeanManager alphaManager = AlphaLocator.getBeanManager(); - assertNotNull(alphaManager); - assertEquals(alphaManager.getBeans(Alpha.class, PowerfulLiteral.INSTANCE).size(), 1); - // Bravo is an alternative enabled in BDA02 only - assertEquals(alphaManager.getBeans(Bravo.class).size(), 0); - - // Test BDA02 - assertNotNull(bravoMarker); - BeanManager bravoManager = bravoMarker.getBeanManager(); - assertNotNull(bravoManager); - assertEquals(bravoManager.getBeans(Alpha.class, PowerfulLiteral.INSTANCE).size(), 1); - assertEquals(bravoManager.getBeans(Bravo.class).size(), 1); - } - - @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertions({ @SpecAssertion(section = PROVIDER, id = "ac") }) - public void testLookup(BravoMarker bravoMarker) { - - // Test BDA01 - Alpha alpha = AlphaLocator.lookupAlpha(); - assertNotNull(alpha); - assertTrue(alpha.ping()); - - // Test BDA02 - assertNotNull(bravoMarker); - Bravo bravo = bravoMarker.lookupBravo(); - assertNotNull(bravo); - assertTrue(bravo.ping()); - } - - // @Test(expectedExceptions = UnsupportedOperationException.class) - @SpecAssertion(section = PROVIDER_EE, id = "e") - public void testCDIProviderInitializeThrowUnsupportedOperationException() { - // FIXME - // CDI.getCDIProvider().initialize(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/Powerful.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/Powerful.java deleted file mode 100644 index d0593d2317..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/Powerful.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.manager.provider.runtime; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Powerful { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/PowerfulLiteral.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/PowerfulLiteral.java deleted file mode 100644 index 3e95aed766..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/manager/provider/runtime/PowerfulLiteral.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.manager.provider.runtime; - -import jakarta.enterprise.util.AnnotationLiteral; - -/** - * @author Martin Kouba - * - */ -@SuppressWarnings("all") -public class PowerfulLiteral extends AnnotationLiteral implements Powerful { - - public static final PowerfulLiteral INSTANCE = new PowerfulLiteral(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/AlternativeEjbFoo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/AlternativeEjbFoo.java deleted file mode 100644 index e19aac98db..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/AlternativeEjbFoo.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.inject.Alternative; - -@Stateless -@Alternative -public class AlternativeEjbFoo implements EjbFooLocal { - - @Override - public int pong() { - return 42; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/AlternativeFoo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/AlternativeFoo.java deleted file mode 100644 index f723be9d97..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/AlternativeFoo.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Alternative; - -@Alternative -@Dependent -public class AlternativeFoo implements Foo { - - @Override - public int pong() { - return 42; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Bar.java deleted file mode 100644 index 0601726ad9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Bar.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -public interface Bar { - - public int ping(); - - public Foo getFoo(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/CashEjbFoo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/CashEjbFoo.java deleted file mode 100644 index ed8f7ac601..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/CashEjbFoo.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.ejb.Local; -import jakarta.ejb.LocalBean; -import jakarta.ejb.Stateless; -import jakarta.enterprise.inject.Specializes; - -@Specializes -@LocalBean -@Local(Foo.class) -@Stateless -public class CashEjbFoo extends PaymentEjbFoo { - - @Override - public int pong() { - return 0; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/CashFoo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/CashFoo.java deleted file mode 100644 index 11ca67aa06..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/CashFoo.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Specializes; - -@Specializes -@Dependent -public class CashFoo extends PaymentFoo { - - @Override - public int pong() { - return 0; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EjbFoo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EjbFoo.java deleted file mode 100644 index 632d4ad5a4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EjbFoo.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.ejb.Stateless; - -@Stateless -public class EjbFoo implements EjbFooLocal { - - @Override - public int pong() { - return 0; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EjbFooLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EjbFooLocal.java deleted file mode 100644 index 570be2277c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EjbFooLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.ejb.Local; - -@Local -public interface EjbFooLocal extends Foo { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledManagedBeanInjectionAvailability02Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledManagedBeanInjectionAvailability02Test.java deleted file mode 100644 index 2c546f81c3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledManagedBeanInjectionAvailability02Test.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * Test that bean in web module bean archive can inject enabled managed bean from another bean archive. - * - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnabledManagedBeanInjectionAvailability02Test extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - WebArchive webArchive = new WebArchiveBuilder().withTestClass(EnabledManagedBeanInjectionAvailability02Test.class) - .withClasses(ManagedFoo.class) - .withBeanLibrary(Foo.class, Bar.class).withBeanLibrary(WebBar.class) - .build(); - - return webArchive; - } - - @Inject - Bar bar; - - @Test - @SpecAssertions({ @SpecAssertion(section = INTER_MODULE_INJECTION, id = "c"), - @SpecAssertion(section = SELECTION, id = "aa") }) - public void testInjection() throws Exception { - Assert.assertEquals(bar.ping(), 0); - assert bar.getFoo() instanceof ManagedFoo; - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledManagedBeanInjectionAvailabilityTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledManagedBeanInjectionAvailabilityTest.java deleted file mode 100644 index 7aca8b50e4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledManagedBeanInjectionAvailabilityTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * Test that bean in web module can inject enabled managed bean from EJB module. - * - * Note that we DO NOT include test class in EJB module since we wouldn't be able to inject bean from web module (Java EE - * classloading requirements)! - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnabledManagedBeanInjectionAvailabilityTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(EnabledManagedBeanInjectionAvailabilityTest.class).withClasses(ManagedFoo.class) - .withBeanLibrary(Foo.class, Bar.class).build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(EnabledManagedBeanInjectionAvailabilityTest.class, WebBar.class).build()); - - return enterpriseArchive; - } - - @Inject - Bar bar; - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = INTER_MODULE_INJECTION, id = "c"), - @SpecAssertion(section = SELECTION, id = "aa") }) - public void testInjection() throws Exception { - Assert.assertEquals(bar.ping(), 0); - assert bar.getFoo() instanceof ManagedFoo; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerFieldInjectionAvailability02Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerFieldInjectionAvailability02Test.java deleted file mode 100644 index 37620d1388..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerFieldInjectionAvailability02Test.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * - * @author Matej Briskar - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnabledProducerFieldInjectionAvailability02Test extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - WebArchive webArchive = new WebArchiveBuilder().withTestClass(EnabledProducerFieldInjectionAvailability02Test.class) - .withClasses(FooFieldProducer.class, ProducedFoo.class).withBeanLibrary(Foo.class, Bar.class) - .withBeanLibrary(WebBar.class).build(); - return webArchive; - } - - @Inject - Bar bar; - - @Test - @SpecAssertions({ @SpecAssertion(section = INTER_MODULE_INJECTION, id = "e") }) - public void testInjection() throws Exception { - Assert.assertEquals(bar.ping(), 0); - assert bar.getFoo() instanceof ProducedFoo; - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerFieldInjectionAvailabilityTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerFieldInjectionAvailabilityTest.java deleted file mode 100644 index df5170b685..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerFieldInjectionAvailabilityTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * Test that bean in web module can inject enabled bean producer field from EJB module. - * - * Note that we DO NOT include test class in EJB module since we wouldn't be able to inject bean from web module (Java EE - * classloading requirements)! - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnabledProducerFieldInjectionAvailabilityTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(EnabledProducerFieldInjectionAvailabilityTest.class) - .withClasses(FooFieldProducer.class, ProducedFoo.class).withBeanLibrary(Foo.class, Bar.class).build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(EnabledProducerFieldInjectionAvailabilityTest.class, WebBar.class).build()); - - return enterpriseArchive; - } - - @Inject - Bar bar; - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = INTER_MODULE_INJECTION, id = "e") }) - public void testInjection() throws Exception { - Assert.assertEquals(bar.ping(), 0); - assert bar.getFoo() instanceof ProducedFoo; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerMethodInjectionAvailability02Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerMethodInjectionAvailability02Test.java deleted file mode 100644 index a691defa69..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerMethodInjectionAvailability02Test.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * - * @author Matej Briskar - */ - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnabledProducerMethodInjectionAvailability02Test extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - WebArchive webArchive = new WebArchiveBuilder().withTestClass(EnabledProducerMethodInjectionAvailability02Test.class) - .withClasses(FooMethodProducer.class, ProducedFoo.class).withBeanLibrary(Foo.class, Bar.class) - .withBeanLibrary(WebBar.class).build(); - return webArchive; - } - - @Inject - Bar bar; - - @Test - @SpecAssertions({ @SpecAssertion(section = INTER_MODULE_INJECTION, id = "f") }) - public void testInjection() throws Exception { - Assert.assertEquals(bar.ping(), 0); - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerMethodInjectionAvailabilityTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerMethodInjectionAvailabilityTest.java deleted file mode 100644 index 8c1abbe61a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledProducerMethodInjectionAvailabilityTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * Test that bean in web module can inject enabled bean producer method from EJB module. - * - * Note that we DO NOT include test class in EJB module since we wouldn't be able to inject bean from web module (Java EE - * classloading requirements)! - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnabledProducerMethodInjectionAvailabilityTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(EnabledProducerMethodInjectionAvailabilityTest.class) - .withClasses(FooMethodProducer.class, ProducedFoo.class).withBeanLibrary(Foo.class, Bar.class).build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(EnabledProducerMethodInjectionAvailabilityTest.class, WebBar.class).build()); - - return enterpriseArchive; - } - - @Inject - Bar bar; - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = INTER_MODULE_INJECTION, id = "f") }) - public void testInjection() throws Exception { - Assert.assertEquals(bar.ping(), 0); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledSessionBeanInjectionAvailability02Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledSessionBeanInjectionAvailability02Test.java deleted file mode 100644 index c6ef604c5c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledSessionBeanInjectionAvailability02Test.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION_EE; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnabledSessionBeanInjectionAvailability02Test extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - WebArchive webArchive = new WebArchiveBuilder().withTestClass(EnabledSessionBeanInjectionAvailability02Test.class) - .withClasses(EjbFoo.class, EjbFooLocal.class).withBeanLibrary(Foo.class, Bar.class) - .withBeanLibrary(WebBar.class) - .build(); - return webArchive; - } - - @Inject - Bar bar; - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = SELECTION_EE, id = "d"), @SpecAssertion(section = SELECTION, id = "aa") }) - public void testInjection() throws Exception { - Assert.assertEquals(bar.ping(), 0); - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledSessionBeanInjectionAvailabilityTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledSessionBeanInjectionAvailabilityTest.java deleted file mode 100644 index 008277651d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/EnabledSessionBeanInjectionAvailabilityTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION_EE; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * Test that bean in web module can inject enabled session bean from EJB module. - * - * Note that we DO NOT include test class in EJB module since we wouldn't be able to inject bean from web module (Java EE - * classloading requirements)! - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnabledSessionBeanInjectionAvailabilityTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(EnabledSessionBeanInjectionAvailabilityTest.class) - .withClasses(EjbFoo.class, EjbFooLocal.class).withBeanLibrary(Foo.class, Bar.class).build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(EnabledSessionBeanInjectionAvailabilityTest.class, WebBar.class).build()); - - return enterpriseArchive; - } - - @Inject - Bar bar; - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = SELECTION_EE, id = "d"), @SpecAssertion(section = SELECTION, id = "aa") }) - public void testInjection() throws Exception { - Assert.assertEquals(bar.ping(), 0); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Enterprise.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Enterprise.java deleted file mode 100644 index e7f5dd409a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Enterprise.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Enterprise { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Foo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Foo.java deleted file mode 100644 index 96018b45e4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Foo.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -public interface Foo { - - public int pong(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/FooFieldProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/FooFieldProducer.java deleted file mode 100644 index d9cfa34fcd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/FooFieldProducer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class FooFieldProducer { - - @Produces - public Foo producedFoo = new ProducedFoo(null); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/FooMethodProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/FooMethodProducer.java deleted file mode 100644 index 0450788f02..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/FooMethodProducer.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class FooMethodProducer { - - @Produces - public Foo produceFoo() { - return new ProducedFoo(null); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleELResolution02Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleELResolution02Test.java deleted file mode 100644 index c765b3470d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleELResolution02Test.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.cdi.Sections.SELECTION; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.testng.annotations.Test; - -public class InterModuleELResolution02Test extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - WebArchive webArchive = new WebArchiveBuilder().withTestClass(InterModuleELResolution02Test.class) - .withClasses(ManagedFoo.class).withBeanLibrary(Foo.class).withBeanLibrary(WebFooELResolver.class).build(); - return webArchive; - } - - @Inject - WebFooELResolver fooELResolver; - - @Test - @SpecAssertion(section = SELECTION, id = "ac") - public void testEnabledManagedBeanAvailableForELResolution() throws Exception { - assert fooELResolver.ping() == 0; - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleELResolutionTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleELResolutionTest.java deleted file mode 100644 index f98e2c1944..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleELResolutionTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test that bean in web module can resolve enabled bean via EL from EJB module. - * - * Note that we DO NOT include test class in EJB module since we wouldn't be able to inject bean from web module (Java EE - * classloading requirements)! - * - * @author Martin Kouba - */ -@Test -@SpecVersion(spec = "cdi", version = "2.0") -public class InterModuleELResolutionTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(InterModuleELResolutionTest.class).withClasses(ManagedFoo.class) - .withBeanLibrary(Foo.class).build(); - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(InterModuleELResolutionTest.class, WebFooELResolver.class).build()); - return enterpriseArchive; - } - - @Inject - WebFooELResolver fooELResolver; - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = SELECTION, id = "ac") - public void testEnabledManagedBeanAvailableForELResolution() throws Exception { - assert fooELResolver.ping() == 0; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleLookup02Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleLookup02Test.java deleted file mode 100644 index 6fcaa868bb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleLookup02Test.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.cdi.Sections.SELECTION; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class InterModuleLookup02Test extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - WebArchive webArchive = new WebArchiveBuilder().withTestClass(InterModuleLookup02Test.class) - .withClasses(ManagedFoo.class).withBeanLibrary(Foo.class).withBeanLibrary(WebFooLookup.class).build(); - return webArchive; - } - - @Inject - WebFooLookup fooLookup; - - @Test - @SpecAssertion(section = SELECTION, id = "ab") - public void testEnabledManagedBeanAvailableForInjection() throws Exception { - assert fooLookup.ping() == 0; - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleLookupTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleLookupTest.java deleted file mode 100644 index d89c4a4fc9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/InterModuleLookupTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test that bean in web module can lookup enabled bean from EJB module. - * - * Note that we DO NOT include test class in EJB module since we wouldn't be able to inject bean from web module (Java EE - * classloading requirements)! - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class InterModuleLookupTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(InterModuleLookupTest.class).withClasses(ManagedFoo.class).withBeanLibrary(Foo.class) - .build(); - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(InterModuleLookupTest.class, WebFooLookup.class).build()); - return enterpriseArchive; - } - - @Inject - WebFooLookup fooLookup; - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = SELECTION, id = "ab") - public void testEnabledManagedBeanAvailableForInjection() throws Exception { - assert fooLookup.ping() == 0; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/ManagedFoo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/ManagedFoo.java deleted file mode 100644 index 23453b10db..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/ManagedFoo.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Named; - -@Named("managedFoo") -@Dependent -public class ManagedFoo implements Foo { - - @Override - public int pong() { - return 0; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/PaymentEjbFoo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/PaymentEjbFoo.java deleted file mode 100644 index 4586700a6c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/PaymentEjbFoo.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.ejb.Local; -import jakarta.ejb.LocalBean; -import jakarta.ejb.Stateless; - -@LocalBean -@Local(Foo.class) -@Stateless -public class PaymentEjbFoo implements Foo { - - @Override - public int pong() { - return 1; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/PaymentFoo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/PaymentFoo.java deleted file mode 100644 index af4fef17af..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/PaymentFoo.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class PaymentFoo implements Foo { - - @Override - public int pong() { - return 1; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/ProducedFoo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/ProducedFoo.java deleted file mode 100644 index 41e0d869bb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/ProducedFoo.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -public class ProducedFoo implements Foo { - - private int value; - - public ProducedFoo(Integer value) { - if (value == null) { - this.value = 0; - } else { - this.value = value; - } - } - - @Override - public int pong() { - return value; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeManagedBeanInjectionAvailability02Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeManagedBeanInjectionAvailability02Test.java deleted file mode 100644 index eb76e7a3b5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeManagedBeanInjectionAvailability02Test.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SelectedAlternativeManagedBeanInjectionAvailability02Test extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - WebArchive webArchive = new WebArchiveBuilder() - .withTestClass(SelectedAlternativeManagedBeanInjectionAvailability02Test.class) - .withClasses(AlternativeFoo.class).withBeanLibrary(Foo.class, Bar.class) - .withBeanLibrary(new BeansXml().alternatives(AlternativeFoo.class), WebBar.class) - .build(); - - return webArchive; - } - - @Inject - Bar bar; - - @Test - @SpecAssertion(section = INTER_MODULE_INJECTION, id = "o") - public void testInjection() throws Exception { - Assert.assertEquals(bar.ping(), 42); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeManagedBeanInjectionAvailabilityTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeManagedBeanInjectionAvailabilityTest.java deleted file mode 100644 index a1ac99ddb8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeManagedBeanInjectionAvailabilityTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * Test that bean in web module can inject selected alternative managed bean from EJB module. - * - * classloading requirements)! - * - * Also note that we need to enable alternative in web module to have it working according to spec (section 5.1.4 Inter-module - * injection). - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SelectedAlternativeManagedBeanInjectionAvailabilityTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(SelectedAlternativeManagedBeanInjectionAvailabilityTest.class) - .withClasses(AlternativeFoo.class).withBeanLibrary(Foo.class, Bar.class).build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder() - .notTestArchive() - .withDefaultEjbModuleDependency() - .withBeansXml(new BeansXml().alternatives(AlternativeFoo.class)) - .withClasses(SelectedAlternativeManagedBeanInjectionAvailabilityTest.class, WebBar.class) - .build()); - - return enterpriseArchive; - } - - @Inject - Bar bar; - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = INTER_MODULE_INJECTION, id = "o") - public void testInjection() throws Exception { - Assert.assertEquals(bar.ping(), 42); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeSessionBeanInjectionAvailability02Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeSessionBeanInjectionAvailability02Test.java deleted file mode 100644 index 055c3ba11a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeSessionBeanInjectionAvailability02Test.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION_EE; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SelectedAlternativeSessionBeanInjectionAvailability02Test extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - - WebArchive webArchive = new WebArchiveBuilder() - .withTestClass(SelectedAlternativeSessionBeanInjectionAvailability02Test.class) - .withClasses(AlternativeEjbFoo.class, EjbFooLocal.class).withBeanLibrary(Foo.class, Bar.class) - .withBeanLibrary(new BeansXml().alternatives(AlternativeEjbFoo.class), WebBar.class) - .build(); - - return webArchive; - } - - @Inject - Bar bar; - - @Test(groups = INTEGRATION) - @SpecAssertion(section = SELECTION_EE, id = "p") - public void testInjection() throws Exception { - Assert.assertEquals(bar.ping(), 42); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeSessionBeanInjectionAvailabilityTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeSessionBeanInjectionAvailabilityTest.java deleted file mode 100644 index 4c9a087b2e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SelectedAlternativeSessionBeanInjectionAvailabilityTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION_EE; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.Assert; -import org.testng.annotations.Test; - -/** - * Test that bean in web module can inject selected alternative managed bean from EJB module. - * - * Note that we DO NOT include test class in EJB module since we wouldn't be able to inject bean from web module (Java EE - * classloading requirements)! - * - * Also note that we need to enable alternative in web module to have it working according to spec (section 5.1.4 Inter-module - * injection). - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SelectedAlternativeSessionBeanInjectionAvailabilityTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(SelectedAlternativeSessionBeanInjectionAvailabilityTest.class) - .withClasses(AlternativeEjbFoo.class, EjbFooLocal.class).withBeanLibrary(Foo.class, Bar.class).build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder() - .withDefaultEjbModuleDependency() - .notTestArchive() - .withBeansXml(new BeansXml().alternatives(AlternativeEjbFoo.class)) - .withClasses(SelectedAlternativeSessionBeanInjectionAvailabilityTest.class, WebBar.class) - .build()); - - return enterpriseArchive; - } - - @Inject - Bar bar; - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = SELECTION_EE, id = "p") - public void testInjection() throws Exception { - Assert.assertEquals(bar.ping(), 42); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedBeanInjectionNotAvailable02Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedBeanInjectionNotAvailable02Test.java deleted file mode 100644 index 360112af80..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedBeanInjectionNotAvailable02Test.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION_EE; -import static org.testng.Assert.assertEquals; - -import java.util.Set; - -import jakarta.enterprise.inject.spi.Bean; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SpecializedBeanInjectionNotAvailable02Test extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - WebArchive webArchive = new WebArchiveBuilder() - .withTestClass(SpecializedBeanInjectionNotAvailable02Test.class) - .withClasses(PaymentFoo.class, CashFoo.class, PaymentEjbFoo.class, CashEjbFoo.class) - .withBeanLibrary(Foo.class, Bar.class, Enterprise.class, Standard.class) - .withBeanLibrary(WebPaymentBar.class, WebPaymentEjbBar.class) - .build(); - return webArchive; - } - - @Inject - @Standard - Bar bar; - - @Inject - @Enterprise - Bar enterpriseBar; - - @Test(groups = INTEGRATION) - @SpecAssertion(section = INTER_MODULE_INJECTION, id = "l") - public void testManagedBeanInjection() throws Exception { - assertEquals(bar.ping(), 0); - Set> beans = getBeans(PaymentFoo.class); - assertEquals(beans.size(), 1); - assertEquals(beans.iterator().next().getBeanClass(), CashFoo.class); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = SELECTION_EE, id = "k") - public void testSessionBeanInjection() throws Exception { - assertEquals(enterpriseBar.ping(), 0); - Set> beans = getBeans(PaymentEjbFoo.class); - assertEquals(beans.size(), 1); - assertEquals(beans.iterator().next().getBeanClass(), CashEjbFoo.class); - } - -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedBeanInjectionNotAvailableTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedBeanInjectionNotAvailableTest.java deleted file mode 100644 index fb1dc1c72b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedBeanInjectionNotAvailableTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION_EE; -import static org.testng.Assert.assertEquals; - -import java.util.Set; - -import jakarta.enterprise.inject.spi.Bean; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test that bean in web module cannot inject specialized CDI beans from EJB module. - * - * Note that we DO NOT include test class in EJB module since we wouldn't be able to inject bean from web module (Java EE - * classloading requirements)! - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SpecializedBeanInjectionNotAvailableTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(SpecializedBeanInjectionNotAvailableTest.class) - .withClasses(PaymentFoo.class, CashFoo.class, PaymentEjbFoo.class, CashEjbFoo.class) - .withBeanLibrary(Foo.class, Bar.class, Enterprise.class, Standard.class).build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(SpecializedBeanInjectionNotAvailableTest.class, WebPaymentBar.class, WebPaymentEjbBar.class) - .build()); - - return enterpriseArchive; - } - - @Inject - @Standard - Bar bar; - - @Inject - @Enterprise - Bar enterpriseBar; - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = INTER_MODULE_INJECTION, id = "l") - public void testManagedBeanInjection() throws Exception { - assertEquals(bar.ping(), 0); - Set> beans = getBeans(PaymentFoo.class); - assertEquals(beans.size(), 1); - assertEquals(beans.iterator().next().getBeanClass(), CashFoo.class); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = SELECTION_EE, id = "k") - public void testSessionBeanInjection() throws Exception { - assertEquals(enterpriseBar.ping(), 0); - Set> beans = getBeans(PaymentEjbFoo.class); - assertEquals(beans.size(), 1); - assertEquals(beans.iterator().next().getBeanClass(), CashEjbFoo.class); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedProducerMethodInjectionNotAvailable02Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedProducerMethodInjectionNotAvailable02Test.java deleted file mode 100644 index 48543cc740..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedProducerMethodInjectionNotAvailable02Test.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; -import static org.testng.Assert.assertEquals; - -import java.util.Set; - -import jakarta.enterprise.inject.spi.Bean; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class SpecializedProducerMethodInjectionNotAvailable02Test extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - WebArchive webArchive = new WebArchiveBuilder() - .withTestClass(SpecializedProducerMethodInjectionNotAvailable02Test.class) - .withClasses(SpecializingFooMethodProducer.class, FooMethodProducer.class, ProducedFoo.class) - .withBeanLibrary(Foo.class, Bar.class) - .withBeanLibrary(WebBar.class).build(); - return webArchive; - } - - @Inject - Bar bar; - - @Test - @SpecAssertion(section = INTER_MODULE_INJECTION, id = "n") - public void testManagedBeanInjection() throws Exception { - assertEquals(bar.ping(), 1); - Set> beans = getBeans(Foo.class); - assertEquals(beans.size(), 1); - assertEquals(beans.iterator().next().getBeanClass(), SpecializingFooMethodProducer.class); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedProducerMethodInjectionNotAvailableTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedProducerMethodInjectionNotAvailableTest.java deleted file mode 100644 index 018b74a54b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializedProducerMethodInjectionNotAvailableTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; -import static org.testng.Assert.assertEquals; - -import java.util.Set; - -import jakarta.enterprise.inject.spi.Bean; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test that bean in web module cannot inject specialized producer methods from EJB module. - * - * Note that we DO NOT include test class in EJB module since we wouldn't be able to inject bean from web module (Java EE - * classloading requirements)! - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SpecializedProducerMethodInjectionNotAvailableTest extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(SpecializedProducerMethodInjectionNotAvailableTest.class) - .withClasses(SpecializingFooMethodProducer.class, FooMethodProducer.class, ProducedFoo.class) - .withBeanLibrary(Foo.class, Bar.class).build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(SpecializedProducerMethodInjectionNotAvailableTest.class, WebBar.class).build()); - - return enterpriseArchive; - } - - @Inject - Bar bar; - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = INTER_MODULE_INJECTION, id = "n") - public void testManagedBeanInjection() throws Exception { - assertEquals(bar.ping(), 1); - Set> beans = getBeans(Foo.class); - assertEquals(beans.size(), 1); - assertEquals(beans.iterator().next().getBeanClass(), SpecializingFooMethodProducer.class); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializingFooMethodProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializingFooMethodProducer.java deleted file mode 100644 index ff7ee48371..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/SpecializingFooMethodProducer.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Produces; -import jakarta.enterprise.inject.Specializes; - -@Dependent -public class SpecializingFooMethodProducer extends FooMethodProducer { - - @Produces - @Specializes - @Override - public Foo produceFoo() { - return new ProducedFoo(1); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Standard.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Standard.java deleted file mode 100644 index bb544452cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/Standard.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -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 jakarta.inject.Qualifier; - -@Target({ TYPE, METHOD, PARAMETER, FIELD }) -@Retention(RUNTIME) -@Documented -@Qualifier -public @interface Standard { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebBar.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebBar.java deleted file mode 100644 index 3ea51d474d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebBar.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Dependent -public class WebBar implements Bar { - - @Inject - Foo foo; - - public int ping() { - return foo.pong(); - } - - @Override - public Foo getFoo() { - return foo; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebFooELResolver.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebFooELResolver.java deleted file mode 100644 index dad62e29d0..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebFooELResolver.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.inject.Inject; - -import org.jboss.cdi.tck.impl.ConfigurationFactory; -import org.jboss.cdi.tck.spi.EL; - -/** - * This bean uses {@link EL} implementation located in EAR library. - * - * @author Martin Kouba - */ -@Dependent -public class WebFooELResolver { - - @Inject - BeanManager beanManager; - - public int ping() { - return ConfigurationFactory.get().getEl().evaluateValueExpression(beanManager, "#{managedFoo}", ManagedFoo.class) - .pong(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebFooLookup.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebFooLookup.java deleted file mode 100644 index 0f058a4367..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebFooLookup.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Instance; -import jakarta.inject.Inject; - -@Dependent -public class WebFooLookup { - - @Inject - Instance instance; - - public int ping() { - return instance.get().pong(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebPaymentBar.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebPaymentBar.java deleted file mode 100644 index c7cedc5a2d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebPaymentBar.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Standard -@Dependent -public class WebPaymentBar implements Bar { - - @Inject - PaymentFoo foo; - - public int ping() { - return foo.pong(); - } - - @Override - public Foo getFoo() { - return foo; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebPaymentEjbBar.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebPaymentEjbBar.java deleted file mode 100644 index 0481892673..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/WebPaymentEjbBar.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Enterprise -@Dependent -public class WebPaymentEjbBar implements Bar { - - @Inject - PaymentEjbFoo foo; - - public int ping() { - return foo.pong(); - } - - @Override - public Foo getFoo() { - return foo; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenBar.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenBar.java deleted file mode 100644 index 8d41fa24a9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenBar.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.broken; - -public interface BrokenBar { - - public int ping(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenFoo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenFoo.java deleted file mode 100644 index 948ea1121b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenFoo.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.broken; - -public interface BrokenFoo { - - public int pong(); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenProducedFoo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenProducedFoo.java deleted file mode 100644 index 0cacd5ca7b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenProducedFoo.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.broken; - -public class BrokenProducedFoo implements BrokenFoo { - - public BrokenProducedFoo(String name) { - } - - @Override - public int pong() { - return 1; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenWebBar.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenWebBar.java deleted file mode 100644 index 64d967b2a3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/BrokenWebBar.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.broken; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Dependent -public class BrokenWebBar implements BrokenBar { - - @Inject - BrokenFoo foo; - - public int ping() { - return foo.pong(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledEjbFoo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledEjbFoo.java deleted file mode 100644 index acd4944553..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledEjbFoo.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.broken; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.inject.Alternative; - -@Alternative -@Stateless -public class DisabledEjbFoo implements EjbFooLocal { - - @Override - public int pong() { - return 0; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledFooFieldProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledFooFieldProducer.java deleted file mode 100644 index 2afab72242..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledFooFieldProducer.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.broken; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Alternative; -import jakarta.enterprise.inject.Produces; - -@Alternative -@Dependent -public class DisabledFooFieldProducer { - - @Produces - public BrokenFoo producedFoo = new BrokenProducedFoo(null); - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledFooMethodProducer.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledFooMethodProducer.java deleted file mode 100644 index dd41e6c288..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledFooMethodProducer.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.broken; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Alternative; -import jakarta.enterprise.inject.Produces; - -@Alternative -@Dependent -public class DisabledFooMethodProducer { - - @Produces - public BrokenFoo produceFoo() { - return new BrokenProducedFoo(null); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledProducerFieldInjectionNotAvailableTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledProducerFieldInjectionNotAvailableTest.java deleted file mode 100644 index 8508ba29d3..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledProducerFieldInjectionNotAvailableTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.broken; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test that bean in web module cannot inject disabled producer field from EJB module. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class DisabledProducerFieldInjectionNotAvailableTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(DisabledProducerFieldInjectionNotAvailableTest.class) - .withClasses(DisabledFooFieldProducer.class, BrokenProducedFoo.class) - .withBeanLibrary(BrokenFoo.class, BrokenBar.class).build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(BrokenWebBar.class).build()); - - return enterpriseArchive; - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = INTER_MODULE_INJECTION, id = "h") - public void testInjection() throws Exception { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledProducerMethodInjectionNotAvailableTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledProducerMethodInjectionNotAvailableTest.java deleted file mode 100644 index 828cdad021..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledProducerMethodInjectionNotAvailableTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.broken; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test that bean in web module cannot inject disabled producer method from EJB module. - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class DisabledProducerMethodInjectionNotAvailableTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(DisabledProducerMethodInjectionNotAvailableTest.class) - .withClasses(DisabledFooMethodProducer.class, BrokenProducedFoo.class) - .withBeanLibrary(BrokenFoo.class, BrokenBar.class).build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(BrokenWebBar.class).build()); - - return enterpriseArchive; - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = INTER_MODULE_INJECTION, id = "g") - public void testInjection() throws Exception { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledSessionBeanInjectionNotAvailableTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledSessionBeanInjectionNotAvailableTest.java deleted file mode 100644 index ff770046c9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/DisabledSessionBeanInjectionNotAvailableTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2011, Red Hat, Inc. and/or its affiliates, and individual - * contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.broken; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION_EE; - -import jakarta.enterprise.inject.spi.DeploymentException; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class DisabledSessionBeanInjectionNotAvailableTest extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(DisabledSessionBeanInjectionNotAvailableTest.class) - .withClasses(DisabledEjbFoo.class, EjbFooLocal.class) - .withBeanLibrary(BrokenFoo.class, BrokenBar.class).build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(BrokenWebBar.class).build()); - - return enterpriseArchive; - } - - @Inject - BrokenBar bar; - - @Test(groups = JAVAEE_FULL) - @SpecAssertion(section = SELECTION_EE, id = "j") - public void testInjection() throws Exception { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/EjbFooLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/EjbFooLocal.java deleted file mode 100644 index 575bd37df2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/broken/EjbFooLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.broken; - -import jakarta.ejb.Local; - -@Local -public interface EjbFooLocal extends BrokenFoo { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Animal.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Animal.java deleted file mode 100644 index f2bd2f592b..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Animal.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.interceptors; - -public interface Animal { - String getName(); -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Bar.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Bar.java deleted file mode 100644 index d5bc8ef4b2..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Bar.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.interceptors; - -import java.io.Serializable; - -import jakarta.enterprise.context.SessionScoped; - -@SuppressWarnings("serial") -@BarBinding -@SessionScoped -public class Bar implements Serializable { - public void ping() { - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/BarBinding.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/BarBinding.java deleted file mode 100644 index 842e8f8c40..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/BarBinding.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.interceptors; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.interceptor.InterceptorBinding; - -@Target({ TYPE }) -@Retention(RUNTIME) -@Documented -@Inherited -@InterceptorBinding -public @interface BarBinding { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/BarInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/BarInterceptor.java deleted file mode 100644 index ff17005af9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/BarInterceptor.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.interceptors; - -import java.io.Serializable; - -import jakarta.annotation.PostConstruct; -import jakarta.annotation.Priority; -import jakarta.inject.Inject; -import jakarta.interceptor.Interceptor; -import jakarta.interceptor.InvocationContext; - -@SuppressWarnings("serial") -@BarBinding -@Priority(1000) -@Interceptor -public class BarInterceptor extends BarSuperInterceptor implements Serializable { - - @Inject - public void setAnimal(Animal animal) { - checker.setAnimal(animal); - } - - @PostConstruct - public void intercept(InvocationContext ctx) { - checker.setBarInterceptorCalled(true); - try { - ctx.proceed(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/BarSuperInterceptor.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/BarSuperInterceptor.java deleted file mode 100644 index 0e1018d748..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/BarSuperInterceptor.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.interceptors; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Dependent -public class BarSuperInterceptor { - - @Inject - protected Checker checker; - - @Inject - public void setSuperAnimal(Animal animal) { - checker.setSuperAnimal(animal); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Cat.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Cat.java deleted file mode 100644 index d56b2d0160..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Cat.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.interceptors; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Cat implements Animal { - @Override - public String getName() { - return "Cat"; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Checker.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Checker.java deleted file mode 100644 index 6d7cccb355..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Checker.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.interceptors; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class Checker { - - private boolean interceptorCalled = false; - private Animal animal; - private Animal superAnimal; - - public void setBarInterceptorCalled(boolean called) { - interceptorCalled = called; - } - - public boolean isBarInterceptorCalled() { - return interceptorCalled; - } - - public Animal getAnimal() { - return animal; - } - - public void setAnimal(Animal animal) { - this.animal = animal; - } - - public Animal getSuperAnimal() { - return superAnimal; - } - - public void setSuperAnimal(Animal animal) { - this.superAnimal = animal; - } - - public void reset() { - interceptorCalled = false; - animal = null; - superAnimal = null; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Cow.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Cow.java deleted file mode 100644 index 8d3e94c5cc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Cow.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.interceptors; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Alternative; - -@Alternative -@Dependent -public class Cow implements Animal { - @Override - public String getName() { - return "Cow"; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Dog.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Dog.java deleted file mode 100644 index 79bb1a4e1c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/Dog.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.interceptors; - -import java.io.Serializable; - -import jakarta.enterprise.context.Dependent; - -@SuppressWarnings("serial") -@Dependent -public class Dog implements Animal, Serializable { - @Override - public String getName() { - return "Dog"; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/InterceptorModularityTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/InterceptorModularityTest.java deleted file mode 100644 index b5c0f358e4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/interceptors/InterceptorModularityTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.interceptors; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.inject.Instance; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.Testable; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.DummySessionBean; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.api.spec.JavaArchive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.spec.se.manifest.ManifestDescriptor; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test that interceptor class's injection and injection point validation are done with respect to the module containing the - * interceptor class and not the intercepted class, i.e. test that an interceptor of a bean uses the interceptor's bean manager - * and not the bean's bean manager (for injection and injection point validation). - * - * @author Matus Abaffy - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class InterceptorModularityTest extends AbstractTest { - - private static final String TEST1_JAR = "test1.jar"; - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder() - .withTestClassDefinition(InterceptorModularityTest.class) - .withClasses(Checker.class, BarBinding.class, Animal.class, Cow.class, BarSuperInterceptor.class) - .withBeansXml(new BeansXml().alternatives(Cow.class)) - .noDefaultWebModule().build(); - - JavaArchive fooArchive = ShrinkWrap.create(JavaArchive.class, TEST1_JAR) - .addClasses(BarInterceptor.class, Dog.class, DummySessionBean.class) - .setManifest(new StringAsset(Descriptors.create(ManifestDescriptor.class) - .addToClassPath(EnterpriseArchiveBuilder.DEFAULT_EJB_MODULE_NAME) - .exportAsString())) - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); - enterpriseArchive.addAsModule(fooArchive); - - WebArchive barArchive = Testable.archiveToTest(new WebArchiveBuilder().notTestArchive().withName("test2.war") - .withClasses(InterceptorModularityTest.class, Bar.class, Cat.class) - .build() - .setManifest( - new StringAsset(Descriptors.create(ManifestDescriptor.class) - .addToClassPath(EnterpriseArchiveBuilder.DEFAULT_EJB_MODULE_NAME) - .addToClassPath(TEST1_JAR) - .exportAsString()))); - enterpriseArchive.addAsModule(barArchive); - - return enterpriseArchive; - } - - @Test(groups = JAVAEE_FULL, dataProvider = ARQUILLIAN_DATA_PROVIDER) - @SpecAssertion(section = SELECTION, id = "aa") - public void testInterceptorEnvironment(Instance barInstance, Instance barSIInstance, - Checker checker) { - checker.reset(); - barInstance.get().ping(); - - assertTrue(checker.isBarInterceptorCalled()); - assertNotNull(checker.getAnimal()); - assertEquals(checker.getAnimal().getName(), "Dog"); - assertEquals(checker.getSuperAnimal().getName(), "Dog"); - - barSIInstance.get(); - assertEquals(checker.getSuperAnimal().getName(), "Cow"); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Alpha.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Alpha.java deleted file mode 100644 index dae21d684c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Alpha.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.modules.specialization; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Alpha extends Connector { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Bravo.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Bravo.java deleted file mode 100644 index 8d4212634c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Bravo.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.modules.specialization; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Bravo extends Connector { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Charlie.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Charlie.java deleted file mode 100644 index 1ad9298478..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Charlie.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.modules.specialization; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Charlie extends Connector { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Connector.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Connector.java deleted file mode 100644 index 052f903b78..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Connector.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.modules.specialization; - -import jakarta.enterprise.context.Dependent; -import jakarta.inject.Inject; - -@Dependent -public abstract class Connector { - - @Inject - Handler handler; - - public String hello() { - return handler.handle("HellO"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Handler.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Handler.java deleted file mode 100644 index 5234703d2a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/Handler.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.modules.specialization; - -import jakarta.enterprise.context.Dependent; - -@Dependent -public class Handler { - - public String handle(String text) { - return text; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/LowercaseHandler.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/LowercaseHandler.java deleted file mode 100644 index 581cd3d889..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/LowercaseHandler.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.modules.specialization; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Specializes; - -@Specializes -@Dependent -public class LowercaseHandler extends Handler { - - public String handle(String text) { - return text.toLowerCase(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity01Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity01Test.java deleted file mode 100644 index ba1a796dc5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity01Test.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.modules.specialization; - -import static org.jboss.cdi.tck.cdi.Sections.DIRECT_AND_INDIRECT_SPECIALIZATION; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Simple WAR with multiple libraries. - * - * Library 1 defines bean {@link Handler}. Library 2 defines bean {@link UppercaseHandler} which specializes {@link Handler}. - * Bean {@link Alpha} packaged in WEB-INF/classes has an injection point of type {@link Handler}. Bean {@link Bravo} packaged in - * library 1 has an injection point of type {@link Handler}. Bean {@link Charlie} packaged in library 1 has an injection point - * of type {@link Handler}. - * - * - * Expected result: {@link UppercaseHandler} is injected into beans {@link Alpha}, {@link Bravo} and {@link Charlie} - * - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SpecializationModularity01Test extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(SpecializationModularity01Test.class).withLibrary(Connector.class) - .withBeanLibrary(Handler.class, Charlie.class).withBeanLibrary(UppercaseHandler.class, Bravo.class) - .withClasses(Alpha.class).build(); - } - - @Inject - Alpha alpha; - - @Inject - Bravo bravo; - - @Inject - Charlie charlie; - - @Test - @SpecAssertions({ @SpecAssertion(section = SELECTION, id = "aa"), - @SpecAssertion(section = DIRECT_AND_INDIRECT_SPECIALIZATION, id = "ia") }) - public void testSpecialization() { - assertNotNull(alpha); - assertEquals(alpha.hello(), "HELLO"); - assertNotNull(bravo); - assertEquals(bravo.hello(), "HELLO"); - assertNotNull(charlie); - assertEquals(charlie.hello(), "HELLO"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity02Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity02Test.java deleted file mode 100644 index 118f2424e4..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity02Test.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.modules.specialization; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.DIRECT_AND_INDIRECT_SPECIALIZATION; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * EAR deployment: - *

    - *
  • 1 WAR
  • - *
  • 1 shared library
  • - *
- * - * Shared library defines {@link Handler}. WEB-INF/classes defines {@link UppercaseHandler} which specializes {@link Handler}. - * Bean {@link Alpha} packaged in WEB-INF/classes has an injection point of type {@link Handler}. - * - * Expected result: {@link UppercaseHandler} is injected into {@link Alpha} - * - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SpecializationModularity02Test extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(SpecializationModularity02Test.class).withBeanLibrary(Handler.class) - .withLibrary(Connector.class).build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(SpecializationModularity02Test.class, UppercaseHandler.class, Alpha.class).build()); - - return enterpriseArchive; - } - - @Inject - Alpha alpha; - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = SELECTION, id = "aa"), - @SpecAssertion(section = DIRECT_AND_INDIRECT_SPECIALIZATION, id = "ia") }) - public void testSpecialization() { - assertNotNull(alpha); - assertEquals(alpha.hello(), "HELLO"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity03Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity03Test.java deleted file mode 100644 index c89db0ce73..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity03Test.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.modules.specialization; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * EAR deployment: - *
    - *
  • 1 WAR
  • - *
  • 1 shared library
  • - *
- * - * Shared library defines {@link Handler}. WEB-INF/classes defines {@link UppercaseHandler} which specializes {@link Handler}. - * Bean {@link Alpha} packaged in WEB-INF/classes has an injection point of type {@link Handler}. Bean {@link Bravo} packaged in - * the shared library has an injection point of type {@link Handler}. - * - * Expected result: UnsatisfiedDependencyException - {@link Bravo} cannot see {@link UppercaseHandler}, {@link Handler} is not - * enabled - * - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SpecializationModularity03Test extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(SpecializationModularity03Test.class).withBeanLibrary(Handler.class, Bravo.class) - .withLibrary(Connector.class).build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(UppercaseHandler.class, Alpha.class).build()); - - return enterpriseArchive; - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = SELECTION, id = "aa"), - @SpecAssertion(section = INTER_MODULE_INJECTION, id = "l") }) - public void testSpecialization() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity04Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity04Test.java deleted file mode 100644 index d0ef509141..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity04Test.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.modules.specialization; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.DIRECT_AND_INDIRECT_SPECIALIZATION; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; - -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * EAR deployment: - *
    - *
  • 1 WAR
  • - *
  • 2 shared libraries (can see each other)
  • - *
- * - * Shared library 1 defines {@link Handler}. Shared library 2 defines {@link UppercaseHandler} which specializes {@link Handler} - * . Bean {@link Alpha} packaged in WEB-INF/classes has an injection point of type {@link Handler}. Bean {@link Bravo} packaged - * in the shared library 1 has an injection point of type {@link Handler}. - * - * Expected result: {@link UppercaseHandler} injected into {@link Alpha} and {@link Bravo} - * - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SpecializationModularity04Test extends AbstractTest { - - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(SpecializationModularity04Test.class).withBeanLibrary(Handler.class, Bravo.class) - .withBeanLibrary(UppercaseHandler.class).withLibrary(Connector.class).build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(SpecializationModularity04Test.class, Alpha.class).build()); - - return enterpriseArchive; - } - - @Inject - Alpha alpha; - - @Inject - Bravo bravo; - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = SELECTION, id = "aa"), - @SpecAssertion(section = DIRECT_AND_INDIRECT_SPECIALIZATION, id = "ia") }) - public void testSpecialization() { - assertNotNull(alpha); - assertEquals(alpha.hello(), "HELLO"); - assertNotNull(bravo); - assertEquals(bravo.hello(), "HELLO"); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity05Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity05Test.java deleted file mode 100644 index 777c2758b5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity05Test.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.modules.specialization; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * EAR deployment: - *
    - *
  • 1 WAR
  • - *
  • 2 shared libraries (can see each other)
  • - *
- * - * Shared library 1 defines {@link Handler}. WEB-INF/classes defines {@link UppercaseHandler} which specializes {@link Handler}. - * Bean {@link Alpha} packaged in WEB-INF/classes has an injection point of type {@link Handler}. Bean {@link Bravo} packaged in - * the shared library 1 has an injection point of type {@link Handler}. Bean {@link Charlie} packaged in the shared library 2 - * has an injection point of type {@link Handler}. - * - * Expected result: UnsatisfiedDependencyException - {@link Bravo} and {@link Charlie} cannot see {@link UppercaseHandler}, - * {@link Handler} is not enabled - * - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SpecializationModularity05Test extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(SpecializationModularity05Test.class).withBeanLibrary(Handler.class, Bravo.class) - .withBeanLibrary(Charlie.class).withLibrary(Connector.class).build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(UppercaseHandler.class, Alpha.class).build()); - - return enterpriseArchive; - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = SELECTION, id = "aa"), - @SpecAssertion(section = INTER_MODULE_INJECTION, id = "l") }) - public void testSpecialization() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity06Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity06Test.java deleted file mode 100644 index 6087edcf6d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity06Test.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.modules.specialization; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.INTER_MODULE_INJECTION; -import static org.jboss.cdi.tck.cdi.Sections.SELECTION; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * EAR deployment: - *
    - *
  • 2 WARs
  • - *
  • 1 shared library
  • - *
- * - * Shared library 1 defines {@link Handler}. WAR 1 defines {@link UppercaseHandler} which specializes {@link Handler}. Bean - * {@link Alpha} packaged in WAR 1 has an injection point of type {@link Handler}. Bean {@link Bravo} packaged in WAR 2 has an - * injection point of type {@link Handler}. Bean {@link Charlie} packaged in the shared library has an injection point of type - * {@link Handler}. - * - * Expected result: UnsatisfiedDependencyException - {@link Bravo} and {@link Charlie} cannot see {@link UppercaseHandler}, - * {@link Handler} is not enabled - * - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SpecializationModularity06Test extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(SpecializationModularity06Test.class).withBeanLibrary(Handler.class, Charlie.class) - .withLibrary(Connector.class).build(); - - // WAR 1 - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(UppercaseHandler.class, Alpha.class).build()); - // WAR 2 - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(Bravo.class).build()); - - return enterpriseArchive; - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = SELECTION, id = "aa"), - @SpecAssertion(section = INTER_MODULE_INJECTION, id = "l") }) - public void testSpecialization() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity07Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity07Test.java deleted file mode 100644 index a905f57553..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/SpecializationModularity07Test.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.modules.specialization; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.INCONSISTENT_SPECIALIZATION; - -import jakarta.enterprise.inject.spi.DeploymentException; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.ShouldThrowException; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * EAR deployment: - *
    - *
  • 2 WARs
  • - *
  • 1 shared library
  • - *
- * - * Shared library 1 defines {@link Handler}. WAR 1 defines {@link UppercaseHandler} which specializes {@link Handler}. WAR 2 - * defines {@link LowercaseHandler} - * which specializes {@link Handler}. Bean {@link Alpha} packaged in WAR 1 has an injection point of type {@link Handler}. Bean - * {@link Bravo} packaged in WAR 2 - * has an injection point of type {@link Handler}. - * - * Expected result: Inconsistent specialization - * - * @author Martin Kouba - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class SpecializationModularity07Test extends AbstractTest { - - @ShouldThrowException(DeploymentException.class) - @Deployment - public static EnterpriseArchive createTestArchive() { - - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().noDefaultWebModule() - .withTestClassDefinition(SpecializationModularity07Test.class) - .withBeanLibrary(Handler.class).withLibrary(Connector.class).build(); - - // WAR 1 - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(UppercaseHandler.class, Alpha.class).build()); - // WAR 2 - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(LowercaseHandler.class, Bravo.class).build()); - - return enterpriseArchive; - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = INCONSISTENT_SPECIALIZATION, id = "a") }) - public void testSpecialization() { - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/UppercaseHandler.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/UppercaseHandler.java deleted file mode 100644 index afd4eaeafd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/UppercaseHandler.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.lookup.modules.specialization; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Specializes; - -@Specializes -@Dependent -public class UppercaseHandler extends Handler { - - public String handle(String text) { - return text.toUpperCase(); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/AlternativeSpecializedFactory.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/AlternativeSpecializedFactory.java deleted file mode 100644 index a54bee99cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/AlternativeSpecializedFactory.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.specialization.alternative; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Alternative; -import jakarta.enterprise.inject.Specializes; - -@Specializes -@Alternative -@Dependent -public class AlternativeSpecializedFactory extends Factory { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Factory.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Factory.java deleted file mode 100644 index f0532bbd7a..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Factory.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.specialization.alternative; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.Produces; - -@Dependent -public class Factory { - - public static boolean eventDelivered; - - @Produces - public Product produce() { - return new Product(); - } - - public void observe(@Observes FactoryEvent event) { - if (this.getClass().equals(Factory.class)) { - eventDelivered = true; - } - } - - public static boolean isEventDelivered() { - return eventDelivered; - } - - public static void reset() { - Factory.eventDelivered = false; - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/FactoryEvent.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/FactoryEvent.java deleted file mode 100644 index 5ec794d94c..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/FactoryEvent.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.specialization.alternative; - -public class FactoryEvent { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/InjectedBean1.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/InjectedBean1.java deleted file mode 100644 index a5eb3885cd..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/InjectedBean1.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.specialization.alternative; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Instance; -import jakarta.inject.Inject; - -@Dependent -public class InjectedBean1 { - - @Inject - private Instance factory; - - @Inject - private Instance product; - - public Instance getFactory() { - return factory; - } - - public Instance getProduct() { - return product; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/InjectedBean2.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/InjectedBean2.java deleted file mode 100644 index 0db865b7be..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/InjectedBean2.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.specialization.alternative; - -import jakarta.enterprise.context.Dependent; -import jakarta.enterprise.inject.Instance; -import jakarta.inject.Inject; - -@Dependent -public class InjectedBean2 { - - @Inject - private Instance factory; - - @Inject - private Instance product; - - public Instance getFactory() { - return factory; - } - - public Instance getProduct() { - return product; - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Product.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Product.java deleted file mode 100644 index ff1b6e396f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Product.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.specialization.alternative; - -import jakarta.enterprise.inject.Vetoed; - -@Vetoed -public class Product { -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization01Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization01Test.java deleted file mode 100644 index 69d48f7c79..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization01Test.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.specialization.alternative; - -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_ALTERNATIVE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVES; -import static org.jboss.cdi.tck.cdi.Sections.SPECIALIZE_MANAGED_BEAN; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.event.Event; -import jakarta.enterprise.inject.Alternative; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Originated from weld test suite. Test for specializing {@link Alternative}. Verifies that a bean is not specialized unless - * the specializing alternative is - * enabled. - * - * @author Jozef Hartinger - * @author Matej Briskar - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class Specialization01Test extends AbstractTest { - - public static String TEST_JAR = "test.jar"; - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(Specialization01Test.class).withBeanLibrary(InjectedBean1.class) - .withBeanLibrary(Factory.class, AlternativeSpecializedFactory.class, Product.class, InjectedBean2.class, - FactoryEvent.class) - .build(); - } - - @Inject - InjectedBean1 bean1; - - @Inject - InjectedBean2 bean2; - - @Inject - private Event event; - - @Test - @SpecAssertions({ @SpecAssertion(section = DECLARING_ALTERNATIVE, id = "aa"), - @SpecAssertion(section = SPECIALIZE_MANAGED_BEAN, id = "ac") }) - public void testNotEnabledAlternativeDoesNotSpecialize() { - assertFalse(bean1.getFactory() instanceof AlternativeSpecializedFactory); - assertFalse(bean1.getProduct().isUnsatisfied()); - assertFalse(bean1.getProduct().isAmbiguous()); - assertNotNull(bean1.getProduct().get()); - - assertFalse(bean2.getFactory() instanceof AlternativeSpecializedFactory); - assertFalse(bean2.getProduct().isUnsatisfied()); - assertFalse(bean2.getProduct().isAmbiguous()); - assertNotNull(bean2.getProduct().get()); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = OBSERVES, id = "a") }) - public void testEvent() { - Factory.reset(); - event.fire(new FactoryEvent()); - assertTrue(Factory.isEventDelivered()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization02Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization02Test.java deleted file mode 100644 index b8027e71c5..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization02Test.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.specialization.alternative; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_ALTERNATIVE; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_SELECTED_ALTERNATIVES_BEAN_ARCHIVE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVES; -import static org.jboss.cdi.tck.cdi.Sections.SPECIALIZATION; -import static org.jboss.cdi.tck.cdi.Sections.SPECIALIZE_MANAGED_BEAN; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.event.Event; -import jakarta.enterprise.inject.Alternative; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Originated from weld test suite. Test for specializing {@link Alternative}. Verifies that a bean is only specialized in the - * BDA where the specializing - * alternative is enabled. - * - * @author Jozef Hartinger - * @author Matej Briskar - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class Specialization02Test extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(Specialization02Test.class) - .withBeanLibrary(InjectedBean1.class) - .withBeanLibrary(new BeansXml().alternatives(AlternativeSpecializedFactory.class), - Factory.class, AlternativeSpecializedFactory.class, Product.class, InjectedBean2.class, - FactoryEvent.class) - .build(); - } - - @Inject - private InjectedBean1 bean1; - - @Inject - private InjectedBean2 bean2; - - @Inject - private Event event; - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = DECLARING_ALTERNATIVE, id = "aa"), - @SpecAssertion(section = SPECIALIZE_MANAGED_BEAN, id = "ac"), - @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_BEAN_ARCHIVE, id = "i"), - @SpecAssertion(section = SPECIALIZATION, id = "ca"), - @SpecAssertion(section = SPECIALIZATION, id = "cb") }) - public void testEnabledAlternativeSpecializes() { - assertTrue(bean1.getFactory().isUnsatisfied()); - assertTrue(bean1.getProduct().isUnsatisfied()); - assertFalse(bean1.getProduct().isAmbiguous()); - - assertTrue(bean2.getFactory().get() instanceof AlternativeSpecializedFactory); - assertTrue(bean2.getProduct().isUnsatisfied()); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = OBSERVES, id = "a"), @SpecAssertion(section = SPECIALIZATION, id = "cc") }) - public void testEvent() { - Factory.reset(); - event.fire(new FactoryEvent()); - assertFalse(Factory.isEventDelivered()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization03Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization03Test.java deleted file mode 100644 index a12f850e87..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization03Test.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.specialization.alternative; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_ALTERNATIVE; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_SELECTED_ALTERNATIVES_BEAN_ARCHIVE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVES; -import static org.jboss.cdi.tck.cdi.Sections.SPECIALIZATION; -import static org.jboss.cdi.tck.cdi.Sections.SPECIALIZE_MANAGED_BEAN; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.event.Event; -import jakarta.enterprise.inject.Alternative; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test for specializing {@link Alternative}. Verifies that a bean is only specialized in the BDA where the specializing - * alternative is enabled. - * - * @author Jozef Hartinger - * @author Matej Briskar - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class Specialization03Test extends AbstractTest { - - @Inject - private InjectedBean1 bean1; - - @Inject - private InjectedBean2 bean2; - - @Inject - private Event event; - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(Specialization03Test.class) - .withBeanLibrary(Factory.class, AlternativeSpecializedFactory.class, Product.class, InjectedBean2.class, - FactoryEvent.class) - .withBeanLibrary(new BeansXml().alternatives(AlternativeSpecializedFactory.class), - InjectedBean1.class) - .build(); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = DECLARING_ALTERNATIVE, id = "aa"), - @SpecAssertion(section = SPECIALIZE_MANAGED_BEAN, id = "ac"), - @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_BEAN_ARCHIVE, id = "i"), - @SpecAssertion(section = SPECIALIZATION, id = "ca"), - @SpecAssertion(section = SPECIALIZATION, id = "cb") }) - public void testEnabledAlternativeSpecializes() { - assertTrue(bean1.getFactory().get() instanceof AlternativeSpecializedFactory); - assertTrue(bean1.getProduct().isUnsatisfied()); - - assertTrue(bean2.getFactory().isUnsatisfied()); - assertTrue(bean2.getProduct().isUnsatisfied()); - assertFalse(bean2.getProduct().isAmbiguous()); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = OBSERVES, id = "a"), @SpecAssertion(section = SPECIALIZATION, id = "cc") }) - public void testEvent() { - Factory.reset(); - event.fire(new FactoryEvent()); - assertFalse(Factory.isEventDelivered()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization04Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization04Test.java deleted file mode 100644 index 1f2eeeeb7f..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization04Test.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.specialization.alternative; - -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_ALTERNATIVE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVES; -import static org.jboss.cdi.tck.cdi.Sections.SPECIALIZATION; -import static org.jboss.cdi.tck.cdi.Sections.SPECIALIZE_MANAGED_BEAN; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.event.Event; -import jakarta.enterprise.inject.Alternative; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - * Test for specializing {@link Alternative}. Verifies that a bean is only specialized in the BDA where the specializing - * alternative is enabled. - * - * @author Jozef Hartinger - * @author Matej Briskar - * - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class Specialization04Test extends AbstractTest { - - @Inject - private InjectedBean1 bean1; - - @Inject - private InjectedBean2 bean2; - - @Inject - private Event event; - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClass(Specialization04Test.class) - .withBeanLibrary(new BeansXml().alternatives(AlternativeSpecializedFactory.class), Factory.class, - AlternativeSpecializedFactory.class, Product.class, InjectedBean2.class, FactoryEvent.class) - .withBeanLibrary(new BeansXml().alternatives(AlternativeSpecializedFactory.class), - InjectedBean1.class) - .build(); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = DECLARING_ALTERNATIVE, id = "aa"), - @SpecAssertion(section = SPECIALIZE_MANAGED_BEAN, id = "ac"), - @SpecAssertion(section = SPECIALIZATION, id = "cb") }) - public void testEnabledAlternativeSpecializes() { - assertTrue(bean1.getFactory().get() instanceof AlternativeSpecializedFactory); - assertTrue(bean1.getProduct().isUnsatisfied()); - assertFalse(bean1.getProduct().isAmbiguous()); - - assertTrue(bean2.getFactory().get() instanceof AlternativeSpecializedFactory); - assertTrue(bean2.getProduct().isUnsatisfied()); - assertFalse(bean2.getProduct().isAmbiguous()); - } - - @Test - @SpecAssertions({ @SpecAssertion(section = OBSERVES, id = "a"), @SpecAssertion(section = SPECIALIZATION, id = "cc") }) - public void testEvent() { - Factory.reset(); - event.fire(new FactoryEvent()); - assertFalse(Factory.isEventDelivered()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization05Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization05Test.java deleted file mode 100644 index 2bcfdf7b64..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization05Test.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.specialization.alternative; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_ALTERNATIVE; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_SELECTED_ALTERNATIVES_BEAN_ARCHIVE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVES; -import static org.jboss.cdi.tck.cdi.Sections.SPECIALIZATION; -import static org.jboss.cdi.tck.cdi.Sections.SPECIALIZE_MANAGED_BEAN; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.event.Event; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.shrinkwrap.impl.BeansXml; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class Specialization05Test extends AbstractTest { - - @Inject - private InjectedBean1 bean1; - - @Inject - private InjectedBean2 bean2; - - @Inject - private Event event; - - @Deployment - public static EnterpriseArchive createTestArchive() { - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder() - .withTestClassDefinition(Specialization05Test.class) - .noDefaultWebModule() - .withBeanLibrary(Factory.class, Product.class, InjectedBean1.class, FactoryEvent.class) - .withBeanLibrary(new BeansXml().alternatives(AlternativeSpecializedFactory.class), - AlternativeSpecializedFactory.class) - .build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(InjectedBean2.class, Specialization05Test.class).build()); - - return enterpriseArchive; - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = DECLARING_ALTERNATIVE, id = "aa"), - @SpecAssertion(section = SPECIALIZE_MANAGED_BEAN, id = "ac"), - @SpecAssertion(section = DECLARING_SELECTED_ALTERNATIVES_BEAN_ARCHIVE, id = "i"), - @SpecAssertion(section = SPECIALIZATION, id = "ca"), - @SpecAssertion(section = SPECIALIZATION, id = "cb") }) - public void testEnabledAlternativeSpecializes() { - assertTrue(bean1.getFactory().isUnsatisfied()); - assertTrue(bean1.getProduct().isUnsatisfied()); - - assertTrue(bean2.getFactory().isUnsatisfied()); - assertTrue(bean2.getProduct().isUnsatisfied()); - assertFalse(bean2.getProduct().isAmbiguous()); - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = OBSERVES, id = "a"), @SpecAssertion(section = SPECIALIZATION, id = "cc") }) - public void testEvent() { - Factory.reset(); - event.fire(new FactoryEvent()); - assertFalse(Factory.isEventDelivered()); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization06Test.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization06Test.java deleted file mode 100644 index 8f8ef4e006..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/modules/specialization/alternative/Specialization06Test.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2021, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.modules.specialization.alternative; - -import static org.jboss.cdi.tck.TestGroups.JAVAEE_FULL; -import static org.jboss.cdi.tck.cdi.Sections.DECLARING_ALTERNATIVE; -import static org.jboss.cdi.tck.cdi.Sections.OBSERVES; -import static org.jboss.cdi.tck.cdi.Sections.SPECIALIZE_MANAGED_BEAN; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; - -import jakarta.enterprise.event.Event; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.EnterpriseArchiveBuilder; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class Specialization06Test extends AbstractTest { - - @Inject - private InjectedBean1 bean1; - - @Inject - private InjectedBean2 bean2; - - @Inject - private Event event; - - @Deployment - public static EnterpriseArchive createTestArchive() { - EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder().withTestClassDefinition(Specialization06Test.class) - .noDefaultWebModule() - .withBeanLibrary(Factory.class, Product.class, InjectedBean2.class, FactoryEvent.class) - .withBeanLibrary(AlternativeSpecializedFactory.class) - .build(); - - enterpriseArchive.addAsModule(new WebArchiveBuilder().notTestArchive().withDefaultEjbModuleDependency() - .withClasses(InjectedBean1.class, Specialization06Test.class).build()); - - return enterpriseArchive; - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = DECLARING_ALTERNATIVE, id = "aa"), - @SpecAssertion(section = SPECIALIZE_MANAGED_BEAN, id = "ac") }) - public void testEnabledAlternativeSpecializes() { - assertTrue(bean1.getFactory().get() instanceof Factory); - assertFalse(bean1.getProduct().isUnsatisfied()); - - assertTrue(bean2.getFactory().get() instanceof Factory); - assertFalse(bean2.getProduct().isUnsatisfied()); - - } - - @Test(groups = JAVAEE_FULL) - @SpecAssertions({ @SpecAssertion(section = OBSERVES, id = "a") }) - public void testEvent() { - Factory.reset(); - event.fire(new FactoryEvent()); - assertTrue(Factory.isEventDelivered()); - } -} \ No newline at end of file diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/Capercaillie.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/Capercaillie.java deleted file mode 100644 index 0d3d1b570e..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/Capercaillie.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.typesafe.resolution.interceptor.ejb; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.inject.Typed; - -@Stateless -@Typed(CapercaillieLocal.class) -public class Capercaillie implements CapercaillieLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/CapercaillieLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/CapercaillieLocal.java deleted file mode 100644 index f5aae6b2e8..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/CapercaillieLocal.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.typesafe.resolution.interceptor.ejb; - -import jakarta.ejb.Local; - -@Local -public interface CapercaillieLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/EnterpriseResolutionByTypeTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/EnterpriseResolutionByTypeTest.java deleted file mode 100644 index 4294582d60..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/EnterpriseResolutionByTypeTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.typesafe.resolution.interceptor.ejb; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.BEAN_TYPES_EE; - -import jakarta.enterprise.inject.spi.Bean; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.lookup.typesafe.resolution.Bird; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseResolutionByTypeTest extends AbstractTest { - - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder() - .withTestClassPackage(EnterpriseResolutionByTypeTest.class) - .withClasses(Bird.class) - .build(); - } - - @Test(groups = { INTEGRATION }) - @SpecAssertion(section = BEAN_TYPES_EE, id = "a") - public void testBeanTypesOnSessionBean() { - assert getBeans(CapercaillieLocal.class).size() == 1; - assert getBeans(ScottishBirdLocal.class).isEmpty(); - Bean bean = getUniqueBean(CapercaillieLocal.class); - assert typeSetMatches(bean.getTypes(), CapercaillieLocal.class, Object.class); - } - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/ScottishBirdLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/ScottishBirdLocal.java deleted file mode 100644 index 100ef7abbc..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/interceptor/ejb/ScottishBirdLocal.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.lookup.typesafe.resolution.interceptor.ejb; - -import jakarta.ejb.Local; - -import org.jboss.cdi.tck.tests.lookup.typesafe.resolution.Bird; - -@Local -public interface ScottishBirdLocal extends Bird { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/Elephant.java b/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/Elephant.java deleted file mode 100644 index e2db3429d9..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/Elephant.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.vetoed.enterprise; - -import jakarta.ejb.Stateful; -import jakarta.enterprise.inject.Vetoed; - -@Vetoed -@Stateful -public class Elephant implements ElephantLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/ElephantLocal.java b/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/ElephantLocal.java deleted file mode 100644 index d5d269689d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/ElephantLocal.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.tests.vetoed.enterprise; - -/** - * @author Martin Kouba - * - */ -public interface ElephantLocal { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/EnterpriseVetoedTest.java b/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/EnterpriseVetoedTest.java deleted file mode 100644 index 0c7a05f220..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/EnterpriseVetoedTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.vetoed.enterprise; - -import static org.jboss.cdi.tck.TestGroups.INTEGRATION; -import static org.jboss.cdi.tck.cdi.Sections.PROCESS_ANNOTATED_TYPE; -import static org.jboss.cdi.tck.cdi.Sections.SESSION_BEANS; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; - -import jakarta.enterprise.inject.Any; -import jakarta.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.cdi.tck.AbstractTest; -import org.jboss.cdi.tck.shrinkwrap.ee.WebArchiveBuilder; -import org.jboss.cdi.tck.tests.vetoed.enterprise.aquarium.Piranha; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.test.audit.annotations.SpecAssertion; -import org.jboss.test.audit.annotations.SpecAssertions; -import org.jboss.test.audit.annotations.SpecVersion; -import org.testng.annotations.Test; - -/** - *

- * This test was originally part of the Weld test suite. - *

- * - * @author Jozef Hartinger - * @author Martin Kouba - */ -@SpecVersion(spec = "cdi", version = "2.0") -public class EnterpriseVetoedTest extends AbstractTest { - - @SuppressWarnings("unchecked") - @Deployment - public static WebArchive createTestArchive() { - return new WebArchiveBuilder().withTestClass(EnterpriseVetoedTest.class) - .withClasses(ElephantLocal.class, Elephant.class, ModifyingExtension.class, VerifyingExtension.class) - .withPackage(Piranha.class.getPackage()) - .withExtensions(ModifyingExtension.class, VerifyingExtension.class) - .withLibrary(Gecko.class).build(); - } - - @Inject - VerifyingExtension verifyingExtension; - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = SESSION_BEANS, id = "aa"), - @SpecAssertion(section = PROCESS_ANNOTATED_TYPE, id = "ia") }) - public void testClassLevelVeto() { - assertFalse(verifyingExtension.getClasses().contains(Elephant.class)); - assertEquals(getCurrentManager().getBeans(Elephant.class, Any.Literal.INSTANCE).size(), 0); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = PROCESS_ANNOTATED_TYPE, id = "ie") }) - public void testAnnotatedTypeAddedByExtension() { - assertFalse(verifyingExtension.getClasses().contains(Gecko.class)); - assertEquals(getCurrentManager().getBeans(Gecko.class, Any.Literal.INSTANCE).size(), 0); - } - - @Test(groups = INTEGRATION) - @SpecAssertions({ @SpecAssertion(section = SESSION_BEANS, id = "aa"), - @SpecAssertion(section = PROCESS_ANNOTATED_TYPE, id = "ii") }) - public void testPackageLevelVeto() { - assertFalse(verifyingExtension.getClasses().contains(Piranha.class)); - assertEquals(getCurrentManager().getBeans(Piranha.class, Any.Literal.INSTANCE).size(), 0); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/Gecko.java b/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/Gecko.java deleted file mode 100644 index dbc293a924..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/Gecko.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.vetoed.enterprise; - -import jakarta.ejb.Stateless; -import jakarta.enterprise.inject.Vetoed; - -/** - * - */ -@Vetoed -@Stateless -public class Gecko { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/ModifyingExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/ModifyingExtension.java deleted file mode 100644 index f1c891256d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/ModifyingExtension.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.vetoed.enterprise; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.AnnotatedType; -import jakarta.enterprise.inject.spi.BeanManager; -import jakarta.enterprise.inject.spi.BeforeBeanDiscovery; -import jakarta.enterprise.inject.spi.Extension; - -import org.jboss.cdi.tck.util.AddForwardingAnnotatedTypeAction; - -public class ModifyingExtension implements Extension { - - public void observeBeforeBeanDiscovery(@Observes BeforeBeanDiscovery event, final BeanManager beanManager) { - - new AddForwardingAnnotatedTypeAction() { - - @Override - public String getBaseId() { - return ModifyingExtension.class.getName(); - } - - @Override - public AnnotatedType delegate() { - return beanManager.createAnnotatedType(Gecko.class); - } - }.perform(event); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/VerifyingExtension.java b/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/VerifyingExtension.java deleted file mode 100644 index 2fb028393d..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/VerifyingExtension.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.vetoed.enterprise; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import jakarta.enterprise.event.Observes; -import jakarta.enterprise.inject.spi.Extension; -import jakarta.enterprise.inject.spi.ProcessAnnotatedType; - -public class VerifyingExtension implements Extension { - - private final Set> classes = new HashSet>(); - - public void observeAnnotatedType(@Observes ProcessAnnotatedType event) { - classes.add(event.getAnnotatedType().getJavaClass()); - } - - public Set> getClasses() { - return Collections.unmodifiableSet(classes); - } -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/aquarium/Piranha.java b/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/aquarium/Piranha.java deleted file mode 100644 index 8cbb318b33..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/aquarium/Piranha.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.tests.vetoed.enterprise.aquarium; - -import jakarta.ejb.Stateful; - -@Stateful -public class Piranha { - -} diff --git a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/aquarium/package-info.java b/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/aquarium/package-info.java deleted file mode 100644 index 2d498920cb..0000000000 --- a/web/src/main/java/org/jboss/cdi/tck/tests/vetoed/enterprise/aquarium/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2010, Red Hat Middleware LLC, and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@Vetoed -package org.jboss.cdi.tck.tests.vetoed.enterprise.aquarium; - -import jakarta.enterprise.inject.Vetoed; diff --git a/web/src/main/resources/META-INF/test-unit.properties b/web/src/main/resources/META-INF/test-unit.properties deleted file mode 100644 index 0866745835..0000000000 --- a/web/src/main/resources/META-INF/test-unit.properties +++ /dev/null @@ -1,23 +0,0 @@ -# If fisheye_base_url is specified, it will generate links to the test class in fisheye -#fisheye_base_url=http\://fisheye.jboss.org/browse/Weld/cdi-tck/trunk/impl/src/main/java - -# If svn_base_url is specified, it will generate links to the test class in SVN -#svn_base_url=http\://anonsvn.jboss.org/repos/weld/cdi-tck/trunk/impl/src/main/java/ - -# If specification_base_url is specified, it will generate links to the appropriate section in the specification -specification_base_url=https://jakarta.ee/specifications/cdi/3.0/ - -# If github_base_url is specified, it will generate links to the test class in GitHub -github_base_url=https://github.com/eclipse-ee4j/cdi-tck/blob/master/impl/src/main/java/ - -# The threshold for which the coverage percentage is a pass if it is equal or greater to this value -pass_threshold=75 - -# The threshold for which the coverage percentage is a fail if it is equal or lower to this value -fail_threshold=50 - -# A comma-separated list of the TestNG test groups that aren't included in the coverage -unimplemented_test_groups= - -# A comma-separated list of TestNG test groups that are summarised at the end of the report -summary_test_groups=rewrite diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/alternative/enterprise/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/alternative/enterprise/beans.xml deleted file mode 100644 index 18c3def193..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/alternative/enterprise/beans.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - org.jboss.cdi.tck.tests.alternative.enterprise.EnabledEjb - - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/application/SimplePage.html b/web/src/main/resources/org/jboss/cdi/tck/tests/context/application/SimplePage.html deleted file mode 100644 index 692b147e60..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/application/SimplePage.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/application/web.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/application/web.xml deleted file mode 100644 index d365eed09d..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/application/web.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - Test servlets used to test session contexts. - Session Context Tests - - org.jboss.cdi.tck.tests.context.application.TestServletContextListener - - - org.jboss.cdi.tck.tests.context.application.TestHttpSessionListener - - - org.jboss.cdi.tck.tests.context.application.TestServletRequestListener - - - Test Filter for Sessions - filterTest - org.jboss.cdi.tck.tests.context.application.TestFilter - - - filterTest - /SimplePage.html - - - TestServlet - TestServlet - org.jboss.cdi.tck.tests.context.application.TestServlet - - - Introspection Service for Application Context - applicationIntrospector - org.jboss.cdi.tck.tests.context.application.IntrospectApplication - - - TestServlet - /TestServlet - - - applicationIntrospector - /IntrospectApplication - - - 10 - - - BASIC - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/builtin.xhtml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/builtin.xhtml deleted file mode 100644 index 391394dca5..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/builtin.xhtml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/cloud.xhtml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/cloud.xhtml deleted file mode 100644 index a827152ed4..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/cloud.xhtml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/clouds.xhtml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/clouds.xhtml deleted file mode 100644 index d67e60c2f5..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/clouds.xhtml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/cumulus.xhtml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/cumulus.xhtml deleted file mode 100644 index c22c74e027..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/cumulus.xhtml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/error.xhtml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/error.xhtml deleted file mode 100644 index ff712c500a..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/error.xhtml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - -

Expected exception was not thrown!

- - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/faces-config.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/faces-config.xml deleted file mode 100644 index 153483b459..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/faces-config.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - org.jboss.cdi.tck.tests.context.conversation.ConversationTestPhaseListener - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/home.xhtml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/home.xhtml deleted file mode 100644 index 72e17eacef..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/home.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -

Hello world!

- -
- \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/lightening.xhtml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/lightening.xhtml deleted file mode 100644 index e9bf55f9f9..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/lightening.xhtml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/rain.xhtml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/rain.xhtml deleted file mode 100644 index 146cdad820..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/rain.xhtml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/servlet/message.html b/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/servlet/message.html deleted file mode 100644 index 4a821267a8..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/servlet/message.html +++ /dev/null @@ -1,15 +0,0 @@ - - - -Test - - -
- - - - - -
- - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/storm-ajax.xhtml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/storm-ajax.xhtml deleted file mode 100644 index 309c368e47..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/storm-ajax.xhtml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/storm.xhtml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/storm.xhtml deleted file mode 100644 index 810faefa9f..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/storm.xhtml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/thunder.xhtml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/thunder.xhtml deleted file mode 100644 index 2e4eb00bea..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/thunder.xhtml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/web.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/web.xml deleted file mode 100644 index 5834e794bb..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/conversation/web.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Faces Servlet - jakarta.faces.webapp.FacesServlet - 1 - - - - OutermostFilter - org.jboss.cdi.tck.tests.context.conversation.OutermostFilter - - - - OutermostFilter - *.jsf - - - - CDI Conversation Filter - /* - - - - Faces Servlet - *.jsf - - - - Conversation Status Servlet - org.jboss.cdi.tck.tests.context.conversation.ConversationStatusServlet - - - - Conversation Status Servlet - /conversation-status - - - - 10 - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/dependent/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/dependent/beans.xml deleted file mode 100644 index 0041244842..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/dependent/beans.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - org.jboss.cdi.tck.tests.full.decorators.context.dependent.InteriorDecorator - - - org.jboss.cdi.tck.tests.context.dependent.TransactionalInterceptor - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/beans.xml deleted file mode 100644 index d1c40548c4..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.context.passivating.broken.decoratorWithNonPassivatingBeanConstructor.CityDecorator - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInitializerMethod/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInitializerMethod/beans.xml deleted file mode 100644 index 91c300a3ec..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInitializerMethod/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.context.passivating.broken.decoratorWithNonPassivatingInitializerMethod.CityDecorator - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingBeanConstructorParameterInInterceptor/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingBeanConstructorParameterInInterceptor/beans.xml deleted file mode 100644 index dc77ea8404..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingBeanConstructorParameterInInterceptor/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.context.passivating.broken.enterpriseBeanWithNonPassivatingBeanConstructorParameterInInterceptor.BrokenInterceptor - - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingConstructorFieldInDecorator/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingConstructorFieldInDecorator/beans.xml deleted file mode 100644 index 5f6be42793..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingConstructorFieldInDecorator/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.context.passivating.broken.enterpriseBeanWithNonPassivatingConstructorFieldInDecorator.BrokenDecorator - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingInitializerInDecorator/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingInitializerInDecorator/beans.xml deleted file mode 100644 index 9796e9eee8..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingInitializerInDecorator/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.context.passivating.broken.enterpriseBeanWithNonPassivatingInitializerInDecorator.BrokenDecorator - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingInitializerParameterInInterceptor/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingInitializerParameterInInterceptor/beans.xml deleted file mode 100644 index 94921c005c..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingInitializerParameterInInterceptor/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.context.passivating.broken.enterpriseBeanWithNonPassivatingInitializerParameterInInterceptor.BrokenInterceptor - - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/interceptorWithNonPassivatingBeanConstructorParameter/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/interceptorWithNonPassivatingBeanConstructorParameter/beans.xml deleted file mode 100644 index 9caf053ad9..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/broken/interceptorWithNonPassivatingBeanConstructorParameter/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.context.passivating.broken.interceptorWithNonPassivatingBeanConstructorParameter.BrokenInterceptor - - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/ejb-jar.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/ejb-jar.xml deleted file mode 100644 index f0c3de448c..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/enterprise/invalid/ejb-jar.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - Elephant - org.jboss.cdi.tck.tests.context.passivating.enterprise.invalid.ElephantLocal - org.jboss.cdi.tck.tests.context.passivating.enterprise.invalid.Elephant - Stateful - false - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/ejb-jar.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/ejb-jar.xml deleted file mode 100644 index 16875119a7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/passivating/enterprise/valid/ejb-jar.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - Elephant - org.jboss.cdi.tck.tests.context.passivating.enterprise.valid.ElephantLocal - org.jboss.cdi.tck.tests.context.passivating.enterprise.valid.Elephant - Stateful - true - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/request/SimplePage.html b/web/src/main/resources/org/jboss/cdi/tck/tests/context/request/SimplePage.html deleted file mode 100644 index 692b147e60..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/request/SimplePage.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/request/web.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/context/request/web.xml deleted file mode 100644 index 7d421575ae..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/request/web.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - Test servlets used to test session contexts. - Session Context Tests - - Test Filter for Sessions - filterTest - org.jboss.cdi.tck.tests.context.request.TestFilter - - - filterTest - /SimplePage.html - - - serviceMethod - service - org.jboss.cdi.tck.tests.context.request.ServiceMethodServlet - - - Introspection Service for Request Context - requestIntrospector - org.jboss.cdi.tck.tests.context.request.IntrospectRequestScope - - - service - /serviceMethodTest - - - requestIntrospector - /IntrospectRequest - - - 10 - - - BASIC - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/context/session/SimplePage.html b/web/src/main/resources/org/jboss/cdi/tck/tests/context/session/SimplePage.html deleted file mode 100644 index 692b147e60..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/context/session/SimplePage.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/custom/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/custom/beans.xml deleted file mode 100644 index af14a30c6e..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/custom/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.full.decorators.custom.VehicleDecorator - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/definition/inject/delegateConstructor/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/definition/inject/delegateConstructor/beans.xml deleted file mode 100644 index 897b1f43ac..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/definition/inject/delegateConstructor/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.full.decorators.definition.inject.delegateConstructor.TimestampLogger - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/definition/inject/delegateField/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/definition/inject/delegateField/beans.xml deleted file mode 100644 index 98e4f72d62..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/definition/inject/delegateField/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.full.decorators.definition.inject.delegateField.TimestampLogger - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/definition/inject/delegateInitializerMethod/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/definition/inject/delegateInitializerMethod/beans.xml deleted file mode 100644 index 562f53fe62..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/definition/inject/delegateInitializerMethod/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.full.decorators.definition.inject.delegateInitializerMethod.TimestampLogger - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/invocation/observer/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/invocation/observer/beans.xml deleted file mode 100644 index 81a3ad5a37..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/invocation/observer/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.full.decorators.invocation.observer.ObserverDecorator - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/invocation/producer/method/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/invocation/producer/method/beans.xml deleted file mode 100644 index abaceaedb7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/invocation/producer/method/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.full.decorators.invocation.producer.method.ProducerDecorator - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/resolution/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/resolution/beans.xml deleted file mode 100644 index c89548653e..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/decorators/resolution/beans.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - org.jboss.cdi.tck.tests.full.decorators.resolution.BarDecorator - org.jboss.cdi.tck.tests.full.decorators.resolution.FooDecorator - org.jboss.cdi.tck.tests.full.decorators.resolution.FooObjectDecorator - org.jboss.cdi.tck.tests.full.decorators.resolution.QuxDecorator - org.jboss.cdi.tck.tests.full.decorators.resolution.QuxListDecorator - org.jboss.cdi.tck.tests.full.decorators.resolution.BazDecorator - org.jboss.cdi.tck.tests.full.decorators.resolution.GraultExtendsDecorator - org.jboss.cdi.tck.tests.full.decorators.resolution.GraultSuperDecorator - org.jboss.cdi.tck.tests.full.decorators.resolution.CorgeDecorator2 - org.jboss.cdi.tck.tests.full.decorators.resolution.CorgeDecorator - org.jboss.cdi.tck.tests.full.decorators.resolution.GarplyDecorator - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/definition/stereotype/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/definition/stereotype/beans.xml deleted file mode 100644 index e646578be7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/definition/stereotype/beans.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/definition/stereotype/inheritance/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/definition/stereotype/inheritance/beans.xml deleted file mode 100644 index ff4610c300..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/definition/stereotype/inheritance/beans.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - org.jboss.cdi.tck.tests.definition.stereotype.inheritance.NamedRequestPolicyStereotype - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/deployment/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/deployment/beans.xml deleted file mode 100644 index e646578be7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/deployment/beans.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/deployment/trimmed/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/deployment/trimmed/beans.xml deleted file mode 100644 index 5de4f6f38a..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/deployment/trimmed/beans.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/beans.xml deleted file mode 100644 index 5de4f6f38a..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/deployment/trimmed/enteprise/beans.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/event/observer/registerUsingEvent/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/event/observer/registerUsingEvent/beans.xml deleted file mode 100644 index e646578be7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/event/observer/registerUsingEvent/beans.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/extensions/container/event/ejb-jar.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/extensions/container/event/ejb-jar.xml deleted file mode 100644 index eb0af3329d..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/extensions/container/event/ejb-jar.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - cow - org.jboss.cdi.tck.tests.extensions.container.event.CowLocal - org.jboss.cdi.tck.tests.extensions.container.event.Cow - Stateful - Container - - - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/faces-config.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/faces-config.xml deleted file mode 100644 index 568fd56aef..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionPoint/ee/faces-config.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestLibrary.tld b/web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestLibrary.tld deleted file mode 100644 index d354fa7a85..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/TestLibrary.tld +++ /dev/null @@ -1,16 +0,0 @@ - - - 1.0 - test-library - http://processInjectionTarget.lifecycle.extensions.tests.tck.cdi.jboss.org/ - - org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget.TagLibraryListener - - - tag - org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget.TestTagHandler - empty - - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/faces-config.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/faces-config.xml deleted file mode 100644 index f5f3995c3e..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/faces-config.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - farm - org.jboss.cdi.tck.tests.extensions.lifecycle.processInjectionTarget.Farm - request - - - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/index.jsp b/web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/index.jsp deleted file mode 100644 index 7495ec8b79..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/extensions/lifecycle/processInjectionTarget/index.jsp +++ /dev/null @@ -1,9 +0,0 @@ -<%@ page contentType="text/html; charset=ISO-8859-1"%> -<%@ taglib prefix="test" uri="http://processInjectionTarget.lifecycle.extensions.tests.tck.cdi.jboss.org/"%> - - - -

my page

- - - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/full/interceptors/definition/interceptorNotListedInBeansXml/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/full/interceptors/definition/interceptorNotListedInBeansXml/beans.xml deleted file mode 100644 index ea1a01471e..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/full/interceptors/definition/interceptorNotListedInBeansXml/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ejb-jar.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ejb-jar.xml deleted file mode 100644 index b3e1663683..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/enterprise/definition/ejb-jar.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - JSR-299 Enterprise Bean Definition Test - JSR-299 Enterprise Bean Definition Test - - - - Elephant - org.jboss.cdi.tck.tests.implementation.enterprise.definition.ElephantLocal - org.jboss.cdi.tck.tests.implementation.enterprise.definition.Elephant - Stateless - Container - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/producer/method/lifecycle/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/producer/method/lifecycle/beans.xml deleted file mode 100644 index e646578be7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/producer/method/lifecycle/beans.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/lifecycle/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/lifecycle/beans.xml deleted file mode 100644 index e646578be7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/lifecycle/beans.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/env/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/env/beans.xml deleted file mode 100644 index e646578be7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/env/beans.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/env/web.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/env/web.xml deleted file mode 100644 index abc05a958f..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/env/web.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - Environment variables for managed beans - Env Injection Tests - - - greeting - java.lang.String - Hello there my friend - - - - check - java.lang.Boolean - true - - - - 10 - - - BASIC - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/beans.xml deleted file mode 100644 index e646578be7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/beans.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/persistence.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/persistence.xml deleted file mode 100644 index fe4c1bb202..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/persistenceContext/persistence.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - java:/DefaultDS - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/beans.xml deleted file mode 100644 index 13fd8e8f6f..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/implementation/simple/resource/resource/beans.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/realization/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/realization/beans.xml deleted file mode 100644 index e646578be7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/realization/beans.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/names/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/names/beans.xml deleted file mode 100644 index e646578be7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/names/beans.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/noextend1/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/noextend1/beans.xml deleted file mode 100644 index e646578be7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/noextend1/beans.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/noextend2/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/noextend2/beans.xml deleted file mode 100644 index e646578be7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/noextend2/beans.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/noextend3/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/noextend3/beans.xml deleted file mode 100644 index e646578be7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/noextend3/beans.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/two/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/two/beans.xml deleted file mode 100644 index e646578be7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/two/beans.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/custom/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/custom/beans.xml deleted file mode 100644 index b367f272e6..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/custom/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.full.interceptors.definition.custom.SimpleInterceptorWithoutAnnotations - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/beans.xml deleted file mode 100644 index e0891a57ae..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.interceptors.definition.enterprise.interceptorOrder.MissileInterceptor - - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/beans.xml deleted file mode 100644 index b493352cb7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/nonContextualReference/beans.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - org.jboss.cdi.tck.tests.interceptors.definition.enterprise.nonContextualReference.MissileInterceptor - org.jboss.cdi.tck.tests.interceptors.definition.enterprise.nonContextualReference.AnchorInterceptor - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/beans.xml deleted file mode 100644 index a356dcf3fa..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.full.interceptors.definition.interceptorCalledBeforeDecorator.FooDecorator - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/web.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/web.xml deleted file mode 100644 index 3d5ac90218..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/clientProxy/incontainer/web.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - Dependency Injection Test - - TestServlet - org.jboss.cdi.tck.tests.lookup.clientProxy.incontainer.TestServlet - 1 - - - TestServlet - /Test/* - - - 10 - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/JSFTestPage.xhtml b/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/JSFTestPage.xhtml deleted file mode 100644 index aa544a3b8f..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/JSFTestPage.xhtml +++ /dev/null @@ -1,11 +0,0 @@ - - - - JSF Test Page - - -

- -

- - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/JSPTestPage.jsp b/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/JSPTestPage.jsp deleted file mode 100644 index 7a5acc41f5..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/JSPTestPage.jsp +++ /dev/null @@ -1,8 +0,0 @@ - - - JSP Test Page - - -

${sheep.name}

- - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/faces-config.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/faces-config.xml deleted file mode 100644 index b626451779..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/faces-config.xml +++ /dev/null @@ -1,5 +0,0 @@ - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/web.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/web.xml deleted file mode 100644 index a17e90bbeb..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/el/integration/web.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - Integration with Unified EL Test - - Faces Servlet - jakarta.faces.webapp.FacesServlet - 1 - - - Faces Servlet - *.xhtml - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/ManagedBeanTestPage.xhtml b/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/ManagedBeanTestPage.xhtml deleted file mode 100644 index 1e4b59cf75..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/ManagedBeanTestPage.xhtml +++ /dev/null @@ -1,12 +0,0 @@ - - - - Managed Bean Test Page - - -

- - -

- - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TagPage.jsp b/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TagPage.jsp deleted file mode 100644 index bc027d0573..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TagPage.jsp +++ /dev/null @@ -1,4 +0,0 @@ -<%@ page language="java" contentType="text/plain; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://contextual.non.injection.lookup.tests.tck.jsr299.jboss.org/" prefix="t" %> - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestLibrary.tld b/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestLibrary.tld deleted file mode 100644 index 4b0f39574d..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/TestLibrary.tld +++ /dev/null @@ -1,17 +0,0 @@ - - - - 1.0 - test-library - http://contextual.non.injection.lookup.tests.tck.jsr299.jboss.org/ - - org.jboss.cdi.tck.tests.lookup.injection.non.contextual.TagLibraryListener - - - tag - org.jboss.cdi.tck.tests.lookup.injection.non.contextual.TestTagHandler - empty - - \ No newline at end of file diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/Translator_schema1.xsd b/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/Translator_schema1.xsd deleted file mode 100644 index a073321c5f..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/Translator_schema1.xsd +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/web.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/web.xml deleted file mode 100644 index 1ddfa088a8..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/web.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - Dependency Injection Test - - org.jboss.cdi.tck.tests.lookup.injection.non.contextual.TestListener - - - TestServlet - org.jboss.cdi.tck.tests.lookup.injection.non.contextual.TestServlet - 1 - - - Faces Servlet - jakarta.faces.webapp.FacesServlet - 1 - - - TestFilter - org.jboss.cdi.tck.tests.lookup.injection.non.contextual.TestFilter - - - TestServlet - /Test/* - - - Faces Servlet - *.jsf - - - TestFilter - /TestFilter - - - 10 - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/web2.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/web2.xml deleted file mode 100644 index 3e326943f0..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injection/non/contextual/web2.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - Dependency Injection Test - - org.jboss.cdi.tck.tests.lookup.injection.non.contextual.TestListener - - - TestServlet - org.jboss.cdi.tck.tests.lookup.injection.non.contextual.TestServlet - 1 - - - Faces Servlet - jakarta.faces.webapp.FacesServlet - 1 - - - TestFilter - org.jboss.cdi.tck.tests.lookup.injection.non.contextual.TestFilter - - - TestServlet - /Test/* - - - Faces Servlet - *.jsf - - - TestFilter - /TestFilter - - - 10 - - - - greeting - java.lang.String - Hello - - - - game - java.lang.String - poker - - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injectionpoint/broken/not/bean/web.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injectionpoint/broken/not/bean/web.xml deleted file mode 100644 index cf66468f16..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/injectionpoint/broken/not/bean/web.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - Dependency Injection Test - - TestServlet - org.jboss.cdi.tck.tests.lookup.injectionpoint.broken.not.bean.TestServlet_Broken - - - TestServlet - /Test/* - - - 10 - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/decorator/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/decorator/beans.xml deleted file mode 100644 index ea549948a7..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/decorator/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - org.jboss.cdi.tck.tests.lookup.typesafe.resolution.decorator.AnimalDecorator - - diff --git a/web/src/main/resources/org/jboss/cdi/tck/tests/se/discovery/trimmed/beans.xml b/web/src/main/resources/org/jboss/cdi/tck/tests/se/discovery/trimmed/beans.xml deleted file mode 100644 index 5de4f6f38a..0000000000 --- a/web/src/main/resources/org/jboss/cdi/tck/tests/se/discovery/trimmed/beans.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/web/src/main/resources/tck-audit-cdi.xml b/web/src/main/resources/tck-audit-cdi.xml deleted file mode 100644 index 8c4ac59c13..0000000000 --- a/web/src/main/resources/tck-audit-cdi.xml +++ /dev/null @@ -1,12181 +0,0 @@ - - -
- -
- - - A bean comprises of a (nonempty) set of bean types. - - - - A bean comprises of a (nonempty) set of qualifiers. - - - - A bean comprises of a scope. - - - - A bean comprises of an optional bean name. - - - - A bean comprises of a set of interceptor bindings. - This may only be tested indirectly - - - - A bean comprises of a bean implementation. - - - - A bean may or may not be an alternative. - -
- -
-
- -
- - - A bean may have multiple bean types. - - - - All beans have the bean type |java.lang.Object|. - - -
- - - -
- - The bean types of a bean may be restricted by annotating the bean class or producer method or field with the annotation - |@jakarta.enterprise.inject.Typed|. When a |@Typed| annotation is explicitly specified, only the types whose classes are explicitly listed using - the |value| member, together with |java.lang.Object| are bean types of the bean. - - - Check managed bean - - - Check producer method - - - Check producer field - - - Check generic managed bean - - - Check generic producer method - - - Check generic producer field - - - - - If a bean class or producer method or field specifies a |@Typed| annotation, and the |value| member specifies a class which does not - correspond to a type in the unrestricted set of bean types of a bean, the container automatically detects the problem and treats it as a - definition error. - - - Check managed bean - - - Check producer method - - - Check producer field - - -
- -
- - A client of a bean may typecast its contextual reference to a bean to any bean type of the bean which is a Java interface. However, the client - may not in general typecast its contextual reference to an arbitrary concrete bean type of the bean. - - -
- -
- -
- -
- - - Every bean has the built-in qualifier |@Any|, even if it does not explicitly declare this qualifier, ~except for the special |@New| qualified - beans defined in Section 3.14, "@New qualified beans"~. - - @New qualified beans cannot be checked since @New beans aren't required to be available via programmatic lookup - - - - If a bean does not explicitly declare a qualifier other than |@Named| or |@Any|, the bean has exactly one additional qualifier, of type - |@Default|. This - is called the default qualifier. - - - - - The default qualifier is also assumed for any injection point that does not explicitly declare a qualifier. - -
- -
- - A qualifier type is a Java annotation defined as |@Target({METHOD, FIELD, PARAMETER, TYPE})|~ and |@Retention(RUNTIME)|~. - Non-runtime retention annotations are discarded by the compiler - - - - A qualifier type may be declared by specifying the |@jakarta.inject.Qualifier| meta-annotation. - - - - A qualifier type may define annotation members. - This is true by default in the JLS - -
- -
- - The qualifiers of a bean are declared by annotating the bean class or producer method or field with the qualifier types. - - - Test by annotating a bean class. - - - - Test by annotating a producer method. - - - - Test by annotating a producer field. - - - - - Any bean may declare multiple qualifier types. - -
- -
- - Qualifier types may be applied to injected fields (see Section 3.8, "Injected fields") to determine the bean that is injected, according to - the rules of typesafe resolution defined in Section 5.3, "Typesafe resolution". - - - - - A bean may only be injected to an injection point if it has all the qualifiers of the injection point. - -
- -
- - Qualifier types may be applied to parameters of producer methods, initializer methods, disposer methods, observer methods or bean constructors - (see Chapter 3, Bean implementation) to determine the bean instance that is passed when the method is called by the container. - - - - Test producer method. - - - - Test initializer method. - - - - Test disposer method. - - - - Test observer method. - - - - Test bean constructor. - - -
- -
- - A repeated qualifier behaves just as any other qualifier does - -
- -
- - All beans have a scope. - - - - A scope type is represented by an annotation type. - This is a statement of intent - - - - The set of scope types is extensible. - -
- -
- - - - There are five standard scope types defined by this specification, all defined in the package |jakarta.enterprise.context|. - - - The container must provide an implementation of the @RequestScoped, @ApplicationScoped and @SessionScoped annotations defined in Section - 6.7, “Context management for built-in scopes”. - - - - - The |@ConversationScoped| annotation represents the conversation scope defined in Section 6.7.4, "Conversation context lifecycle". - - - - The |@Dependent| pseudo-scope is for dependent objects, as defined in Section 6.4, "Dependent pseudo-scope" - - - - If an interceptor or decorator has any scope other than |@Dependent|, non-portable behavior results. - - - - -
- -
- - A scope type is a Java annotation defined as |@Target({TYPE, METHOD, FIELD})|~ and |@Retention(RUNTIME)|~. - - - - A scope type is a Java annotation defined as ~|@Target({TYPE, METHOD, FIELD})| and ~|@Retention(RUNTIME)|. - Non-runtime retention annotations are discarded by the compiler - - - - A scope type must not have any attributes. If a scope type has attributes non-portable behavior results. - - - - All scope types must specify the |@jakarta.inject.Scope| or |@jakarta.enterprise.context.NormalScope| meta-annotation. - - -
- -
- - The scope of a bean is defined by annotating the bean class or producer method or field with a scope type. - - - - A bean class or producer method or field may specify at most one scope type annotation. If a bean class or producer method or field specifies - multiple scope type annotations, the container automatically detects the problem and treats it as a definition error. - - - Test with a bean class. - - - Test with a producer method. - - - Test with a producer field. - - - - - A scope type may be specified using a stereotype annotation, as defined in Section 2.7.2, "Declaring the stereotypes for a bean" - -
- -
- - When no scope is explicitly declared by annotating the bean class or producer method or field the scope of a bean is defaulted. - - - - If the bean does not declare any stereotype with a declared default scope, the default scope for the bean is |@Dependent|. - - - - If all stereotypes declared by the bean that have some declared default scope have the same default scope, then that scope is the default - scope for the bean. - - - - - If there are two different stereotypes present on the bean, directly, indirectly, or transitively, that declare different default scopes, - then there is no default scope and the bean must explicitly declare a scope. If it does not explicitly declare a scope, the container automatically - detects the problem and treats it as a definition error. - - - - - If a bean explicitly declares a scope, any default scopes declared by stereotypes are ignored. - -
- -
- - - If the bean discovery mode is annotated then: - - bean classes that don’t have bean defining annotation (as defined in Section 2.5.1, “Bean defining annotations”) are not discovered - - - producer methods (as defined in Section 3.3, “Producer methods”) whose bean class does not have a bean defining annotation are not - discovered - - - - producer fields (as defined in Section 3.4, “Producer fields”) whose bean class does not have a bean defining annotation are not - discovered - - - - disposer methods (as defined in Section 3.5, “Disposer methods”) whose bean class does not have a bean defining annotation are not - discovered - - - - observer methods (as defined in Section 10.4.2, “Declaring an observer method”) whose bean class does not have a bean defining annotation - are not discovered - - - - -
- -
- - - A bean class may have a bean defining annotation, allowing it to be placed anywhere in an application, as defined in Section 12.1. A bean - class with a bean defining annotation is said to be an implicit bean. - - This is a statement of intent - - - - The set of bean defining annotations contains: - - @ApplicationScoped, @SessionScoped, @ConversationScoped and @RequestScoped annotations - - - all other normal scope types - - - @Interceptor annotation - - - @Decorator annotation - - - all stereotype annotations (i.e. annotations annotated with @Stereotype) - - - the @Dependent scope annotation - - - - - Note that to ensure compatibility with other JSR-330 implementations, all pseudo-scope annotations except @Dependent are not bean defining - annotations. - - - - However, a stereotype annotation including a pseudo-scope annotation is a bean defining annotation. - - -
- -
- - - A valid bean name is a period-separated list of valid EL identifiers - -
- -
- - - To specify the name of a bean, the qualifier |@jakarta.inject.Named| is applied to the bean class or producer method or field. - - - Test with a bean class. - - - - Test with a producer method. - - - - Test with a producer field. - - - -
- -
- - - A default name must be assigned by the container when a bean class or producer method or field of a bean declares a |@Named| annotation and no - bean name is explicitly specified by the |value| member. - - - Test with a bean class. - - - Test with a producer method. - - - Test with a producer field. - - - - - A default name must be assigned by the container when a bean declares a stereotype that declares an empty |@Named| annotation, and the bean - does not explicitly specify an bean name. - - - - - If a bean class or producer method or field of a bean declares a |@Named| annotation and no bean name is explicitly specified the value of the - |value| member is defaulted. - - - Test with a bean class. - - - Test with a producer method. - - - Test with a producer field. - - - -
- -
- - - If |@Named| is not declared by the bean, nor by its stereotypes, a bean has no name. - - - - If an interceptor or decorator has a name, non-portable behavior results. - -
- -
- - An alternative is a bean that must be explicitly selected if it should be available for lookup, injection or EL resolution. - Tested in section 5.1.1 Declaring selected alternatives. - -
- -
- - - An alternative may be declared by annotating the bean class or producer method or field with the |@Alternative| annotation. - - - Test with a bean class. - - - - Test with a producer method. - - - - Test with a producer field. - - - - - An alternative may be declared by annotating a bean, producer method or producer field with a stereotype that declares an |@Alternative| - annotation. - - - - Test with a bean. - - - - Test with a producer method. - - - - Test with a producer field. - - - - - If an interceptor or decorator is an alternative, non-portable behavior results. - Non-portable behavior. - - -
- -
- - - A stereotype may specify that all beans with the stereotype have defaulted bean names. - - - - A stereotype may specify that all beans with the stereotype are alternatives. - - - - A bean may declare zero, one or multiple stereotypes. - - - A bean may declare zero stereotypes. - Not testable through API - - - - Test with one stereotype. - - - - Test with multiple stereotypes. - - - -
- -
- - A beans stereotype is a Java annotation defined as |@Target({TYPE, METHOD, FIELD})|, |@Target(TYPE)|, |@Target(METHOD)|, |@Target(FIELD)| or - |@Target({METHOD, FIELD})| and |@Retention(RUNTIME)|. - - - - Test |@Target({TYPE, METHOD, FIELD})|. - - - - Test |@Target(TYPE)|. - - - - Test |@Target(FIELD)|. - - - - - - |@Retention(RUNTIME)| - untestable. - Non-runtime retention annotations are discarded by the compiler - - - - - A stereotype may be declared by specifying the |@jakarta.enterprise.inject.Stereotype| meta-annotation. - -
- -
- - - The default scope of a stereotype is defined by annotating the stereotype with a scope type. A stereotype may declare at most one scope. If a - stereotype declares more than one scope, the container automatically detects the problem and treats it as a definition error. - - - - Test with one scope. - - - - Test that a stereotype with multiple scopes throws an exception. - - - -
- -
- - The interceptor bindings of a stereotype are defined by annotating the stereotype with the interceptor binding types. - - - - A stereotype may declare zero interceptor bindings. - - - - A stereotype may declare one interceptor bindings. - - - - A stereotype may declare multiple interceptor bindings. - -
- -
- - A stereotype may declare an empty |@Named| annotation, which specifies that every bean with the stereotype has a defaulted name when a name is - not explicitly specified by the bean. - - - - - A |@Named| qualifier declared by a stereotype is not added to the qualifiers of a bean with the stereotype. - - - - If a stereotype declares a non-empty |@Named| annotation, the container automatically detects the problem and treats it as a definition - error. - - - - - A stereotype should not declare any qualifier annotation other than |@Named|. If a stereotype declares any other qualifier annotation, - non-portable behavior results. - - The behavior here is undefined. - - - - A stereotype should not be annotated |@Typed|. If a stereotype is annotated |@Typed|, non-portable behavior results. - - -
- -
- - A stereotype may declare an |@Alternative| annotation, which specifies that every bean with the stereotype is an alternative. - -
- -
- - A stereotype may declare a @Priority annotation which functions as a means of enabling and ordering affected beans. - - - - If there are two different stereotypes present on a bean, directly, indirectly, or transitively, that declare - different priority values, then the bean must explicitly declare a @Priority annotation. If the bean does not - explicitly declare priority, the container automatically detects the problem and treats it as a definition error. - - - -
- -
- - A stereotype may declare other stereotypes. - - - - Stereotype declarations are transitive - a stereotype declared by a second stereotype is inherited by all beans and other stereotypes that - declare the second stereotype. - - - - - Stereotypes declared |@Target(TYPE)| may not be applied to stereotypes declared |@Target({TYPE, METHOD, FIELD})|, |@Target(METHOD)|, - |@Target(FIELD)|, |@Target({METHOD, FIELD})|. - - No definition of what happens if you do this - - -
- -
- - Stereotype annotations may be applied to a bean class or producer method or field. - - - Test with a bean class. - - - - Test with a producer method. - - - - Test with a producer field. - - - - - The default scope declared by the stereotype may be overridden by the bean. - - - - Multiple stereotypes may be applied to the same bean. - -
- -
- - The built-in stereotype |@jakarta.enterprise.inject.Model| is intended for use with beans that define the model layer of an MVC web application - architecture such as JSF. - - Tested by API signature test - -
- -
- - When the application violates a rule defined by this specification, the container automatically detects the problem. There are three kinds of - problem - definition errors occur when a single bean definition violates the rules of this specification, deployment problems occur when there - are problems resolving dependencies, or inconsistent specialization, in a particular deployment, and exceptions occur at runtime. - - Generalization - - - - Definition errors are developer errors. They may be detected by tooling at development time, and are also detected by the container at - initialization time. If a definition error exists in a deployment, initialization will be aborted by the container. - - - - - If a definition error exists, the container must throw a subclass of |jakarta.enterprise.inject.spi.DefinitionException|. - - - - Deployment problems are detected by the container at initialization time. If a deployment problem exists in a deployment, initialization will - be aborted by the container. - - - - - If a deployment problem occurs, the container must throw a subclass of |jakarta.enterprise.inject.spi.DeploymentException|. - - - - The container is permitted to define a non-portable mode, for use at development time, in which some definition errors and deployment problems - do not cause application initialization to abort. - - - - - Exceptions represent problems that may not be detected until they actually occur at runtime. All exceptions defined by this specification are - unchecked exceptions. All exceptions defined by this specification may be safely caught and handled by the application. - - - -
- -
-
- -
- -
- -
- - - If the bean class of a managed bean is annotated with both the |@Interceptor| and |@Decorator| stereotypes, the container automatically - detects the problem and treats it as a definition error. - - - - - If a managed bean has a non-static public field, its scope must be a pseudo-scope. - If a managed bean with a non-static public field declares a normal scope, the container automatically detects the problem and treats it as a definition error. - - - Check a pseudo-scoped bean with a public field. - - - Check a managed bean with a static public field which declares a normal scope. - - - Check a managed bean with a non-static public field which declares a normal scope. - - - - - If the managed bean class is a generic type, it must have scope |@Dependent|. If a managed bean with a parameterized bean class declares any - scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error. - - -
- -
- - A Java class is not a managed bean if it is an inner class. - - - - A Java class that is a static nested class can be a managed bean. - Implied as the inverse of assertion 3.1.1.b - - - - A Java class is not a managed bean if it is an abstract class, unless it is annotated |@Decorator|. - - - - A Java class is not a managed bean if it is an interface, unless it is annotated |@Decorator|. - - - - A Java class is not a managed bean if it implements |jakarta.enterprise.inject.spi.Extension|. - - - - A Java class is not a managed bean if it is annotated |@Vetoed| or placed in a package annotated |@Vetoed|. - - - - A Java class is only a managed bean if it has an appropriate constructor - a constructor with no parameters. - - - - A Java class is only a managed bean if it has an appropriate constructor - a constructor annotated |@Inject|. - - - - If packages annotated |@Vetoed| are split across classpath entries, non-portable behavior results. An application can prevent packages being - split across jars by sealing the package as defined by the Extension Mechanism Architecture. - - Non-portable behavior. - - -
- -
- - - The unrestricted set of bean types for a managed bean contains the bean class, every superclass and all interfaces it implements directly or - indirectly. - - - - - - The resulting set of bean types for a managed bean consists only of legal bean types, all other types are - removed from the set of bean types. - - -
- -
- - A managed bean with a constructor that takes no parameters does not require any special annotations - - - - If the managed bean does not have a constructor that takes no parameters, it must have a constructor annotated |@Inject|. No additional - special annotations are required. - - - - - A bean class may also specify a scope, name, stereotypes and/or qualifiers. - - - Test a bean with a scope. - - - - Test a bean with a name. - - - - Test a bean with a stereotype. - - - - Test a bean with a qualifier. - - - - - A managed bean may extend another managed bean. - -
- -
- - If a bean class of a managed bean X is annotated |@Specializes|, then the bean class of X must directly extend the bean class of another - managed bean Y. Then X directly specializes Y, as defined in Section 4.3, "Specialization". - - - - Test that a specializing bean has all its own qualifiers and the qualifiers of the specialized bean. - - - - Test that a specializing bean has the name of the specialized bean. - - - - Test a specialized bean extending a managed bean. - - - - - If the bean class of X does not directly extend the bean class of another managed bean, the container automatically detects the problem and - treats it as a definition error. - - - - Test a specializing bean extending a non simple bean. - - - - Test a specializing bean extending nothing. - - - - Test a specializing bean implementing an interface and extending nothing. - - -
- -
- - The default name for a managed bean is the unqualified class name of the bean class, after converting the first character to lower case - -
- -
- - A producer method must be a default-access, public, protected or private, non-abstract method of a managed bean class. - - - - A producer method may be static. - - - - A producer method may be non-static. - - - - If a producer method sometimes returns a null value, then the producer method must have scope |@Dependent|. - - - - If a producer method returns a null value at runtime, and the producer method declares scope other than |@Dependent|, an - |IllegalProductException| is thrown by the container. This restriction allows the container to use a client proxy, as defined in Section 5.4, - "Client proxies". - - - - - If the producer method return type is a parameterized type, it must specify an actual type parameter or type variable for each type - parameter. - - - - - If a producer method return type contains a wildcard type parameter the container automatically detects the problem and treats it as a - definition error. - - - - - If a producer method return type is an array type whose component type contains a wildcard type parameter the container automatically detects - the problem and treats it as a definition error. - - - - - If the producer method return type is a parameterized type with a type variable, it must have scope |@Dependent|. - - - - If a producer method with a parameterized return type with a type variable declares any scope other than |@Dependent|, the container - automatically detects the problem and treats it as a definition error. - - - - - If a producer method return type is a type variable the container automatically detects the problem and treats it as a definition error. - - - - - If a producer method return type is an array type whose component type is a type variable the container automatically detects the problem and - treats it as a definition error. - - - - - The application may call producer methods directly. However, if the application calls a producer method directly, no parameters will be passed - to the producer method by the container; the returned object is not bound to any context; and its lifecycle is not managed by the container. - - - - - A bean may declare multiple producer methods. - -
- -
- - If the return type of a producer method is an interface, the unrestricted set of bean types contains the return type, all interfaces it - extends directly or indirectly and |java.lang.Object| - - - - - If a return type of a producer method is primitive or is a Java array type, the unrestricted set of bean types contains exactly two types: the - method return type and |java.lang.Object|. - - - Check primitive return type - - - - Check array return type - - - - - - If the return type of a producer method is a class, the unrestricted set of bean types contains the return type, every superclass and all - interfaces it implements directly or indirectly. - - - - - The resulting set of bean types for a producer method consists only of legal bean types, all other types - are removed from the set of bean types. - - -
- -
- - A producer method may be declared by annotating a method with the |@jakarta.enterprise.inject.Produces| annotation - - - - A producer method may specify a scope. - - - - A producer method may specify a name. - - - - A producer method may specify stereotypes. - - - - A producer method may specify qualifiers. - - - - If a producer method is annotated |@Inject|, has a parameter annotated |@Disposes|, or has a parameter annotated |@Observes|, or has a - parameter annotated |@ObservesAsync|, the container - automatically detects the problem and treats it as a definition error. - - - - Test with a producer method annotated |@Inject|. - - - - Test with a producer method annotated |@Disposes|. - - - - Test with a producer method annotated |@Observes|. - - - - Test with a producer method annotated |@ObservesAsync|. - - - - - Interceptors ~and decorators~ may not declare producer methods. If an interceptor ~or decorator~ has a method annotated |@Produces|, the - container automatically detects the problem and treats it as a definition error. - - - - - ~Interceptors and~ decorators may not declare producer methods. If an ~interceptor or~ decorator has a method annotated |@Produces|, the - container automatically detects the problem and treats it as a definition error. - - - - - A producer method may have any number of parameters. - - - - All producer method parameters are injection points. - -
- -
- - If a producer method X is annotated |@Specializes|, then it must be non-static and directly override another producer method Y. Then X - directly specializes Y, as defined in Section 4.3 "Specialization". - - - - - If a producer method is static, the container automatically detects the problem and treats it as a definition error. - - - - If a producer method does not directly override another producer method, the container automatically detects the problem and treats it as a - definition error. - - -
- -
- - The default name for a producer method is the method name, unless the method follows the JavaBeans property getter naming convention, in which - case the default name is the JavaBeans property name - - - Test default name is the method name. - - - Test default name is the JavaBeans property name. - - -
- -
- - A producer field must be a default-access, public, protected or private, field of a managed bean class~ - Just test that a producer field on these works - - - - A producer field may be static. - - - - A producer field may be non-static. - - - - If a producer field sometimes contains a null value when accessed, then the producer field must have scope |@Dependent| - - - - If a producer field contains a null value at runtime, and the producer field declares any other scope, an |IllegalProductException| is thrown - by the container. This restriction allows the container to use a client proxy, as defined in Section 5.4, "Client proxies" - - - - - If the producer field type is a parameterized type, it must specify an _actual type parameter_ or type variable for each type parameter - - - - If the producer field type is a parameterized type, it must specify an actual type parameter or _type variable_ for each type parameter - - - - If a producer field type contains a wildcard type parameter the container automatically detects the problem and treats it as a definition - error. - - - - - If a producer field type is an array type whose component type contains a wildcard parameter the container automatically detects the problem - and treats it as a definition error. - - - - - If the producer field type is a parameterized type with a type variable, it must have scope |@Dependent|. If a producer field with a - parameterized type with a type variable declares any scope other than |@Dependent|, the container automatically detects the problem and treats - it as a definition error. - - - - - If a producer field type is a type variable the container automatically detects the problem and treats it as a definition error. - - - - If a producer field type is an array type whose component type is a type variable the container automatically detects the problem and treats - it as a definition error. - - - - - The application may access producer fields directly. However, if the application accesses a producer field directly, the returned object is - not bound to any context; and its lifecycle is not managed by the container - - This is a statement of intent - - - - A bean may declare multiple producer fields - -
- -
- - The bean types of a producer field depend upon the field type. If the field type is an interface, the unrestricted set of bean types contains - the field type, all interfaces it extends directly or indirectly and |java.lang.Object|. - - - - - The bean types of a producer field depend upon the field type. If a field type is primitive or is a Java array type, the unrestricted set of - bean types contains exactly two types: the field type and |java.lang.Object|. - - - Check primitive type - - - - Check array type - - - - - The bean types of a producer field depend upon the field type. If the field type is a class, the unrestricted set of bean types contains the - field type, every superclass and all interfaces it implements directly or indirectly - - - - The resulting set of bean types for a producer field consists only of legal bean types, all other types - are removed from the set of bean types. - - -
- -
- - A producer field may be declared by annotating a field with the |@jakarta.enterprise.inject.Produces| annotation. - - - - A producer field may specify a scope. - - - - A producer field may specify a name. - - - - A producer field may specify stereotypes. - - - - A producer field may specify qualifiers. - - - - If a producer field is annotated |@Inject|, the container automatically detects the problem and treats it as a definition error. - - - - Interceptors ~and decorators~ may not declare producer fields. If an interceptor ~or decorator~ has a field annotated |@Produces|, the - container automatically detects the problem and treats it as a definition error. - - - - - ~Interceptors~ and decorators may not declare producer fields. If ~an interceptor or~ decorator has a field annotated |@Produces|, the - container automatically detects the problem and treats it as a definition error. - - -
- -
- - The default name for a producer field is the field name - -
- -
- - - A disposer method must be a default-access, public, protected or private, non-abstract method of a managed bean class. - - - - A disposer method may be static. - - - - A disposer method may be non-static. - - - - A bean may declare multiple disposer methods. - -
- -
- - Each disposer method must have exactly one disposed parameter, of the same type as the corresponding producer method return type or producer - field type. - - - - - When searching for disposer methods for a producer method or producer field the container considers the type and qualifiers of the disposed - parameter. If a producer method or producer field declared by the same bean class is assignable to the disposed parameter, according to the - rules of typesafe resolution defined in Section 5.2, "Typesafe resolution", the container must call this method when destroying any instance - returned by that producer method or producer field. - - - - - A disposer method may resolve to multiple producer methods or producer fields declared by the bean class, in which case the container must - call it when destroying any instance returned by any of these producer methods or producer fields. - - -
- -
- - A disposer method may be declared by annotating a parameter |@jakarta.enterprise.inject.Disposes|. That parameter is the disposed parameter - - - - - Qualifiers may be declared by annotating the disposed parameter. - - - - If a method has more than one parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition - error. - - - - - If a disposer method is annotated |@Produces|, the container automatically detects the problem and treats it as a definition error. - - - - If a disposer method is annotated |@Inject|, the container automatically detects the problem and treats it as a definition error. - - - - If a disposer method has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition - error. - - - - - If a disposer method has a parameter annotated |@ObservesAsync|, the container automatically detects the problem and treats it as a definition - error. - - - - - Interceptors ~and decorators~ may not declare disposer methods. If an interceptor ~or decorator~ has a method annotated |@Disposes|, the - container automatically detects the problem and treats it as a definition error. - - - - - ~Interceptors and ~decorators may not declare disposer methods. If ~an interceptor or~ decorator has a method annotated |@Disposes|, the - container automatically detects the problem and treats it as a definition error. - - - - - In addition to the disposed parameter, a disposer method may declare additional parameters, which may also specify qualifiers. These - additional parameters are injection points. - - -
- -
- - A disposer method is bound to a producer method if the producer method is declared by the same bean class as the disposer method, and the - producer method is assignable to the disposed parameter, according to the rules of typesafe resolution defined in Section 5.2, "Typesafe - resolution". - - - - - A disposer method is bound to a producer field if the producer field is declared by the same bean class as the disposer method, and the - producer field is assignable to the disposed parameter, according to the rules of typesafe resolution defined in Section 5.2, "Typesafe - resolution". - - - - - If there are multiple disposer methods for a single producer method or producer field, the container automatically detects the problem and - treats it as a definition error. - - - - - If there is no producer method or producer field declared by the bean class that is assignable to the disposed parameter of a disposer method, - the container automatically detects the problem and treats it as a definition error. - - -
- -
- - When the container instantiates a bean, it calls the bean constructor. The bean constructor is a default-access, public, protected or private - constructor of the bean class. - - -
- -
- - The bean constructor may be identified by annotating the constructor |@Inject| - - Test an @Inject constructor is used on a managed bean - - - - - If a bean class does not explicitly declare a constructor using |@Inject|, the constructor that accepts no parameters is the bean - constructor. - - Can't check implicit constructor - - - - If a bean class has more than one constructor annotated |@Inject|, the container automatically detects the problem and treats it as a - definition error. - - - - - If a bean constructor has a parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition - error. - - - - - If a bean constructor has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition - error. - - - - - If a bean constructor has a parameter annotated |@ObservesAsync|, the container automatically detects the problem and treats it as a - definition - error. - - - - - A bean constructor may have any number of parameters. - - - - All parameters of a bean constructor are injection points. - -
- -
- - An injected field is a non-static, non-final field of a bean class or of any other classes supporting injection. - - - Test a bean class. - - - -
- -
- - An injected field may be declared by annotating the field |@jakarta.inject.Inject|. - - - - If an injected field is annotated |@Produces|, the container automatically detects the problem and treats it as a definition error. - -
- -
- - An initializer method is a default-access, public, protected or private, non-abstract, non-static, non-generic method of a bean class or of - any other classes supporting injection. - - - - Test a bean-class. - - - - - - Method interceptors are never called when the container calls an initializer method - - - - A bean class may declare multiple (or zero) initializer methods - - - - The application may call initializer methods directly, but then no parameters will be passed to the method by the container - This is a statement of intent - -
- -
- - An initializer method may be declared by annotating the method |@jakarta.inject.Inject| - - - - If a generic method of a bean is annotated |@Inject|, the container automatically detects the problem and treats it as a definition error. - - - - - If an initializer method is annotated |@Produces|, the container automatically detects the problem and treats it as a definition error. - - - - If an initializer method has a parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition - error. - - - - - If an initializer method has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition - error. - - - - - If an initializer method has a parameter annotated |@ObservesAsync|, the container automatically detects the problem and treats it as a - definition - error. - - - - - An initializer method may have any number of parameters. - - - - All initializer method parameters are injection points. - -
- -
- - If an injection point declares no qualifier, the injection point has exactly one qualifier, the default qualifier |@Default|. - -
- -
- - If an injected field declares a |@Named| annotation that does not specify the |value| member, the name of the field is assumed. - - - - If any other injection point declares a |@Named| annotation that does not specify the |value| member, the container automatically detects the - problem and treats it as a definition error. - - -
- -
- - For each managed bean, a second bean exists which has the same bean class. - - - - For each managed bean, a second bean exists which has the same bean types. - - - - For each managed bean, a second bean exists which has the same bean constructor. - - - - For each managed bean, a second bean exists which has the same initializer methods. - - - - For each managed bean, a second bean exists which has the same injected fields. - - - - For each managed bean, a second bean exists which has the same interceptor bindings. - - - - This second bean has scope |@Dependent|. - - - - This second bean has exactly one qualifier: |@jakarta.enterprise.inject.New(X.class)| where |x| is the bean class. - - - - This second bean has no bean name. - - - - This second bean has no stereotypes. - - - - This second bean has no observer methods. - - - - This second bean has no producer methods. - - - - This second bean has no producer fields. - - - - This second bean has no disposer methods. - - - - This second bean is not an alternative. - - - - This second bean is enabled, in the sense of Section 5.1.2, "Enabled and disabled beans", if and only if some other enabled bean has an - injection point with the qualifier |@New(X.class)| where |X| is the bean class. - - - - - This bean is called the |@New| qualified bean for the class |X|. - - - - Note that this second bean exists, and may be enabled and available for injection even if the first bean is disabled, as defined by Section - 5.1.2, “Enabled and disabled beans” or if the bean class is deployed outside of a bean deployment archive, as defined in Section 12.1, “Bean - deployment archives”, and is therefore not discovered during the bean discovery process defined in Chapter 12, Packaging and deployment. The - container discovers |@New| qualified beans by inspecting injection points of other enabled beans. - - - Check that @New on a field injection point outside the BDA, but in the classpath causes a bean with qualifier @New and the given type to - be created - - - - Check that @New on a initializer method injection point outside the BDA, but in the classpath causes a bean with qualifier @New and the - given type to be created - - - - Check that @New on a constructor injection point outside the BDA, but in the classpath causes a bean with qualifier @New and the given - type to be created - - - - Check that @New on a producer method injection point outside the BDA, but in the classpath causes a bean with qualifier @New and the given - type to be created - - - - Check that @New on a observer method injection point outside the BDA, but in the classpath causes a bean with qualifier @New and the given - type to be created - - - - Check that @New on a disposer method injection point outside the BDA, but in the classpath causes a bean with qualifier @New and the given - type to be created - - - - - - When the qualifier |@New| is specified at an injection point and no |value| member is explicitly specified, the container defaults the |value| - to the declared type of the injection point. - - -
- -
- - - - Certain legal bean types cannot be proxied by the container. If an injection point whose declared type cannot be proxied by the container - resolves to a bean with a normal scope, the container automatically detects the problem and treats it as a deployment problem. - - - - Test a class which doesn't have a non-private constructor with no parameters. - - - - Test a class which is declared final. - - - - Test a class that has non-static, final method with public visibility. - - - - Test a class that has non-static, final method with public visibility declared on a superclass. - - - - Test with a class that has static final method with public visibility. - This is not allowed in CDI 1.0. - - - - Test a class that has final method with private visibility. - This is not allowed in CDI 1.0. - - - - Test primitive type. - - - - Test array type. - - - - - - A bean type must be proxyable if an injection point resolves to a bean: - - - That has an associated decorator. - - - - That has a bound interceptor. - - - - -
- -
- -
- -
- - Suppose a class X is extended directly or indirectly by the bean class of a managed bean Y. If X is annotated with a qualifier type, - stereotype or interceptor binding type Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y - nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z. - - - - Test qualifier type for directly extended managed bean annotated |@Inherited| is inherited. - - - - Test qualifier type for directly extended managed bean not annotated |@Inherited| is not inherited. - - - - Test stereotype for directly extended managed bean annotated |@Inherited| is inherited. - - - - Test stereotype for directly extended managed bean not annotated |@Inherited| is not inherited. - - - - - - Test interceptor binding type for directly extended managed bean not annotated |@Inherited| is not inherited. - - - - Test qualifier type for indirectly extended managed bean annotated |@Inherited| is inherited. - - - - Test qualifier type for indirectly extended managed bean not annotated |@Inherited| is not inherited. - - - - Test stereotype for indirectly extended managed bean annotated |@Inherited| is inherited. - - - - Test stereotype for indirectly extended managed bean not annotated |@Inherited| is not inherited. - - - - Test interceptor binding type for indirectly extended managed bean annotated |@Inherited| is inherited. - - - - Test interceptor binding type for indirectly extended managed bean not annotated |@Inherited| is not inherited. - - - - - - Suppose a class X is extended directly or indirectly by the bean class of a managed bean Y. If X is annotated with a scope type Z then Y - inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass - of X and a superclass of Y declares a scope type. - - - - Test scope type for directly extended managed bean annotated |@Inherited| is inherited. - - - - Test scope type for directly extended managed bean not annotated |@Inherited| is not inherited. - - - - Test scope type for indirectly extended managed bean annotated |@Inherited| is inherited. - - - - Test scope type for indirectly extended managed bean not annotated |@Inherited| is not inherited. - - - - - For class X which is extended _directly_ by the bean class of a _managed_ bean Y, a scope type explicitly declared by X and inherited by Y - from X takes precedence over default scopes of stereotypes declared or inherited by Y. - - - - - For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, a scope type explicitly declared by X and inherited by Y - from X takes precedence over default scopes of stereotypes declared or inherited by Y. - - - - - For annotations defined by the bean specification, all built-in _scope types_ are declared |@Inherited| - sigtest - - - - For annotations defined by the bean specification, all built-in _stereotypes_ are declared |@Inherited| - sigtest - - - - For annotations defined by the bean specification, _no built-in qualifier type is declared |@Inherited|_ - sigtest - - - - The |@Named| annotation is not declared |@Inherited| and bean names are not inherited unless specialization is used - sigtest - - -
- -
- - - Suppose a class X is extended directly or indirectly by the bean class of a managed bean. If X declares an injected field x then Y inherits - x. - - - - Check managed bean X _directly_ extends managed bean Y - - - - Check managed bean X _indirectly_ extends managed bean Y - - - - - Suppose a class X is extended directly or indirectly by the bean class of a managed bean Y. If X declares an initializer, non-static observer, - @PostConstruct or @PreDestroy method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a - superclass of Y overrides the method x(). - - - - Check managed bean X _directly_ extends managed bean Y with _|@PostConstruct|_ - - - - Check managed bean X _indirectly_ extends managed bean Y with _|@PostConstruct|_ - - - - Check managed bean X _directly_ extends managed bean Y with _|@PostDestroy|_ - - - - Check managed bean X _indirectly_ extends managed bean Y with _|@PostDestroy|_ - - - - Check managed bean X _directly_ extends managed bean Y with a _non-static observer method_ - - - - Check managed bean X _indirectly_ extends managed bean Y with a _non-static observer method_ - - - - Check managed bean X _directly_ extends managed bean Y with a _initializer method_ - - - - Check managed bean X _indirectly_ extends managed bean Y with a _initializer method_ - - - - - Suppose a class X is extended directly or indirectly by the bean class of a managed bean. If X declares a non-static method x() annotated with - an interceptor binding type Z then Y inherits the binding if and only if neither Y nor any intermediate class that is a subclass of X and a - superclass of Y overrides the method x(). - - - - Check managed bean X _directly_ extends managed bean Y - - - - Check managed bean X _indirectly_ extends managed bean Y - - - - - - Suppose a class X is extended directly or indirectly by the bean class of a managed bean Y. If X declares a non-static producer or disposer - method x() then Y does not inherit this method. - - - - Check managed bean X _directly_ extends managed bean Y with a _non-static producer method_ - - - - Check managed bean X _directly_ extends managed bean Y with a _non-static disposer method_ - - - - Check managed bean X _indirectly_ extends managed bean Y with a _non-static producer method_ - - - - Check managed bean X _indirectly_ extends managed bean Y with a _non-static disposer method_ - - - - - Suppose a class X is extended directly or indirectly by the bean class of a managed bean or session bean Y. If X declares a non-static - producer field x then Y does not inherit this field. - - - - Check managed bean X _directly_ extends managed bean Y - We don't test session beans, as they can't have non-static producer fields - - - - Check managed bean X _indirectly_ extends managed bean Y - We don't test session beans, as they can't have non-static producer fields - - - - - - If X is a generic type, and an injection point or observer method declared by X is inherited by Y, and the declared type of the injection - point, producer method, producer field, disposed para- meter or event parameter contains type variables declared by X, the type of the injection - point, producer method, producer field, disposed parameter or event parameter inherited in Y is the declared type, after substitution of actual - type arguments declared by Y or any intermediate class that is a subclass of X and a superclass of Y. - - - - Check injection point - - - - check observer method - - - -
- -
- - - If two beans both support a certain bean type, and share at least one qualifier, then they are both eligible for injection to any injection - point with that declared type and qualifier. - - - - - When an enabled bean specializes a second bean, we can be certain that the second bean is never instantiated or called by the container. Even - if the second bean defines a producer or observer method, the method will never be called. - - - The second bean is never instantiated. - - - Producer method on specialized bean is not called. - - - Observer method on specialized bean is not called. - - - Producer field on specialized bean is not used. - - - -
- -
- - A bean X is said to specialize another bean Y if X directly specializes Y. - - - - A bean X is said to specialize another bean Y if a bean Z exists, such that X directly specializes Z and Z specializes Y. - - - - A bean X that specializes bean Y will include all qualifiers of Y, together with all qualifiers declared explicitly by X. - - - - A bean X that specializes bean Y will have the same name as Y if Y has a name. - - - - X must have all the bean types of Y. If X does not have some bean type of Y, the container automatically detects the problem and treats it as - a definition error. - - - - - If Y has a bean name and X declares a bean name explicitly the container automatically detects the problem and treats it as a definition - error. - - - Test that a specializing producer method with a name throws a definition exception. - - - Test that a specializing managed bean with a name throws a definition exception. - - - - - If an interceptor or decorator is annotated |@Specializes|, non-portable behavior results. - Defines non-portable behavior - -
- -
- - - The container is required to support circularities in the bean dependency graph where at least one bean participating in every circular chain - of dependencies has a normal scope, as defined in Section 6.3, "Normal scopes and pseudo-scopes". - - The RI has unit tests for this atm - - - - The container is not required to support circular chains of dependencies where every bean participating in the chain has a pseudo-scope. - - -
- -
- - A bean packaged in a certain module is available for injection, lookup and name resolution to classes packaged in some other module if the - bean class of the bean is required to be accessible to the other module by the class accessibility requirements of the module architecture. - - - - Test with injection. - - - - Test with lookup. - - - - Test with name resolution. - - - - - An alternative is never available for injection, lookup or name resolution in a module unless the module is a bean archive and the alternative - is explicitly selected for the bean archive or the application.. - - If a module/library is not BDA then no injection is possible at all - - - - Nor is an alternative available for injection, lookup or name resolution in every bean deployment archive. An alternative must be explicitly - selected in every bean deployment archive in which the alternative should be available for injection, lookup and name resolution. - - -
- -
- - - This specification defines two methods of selecting alternatives. From Contexts and Dependency Injection 1.1 onwards the |@Priority| - annotation allows an alternative to be selected for an entire application. Contexts and Dependency Injection 1.0 allowed only for an alternative - to be selected for a bean archive. - - Statement of intent. - - -
- -
- - - An alternative may be given a priority for the application by placing the |@Priority| annotation on the bean class of a managed bean. - - Test |@Priority| on the bean class of a managed bean. - - - - - An alternative may be given a priority for the application by placing the |@Priority| annotation on the bean class that declares the producer - method, field or resource. - - - Test |@Priority| on the bean class of a producer method. - - - Test |@Priority| on the bean class of a producer field. - - - Test |@Priority| on the resource. - - - - - An alternative may be given a priority for the application by placing the |@Priority| annotation on the producer field, method or resource. - - - Test |@Priority| on a producer method. - - - Test |@Priority| on a producer field. - - - Test |@Priority| on a resource. - - - - - For the purpose of determining the priority of any producer method or field during ambiguity resolution, the priority of the producer method or field is considered first. - If the producer method or field does not have a priority, the priority of the managed bean that declares the producer method or field is used. - - Test |@Priority| declared directly on producer is considered first. - - - -
- -
- - - An alternative may be explicitly declared using the |<alternatives>| element of the |beans.xml| file of the bean archive. The |<alternative>| - element contains a list of bean classes and stereotypes. - - Statement of intent. - - - - An alternative is selected for the bean archive if the alternative is a managed bean and the bean class of the bean is listed. - - Test selected managed bean. - - - - - An alternative is selected for the bean archive if the alternative is a producer method, field or resource, and the bean class that declares - the method or field is listed. - - - Test selected producer method. - - - Test selected producer field. - - - Test selected resource. - - - - - An alternative is selected for the bean archive if any @Alternative stereotype of the alternative is listed. - - - - For each child |<class>| element the container verifies that either a class with the specified name exists and is annotated with - @Alternative or an @Alternative stereotype, or a class with the specified name exists and declares a field or method annotated with @Produces - and, at the same time, annotated with @Alternative or an @Alternative stereotype, or an alternative bean whose bean class has the specified name - exists. Otherwise, the container automatically detects the problem and treats it as a deployment problem. - - - - - Each child |<stereotype>| element must specify the name of a |@Alternative| stereotype annotation. If there is no annotation with the - specified name, or the annotation is not a |@Alternative| stereotype, the container automatically detects the problem and treats it as a - deployment problem. - - - - - If the same type is listed twice under the |<alternatives>| element, the container automatically detects the problem and treats it as a - deployment problem. - - - - - For a custom implementation of the |Bean| interface defined in Section "bean", the container calls |isAlternative()| to determine whether the - bean is an alternative, and |getBeanClass()| and |getStereotypes()| to determine whether an alternative is selected in a certain bean deployment - archive. - - - - - An alternative selected only for a specific bean archive is not selected for an application. - - -
- -
- - A bean is said to be enabled if it is deployed in a bean deployment archive, and it is not a producer method or field of a disabled bean, and - it is not specialized by any other enabled bean, as defined in Section 4.3, "Specialization", and either it is not an alternative, or it is not - an alternative, or it is a selected alternative of at least one bean archive or the application. Otherwise, the bean is said to be disabled. - - Tested in section inter_module_injection - -
- -
- - Suppose an enabled bean X specializes a second bean Y. If there is another enabled bean that specializes Y we say that inconsistent - specialization exists. The container automatically detects inconsistent specialization and treats it as a deployment problem. - - -
- -
- - A bean is available for injection in a certain module if the bean is not an interceptor or decorator, the bean is enabled, the bean is either - not an alternative, or the module is a bean archive and the bean is a selected alternative of the bean archive, and the bean class is required - to be accessible to classes in the module, according to the class accessibility requirements of the module architecture. - - - - Check a decorator can not be injected - - - - Check an interceptor can not be injected - - - - Check an enabled managed bean can be injected - - - - Check an enabled producer field can be injected - - - - Check an enabled producer method can be injected - - - - Check producer method of a disabled bean is not injectable - - - - Check producer field of a disabled bean is not injectable - - - - Check a disabled managed bean is not injectable - - - - Check a specialized managed bean is not injectable - - - - Check a specialized producer field is not injectable - Specialized producer field is not legal. - - - - Check a specialized producer method is not injectable - - - - Check a selected alternative being managed bean is injected - - - - - - For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface, the container calls |getBeanClass()| to - determine the bean class of the bean and |InjectionPoint.getMember()| and then |Member.getDeclaringClass()| to determine the class that declares - an injection point. - - - Check |Bean.getBeanClass()| is used to determine the bean class - It is not clear from the spec when exactly the method should be called. - - - - Check |InjectionPoint.getMember().getDeclaringClass()| is used to determine the class declaring the injection point - It is not clear from the spec when exactly the method should be called. - - -
- -
-
- -
- - - A bean is assignable to a given injection point if the bean has a bean type that matches the required type. For this purpose, primitive types - are considered to match their corresponding wrapper types in |java.lang| and array types are considered to match only if their element types are - identical. Parameterized and raw types are considered to match if they are identical or if the bean type is assignable to the required type, as - defined in Section 5.2.3, "Assignability of raw and parameterized types". - - - - Test with a primitive type. - - - - Test with an array type. - - - - Test with a parameterized type. - - - - Test with a raw type. - - - - Test with a |@Named| bean. - - - - - A bean is assignable to a given injection point if the bean has all the required qualifiers. If no required qualifiers were explicitly - specified, the container assumes the required qualifier |@Default|. A bean has the required qualifier if it has a qualifier with (a) the same - type and (b) the same annotation member value for each member which is not annotated |@jakarta.enterprise.util.NonBinding|. - - - - Test with beans with required qualifiers. - - - - Test with beans without required qualifiers. - - - - Test with matching beans with matching qualifier with same type. - - - - Test with matching beans with matching qualifier with same annotation member value for each member which is not annotated - |@jakarta.enterprise.util.NonBinding|. - - - - - - A bean is eligible for injection to a certain injection point if it is available for injection in the module that contains the class that - declares the injection point, and it is assignable to the injection point. - - - - - For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls |getTypes()| and - |getQualifiers()| to determine the bean types and qualifiers. - - - - Test |getTypes()| determines bean types. - - - - Test |getQualifiers()| determines qualifiers. - - - -
- -
- - - When an ambiguous dependency exists, the container attempts to resolve the ambiguity. The container eliminates all eligible beans that are not - alternatives selected for the bean archive or selected for the application, except for producer methods and fields of beans that are - alternatives. - - - If there is exactly one bean remaining, the container will select this bean, and the ambiguous dependency is called resolvable. - - - - If all the beans left are alternatives with a priority, then the container will determine the highest priority value, and eliminate all - beans, except for producer methods and fields of beans that are alternatives with the highest priority value. If there is exactly one bean - remaining, the container will select this bean, and the ambiguous dependency is called resolvable. - - - - - - The container must validate all injection points of all enabled beans, all observer methods and all disposer methods when the application is - initialized to ensure that there are no unsatisfied or ambiguous dependencies. If an unsatisfied or ambiguous dependency exists, the container - automatically detects the problem and treats it as a deployment problem. - - - Test unsatisfied dependency for enabled bean. - - - Test unsatisfied dependency for observer method. - - - Test unsatisfied dependency for disposer method. - - - Test ambiguous dependency for enabled bean. - - - Test ambiguous dependency for observer method. - - - Test ambiguous dependency for disposer method. - - - - - For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls |getInjectionPoints()| - to determine the set of injection points. - - -
- - - -
- - A parameterized bean type is considered assignable to a raw required type if the raw types are identical and all type parameters of the bean - type are either unbounded type variables or |java.lang.Object|. - - - - - A parameterized bean type is considered assignable to a parameterized required type if they have identical raw type and for each parameter: - the required type parameter and the bean type parameter are actual types with identical raw type, and, if the type is parameterized, the bean - type parameter is assignable to the required type parameter according to these rules, or the required type parameter is a wildcard, the bean - type parameter is an actual type and the actual type is assignable to the upper bound, if any, of the wildcard and assignable from the lower - bound, if any, of the wildcard, or the required type parameter is a wildcard, the bean type parameter is a type - variable and the upper bound of the type variable is assignable to or assignable from the upper bound, if any, of the wildcard and assignable - from the lower bound, if any, of the wildcard, or the required type parameter is an actual type, the bean type parameter is a type variable and - the actual type is as- signable to the upper bound, if any, of the type variable, or the required type parameter and the bean type parameter are - both type variables and the upper bound of the required type parameter is assignable to the upper bound, if any, of the bean type parameter. - - - - Check the required type parameter and the bean type parameter are actual types with identical raw type - - - - Check the required type parameter and the bean type parameter are actual types with identical raw type for nested type parameters - - - - Check the required type parameter is a wildcard, the bean type parameter is an actual type and the actual type is assignable to the upper - bound of the wildcard and assignable from the lower bound of the wildcard - - - - - Check the required type parameter is a wildcard, the bean type parameter is a type variable and the upper bound of the type variable is - _assignable to_ the _upper_ bound of the wildcard - - - - - Check the required type parameter is a wildcard, the bean type parameter is a type variable and the upper bound of the type variable is - _assignable from_ the _upper_ bound of the wildcard - - - - - Check the required type parameter is a wildcard, the bean type parameter is a type variable and the upper bound of the type variable is - _assignable from_ the _lower_ bound of the wildcard - - - - - Check the required type parameter is an actual type, the bean type parameter is a type variable and the actual type is assignable to the - upper bound of the type variable - - - - - Check the required type parameter and the bean type parameter are both type variables and the upper bound of the required type parameter - is assignable to the upper bound of the bean type parameter. - - - - - - A raw bean type is considered assignable to a parameterized required type if the raw types are identical and all type parameters of the - required type are either unbounded type variables or |java.lang.Object|. - - - -
- -
- - If necessary, the container performs boxing or unboxing when it injects a value to a field or parameter of primitive or wrapper type. - - - Test boxing. - - - - Test unboxing. - - - - - If an injection point of primitive type resolves to a producer method or producer field that returns a null value at runtime, the container - must inject the primitive type's default value as defined by the Java Language Specification. - - - -
- -
- - Qualifier types may have annotation members. - A statement of intent - - - - An annotation member may be excluded from consideration using the |@NonBinding| annotation. - - - - Array-valued or annotation-valued members of a qualifier type should be annotated |@NonBinding| in a portable application. If an array-valued - or annotation-valued member of a qualifier is not annotated |@NonBinding|, non-portable behavior results. - - -
- -
- - A bean class may declare multiple qualifiers. - - - - A producer method may declare multiple qualifiers. - - - - A producer field may declare multiple qualifiers. - - - - A bean must declare all of the qualifiers that are specified at the injection point to be considered a candidate for injection. - -
- -
- - An name resolves to a bean if the bean has the given bean name, and the bean is available for injection in the module where the name - resolution is requested. - - - - - For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls |getName()| to - determine the bean name. - - -
- -
- - - An ambiguous name exists when a name resolves to multiple beans. When an ambiguous name exists, the container attempts to resolve the - ambiguity. The container eliminates all eligible beans that are not alternatives selected for the bean archive or selected for the application, - except for producer methods and fields of beans that are alternatives. - - - If there is exactly one bean remaining, the container will select this bean, and the ambiguous dependency is called resolvable. - - - If all the beans left are alternatives with a priority, then the container will determine the highest priority value, and eliminate all - beans, except for producer methods and fields of beans that are alternatives with the highest priority value. If there is exactly one bean - remaining, the container will select this bean, and the ambiguous dependency is called resolvable. - - - - - - All unresolvable ambiguous names are detected by the container when the application is initialized. Suppose two beans are both available for - injection in a certain module, and either - - - - Test two beans have the same bean name and the name is not resolvable. - - - - Test the bean name of one bean is of the form x.y , where y is a valid bean name, and x is the bean name of the other bean. - - -
- -
- - A contextual reference to a bean with a normal scope, as defined in Section 6.3, “Normal scopes and pseudo-scopes”, is not a direct reference - to a contextual instance of the bean (the object returned by |Contextual.create()|). Instead, the contextual reference is a client proxy object. - - - - - Client proxies are never required for a bean whose scope is a pseudo-scope such as |@Dependent|. - - - - Client proxies are serializable - For the statement "Client proxies may be passivated, even when the bean itself may not be. Therefore the container must use a client proxy - whenever a bean with normal scope is injected into a bean with a passivating scope" to hold true the client proxy must be serializable. - - - - - The container must guarantee that when any valid injected reference to a bean of normal scope is invoked, the invocation is always processed - by the current instance of the injected bean. - - - - - Client proxies may be shared between multiple injection points. - -
- -
- - Every time a method of the bean is invoked upon a client proxy, the client proxy must obtain a contextual instance of the bean, as defined in - Section 6.5.2, "Contextual instance of a bean", and invoke the method upon this instance. - - - - - If the scope is not active, as specified in Section 6.5.1, "The active context object for a scope", the client proxy rethrows - |ContextNotActiveException| or |IllegalStateException|. - - - - - The behavior of all methods declared by |java.lang.Object|, except for |toString()|, is undefined for a client proxy. - - -
- -
- - The container is required to perform dependency injection whenever it creates a contextual instance of a managed bean. - - - - The container is required to perform dependency injection whenever it instantiates non-contextual instances of managed beans. - - - - The container interacts with instances of beans or objects supporting injection by calling methods and getting and setting the field values. - - - - - The object injected by the container may not be a direct reference to a contextual instance of the bean. Instead, it is an injectable - reference, as defined by Section 6.5.5, "Injectable references". - - -
- -
- - When the container instantiates a managed bean with a constructor annotated |@Inject|, the container calls this constructor, passing an - injectable reference to each parameter. If there is no constructor annotated |@Inject|, the container calls the constructor with no parameters. - - - Test managed bean with a constructor annotated |@Inject|. - - - Test constructor with no parameters is used for a managed bean - - -
- -
- - When the container creates a new instance of a managed bean the container must: Initialize the values of all injected fields. The container - sets the value of each injected field to an injectable reference. Call all initializer methods, passing an injectable reference to each - parameter. - - - Test managed bean fields injected - - - - - - The container must ensure that: Initializer methods declared by a class X in the type hierarchy of the bean are called after all injected - fields declared by X or by superclasses of X have been initialized. Any |@PostConstruct| callback declared by a class X in the type hierarchy of - the bean is called after all initializer methods declared by X or by superclasses of X have been called, after all injected fields declared by X - or by superclasses of X have been initialized. - - - Test managed bean initializer methods called after injected field of X - - - Test managed bean initializer methods called after injected field of superclass of X - - - Test managed bean @PostConstruct called after initializer of X - - - Test managed bean @PostConstruct called after initializer of superclass of X - - -
- -
- - When the container destroys an instance of a bean, the container destroys all dependent objects, as defined in Section 6.4.2, "Destruction of - objects with scope @Dependent", after the |@PreDestroy| callback completes. - - -
- -
- - When the container calls a producer method, if the method is static, the container must invoke the method. - - - - When the container calls a disposer method, if the method is static, the container must invoke the method. - - - - When the container calls a producer method, if the method is non-static the container must obtain a contextual instance of the bean which - declares the method, as defined by Section 6.5.2 "Contextual instance of a bean", then invoke the method upon this instance. - - - - - When the container calls a disposer method, if the method is non-static the container must obtain a contextual instance of the bean which - declares the method, as defined by Section 6.5.2 "Contextual instance of a bean", then invoke the method upon this instance. - - - - - The container passes an injectable reference to each injected method parameter. - - - - The container is also responsible for destroying dependent objects created during this invocation, as defined in Section 6.4.2, "Destruction - of objects with scope @Dependent". - - - - -
- -
- - When the container accesses the value of a producer field, if the producer field is static, the container must access the field value. - - - - When the container accesses the value of a producer field, if the producer field is non-static, the container must obtain a contextual - instance of the bean which declares the producer field, as defined by Section 6.5.2 "Contextual instance of a bean", then access the field value - of this instance. - - -
- -
- - When the container calls an observer method (defined in Section 10.4 "Observer methods"), if the observer method is static, the container must - invoke the method. - - - - - When the container calls an observer method (defined in Section 10.4 "Observer methods"), if the observer method is non-static, the container - must obtain a contextual instance of the bean according to Section 6.5.2 "Contextual instance of a bean". If this observer method is a - conditional observer method, obtain the contextual instance that already exists, only if the scope of the bean that declares the observer method - is currently active, without creating a new contextual instance. Finally, the container must invoke the observer method on the resulting - instance, if any, as a business method invocation, as defined in Section 7.2 "Container invocations and interception". - - - - - The container must pass the event object to the event parameter and an injectable instance to each injected method parameter. - - - - The container is also responsible for destroying dependent objects created during this invocation, as defined in Section 6.4.2, "Destruction - of objects with scope @Dependent". - - -
- -
- - The |getBean()| method returns the Bean object representing the bean that defines the injection point. - - - - If the injection point does not belong to a bean, |getBean()| returns a null value. - - - - If the injection point represents a dynamically obtained instance, the |getBean()| method should return the |Bean| object representing the - bean that defines the |Instance| injection point. - - - - - The |getType()| method returns the required type of the injection point. - - - - If the injection point represents a dynamically obtained instance, the |getType()| method returns the required type (as defined by - |Instance.select()|). - - - - - The |getQualifiers()| method returns the required qualifiers of the injection point. - - - - If the injection point represents a dynamically obtained instance, the |getQualifiers()| method returns required qualifiers of the injection - point including any additional required qualifers (as defined by |Instance.select()|). - - - - - The |getMember()| method returns the |Field| object in the case of field injection. - - - - If the injection point represents a dynamically obtained instance, the |getMember()| method returns the |Field| object representing the field - that defines the |Instance| injection point in the case of field injection. - - - - - The |getMember()| method returns the |Method| object in the case of method parameter injection. - - - - If the injection point represents a dynamically obtained instance, the |getMember()| method returns the |Method| object representing the - method that defines the |Instance| injection point in the case of method parameter injection. - - - - - The |getMember()| method returns the |Constructor| object in the case of constructor parameter injection. - - - - If the injection point represents a dynamically obtained instance, the |getMember()| method returns the |Constructor| object representing the - constructor that defines the |Instance| injection point in the case of constructor parameter injection. - - - - - The |getAnnotated()| method returns an instance of |jakarta.enterprise.inject.spi.AnnotatedField| or - |jakarta.enterprise.inject.spi.AnnotatedParameter|, depending upon whether the injection point is an injected field or a constructor/method - parameter. - - - - - If the injection point represents a dynamically obtained instance, then the |getAnnotated()| method returns an instance of - |jakarta.enterprise.inject.spi.AnnotatedField| or |jakarta.enterprise.inject.spi.AnnotatedParameter| representing the |Instance| injection point, - depending upon whether the injection point is an injected field or a constructor/method parameter. - - - - - The |isDelegate()| method returns true if the injection point is a decorator delegate injection point, and false otherwise. - - - - If the injection point represents a dynamically obtained instance then |isDelegate()| returns false. - - - - The |isTransient()| method returns true if the injection point is a transient field, and false otherwise. - - - - If the injection point represents a dynamically obtained instance then the |isTransient()| method returns true if the |Instance| injection - point is a transient field, and false otherwise. - - - - - The container must provide a bean with scope |@Dependent|, bean type |InjectionPoint| and qualifier |@Default|, allowing dependent objects, as - defined in Section 6.4.1, "Dependent objects", to obtain information about the injection point to which they belong. - - - - - The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies". - - - - If a bean that declares any scope other than |@Dependent| has an injection point of type |InjectionPoint| and qualifier |@Default|, the - container automatically detects the problem and treats it as a definition error. - - - - - If a disposer method has an injection point of type |InjectionPoint| and qualifier |@Default|, the container automatically detects the - problem and treats it as a definition error. - - - - - If a class supporting injection that is not a bean has an injection point of type |InjectionPoint| and qualifier |@Default|, the container - automatically detects the problem and treats it as a definition error. - - - -
- -
- - - The container must provide beans allowing a bean instance to obtain a |Bean|, |Interceptor| or |Decorator| instance containing its metadata. - - - Bean with scope |@Dependent|, qualifier |@Default| and type |Bean| can be injected into any bean instance. - - - Bean with scope |@Dependent|, qualifier |@Default| and type |Interceptor| can be injected into any interceptor instance. - - - Bean with scope |@Dependent|, qualifier |@Default| and type |Decorator| which can be injected into any decorator instance. - - - - - Additionally, the container must provide beans allowing interceptors and decorators to obtain information about the beans they intercept and - decorate. - - - Bean with scope |@Dependent|, qualifier |@Intercepted| and type |Bean| which can be injected into any interceptor instance. - - - Bean with scope |@Dependent|, qualifier |@Decorated| and type |Bean| can be injected into any decorator instance. - - - - - These beans are passivation capable dependencies, as defined in Section 6.6.2, "Passivation capable dependencies". - - - - If an |Interceptor| instance is injected into a bean instance other than an interceptor instance, the container automatically detects the - problem and treats it as a definition error. - - - - - If a |Decorator| instance is injected into a bean instance other than a decorator instance, the container automatically detects the problem - and treats it as a definition error. - - - - - If a |Bean| instance with qualifier |@Intercepted| is injected into a bean instance other than an interceptor instance, the container - automatically detects the problem and treats it as a definition error. - - - - - If a |Bean| instance with qualifier |@Decorated| is injected into a bean instance other than an interceptor instance, the container - automatically detects the problem and treats it as a definition error. - - - - - The injection of bean metadata is restricted. - - If the injection point is a field, an initializer method parameter or a bean constructor, with qualifier |@Default| and type parameter of - the injected |Bean| is not the same as the type declaring the injection point, the container automatically detects the problem and treats it - as a definition error. - - - - If the injection point is a field, an initializer method parameter or a bean constructor, with qualifier |@Default| and type parameter of - the injected |Interceptor| is not the same as the type declaring the injection point, the container automatically detects the problem and - treats it as a definition error. - - - - If the injection point is a field, an initializer method parameter or a bean constructor, with qualifier |@Default| and type parameter of - the injected |Decorator| is not the same as the type declaring the injection point, the container automatically detects the problem and - treats it as a definition error. - - - - If the injection point is a field, an initializer method parameter or a bean constructor of an interceptor, with qualifier |@Intercepted| - and the type parameter of the injected |Bean| is not an unbounded wildcard, the container automatically detects the problem and treats it as - a definition error. - - - - If he injection point is a field, an initializer method parameter or a bean constructor of a decorator, with qualifier |@Decorated| and - the type parameter of the injected |Bean| is not the same as the delegate type, the container automatically detects the problem and treats - it as a definition error. - - - - If the injection point is a producer method parameter and the type parameter of the injected |Bean| is not the same as the producer method - return type, the container automatically detects the problem and treats it as a definition error. - - - - If the injection point is a disposer method parameter then no Bean instance can be injected, the container automatically detects the - problem and treats it as a definition error. - - - - -
- -
- - An instance of the |jakarta.enterprise.inject.Instance| interface may be injected. - - - - The method |jakarta.enterprise.inject.Instance.get()| returns a contextual reference. - - - - Any combination of qualifiers may be specified at the injection point. - - - - The |@Any| qualifier may be used to allow the application to specify qualifiers dynamically. - - - - The |@New| qualifier may be used, allowing the application to obtain a |@New| qualified bean, as defined in Section 3.12, "@New qualified - beans". - - -
- -
- - The |Instance| interface provides a method for obtaining instances of beans with a specified combination of required type and qualifiers, and - inherits the ability to iterate beans with that combination of required type and qualifiers from |java.lang.Iterable|. - - - - - For an injected |Instance|, the required type is the type parameter specified at the injection point, and the required qualifiers are the - qualifiers specified at the injection point. - - - - - The |select()| method returns a child |Instance| for a given required type and additional required qualifiers. If no required type is given, - the required type is the same as the parent. - - - - - Rules specified at "The default qualifier at injection points" are applied before performing typesafe resolution. - - - - If an injection point of raw type |Instance| is defined, the container automatically detects the problem and treats it as a definition - error. - - - - - If two instances of the same non repeating qualifier type are passed to |select()|, an |IllegalArgumentException| is thrown. - - - - If an instance of an annotation that is not a qualifier type is passed to |select()|, an |IllegalArgumentException| is thrown. - - - - The |get()| method must identify a bean that has the required type and required qualifiers and is eligible for injection into the class into - which the parent |Instance| was injected, according to the rules of typesafe resolution, as defined in Section 5.2, "Typesafe resolution", - resolving ambiguities according to Section 5.2.1, "Unsatisfied and ambiguous dependencies". - - - - - If typesafe resolution results in an unsatisfied dependency, throw an |UnsatisfiedResolutionException|. - - - - If typesafe resolution results in an unresolvable ambiguous dependency, throw an |AmbiguousResolutionException|. - - - - Otherwise, obtain a contextual reference for the bean and the required type, as defined in Section 6.5.3, "Contextual reference for a bean". - - - - - The |iterator()| method must identify the set of beans that have the required type and required qualifiers and are eligible for injection into - the class into which the parent |Instance| was injected, according to the rules of typesafe resolution, as defined in Section 5.2, "Typesafe - resolution". - - - - - The |iterator()| method must return an |Iterator|, that iterates over the set of contextual references for the resulting beans and required - type, as defined in Section 6.5.3, "Contextual reference for a bean". - - - - - - The |stream()| method must identify the set of beans that have the required type and required qualifiers and are eligible for - injection into the class into which the parent |Instance| was injected, according to the rules of - typesafe resolution, as defined in Section 5.2.1, "Performing typesafe resolution", resolving ambiguities according - to Section 5.2.2 "Unsatisfied and ambiguous dependencies". - - - - - - The |stream()| method must return a |Stream|, that can stream over the set of contextual references for the resulting beans and - required type, as defined in Section 6.5.3, "Contextual reference for a bean". - - - - - The methods |isUnsatisfied()|, |isAmbiguous()| and |isResolvable()| must: - - - - Identify the set of beans that have the required type and required qualifiers and are eligible for - injection into the class into which the parent Instance was injected, according to the rules of - typesafe resolution, as defined in Performing typesafe resolution, resolving ambiguities according - to Unsatisfied and ambiguous dependencies. - - - - - The method |isUnsatisfied()| returns true if there is no bean found, or false otherwise. - - - - The method |isAmbiguous()| returns true if there is more than one bean found, or false otherwise. - - - - The method |isResolvable()| returns true if there is exactly one bean found, or false otherwise. - - - - - - The method |destroy()| instructs the container to destroy the instance. The bean instance passed to |destroy()| should be a dependent scoped - bean instance, or a client proxy for a normal scoped bean. Applications are encouraged to always call |destroy()| when they no longer require an - instance obtained from |Instance|. - - - Test dependent scoped bean instance passed to |destroy()|. - - - Test client proxy passed to |destroy()|. - - - Test |UnsupportedOperationException| is thrown when if the active context object for the scope type of the bean does not support - destroying bean instances. - - - - - - The |getHandle()| method must: - - Return an initialized contextual reference |Handle| for a bean that has the required type and qualifiers - and is eligible for injection. The contextual reference must be resolved lazily, i.e. when first needed. - - - - Throw UnsatisfiedResolutionException if there is no bean with given type and qualifiers. - - - Throw AmbiguousResolutionException if there is more than one bean given type and qualifiers. - - - - - - The |handles()| method must: - - Allow iterating over contextual reference handles for all beans that have the required type and required qualifiers and are eligible for injection. - - - - Return stateless Iterable. Therefore, each Iterable#iterator() produces a new set of handles. - - - -
- -
- - The get() method returns a contextual reference object. - - The contextual reference is resolved lazily. - - - Test IllegalStateException is thrown if invoked on Handle that previously successfully destroyed its underlying contextual reference. - - - - - The destroy() method destroys the contextual instance and is a no-op if: - - - called multiple times - - - the producing Instance does not exist - the handle does not hold a contextual reference, i.e. get() was never called - - - the handle does not hold a contextual reference, i.e. get() was never called - - -
- -
- - The container must provide a built-in bean that is eligible for injection to any injection point with required type Instance <X> or - Provider<>, for any - legal bean type X. - - - - - The container must provide a built-in bean that has any qualifiers. - - - - The container must provide a built-in bean with scope @Dependent. - - - - The container must provide a built-in bean with no bean name. - - - - The container must provide a built-in bean with an implementation provided automatically by the container. - - - - The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies". - -
- -
- - Test |jakarta.enterprise.util.AnnotationLiteral| when using |Instance.select()| to specify qualifiers. - - - - Test |jakarta.enterprise.util.TypeLiteral| when specifying a parameterized type with actual type parameters when calling |Instance.select()|. - - -
- -
- -
- -
- -
- -
- - If an exception occurs while creating an instance, the exception is rethrown by the |create()| method. If the exception is a checked - exception, it must be wrapped and rethrown as an (unchecked) |CreationException|. - - - - - If an exception occurs while destroying an instance, the exception must be caught by the |destroy()| method. - - - - If the application invokes a contextual instance after it has been destroyed, the behavior is undefined. - A statement about container specific behavior which is not spec defined - - - - The container and portable extensions may define implementations of the |Contextual| interface that do not extend |Bean|, but it is not - recommended that applications directly implement |Contextual|. - - Advice only - -
- -
- - The interface |jakarta.enterprise.context.spi.CreationalContext| provides operations that are used by the |Contextual| implementation during - instance creation and destruction. - - introductory text - - - - |push()| registers an incompletely initialized contextual instance with the container. A contextual instance is considered incompletely - initialized until it is returned by the |create()| method. - - - - - |release()| destroys all dependent objects, as defined in Section 6.4.1, "Dependent objects", of the instance which is being destroyed, by - passing each dependent object to the |destroy()| method of its |Contextual| object. - - - - - The implementation of |Contextual| is not required to call |push()|. However, for certain bean scopes, invocation of |push()| between - instantiation and injection helps the container minimize the use of client proxy objects (which would otherwise be required to allow circular - dependencies). - - - - - If |Contextual.create()| calls |push()|, it must also return the instance passed to |push()|. - - - - |Contextual.create()| should use the given |CreationalContext| when obtaining contextual references to inject, as defined in Section 6.5.3, - "Contextual reference for a bean", in order to ensure that any dependent objects are associated with the contextual instance that is being - created. - - Advice - - - - |Contextual.destroy()| should call |release()| to allow the container to destroy dependent objects of the contextual instance. - Advice - -
- -
- - The |jakarta.enterprise.context.spi.Context| interface provides an operation for obtaining contextual instances with a particular scope of any - contextual type. - - Introductory text - - - - The method |getScope()| returns the scope type of the context object. - - - - When a context object is active the |isActive()| method returns |true|. Otherwise, we say that the context object is inactive and the - |isActive()| method returns false. - - - - - The |Context.get()| method may either return an existing instance of the given contextual type, ~or if no |CreationalContext| is given, return - a null value, or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create()| and - return the new instance~. - - - - - The |Context.get()| method may either ~return an existing instance of the given contextual type~, or if no |CreationalContext| is given, - return a null value, ~or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create()| - and return the new instance~. - - - - - The |Context.get()| method may either ~return an existing instance of the given contextual type, or if no |CreationalContext| is given, return - a null value~, or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create()| and - return the new instance. - - - - - If the context object is inactive, the |get()| method must throw a |ContextNotActiveException|. - - - - The |get()| method may not return a null value _unless no |CreationalContext| is given_, or |Contextual.create()| returns a null value. - - - - The |get()| method may not return a null value unless no |CreationalContext| is given, or _|Contextual.create()| returns a null value_. - - - - The |get()| method may not create a new instance of the given contextual type unless a |CreationalContext| is given. - - - - When the container calls |get()| for a context that is associated with a passivating scope it must ensure that the given instance of - |Contextual| and the instance of |CreationalContext|, if given, are serializable. - - - - - The |destroy()| method destroys an existing contextual instance, removing it from the context instance. - The AlterableContext interface was introduced in Contexts and Dependency Injection for Jakarta EE 1.1 to allow bean instances to be destroyed by - the application. - - - - - The context object is responsible for destroying any contextual instance it creates by passing the instance to the |destroy()| method of the - |Contextual| object representing the contextual type. - - - - - A destroyed instance must not subsequently be returned by the |get()| method. - - - - The context object must pass the same instance of |CreationalContext| to |Contextual.destroy()| that it passed to |Contextual.create()| when - it created the instance. - - -
- -
- - There may be no more than one mapped instance of a context object per contextual type per thread - Not testable through API - - - - A context may be associated with one or more threads - A statement of intent - - - - The |get()| operation of the |Context| object for an active normal scope returns the current instance of the given contextual type. - - - - When a context is destroyed, all mapped instances belonging to that context are destroyed by passing them to the |Contextual.destroy()| - method. - - - - - Contexts with normal scopes must obey the following rule: Suppose beans A, B and Z all have normal scopes. Suppose A has an injection point x, - and B has an injection point y. Suppose further that both x and y resolve to bean Z according to the typesafe resolution algorithm. If a is the - current instance of A, and b is the current instance of B, then both a.x and b.y refer to the same instance of Z. This instance is the current - instance of Z. - - - - - All normal scopes must be explicitly declared |@NormalScope|, to indicate to the container that a client proxy is required. - A statement of intent - - - - All pseudo-scopes must be explicitly declared |@Scope|, to indicate to the container that no client proxy is required. - A statement of intent - - - - All scopes defined by this specification, except for the |@Dependent| pseudo-scope, are normal scopes - A statement of intent - -
- -
- - When a bean is declared to have |@Dependent| scope, no injected instance of the bean is ever shared between multiple injection points. - - - - When a bean is declared to have |@Dependent| scope, any instance of the bean injected into an object that is being created by the container is - bound to the lifecycle of the newly created object. - - - - - When a bean is declared to have |@Dependent| scope, any instance of the bean that receives a producer method, producer field, disposer method - or observer method invocation exists to service that invocation only - - - - Test with a producer method. - - - - Test with a producer field. - - - - Test with a disposer method. - - - - Test with an observer method. - - - - - When a bean is declared to have |@Dependent| scope, any instance of the bean injected into method parameters of a disposer method or observer - method exists to service the method invocation only (except for observer methods of container lifecycle events). - - - - - Every invocation of the |get()| operation of the |Context| object for the |@Dependent| scope with a |CreationalContext| returns a new instance - of the given bean. - - - - - Every invocation of the |get()| operation of the |Context| object for the |@Dependent| scope with no |CreationalContext| returns a null - value. - - - - - The |@Dependent| scope is always active. - -
- -
- - Instances of interceptors or decorators with scope |@Dependent| are dependent objects of the bean instance they decorate. - - Test with a |@Dependent|-scoped interceptor. - - - - Test with a |@Dependent|-scoped decorator. - - - - - An instance of a bean with scope |@Dependent| injected into a field, bean constructor or initializer method is a dependent object of the bean - into which it was injected. - - - - Test with |@Dependent|-scoped bean injected into field. - - - - Test with |@Dependent|-scoped bean injected into bean constructor. - - - - Test with |@Dependent|-scoped bean injected into initializer method. - - - - - An instance of a bean with scope |@Dependent| injected into a producer method is a dependent object of the producer method bean instance that - is being produced. - - - - - An instance of a bean with scope |@Dependent| obtained by direct invocation of an |Instance| is a dependent object of the instance of - |Instance|. - - -
- -
- - - The container must ensure that all dependent objects of a non-contextual instance of a bean are destroyed when the instance is destroyed by - the container. - - - - Test with a managed bean. - - - - - - The container must ensure that all |@Dependent| scoped contextual instances injected into method parameters of a disposer method or observer - method of any other event are destroyed when the invocation completes. - - - Check disposer method. - - - - Check observer method. - - - - - The container must ensure that all |@Dependent| scoped contextual instances injected into method or constructor parameters that are annotated - with |@TransientReference| are destroyed when the invocation completes. - - - Test producer method parameter. - - - Test initializer method parameter. - - - Test bean constructor parameter. - - - - - The container must ensure that any |@Dependent| scoped contextual instance created to receive a producer method, producer field, disposer - method or observer method invocation is destroyed when the invocation completes. - - - - Check producer method. - - - - Check producer field. - - - - Check disposer method. - - - - Check observer method. - - - - - The container is permitted to destroy any |@Dependent| scoped contextual instance at any time if the instance is no longer referenced by the - application (excluding weak, soft and phantom references). - - In other words this is unspecified - -
- -
- -
- -
- - From time to time, the container must obtain an active context object for a certain scope type. The container must search for an active - instance of |Context| associated with the scope type. If no active context object exists for the scope type, the container throws a - |ContextNotActiveException|. - - - - - If more than one active context object exists for the given scope type, the container must throw an |IllegalStateException|. - -
- -
- - - Certain built in contexts support the ability to be activated and deactivated. This allows developers to - control built-in contexts in ways that they could also manage custom built contexts. - When activating and deactivating built in contexts, it is important to realize that they can only be - activated if not already active within a given thread. - - -
- -
- - Request contexts can be managed either programmatically or via interceptor. - - - - To programmatically manage request contexts, the container provides a built in bean that is @Dependent - scoped and of type RequestContextController that allows you to activate and deactivate a request - context on the current thread. The object should be considered stateful, invoking the same instance on - different threads may not work properly, non-portable behavior may occur. - - - - - When the activate() method is called, if the request context is not already active on the current thread - then it will be activated and the method returns true. Otherwise, the method returns false. - - - - - When the deactivate() method is called, - - if this controller started the request context then the request context is stopped - - - The method does nothing if this controller did not activate the context and the context is active. - - - This method throws a ContextNotActiveException if there is no request context active. - - - - - If within the same thread the activate() and deactivate() methods are invoked repeatedly, the - instances between the activations are not the same instances, each request context should be assumed - to be new. - - - - - To automatically start a request context via interceptor binding, the container provides an interceptor - @ActivateRequestContext which will activate a request context if not already active prior to the - method’s invocation, and deactivate it upon method completion, with the same rules as in - RequestContextController. - - - - - When the requestContext is managed via interceptor binding, the interceptor is automatically registered with a priority of PLATFORM_BEFORE + - 100 - - - -
- -
- - From time to time, the container must obtain a contextual instance of a bean. The container must obtain the active context object for the bean - scope, then obtain an instance of the bean by calling |Context.get()|, passing the |Bean| instance representing the bean and an instance of - |CreationalContext|. - - - - - From time to time, the container attempts to obtain a contextual instance of a bean that already exists, without creating a new contextual - instance. The container must determine if the scope of the bean is active and if it is, obtain the active context object for the bean scope, - then attempt to obtain an instance of the bean by calling |Context.get()|, passing the |Bean| instance representing the bean without passing any - instance of |CreationalContext|. - - - - - If the scope is not active, or if |Context.get()| returns a null value, there is no contextual instance that already exists. - Statement of intent - - - - For a custom implementation of the |Bean| interface defined in Section 11.1, "The Bean interface", the container calls |getScope()| to - determine the bean scope. - - -
- -
- - Contextual references must be obtained with a given |CreationalContext|, allowing any instance of scope |@Dependent| that is created to be - later destroyed. - - - - - If the bean has a normal scope and the given bean type cannot be proxied by the container, as defined in Section 5.4.1, "Unproxyable bean - types", the container throws an |UnproxyableResolutionException|. - - - - - If the bean has a normal scope, then the contextual reference for the bean is a client proxy, as defined in Section 5.4, "Client proxies", - created by the container, that implements the given bean type and all bean types of the bean which are Java interfaces. - - - - - If the bean has a pseudo-scope, the container must obtain a contextual instance of the bean. If the bean has scope |@Dependent|, the container - must associate it with the |CreationalContext|. - - - - - The container must ensure that every injection point of type |InjectionPoint| and qualifier |@Default| of any dependent object instantiated - during this process receives an instance of |InjectionPoint| representing the injection point into which the dependent object will be injected, - or a null value if it is not being injected into any injection point. - - - Test an injected dependent object. - - - Test a non-injected dependent object. - - -
- -
- - Any reference to a bean with a normal scope is valid as long as the application maintains a hard reference to it. However, it may only be - invoked when the context associated with the normal scope is active. If it is invoked when the context is inactive, a - |ContextNotActiveException| is thrown by the container. - - - - - Any reference to a bean with a normal scope is invalid after CDI container shutdown. Maintaining such reference and attempting - to use it after container shutdown results in an IllegalStateException. - - - - - Any reference to a bean with a pseudo-scope (such as |@Dependent|) is valid until the bean instance to which it refers is destroyed. It may be - invoked even if the context associated with the pseudo-scope is not active. If the application invokes a method of a reference to an instance - that has already been destroyed, the behavior is undefined. - - Describes unspecified behavior - -
- -
- - From time to time, the container must obtain an injectable reference for an injection point. The container must identify a bean according to - the rules defined in Section 5.2, "Typesafe resolution" and resolving ambiguities according to Section 5.2.1, "Unsatisfied and ambiguous - dependencies", then obtain a contextual reference for this bean and the type of the injection point according to Section 6.5.3, "Contextual - reference for a bean". - - - - - For certain combinations of scopes, the container is permitted to optimize the procedure for obtaining an injectable reference for an - injection point - the container is permitted to directly inject a contextual instance of the bean, as defined in Section 6.5.2, "Contextual - instance of a bean", and if an incompletely initialized instance of the bean is registered with the current |CreationalContext|, as defined in - Section 6.1, "The Contextual interface", the container is permitted to directly inject this instance. - - -
- -
- - Injectable references to a bean must respect the rules of contextual reference validity, with the following exceptions - a reference to a bean - injected into a field, bean constructor or initializer method is only valid until the object into which it was injected is destroyed, a - reference to a bean injected into a producer method is only valid until the producer method bean instance that is being produced is destroyed, - and a reference to a bean injected into a disposer method or observer method is only valid until the invocation of the method completes. - - - - - The application should not invoke a method of an invalid injected reference. If the application invokes a method of an invalid injected - reference, the behavior is undefined. - - Behavior is undefined. - -
- -
- - Test that passivation occurs. - -
- -
- - - A managed bean is passivation capable if and only if the bean class is serializable and all interceptors and decorators of the bean are - passivation capable. - - - Tests with a serializable bean class. - - - Tests with a serializable interceptor. - - - Tests with a serializable decorator. - - - - - A producer method is passivation capable if and only if it never returns a value which is not passivation capable at runtime. - Tested in "Validation of passivation capable beans and dependencies" section - - - - A producer field is passivation capable if and only if it never refers to a value which is not passivation capable at runtime. - Tested in "Validation of passivation capable beans and dependencies" section - - - - A producer method is passivation capable if and only if it never returns a value which is not passivation capable at runtime. - - - Test that a producer method with a primitive return type is passivation capable. - - - - Test that a producer method with a serializable return type is passivation capable. - - - - - A producer field is passivation capable if and only if it never refers to a value which is not passivation capable at runtime. - - - Test that a producer field with a primitive type is passivation capable. - - - - Test that a producer field with a serializable type is passivation capable. - - - - - - A custom implementation of Bean is passivation capable if it implements the interface |PassivationCapable|. - - - - An implementation of |Contextual| that is not a bean is passivation capable if it implements both |PassivationCapable| and |Serializable|. - - - - - The |getId()| method of the |PassivationCapable| implementation must return a value that uniquely identifies the instance of |Bean| or - |Contextual|. - - This is a requirement of the implementation - - - - The |getId()| ~method of the |PassivationCapable| implementation must return a value that uniquely identifies the instance of |Bean| or - |Contextual|. It~ is recommended that the string contain the package name of the class that implements |Bean| or |Contextual|. - - Recommendation only - -
- -
- - - An injection point of a bean is passivation capable if the injection point is a transient field. - - - - An injection point of a bean is passivation capable if the injection point is a non-transient field which resolves to a bean that is a - passivation capable dependency. - - - - - An injection point of a bean is passivation capable if the injection point is a bean constructor parameter which is annotated with - |@TransientReference|. - - - - - An injection point of a bean is passivation capable if the injection point is a bean constructor parameter which resolves to a bean that is a - passivation capable dependency. - - - - - An injection point of a bean is passivation capable if the injection point is a method parameter which is annotated with - |@TransientReference|. - - - - - An injection point of a bean is passivation capable if the injection point is a method parameter which resolves to a bean that is a - passivation capable dependency. - - - -
- -
- - - The container must guarantee that all beans with normal scope are passivation capable dependencies. - - - - The container must guarantee that all passivation capable beans with scope |@Dependent| are passivation capable dependencies. - - - - The container must guarantee that the built-in beans of type |Instance|, |Event|, |InjectionPoint| and |BeanManager| are passivation capable - dependencies. - - - Test built-in |Instance|. - - - Test built-in |Event|. - - - Test built-in |InjectionPoint|. - - - Test built-in |BeanManager|. - - - - - A custom implementation of |Bean| is a passivation capable dependency if it implements |PassivationCapable|. - -
- -
- - A passivating scope requires that beans with the scope are passivation capable, and implementations of |Contextual| passed to any context - object for the scope are passivation capable. - - - - Test that a bean with the scope is passivation capable. - - - - Test that an implementation of |Contextual| passed to the context object for the scope is passivation capable. - This is in essence enforced by the stuff in 6.6.4 - - - - - Passivating scopes must be explicitly declared |@NormalScope(passivating=true)|. - A statement of intent - -
- -
- - - If a managed bean which declares a passivating scope, or a built-in bean is not passivation capable then the container automatically detects - the problem and treats it as a deployment problem. - - - Test managed bean. - - - - - If a managed bean which declares a passivating scope, or a built-in bean has has an injection point that is not passivation capable, then the - container automatically detects the problem and treats it as a deployment problem. - - - Test non-transient injected field. - - - Test transient injected field. - - - Test bean constructor parameter which is not annotated with |@TransientReference|. - - - - Test initializer method parameter which is not annotated with |@TransientReference|. - - - Test initializer method parameter which is annotated with |@TransientReference|. - - - - - If a managed bean which declares a passivating scope, or a built-in bean has a non-transient injected field, bean constructor parameter or - initializer method parameter that resolves to a bean that is not a dependent scoped bean and that is not a passivation capable dependency then - the container automatically detects the problem and treats it as a deployment problem. - - It's not defined which non-dependent bean is not a passivation capable dependency. - - - - If a managed bean which declares a passivating scope, or a built-in bean has an interceptor or decorator with a non-transient injected field - that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment - problem. - - - Test interceptor with a non-transient injected field that does not resolve to a passivation capable dependency. - - - Test decorator with a non-transient injected field that does not resolve to a passivation capable dependency. - - - - - If a producer method declares a passivating scope and has a return type that is declared final and does not implement or extend |Serializable| - then the container automatically detects the problem and treats it as a deployment problem. - - - - - If a producer method declares a passivating scope and doesn't only return |Serializable| types at runtime, then the container must throw an - |IllegalProductException|. - - - - - If a producer field declares a passivating scope and has a type that is declared final and does not implement or extend |Serializable| then - the container automatically detects the problem and treats it as a deployment problem. - - - - - If a producer field declares a passivating scope and doesn't only contain |Serializable| values at runtime then the container must throw - an|IllegalProductException|. - - - - - If a producer method or field of scope |@Dependent| returns an unserializable object for injection into an injection point that requires a - passivation capable dependency, the container must throw an |IllegalProductException| - - - - Test for a runtime exception with a producer method. - - - - Test for a runtime exception with a producer field. - - - - - For a custom implementation of |Bean|, the container calls |getInjectionPoints()| to determine the injection points, and - |InjectionPoint.isTransient()| to determine whether the injected point is a transient field. - - - - Test calling |getInjectionPoints()|. - - - - Test calling |InjectionPoint.isTransient()|. - - - - - If a bean which declares a passivating scope type has a decorator or interceptor which is not a passivation capable dependency, the container - automatically detects the problem and treats it as a deployment problem. - - - Test a bean with decorator which is not a passivation capable dependency. - - - Test a bean with interceptor which is not a passivation capable dependency. - - - - - Passivation capable interceptor with non-passivation capable dependencies is allowed unless it intercepts a bean declaring passivation - scope. - - - - - Passivation capable decorator with non-passivation capable dependencies is allowed unless it decorates a bean declaring passivation scope. - - - -
- -
- - A portable extension may define a custom context object for any or all of the built-in scopes. For - example, a remoting framework might provide a request context object for the built-in request scope. - - - - - The context associated with a built-in normal scope propagates across local, synchronous Java method - calls. The context does not propagate across remote method invocations or to asynchronous processes. - - - - - Portable extensions are encouraged to synchronously fire (where X is the scope type associated with the context.): - - an event with qualifier @Initialized(X.class) when a custom context is initialized, i.e. ready for - use, - - - - an event with qualifier @BeforeDestroyed(X.class) when a custom context is about to be destroyed, - i.e. before the actual destruction, - - - - an event with qualifier @Destroyed(X.class) when a custom context is destroyed, i.e. after the actual - destruction, - - - - -
- -
- - An event with qualifier |@Initialized(RequestScoped.class)| is synchronously fired when the request - context is initialized. - - - - - An event with qualifier |@BeforeDestroyed(RequestScoped.class)| is synchronously - fired when the request context is about to be destroyed, i.e. before the actual destruction. - - - - - An event with qualifier |@Destroyed(RequestScoped.class)| is synchronously fired when the request context is - destroyed, i.e. after the actual destruction. - - - - - The request context is active: - - during notification of an asynchronous observer method - - - during |@PostConstruct| callback of any bean. - - - - - The request context is destroyed: - - after the invocation of an asynchronous observer method completes - - - after the |@PostConstruct| callback completes, if it did not already exist when the |@PostConstruct| callback occurred - - - -
- -
-
- -
- - An event with qualifier @Initialized(ApplicationScoped.class) is synchronously fired when the - application context is initialized. - - - - - An event with qualifier @BeforeDestroyed(ApplicationScoped.class) is - synchronously fired when the application context is about to be destroyed, i.e. before the actual - destruction. - - - - - An event with qualifier @Destroyed(ApplicationScoped.class) is synchronously fired when - the application context is destroyed, i.e. after the actual destruction. - - -
- -
-
- - -
- - The container provides a built-in bean with bean type |Conversation|, scope |@RequestScoped|, and qualifier |@Default|, named - |jakarta.enterprise.context.conversation|. - - - Test the bean type is correct. - - - - Test the scope is correct. - - - - Test the qualifier is correct. - - - - Test the bean name is correct. - - - - - |begin()| marks the current transient conversation long-running. A conversation identifier may, optionally, be specified. If no conversation - identifier is specified, an identifier is generated by the container. - - - - - |end()| marks the current long-running conversation transient. - - - - |getId()| returns the identifier of the current long-running conversation, or a null value if the current conversation is transient. - - - - |getTimeout()| returns the timeout, in milliseconds, of the current conversation. - - - - |setTimeout()| sets the timeout of the current conversation. - - - - |isTransient()| returns |true| if the conversation is marked transient, or |false| if it is marked long-running. - - - - If any method of |Conversation| is called when the conversation scope is not active, a |ContextNotActiveException| is thrown. - - - - If |end()| is called, and the current conversation is marked transient, an |IllegalStateException| is thrown. - - - - If |begin()| is called, and the current conversation is already marked long-running, an |IllegalStateException| is thrown. - - - - If |begin()| is called with an explicit conversation identifier, and a long-running conversation with that identifier already exists, an - |IllegalArgumentException| is thrown. - - -
- -
-
- -
-
- -
- - - When the application invokes a method of a bean via a contextual reference to the bean, as defined in Section 6.5.3, "Contextual reference for - a bean", the invocation is treated as a business method invocation. - - - - - When the application invokes a method of a bean via a non-contextual reference to the bean, if the instance was created by the container, the - invocation is treated as a business method invocation. - - - - - When the application invokes a method of a bean via a non-contextual reference to the bean, if the instance was enhanced with - the |InterceptionFactory| interface as defined in `Apply interceptor programmatically`, the invocation is treated as a business method - invocation. - - - - - - - Invocations of producer, disposer and observer methods by the container are business method invocations are are intercepted by method - interceptors and decorators. - - - - Verify producer methods are intercepted - - - - Verify producer methods are decorated - - - - Verify disposer methods are intercepted - - - - Verify disposer methods are decorated - - - - Verify observer methods are intercepted - - - - Verify observer methods are decorated - - - - - Invocation of lifecycle callbacks by the container are not business method invocations, but are intercepted by interceptors for lifecycle - callbacks. - - - - - Invocations of interceptors and decorator methods during method or lifecycle callback interception are not business method invocations, and - therefore no recursive interception occurs. - - - Verify decorators callbacks are not intercepted - - - - Verify decorators callbacks are not decorated - - - - Verify interceptor callbacks are not intercepted - - - - Verify interceptor callbacks are not decorated - - - - - Invocations of methods declared by |java.lang.Object| are not business method invocations. - - - - If, and only if, the invocation is a business method invocation it passes through method interceptors and decorators. - - - Verify that a managed bean's business methods are intercepted - - - - Verify that a managed bean's business methods are decorated - - - - - - If the invocation is not a business method invocation, it is treated as a normal Java method call and is not intercepted by the container. - - - -
- -
- -
- -
- - When the |create()| method of the |Bean| object that represents a managed bean is called, the container obtains an instance of the bean, as - defined by the Managed Beans specification, calling the bean constructor as defined by Section 5.5.1, "Injection using the bean constructor", - and performing dependency injection as defined in Section 5.5.2, "Injection of fields and initializer methods". - - - - - When the |destroy()| method is called, the container destroys the instance, as defined by the Managed Beans specification, and any dependent - objects, as defined in Section 5.5.3, "Destruction of dependent objects". - - -
- -
- - When the create() method of a |Bean| object that represents a producer method is called, the container must invoke the producer method as - defined by Section 5.5.4, "Invocation of producer or disposer methods". The return value of the producer method, after method interception - completes, is the new contextual instance to be returned by |Bean.create()|. - - - - - If the producer method returns a null value and the producer method bean has the scope |@Dependent|, the |create()| method returns a null - value. - - - - - If the producer method returns a null value, and the scope of the producer method is not |@Dependent|, the |create()| method throws an - |IllegalProductException|. - - - - - When the |destroy()| method is called, and if there is a disposer method for this producer method, the container must invoke the disposer - method as defined by Section 5.5.4, "Invocation of producer or disposer methods", passing the instance given to |destroy()| to the disposed - parameter. - - - - - Finally, the container destroys dependent objects, as defined in Section 5.5.3, "Destruction of dependent objects". - -
- -
- - When the |create()| method of a |Bean| object that represents a producer field is called, the container must access the producer field as - defined by Section 5.5.5, "Access to producer field values" to obtain the current value of the field. The value of the producer field is the new - contextual instance to be returned by |Bean.create()|. - - - - - If the producer field contains a null value and the producer field bean has the scope |@Dependent|, the |create()| method returns a null - value. - - - - - If the producer field contains a null value, and the scope of the producer method is not |@Dependent|, the |create()| method throws an - |IllegalProductException|. - - - - - When the |destroy()| method is called, and if there is a disposer method for this producer field, the container must invoke the disposer - method as defined by Section 5.5.4, "Invocation of producer or disposer methods", passing the instance given to |destroy()| to the disposed - parameter. - - -
- -
- - Decorators may be associated with any managed bean that is not itself an interceptor or decorator, with any EJB session bean or with any - built-in bean other than the built-in bean with type |BeanManager| and qualifier |@Default|. - - Tested elsewhere. - - - - Decorators are not applied to the return value of a producer method or the current value of a producer field. - - - - A decorator instance is a dependent object of the object it decorates. - -
- -
- - A decorator is a managed bean. - Statement of intent - - - - The set of decorated types of a decorator includes all bean types of the managed bean which are Java interfaces, except for - |java.io.Serializable|. - - - - - The decorator bean class and its superclasses are not decorated types of the decorator. - - - - The decorator class may be abstract. - - - - If the set of decorated types of a decorator is empty, the container automatically detects the problem and treats it as a definition error. - - - - - If a decorator declares any scope other than @Dependent, the container automatically detects the problem and treats it as a definition - error. - - - -
- -
- - A decorator is declared by annotating the bean class with the |@jakarta.decorator.Decorator| stereotype. - -
- -
- - All decorators have a delegate injection point. A delegate injection point is an injection point of the bean class. The type and qualifiers of - the injection point are called the delegate type and delegate qualifiers. The decorator applies to beans that are assignable to the delegate - injection point. The delegate injection point must be be declared by annotating the injection point with the annotation - |@jakarta.decorator.Delegate|. - - - - - A decorator must have exactly one delegate injection point. If a decorator has more than one delegate injection point, or does not have a - delegate injection point, the container automatically detects the problem and treats it as a definition error. - - - - Test with more than one delegate injection point. - - - - Test a decorator without a delegate injection point. - - - - - The delegate injection point must be an injected field, initializer method parameter or bean constructor method parameter. If an injection - point that is not an injected field, initializer method parameter or bean constructor method parameter is annotated |@Delegate|, the container - automatically detects the problem and treats it as a definition error. - - - - Check an injected field is ok - - - - Check an initializer method parameter is ok - - - - Check a bean constructor method parameter is ok - - - - Check that a producer method parameter is not ok - - - - - - If a bean class that is not a decorator has an injection point annotated |@Delegate|, the container automatically detects the problem and - treats it as a definition error. - - - - - The container must inject a delegate object to the delegate injection point. The delegate object implements the delegate type and delegates - method invocations to the remaining uninvoked decorators and eventually to the bean. When the container calls a decorator during business method - interception, the decorator may invoke any method of the delegate object. - - - - - If a decorator invokes the delegate object at any other time, the invoked method throws an |IllegalStateException|. - - -
- -
- - The delegate type of a decorator must implement or extend every decorated type (with exactly the same type parameters). If the delegate type - does not implement or extend a decorated type of the decorator (or specifies different type parameters), the container automatically detects the - problem and treats it as a definition error. - - - - - If a decorated type is a parameterized type and the delegate type does not have exactly the same type parameters as the decorated type, the - container automatically detects the problem and treats it as a definition error. - - - - - A decorator is not required to implement the delegate type. - - - - A decorator may be an abstract Java class, and is not required to implement every method of every decorated type. - - - - Whenever the decorator does not implement a method of the decorated type, the container will provide an implicit implementation that calls the - method on the delegate. - - - - - If a decorator has abstract methods that are not declared by a decorated type, the container automatically detects the problem and treats it - as a definition error. - - - - - The decorator intercepts every method which is declared by a decorated type of the decorator and is implemented by the bean class of the - decorator. - - -
- -
- - - This specification defines two methods of enabling and ordering decorators. From Contexts and Dependency Injection 1.1 onwards the |@Priority| - annotation allows a decorator to be enabled and ordered for an entire application. Contexts and Dependency Injection 1.0 allowed only for a - decorator to be enabled and ordered for a bean archive. - - Statement of intent - - - - Decorators are called after interceptors. - - - - Decorators enabled using @Priority are called before decorators enabled using |beans.xml|. - - - - If a decorator is enabled for the application and for the bean archive, then the enablement from the - bean archive is ignored by the container. The decorator will only be executed once based on the - @Priority annotation’s invocation chain. - - -
- -
- - - A decorator may be enabled for the entire application by applying the |@Priority| annotation, along with a priority value, on the decorator - class. - - - - - Decorators with the smaller priority values are called first. - - - - The order of more than one decorator with the same priority is undefined. - Undefined behaviour. - - - - The priority value ranges defined in the Java Interceptors specification section 5.5 should be used when defining decorator priorities. - No explicit requirement. - - -
- -
- - - A decorator may be explicitly enabled by listing its bean class under the |<decorators>| element of the beans.xml file of the bean - archive. - - - - - The order of the decorator declarations determines the decorator ordering. Decorators which occur earlier in the list are called first. - - - - Each child |<class>| element must specify the name of a decorator bean class. If there is no class with the specified name, or if the - class with the specified name is not a decorator bean class, the container automatically detects the problem and treats it as a deployment - problem. - - - Test with a nonexistent class name. - - - Test with a non-decorator class. - - - - - If the same class is listed twice under the |<decorators>| element, the container automatically detects the problem and treats it as a - deployment problem. - - - -
- -
- - The process of matching decorators to a certain bean is called decorator resolution. A decorator is bound to a bean if the bean is assignable - to the delegate injection point according to the rules defined in Section 5.2, "Typesafe resolution", and the decorator is enabled in the bean - archive containing the bean. - - - - - If a decorator matches a managed bean, and the managed bean class is declared final, the container automatically detects the problem and - treats it as a deployment problem. - - - - - If a decorator matches a managed bean with a non-static, non-private, final method, and the decorator also implements that method, the - container automatically detects the problem and treats it as a deployment problem. - - - - - For a custom implementation of the |Decorator| interface defined in Section 11.1.1, "The Decorator interface", the container calls - |getDelegateType()|, |getDelegateQualifiers()| and |getDecoratedTypes()| to determine the delegate type and qualifiers and decorated types of - the decorator. - - -
- -
- - A raw bean type is considered assignable to a parameterized delegate type if the raw types are identical and all type parameters of the - delegate type are either unbounded type variables or |java.lang.Object|. - - - - Check all type parameters are unbounded type variables - - - - Check all type parameters are Object - - - - Check mix - - - - - A parameterized bean type is considered assignable to a parameterized delegate type if they have identical raw type and for each parameter: - the delegate type parameter and the bean type parameter are actual types with identical raw type, and, if the type is parameterized, the bean - type parameter is assignable to the delegate type parameter according to these rules, or the delegate type parameter is a wildcard, the bean - type parameter is an actual type and the actual type is assignable to the upper bound, if any, of the wildcard and assignable from the lower - bound, if any, of the wildcard, or the delegate type parameter is a wildcard, the bean type parameter is a type - variable and the upper bound of the type variable is assignable to the upper bound, if any, of the wildcard and assignable from the lower bound, - if any, of the wildcard, or the delegate type parameter and the bean type parameter are both type variables and the upper bound of the bean type - parameter is assignable to the upper bound, if any, of the delegate type parameter, or the delegate type parameter is a type variable, the bean - type parameter is an actual type, and the actual type is assignable to the upper bound, if any, of the type variable. - - - - Check both have identical type parameters - - - - Check nested identical type parameters - - - - Check delegate type parameter is a wildcard, the bean type parameter is an actual type and the actual type is assignable to the upper - bound of the wildcard and assignable from the lower bound of the wildcard - - - - - Check delegate type parameter is a wildcard, the bean type parameter is a type variable and the upper bound of the type variable is - assignable to the upper bound of the wildcard and assignable from the lower bound of the wildcard - - - - - Check the delegate type parameter and the bean type parameter are both type variables and the upper bound of the bean type parameter is - assignable to the upper bound of the delegate type parameter - - - - - Check the delegate type parameter is a type variable, the bean type parameter is an actual type, and the actual type is as- signable to - the upper bound of the type variable - - - - - -
- -
- - - Whenever a business method is invoked on an instance of a bean with decorators, the container intercepts the business method invocation and, - after processing all interceptors of the method, invokes decorators of the bean. The container searches for the first decorator of the instance - that implements the method that is being invoked as a business method. If such decorator exists, the container calls the method of the - decorator. - - - Test decorator of managed bean is called. - - - Test injected Event - - - Test injected Instance - - - Test injected Conversation - - - - - If no such decorator exists, the container invokes the business method of the intercepted instance. - - - - When any decorator is invoked by the container, it may in turn invoke a method of the delegate. The container intercepts the delegate - invocation and searches for the first decorator of the instance such that the decorator occurs after the decorator invoking the delegate, and - the decorator implements the method that is being invoked upon the delegate. - - - - - If no such decorator exists, the container invokes the business method of the intercepted instance. - - - - Otherwise, the container calls the method of the decorator. - -
- -
-
- -
-
- -
- - Interceptor bindings may be applied to a stereotype by annotating the stereotype annotation. - - - - An interceptor binding declared by a stereotype is inherited by any bean that declares that stereotype. - - - - If a stereotype declares interceptor bindings, it must be defined as |@Target(TYPE)|. - Undefined behaviour. - -
- -
- -
- -
- - - Interceptor bindings may be used to associate interceptors with any managed bean that is not a decorator. - - - - The set of interceptor bindings for a method are those declared at class level includes those declared on stereotypes. An interceptor binding - declared on a bean class replaces an interceptor binding of the same type declared by a stereotype that is applied to the bean class. - - - - - Since CDI 2.0 it is possible to apply interceptors programmatically to the return value of a producer - method, with the |InterceptionFactory| interface as defined in `Apply interceptor programmatically`. - - - - - If a managed bean has a class-level or method-level interceptor binding, the managed bean must be a proxyable bean type, as defined in Section - "unproxyable". - - - -
- -
- - - This specification extends the Java Interceptors specification and defines support for enabling interceptors only for a bean archive, as - defined by Contexts and Dependency Injection 1.0, and the ability to override the interceptor order using the portable extension SPI, defined in - Section "atd". - - Statement of intent. - - - - An interceptor may be explicitly enabled for a bean archive by listing its class under the |<interceptors>| element of the |beans.xml| - file of the bean archive. - - - - - The order of the interceptor declarations determines the interceptor ordering. Interceptors which occur earlier in the list are called - first. - - - - - Each child |<class>| element must specify the name of an interceptor class. If there is no class with the specified name, or if the - class with the specified name is not an interceptor class, the container automatically detects the problem and treats it as a deployment - problem. - - - Test with a non-existant class. - - - Test with a class that isn't an interceptor. - - - - - If the same class is listed twice under the |<interceptors>| element, the container automatically detects the problem and treats it as a - deployment problem. - - - - - Interceptors enabled using |@Priority| are called before interceptors enabled using |beans.xml|. - - - - Interceptors declared using interceptor bindings are called after interceptors declared using the |Interceptors| annotation (or using the - corresponding element of a deployment descriptor). - - This is defined in the Interceptors 1.2 spec, 5.1 Defining Interceptor Order. - - - - Interceptors declared using interceptor bindings are called before any around-invoke, around-timeout, or lifecycle event callback methods - declared on the target class or any superclass of the target class. - - This is defined in the Interceptors 1.2 spec, 5.1 Defining Interceptor Order. - - - - By default, a bean archive has no enabled interceptors. - - - - If an interceptor declares any scope other than @Dependent, the container automatically detects the problem and treats it as a definition - error. - - - - - If an interceptor is enabled for the application and for the bean archive, then the enablement from the - bean archive is ignored by the container. The interceptor will only be executed once based on the - @Priority annotation’s invocation chain. - - - - - The Priority annotation can be used to enable and order interceptors associated with components that use interceptor bindings. - The required value element of the Priority annotation determines the ordering. - Interceptors with smaller priority values are called first. - This is defined in the Interceptors 2.0 spec, 5.2.1. Use of the Priority Annotation in Ordering Interceptors. - - -
- -
- - - This specification extends the Java Interceptors specification and defines the effect of applying |@Nonbinding| to an interceptor binding - member, and how the interceptor bindings of a custom implementation of the |Interceptor| interface are determined. - - Statement of intent. - - - - If any interceptor binding has a member annotated |@jakarta.enterprise.util.Nonbinding|, the member is ignored when performing interceptor - resolution, and the method does not need to have the same annotation member value. - - - - - For a custom implementation of the |Interceptor| interface defined in Section "interceptor", the container calls |getInterceptorBindings()| to - determine the interceptor bindings of the interceptor and |intercepts()| to determine if the interceptor intercepts a given kind of lifecycle - callback or business method. - - - Check for @PostConstruct - - - Check for @PreDestroy - - - Check for @PostActivate - - - Check for @PrePassivate - - - Check for @AroundInvoke - - - Check for @AroundTimeout - - - -
- -
-
- -
- - - An event object is an instance of a concrete Java class with no unresolvable type variables. - - - - The event types of the event include all superclasses and interfaces of the runtime class of the event object. - - - - An event type may not contain an unresolvable type variable. - - - - An event qualifier type is a Java annotation defined as |@Target({FIELD, PARAMETER})| or |@Target({METHOD, FIELD, PARAMETER, TYPE})| - - - - All event qualifier types must specify the |@jakarta.inject.Qualifier| meta-annotation - - - - Every event has the qualifier |@jakarta.enterprise.inject.Any|, even if it does not explicitly declare this qualifier. - - - - Any Java type may be an observed event type. - -
- -
- - Beans fire events via an instance of the |jakarta.enterprise.event.Event| interface, which may be injected. - - - - Any combination of qualifiers may be specified at the injection point. - - - - Or, the |@Any| qualifier may be used, allowing the application to specify qualifiers dynamically. - - -
- -
- - - The method |fire()| accepts an event object. - - - - Event fired with the fire() method is fired synchronously. All the resolved synchronous observers are called in the thread in which fire() was - called. - - - - - A synchronous observer notification blocks the calling thread until it completes. - -
- -
- - - Event fired with the fireAsync() method is fired asynchronously. All the resolved asynchronous observers are called in one or more different - threads. - - - -
- -
- - The |Event| interface provides a method for firing events with a specified combination of type and qualifiers. - - - - For an injected |Event|, the specified type is the type parameter specified at the injection point, and the specified qualifiers are the - qualifiers specified at the injection point. - - - - - The |select()| method returns a child |Event| for a given specified type and additional specified qualifiers. If no specified type is given, - the specified type is the same as the parent. - - - - - If the specified type contains a type variable, an |IllegalArgumentException| is thrown. - - - - If two instances of the same non repeating qualifier type are passed to |select()|, an |IllegalArgumentException| is thrown. - - - - If an instance of an annotation that is not a qualifier type is passed to |select()|, an |IllegalArgumentException| is thrown. - - - - The method |fire()| and |fireAsync()| fire an event with the specified qualifiers and notifies observers, as defined by Section 10.5, - "Observer notification". - - - - - If the container is unable to resolve the parameterized type of the event object, it uses the specified type to infer the parameterized type - of the event types. - - - - - The method fireAsync() may be called with a |NotificationOptions| object to configure the observer - methods notification, e.g. to specify an |Executor| object to be used for asynchronous delivery. - - - - - The following elements are container specific: - - the default Executor used by the container when fireAsync() is called without specifying an Executor, - - - the CompletionStage returned by fireAsync methods, - - - all dependent stages of this initial CompletionStage. - - - - - If the runtime type of the event object contains an unresolvable type variable, an |IllegalArgumentException| is thrown. - - - - If the runtime type of the event object is assignable to the type of a container lifecycle event, |IllegalArgumentException| is thrown. - -
- -
- - The container must provide a built-in bean with |Event<X>| in its set of bean types, for every Java type |x| that does not contain a - type variable. - - - - - The container must provide a built-in bean with every event qualifier type in its set of qualifier types. - - - - The container must provide a built-in bean with scope |@Dependent|. - - - - The container must provide a built-in bean with no bean name. - - - - The container must provide a built-in bean with an implementation provided automatically by the container. - - - - If an injection point of raw type |Event| is defined, the container automatically detects the problem and treats it as a definition error. - - - - - The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable - dependencies (CDI Full)". - - -
- -
- - The process of matching an event to its observer methods is called observer resolution. The container considers event type and qualifiers when - resolving observers. - - Statement of intent - - - - Observer resolution usually occurs at runtime. - Describes non-portable behavior - - - - An event is delivered to an observer method if the observer method belongs to an enabled bean, an event type is assignable to the observed - event type, taking type parameters into consideration, the observer method has no event qualifiers or has a subset of the event qualifiers. An - observer method has an event qualifier if it has an observed event qualifier with (a) the same type and (b) the same annotation member value for - each member which is not annotated |@jakarta.enterprise.util.Nonbinding|. Also the event is not a container lifecycle event, as defined in Section - 11.5 "Container lifecycle events", or the observer method belongs to an extension. - - - Check an event is delivered if the observer method belongs to an enabled bean, an event type is assignable to the observed event type and - has a subset of the event qualifiers. - - - - Check an event is not delivered if the observer method belongs to an disabled bean. - - - Check an event is delivered if the observer method if the event is fired synchronously and the observer is defined with @Observes - - - Check an event is delivered if the observer method if the event is fired asynchronously and the observer is defined with @ObservesAsync . - - - - - - If the runtime type of the event object contains an unresolvable type variable, the container must throw an |IllegalArgumentException|. - - - - For a custom implementation of the |ObserverMethod| interface defined in Section 11.1.3, "The ObserverMethod interface", the container must - call |getObservedType()| and |getObservedQualifiers()| to determine the observed event type and qualifiers. - - -
- -
- - An event type is considered assignable to a type variable if the event type is assignable to the upper bound, if any. - - - - A parameterized event type is considered assignable to a raw observed event type if the raw types are identical. - - - - A parameterized event type is considered assignable to a parameterized observed event type if they have identical raw type and for each - parameter the observed event type parameter is an actual type with identical raw type to the event type parameter, and, if the type is - parameterized, the event type parameter is assignable to the observed event type parameter according to these rules, or the observed event type - parameter is a wildcard and the event type parameter is assignable to the upper bound, if any, of the wildcard and assignable from the lower - bound, if any, of the wildcard, or the observed event type parameter is a type variable and the event type parameter is - assignable to the upper bound, if any, of the type variable. - - - Check the event type parameter and the observed event type parameter are actual types with identical raw type. - - - Check the event type parameter and the observed event type parameter are actual types with identical raw type for nested type - parameters. - - - - Check the observed event type parameter is a wildcard and the event type parameter is assignable to the upper bound, if any, - of the wildcard and assignable from the lower bound, if any, of the wildcard. - - - - Check the observed event type parameter is a type variable and the event type parameter is assignable to the upper bound, if - any, of the type variable. - - - - -
- -
- - The qualifier type for an |Event| qualifier may have annotation members. - - - - The container uses |equals()| to compare event qualifier type member values. - Since only primitive types are allowed, the call to equals() cannot be checked - -
- -
- - An event parameter may have multiple qualifiers. - - - - An observer method will only be notified if all the observed event qualifiers are specified when the event is fired. - - -
- -
- - An observer method allows the application to receive and respond to event notifications. - A general statement. - - - - An observer method is a non-abstract method of a managed bean class (or of an extension, as defined in Section 11.5, "Container lifecycle - events"). - - - - - An observer method may be either static or non-static. - - - - There may be arbitrarily many observer methods with the same event parameter type and qualifiers. - - - - A bean (or extension) may declare multiple observer methods. - -
- -
- - Each observer method must have exactly one event parameter, of the same type as the event type it observes. When searching for observer - methods for an event, the container considers the type and qualifiers of the event parameter - - - - - If the event parameter does not explicitly declare any qualifier, the observer method observes events with no qualifier. - - - - The event parameter type may contain a type variable or wildcard. - - Test with a type variable. - - - - Test with a wildcard. - - - - - The event parameter may be an array type whose component type contains a type variable or a wildcard. - - Test with a type variable. - - - - Test with a wildcard. - - - - - Modifications made to the event parameter in an observer method are propagated to following observers. - - -
- -
- - An observer method may be declared by annotating a parameter |@jakarta.enterprise.event.Observes| or |@jakarta.enterprise.event.ObservesAsync| of - a default-access, public, protected or private method. That parameter is the event parameter. The declared type of the parameter is the observed - event type. - - - - - If @Observes is used the observer method is a synchronous observer method. - - - - If @ObservesAsync is used the observer method is an asynchronous observer method. - - - - If a method has more than one parameter annotated |@Observes| or |@ObservesAsync|, the container automatically detects the problem and treats - it as a definition error. - - - - - If a method has a parameter annotated |@Observes| and |@ObservesAsync|, the container automatically - detects the problem and treats it as a definition error. - - - - - Observed event qualifiers may be declared by annotating the event parameter. - - - - If an observer method is annotated |@Produces| the container automatically detects the problem and treats it as a definition error. - - - - If an observer method is annotated |@Inject| the container automatically detects the problem and treats it as a definition error. - - - - If an observer method has a parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition - error. - - - - - Interceptors and decorators may not declare observer methods. If an interceptor or decorator has a method with a parameter annotated - |@Observes| or |@ObservesAsync|, the container automatically detects the problem and treats it as a definition error. - - - - - In addition to the event parameter, observer methods may declare additional parameters, which may declare qualifiers. These additional - parameters are injection points. - - -
- -
- - - The interface |jakarta.enterprise.inject.spi.EventMetadata| provides access to metadata about an observed event. - - |getQualifiers()| returns the set of qualifiers with which the event was fired. - - - |getInjectionPoint()| returns the |InjectionPoint| from which this event payload was fired, or |null| if it was fired from - |BeanManager.fireEvent()|. - - - - |getType()| returns the type representing runtime class of the event object with type variables resolved. - - - - - The container must provide a bean with scope |@Dependent|, bean type |EventMetadata| and qualifier |@Default|, allowing observer methods to - obtain information about the events they observe. - - - - - If an injection point of type |EventMetadata| and qualifier |@Default| which is not a parameter of an observer method exists, the container - automatically detects the problem and treats it as a definition error. - - - -
- -
- - A conditional observer method may be declared by specifying |receive=IF_EXISTS|. - - - - Beans with scope |@Dependent| may not have conditional observer methods. If a bean with scope |@Dependent| has an observer method declared - |receive=IF_EXISTS|, the container automatically detects the problem and treats it as a definition error. - - - - - The enumeration |jakarta.enterprise.event.Reception| identifies the possible values of |receive|. - -
- -
- - Transactional observer methods are observer methods which receive event notifications during the before or after completion phase of the - transaction in which the event was fired. If no transaction is in progress when the event is fired, they are notified at the same time as other - observers - - - - - If the transaction is in progress, but |jakarta.transaction.Synchronization| callback cannot be registered due to the transaction being already - marked for rollback or in state where |jakarta.transaction.Synchronization| callbacks cannot be registered, the before completion, after - completion and after failure observer methods are notified at the same time as other observers, but - after success observer methods get skipped. - - - - - A before completion observer method is called during the before completion phase of the transaction - - - - An after completion observer method is called during the after completion phase of the transaction - - - - An after success observer method is called during the after completion phase of the transaction, only when the transaction completes - successfully - - - - - An after failure observer method is called during the after completion phase of the transaction, only when the transaction fails - - - - The enumeration |jakarta.enterprise.event.TransactionPhase| identifies the kind of transactional observer method. - Should we just sigtest this? - - - - A transactional observer method may be declared by specifying any value other than |IN_PROGRESS| for |during|. - -
- -
- - - When an event is fired by the application, the container must determine the observers for that event according to the observer resolution - defined by Section 10.2, "Observer resolution", then then for each observer method, either invoke the observer method immediately or register - the observer method for later invocation during the transaction completion phase, using a JTA |Synchronization| and honor the priority of - observer methods as defined in Section 10.6.2, “Observer ordering”. - - - - - The container calls observer methods as defined in Section 5.5.6, "Invocation of observer methods". - Tested in 5.5.6. - - - - If the observer method is a transactional observer method and there is currently a JTA transaction in progress, the container calls the - observer method during the appropriate transaction completion phase. ~Otherwise, the container calls the observer immediately.~ - - - - - If there is no context active for the scope to which the bean declaring the observer method belongs, then the observer method should not be - called. - - - - - Any observer method called before completion of a transaction may call |setRollbackOnly()| to force a transaction rollback. - - - - An observer method may not directly initiate, commit or rollback JTA transactions. - Doesn't specify what happens if they do - - - - - Observers may throw exceptions: - - If an observer method is a transactional observer method, any exception is caught and logged by the container. - We can't verify what is logged - - - - If the observer method is asynchronous, the exception aborts processing of the observer but not of the event. - - - - Otherwise, the exception aborts processing of the event. No other observer methods of that event will be called. The - BeanManager.fireEvent() or Event.fire() method rethrows the exception. If the exception is a checked exception, it is wrapped and rethrown - as an (unchecked) ObserverException. - - - - - - For a custom implementation of the |ObserverMethod| interface defined in Section 11.1.3, "The ObserverMethod interface", the container must - call |getTransactionPhase()| to determine if the observer method is a transactional observer method, and |notify()| which accepts - |jakarta.enterprise.inject.spi.EventContext| to invoke the method. - - - Check |getTransactionPhase()| is called. - - - Check |notify()| is called. - - - -
- -
- - If an event is asynchronous, and an exception is thrown by one or more of its notified observers, the - `CompletionStage` returned by `fireAsync` will complete exceptionally with - `java.util.concurrent.CompletionException`. - - - - - java.util.concurrent.CompletionException contains all exceptions thrown by observers as suppressed exceptions. They can be accessed as an - array of `Throwable` with the `getSuppressed` method. - - -
- -
- - - Before the actual observer notification, the container determines an order in which the observer methods for a certain event are invoked. The - priority of an observer method may be declared using the @Priority annotation - - - If no @Priority annotation is specified, the default priority APPLICATION + 500 is assumed - - - Observers with smaller priority values are called first - - - - The order of more than one observer with the same priority is undefined and the observer methods are notified therefore in a non - predictable order. - - - - -
- -
- - - If the observer method is asynchronous, it is called: - - in a new lifecycle contexts. - - - - in a new transaction context. - - - - - If the observer method is a before completion transactional observer method, it is called within the context of the transaction that is about - to complete and with the same client security context and lifecycle contexts. - - - - - If the observer method is any other kind of transactional observer method, it is called in an unspecified transaction context, but with the - same client security context and lifecycle contexts as the transaction that just completed. - - - - - If an observer method is not a before completion transactional method, and not any other kind of transactional observer method, then the - observer method is called in the same transaction context, client security context and lifecycle contexts as the invocation of |Event.fire()| or - |BeanManager.fireEvent()|. - - -
- -
- -
- - - Implementations are required to fire a startup event during application initialization. - - This must be done synchronously with an event payload of jakarta.enterprise.event.Startup and qualifier jakarta.enterprise.inject.Any - - - - This event is fired after the event with qualifier @Initialized(ApplicationScope.class) but before processing requests. - - - - Applications must never manually fire any events with payload type jakarta.enterprise.event.Startup. - -
- -
- - - Implementations are required to fire a shutdown event during application shutdown. - - This must be done synchronously with an event payload of jakarta.enterprise.event.Shutdown and qualifier jakarta.enterprise.inject.Any. - - - - This event is fired during CDI container shutdown but not later than the event with qualifier @BeforeDestroyed(ApplicationScoped.class). - - - - Applications must never manually fire any events with payload type jakarta.enterprise.event.Shutdown. - -
- -
- - - CDI-based frameworks often need to invoke application methods declared on managed beans. - Frameworks cannot invoke application methods directly, because they are not compiled against the application code. - However, during application deployment, frameworks may observe application methods through CDI extensions and build an |Invoker| for each relevant method. - The invokers can then be used at application runtime to invoke the methods indirectly. - - Basic test of method invokers - -
- -
- - The CDI container allows building an |Invoker| for a method of an enabled managed bean. - - - - Invalid target methods are: private methods, constructors, - methods declared on the |java.lang.Object| class, except of the |toString()| method, - methods that are not declared on the bean class of the target bean or inherited from its supertypes. - Attempting to build an invoker for an invalid target method leads to a deployment problem. - - - Test for private method - - - Test for constructor - - - Test for |java.lang.Object| method - - - Test for method from a different class - - - Test for public, protected and package-private methods - - - - When the target bean is not a managed bean, attempting to build an invoker leads to a deployment problem. - - Test for a producer method - - - Test for a producer field - - - - When the target bean is an interceptor, attempting to build an invoker leads to a deployment problem. - - - The only way to build an invoker is using the |InvokerBuilder|. - -
- -
- - Calling |invoke()| invokes the target method on given |instance| of the target bean, passing given |arguments|, and propagates back the return value or thrown exception. - - - The |instance| and |arguments| may be contextual or non-contextual objects. - - - A single invoker instance may be used to perform multiple, possibly concurrent, invocations of the target method, possibly on different instances of the target bean, possibly with different arguments. - - - Whenever a direct invocation of a method on an object is a business method invocation, an indirect invocation of that method on that object through an invoker is also a business method invocation. - -
- -
- - If the target method is |static|, the |instance| is ignored; by convention, it should be |null|. - - - If the target method is not |static| and |instance| is |null|, a |RuntimeException| is thrown. - - - If the target method is not |static| and the |instance| is not permissible for the target method, a |RuntimeException| is thrown. - - - The |instance| is permissible for the target method when: - - the |instance| is a contextual reference for the target bean and the bean type that declares the target method - - - the |instance| is a contextual reference for the target bean (regardless of the bean type) and the target method is declared on an interface that is present in the set of bean types of the target bean - - - the |instance| is a non-contextual object and the class of the |instance| declares the target method or inherits it from a supertype - - - - Correspondence between given |arguments| and declared parameters of the target method is positional: the Nth element of the |arguments| array is passed as the Nth argument to the target method. - - - If the target method is a variable arity method, the last element of the |arguments| array corresponds to the variable arity parameter (and therefore must be an array). - - - When passing an argument to the method, the applicable method invocation conversion is performed. - - - If the target method declares no parameter, |arguments| are ignored. - - - If the target method declares any parameter and |arguments| is |null|, |RuntimeException| is thrown. - - - If the |arguments| array has fewer elements than the number of parameters of the target method, |RuntimeException| is thrown. - - - If the |arguments| array has more elements than the number of parameters of the target method, the excess elements are ignored. - - - If a method invocation conversion does not exist from the class of some of the |arguments| (or from the null type if the argument is |null|) to the declared type of the corresponding parameter of the target method, |RuntimeException| is thrown. - - - If the target method returns normally, its return value is returned (after boxing conversion if the target method's return type is a primitive type), unless the target method is declared |void|, in which case |null| is returned. - - - If the target method throws an exception, it is rethrown directly. - -
- -
- - - |InvokerBuilder| can be obtained in build compatible extensions from |InvokerFactory.createInvoker()|. - An |InvokerFactory| may be declared as a parameter of |@Registration| extension methods. - - The target bean of the created invoker is the bean represented by the |BeanInfo| object passed to |createInvoker()|. - The target method of the created invoker is the method represented by the |MethodInfo| object passed to |createInvoker()|. - - Calling |InvokerBuilder.build()| produces an opaque token (|InvokerInfo|) that can be passed as a parameter to a |SyntheticBeanBuilder| or |SyntheticObserverBuilder| and materializes as an |Invoker| at application runtime. - - Basic test of method invokers. - -
- -
- - The |InvokerBuilder| allows specifying that the |instance| or any of the |arguments| passed to |Invoker.invoke()| should be ignored and a value should be looked up from the CDI container instead. - - - When |withInstanceLookup()| is called on an invoker builder and the target method is not |static|, the |invoke()| method of the built invoker shall ignore the |instance| argument and instead obtain and use a contextual reference for the target bean and the bean type that declares the target method. - - Test with target bean that is |@ApplicationScoped| - - - Test with target bean that is |@Dependent| - - - - Calling |withInstanceLookup()| on an invoker builder for a |static| target method has no effect. - - - - When |withArgumentLookup()| is called on an invoker builder, the |invoke()| method of the built invoker shall ignore the given element of the |arguments| array and instead: - - 1. identify a bean according to the rules of typesafe resolution, as defined in `Performing typesafe resolution`, where the required type is the declared type of the corresponding parameter of the target method and the required qualifiers are all qualifiers present on the parameter, resolving ambiguities according to `Unsatisfied and ambiguous dependencies`; - 2. obtain and use a contextual reference for the identified bean and the declared type of the parameter. - - - Test with parameter that resolves to an |@ApplicationScoped| bean - - - Test with parameter that resolves to a |@Dependent| bean - - - Test with parameter that resolves to an |Instance| bean - - - Test with parameter that resolves to an |Event| bean - - - Test with parameter that resolves to a |BeanManager| bean - - - - Calling |withArgumentLookup()| with |position| less than 0 or greater than or equal to the number of parameters of the target method leads to an |IllegalArgumentException|. - - Test for position less than zero - - - Test for position greater than the number of parameters - - - Test for position equal to the number of parameters - - - - - Configuring a lookup using |withInstanceLookup()| or |withArgumentLookup()| does not relax the requirements defined in `Behavior of |invoke()|`. - Notably, the |arguments| array must still have an element for each argument, regardless of whether a lookup was configured for it. - This means that for a target method with N parameters, the |arguments| array must always have at least N elements. - - - - - During deployment validation, implementations are required to identify all looked up beans for all built invokers, as described above. - It is a deployment problem if an attempt to identify a looked up bean results in an unsatisfied dependency or an ambiguous dependency that is not resolvable. - - - Test for unsatisfied lookup - - - Test for unresolvable ambiguous lookup - - - - Implementations are permitted to remember the identified beans and not repeat the resolution process for each invocation of |Invoker.invoke()|. - - - All instances of |@Dependent| looked up beans obtained during |Invoker.invoke()| are destroyed before the |invoke()| method returns or throws. - - - The order in which the instances of |@Dependent| looked up beans are destroyed is not specified. - - - The order in which instances of looked up beans are obtained during |Invoker.invoke()| in not specified. - -
- -
-
- -
- - When the target bean is a decorator, attempting to build an invoker leads to a deployment problem. - -
- -
- - - |InvokerBuilder| can be obtained in portable extensions from |ProcessManagedBean.createInvoker()|. - - The target bean of the created invoker is the bean for which the |ProcessManagedBean| event was fired. - The target method of the created invoker is the method represented by the |AnnotatedMethod| object passed to |createInvoker()|. - - Calling |InvokerBuilder.build()| produces an |Invoker| which should be stored for usage at application runtime. - - -
- - -
- - The container provides a built-in bean with bean type |BeanContainer|, scope |@Dependent| and qualifier |@Default|. - - - Test the bean type. - - - - Test the scope. - - - - Test the qualifier. - - -
- -
-
- -
- - A build compatible extension is a service provider of the jakarta.enterprise.inject.build.compatible.spi.BuildCompatibleExtension interface, declared in META-INF/services. - - - The invocation order for extension methods may be controlled using the @Priority annotation. If an extension - method does not have the @Priority annotation, the default priority jakarta.interceptor.Interceptor.Priority.APPLICATION + 500 is assumed. - If two extension methods have equal priority, the ordering between them is undefined. Note that priority only affects - order of extension methods in a single phase. - - - At deployment time, CDI container does not have to be running, so calling CDI.current() from an extension - method, or attempting to access a running CDI container in any other way, results in non-portable behavior. - -
- -
- - Test that discovery phase changes are seen - - - Test that classes with bean defining annotations not added to scan are not seen in non-bean archives - - - Test that classes added to scan are seen in non-bean archives - -
-
- - Extension methods annotated @Enhancement must declare exactly one parameter of one of the following types: - ClassConfig or ClassInfo - MethodConfig or MethodInfo - FieldConfig or FieldInfo - - - Test that a method with none of these parameters fails deployment. - - - - Test that a method with more than one of these parameters fails deployment. - - - - Test that a method with more than one of these parameters fails deployment. - - - - Test that enhancment phase annotation changes are seen - - - When an extension method declares a parameter of type ClassConfig or ClassInfo, it will be called for each - discovered class matching the criteria defined on the @Enhancement annotation - -
-
- - Extension methods annotated @Registration must declare exactly one parameter of one of the following types: - BeanInfo - InterceptorInfo - ObserverInfo - - - Test that a method with none of these parameters fails deployment. - - - - Test that a method with more than one of these parameters fails deployment. - - - When an extension method declares a parameter of type BeanInfo, it will be called for each bean whose set - of bean types matches the criteria defined on the @Registration annotation. - - - - When an extension method declares a parameter of type ObserverInfo, it will be called for each observer - whose observed event type matches the criteria defined on the @Registration annotation. - - - - - Test that enhancment phase annotation changes are seen - -
-
- - Test that synthesis phase beans are availalble for use by runtime - - - Test that synthesis observers are notified of fired events - -
-
- - Test that validation phase controls test outcome - -
- - -
-
- -
- - A portable extension may integrate with the container by providing its own beans, interceptors and decorators to the container. - - - - A portable extension may integrate with the container by injecting dependencies into its own objects using the dependency injection service. - - - - - A portable extension may integrate with the container by providing a context implementation for a custom scope. - - - - Augmenting or overriding the annotation-based metadata with metadata from some other source. - -
- -
- - - The |BeanAttributes| interface exposes the basic attributes of a bean. - - - |getTypes()|, |getQualifiers()|, |getScope()|, |getName()| and |getStereotypes()| must return the bean types, qualifiers, scope type, EL - name and stereotypes of the bean, as defined in Chapter 2, Concepts. - - - - - |isAlternative()| must return |true| if the bean is an alternative, and |false| otherwise. - - - - - - The interface |jakarta.enterprise.inject.spi.Bean| defines everything the container needs to manage instances of a certain bean. - - - |getBeanClass()| returns the bean class of the managed bean or of the bean that declares the producer method or field. - - - - |getInjectionPoints()| returns a set of |InjectionPoint| objects, defined in Section 5.5.7, "Injection point metadata", representing - injection points of the bean, that will be validated by the container at initialization time. - - - - - |isNullable()| is deprecated in CDI 1.1 and should be ignored by the container. - - - - - - Implementations of |Bean| must also implement the inherited operations defined by the |Contextual| interface defined in Section 6.1, "The - Contextual interface". - - - - - An instance of |Bean| exists for every enabled bean. - - - - A portable extension may add support for new kinds of beans beyond those defined by the this specification (managed beans, session beans, - producer methods, producer fields and resources) by implementing |Bean| and registering beans with the container, using the mechanism defined in - Section 11.5.2, "AfterBeanDiscovery event". - - -
- -
- - The |Bean| object for a decorator must implement the interface |jakarta.enterprise.inject.spi.Decorator|. - - - - |getDecoratedTypes()| returns the decorated types of the decorator. - - - - |getDelegateType()| and |getDelegateQualifiers()| return the delegate type and qualifiers of the decorator. - - - - An instance of |Decorator| exists for every enabled decorator. - -
- -
- - The |Bean| object for an interceptor must implement |jakarta.enterprise.inject.spi.Interceptor|. - - - - |getInterceptorBindings()| returns the interceptor bindings of the interceptor. - - - - |intercepts()| returns |true| if the interceptor intercepts the specified kind of lifecycle callback or method invocation, and |false| - otherwise. - - - - - |intercept()| invokes the specified kind of lifecycle callback or method invocation interception upon the given instance of the interceptor. - - - - - An |InterceptionType| identifies the kind of lifecycle callback or business method. - - - - An instance of |Interceptor| exists for every enabled interceptor. - -
- -
- - The interface |jakarta.enterprise.inject.spi.ObserverMethod| defines everything the container needs to know about an observer method. - - - - |getBeanClass()| returns the bean class of the bean that declares the observer method. - - - - |getObservedType()| and |getObservedQualifiers()| return the observed event type and qualifiers. - - - - |getReception()| returns |IF_EXISTS| for a conditional observer and |ALWAYS| otherwise. - - - - |getTransactionPhase()| returns the appropriate transaction phase for a transactional observer method or |IN_PROGRESS| otherwise. - - - - |getPriority()| returns the priority that will be used by the container to determine the notification order. - - - - |notify()| calls the observer method, as defined in Section 5.5.6 "Invocation of observer methods". - - - - |isAsync()| returns true if the method is an asynchronous observer method otherwise returns false - - - - An instance of |ObserverMethod| exists for every observer method of every enabled bean. - - - - |getDeclaringBean()| returns the Bean object that declares the observer method. Return value is undefined for synthetic observers. - -
- -
- - The interface |jakarta.enterprise.inject.spi.Producer| provides a generic operation for producing an instance of a type. - Statement of intent - - - - For a |Producer| that represents a class, |produce()| calls the constructor annotated |@Inject| if it exists, or the constructor with no - parameters otherwise, as defined in Section 5.5.1, "Injection using the bean constructor". and returns the resulting instance. If the class has - interceptors, |produce()| is responsible for building the interceptors and decorators of the instance. - - - Test field injection occurs - - - Test initializer methods called - - - Test constructor injected - - - Test decorator stack built - - - Test interceptor stack built - - - - - - For a |Producer| that represents a class, |dispose()| does nothing. - - - - For a |Producer| that represents a class, |getInjectionPoints()| returns a set of |InjectionPoint| objects representing all injected fields, - bean constructor parameters and initializer method parameters. - - - - Test injected fields. - - - - Test bean constructor parameters. - - - - Test initializer method parameters. - - - - - For a |Producer| that represents a producer method or field, |produce()| calls the producer method on, or accesses the producer field of, a - contextual instance of the bean that declares the producer method, as defined in Section 5.5.4, "Invocation of producer or disposer methods". - - - - Test with producer method. - - - - Test with producer field. - - - - - For a Producer that represents a producer method or field, |dispose()| calls the disposer method, if any, on a contextual instance of the bean - that declares the disposer method, as defined in Section 5.5.4, "Invocation of producer or disposer methods", or performs any additional - required cleanup, if any, to destroy state associated with a resource. - - - - Test with producer method. - - - - - - For a Producer that represents a producer method, |getInjectionPoints()| returns the set of |InjectionPoint| objects representing all - parameters of the producer method. - - - - - The subinterface |jakarta.enterprise.inject.spi.InjectionTarget| provides operations for performing dependency injection and lifecycle callbacks - on an instance of a type. - - Statement of intent - - - - |inject()| performs dependency injection upon the given object. The container sets the value of all injected fields, and calls all initializer - methods, as defined in Section 5.5.2, “Injection of fields and initializer methods”. - - - - - |postConstruct()| calls the |@PostConstruct| callback, if it exists. - - - - |preDestroy()| calls the |@PreDestroy| callback, if it exists. - - - - Implementations of |Producer| and |InjectionTarget| must ensure that the set of injection points returned by |getInjectionPoints()| are - injected by |produce()| or |inject()|. - - Targeting extension developers - - -
- -
- - The container provides a built-in bean with bean type |BeanManager|, scope |@Dependent| and qualifier |@Default|. - - - Test the bean type. - - - - Test the scope. - - - - Test the qualifier. - - - - - Exception is thrown if the following operations are called before the AfterBeanDiscovery event is fired: - - - - - Test getBeans(Type, Annotation...) - - - - Test getPassivationCapableBean(String) - - - - Test resolve(Set) - - - - Test resolveDecorators(Set, Annotation...) - - - - Test resolveInterceptors(InterceptionType, Annotation...) - - - - Test resolveObserverMethods(Object, Annotation...) - - - - Test validate(InjectionPoint) - - - - Exception is thrown if the following operations are called before the {@Link AfterDeploymentValidation} event is fired: - - - Test |createInstance()| - - - - Test |getReference(Bean, Type, CreationalContext)| - - - - Test |getInjectableReference(InjectionPoint, CreationalContext)| - - - - - The built-in implementation must be a passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies". - - - - Any bean may obtain an instance of |BeanManager| by injecting it. - - - - Any operation of |BeanManager| may be called at any time during the execution of the application. - Note that all operations have dedicated assertions. - -
- -
- - - - A portable extension or other object may obtain a reference to the current container by calling |CDI.current()|. |CDI.getBeanManager()| may be - called at any time after the container fires the |BeforeBeanDiscovery| container - lifecycle event until the container fires the |BeforeShutdown| container lifecycle event. Other methods on CDI may be called after the - application initialization is completed until the application shutdown starts. - - - Test |CDI.getBeanManager()| is called before the application initialization is completed. - - - Test |CDI.getBeanManager()| is called after the application initialization is completed. - - - Test lookup of bean instances after the application initialization is completed. - - - - - - |CDI| implements |jakarta.enterprise.inject.Instance| and therefore might be used to perform - programmatic lookup as defined in "The Instance interface". If no qualifier is passed to |CDI.select()| - method, the |@Default| qualifier is assumed. - - - - - - When |CDI.current()| is called, |getCDI()| method is called on |jakarta.enterprise.inject.spi.CDIProvider|. - - - - - - The |CDIProvider| to use may be set by the application or container using the |setCDIProvider()| method. If the |setCDIProvider()| has not been - called, the service provider with highest priority of the service - jakarta.enterprise.inject.spi.CDIProvider declared in META-INF/services is used. The order of more - than one CDIProvider with the same priority is undefined.. If no provider is available an |IllegalStateException| is thrown. - - - - Test using |CDIProvider| set by the application. - - Priority ordering is tested in CDI API. - - - - -
- -
- - The method |BeanManager.getReference()| returns a contextual reference for a given bean and bean type, as defined in Section 6.5.3, - "Contextual reference for a bean". - - - - - The first parameter is the |Bean| object representing the bean. The second parameter represents the bean type that must be implemented by any - client proxy that is returned. The third parameter is an instance of |CreationalContext| that may be used to destroy any object with scope - |@Dependent| that is created. - - - - - If the given type is not a bean type of the given bean, an |IllegalArgumentException| is thrown. - -
- -
- - The method |BeanManager.getInjectableReference()| returns an injectable reference for a given injection point, as defined in Section 6.5.5, - "Injectable references". - - - - - The first parameter represents the target injection point. The second parameter is an instance of |CreationalContext| that may be used to - destroy any object with scope |@Dependent| that is created. - - - - - If the |InjectionPoint| represents a decorator delegate injection point, |getInjectableReference()| returns a delegate, as defined in Section - 8.1.2, "Decorator delegate injection points". - - - - - If typesafe resolution results in an unsatisfied dependency, the container must throw an |UnsatisfiedResolutionException|. - - - - If typesafe resolution results in an unresolvable ambiguous dependency, the container must throw an |AmbiguousResolutionException|. - - - - Implementations of |Bean| usually maintain a reference to an instance of |BeanManager|. When the |Bean| implementation performs dependency - injection, it must obtain the contextual instances to inject by calling |BeanManager.getInjectableReference()|, passing an instance of - |InjectionPoint| that represents the injection point and the instance of |CreationalContext| that was passed to |Bean.create()|. - - This cannot be well tested at the moment. - - -
- -
- - - A helper class, |Unmanaged| provides a set of methods optimized for working with unmanaged instances. - - Test creating an injector for the given class, using the current bean manager. - - - Test creating an injector for the given class. - Let the container identify the current bean manager. - - - - - |UnmanagedInstance| methods throws IllegalStateException in following cases: - - |produce()| is called on an already produced instance. - CDI-602 - - - |produce()| is called on an instance that has already been disposed - CDI-602 - - - |inject()| is called before produce() is called - CDI-602 - - - |inject()| is called on an instance that has already been disposed - CDI-602 - - - |postConstruct()| is called before produce() is called - CDI-602 - - - |postConstruct()| is called on an instance that has already been disposed - CDI-602 - - - |preDestroy()| is called before produce() is called - CDI-602 - - - |preDestroy()| is called on an instance that has already been disposed - CDI-602 - - - |dispose()| is called before produce() is called - CDI-602 - - - |dispose()| is called on an instance that has already been disposed - CDI-602 - - - -
- -
- - An instance of |CreationalContext| for a certain instance of |Contextual| may be obtained by calling - |BeanManager.createCreationalContext()|. - - - - - An instance of |CreationalContext| for a non-contextual object may be obtained by passing a null value to |createCreationalContext()|. - -
- -
- - - The method |BeanManager.getBeans()| returns the set of beans which have the given required type and qualifiers and are available for injection - in the module or library containing the class into which the |BeanManager| was injected or or the class from whose JNDI environment namespace - the |BeanManager| was obtained, according to the rules for candidates of typesafe resolution defined in Section 5.2.1, “Performing typesafe - resolution”. - - - Test simple scenario. - - - Test alternatives are not filtered. - CDI-231 - - - - - The first parameter is a required bean type. The remaining parameters are required qualifiers. - - - - If no qualifiers are passed to |getBeans()|, the default qualifier |@Default| is assumed. - - - - If the given type represents a type variable, an |IllegalArgumentException| is thrown. - - - - If two instances of the same non repeating qualifier type are given, an |IllegalArgumentException| is thrown. - - - - If an instance of an annotation that is not a qualifier type is given, an |IllegalArgumentException| is thrown. - - -
- -
- - The method |BeanManager.getBeans()| which accepts a string returns the set of beans which have the given bean name and are available for - injection in the module or library containing the class into which the |BeanManager| was injected or the class from whose JNDI environment - namespace the |BeanManager| was obtained, according to the rules of name resolution defined in Section 5.3, "Name resolution". - - - - - The parameter is a bean name. - -
- -
- - The method |BeanManager.getPassivationCapableBean()| returns the |PassivationCapable| bean with the given identifier (see Section 6.6.1, - "Passivation capable beans"). - - -
- -
- - The method |BeanManager.resolve()| applies the ambiguous dependency resolution rules defined in Section 5.2.1, "Unsatisfied and ambiguous - dependencies" to a set of |Bean|s. - - - - - If the ambiguous dependency resolution rules fail, the container must throw an |AmbiguousResolutionException|. - - - - The method |BeanManager.resolve()| must return null, if: - - null is passed to |resolve()|, - - - no beans are passed to |resolve()|, - - - -
- -
- - The |BeanManager.validate()| operation validates an injection point and throws an |InjectionException| if there is a deployment problem (for - example, an unsatisfied or unresolvable ambiguous dependency) associated with the injection point. - - -
- -
- - The method |BeanManager.fireEvent()| fires an event and notifies observers, according to Section 10.5, "Observer notification". - - - - The first argument is the event object. The remaining parameters are event qualifiers. - - - - If the runtime type of the event object contains a type variable, an |IllegalArgumentException| is thrown. - - - - If two instances of the same non repeating qualifier type are given, an |IllegalArgumentException| is thrown. - - - - If an instance of an annotation that is not a qualifier type is given, an |IllegalArgumentException| is thrown. - - - - If the runtime type of the event object is assignable to the type of a container lifecycle event, |IllegalArgumentException| is thrown. - - -
- -
- - The method |BeanManager.resolveObserverMethods()| resolves observer methods for an event according to the rules of observer resolution defined - in Section 10.4, "Observer resolution". - - - - - The first parameter of |resolveObserverMethods()| is the event object. The remaining parameters are event qualifiers. - - - - If the runtime type of the event object contains a type variable, an |IllegalArgumentException| is thrown. - - - - If two instances of the same non repeating qualifier type are given, an |IllegalArgumentException| is thrown. - - - - If an instance of an annotation that is not a qualifier type is given, an |IllegalArgumentException| is thrown. - - -
- -
- - The method |BeanManager.resolveDecorators()| returns the ordered list of decorators for a set of bean types and a set of qualifiers which are - enabled in the module or library containing the class into which the |BeanManager| was injected or the class from whose JNDI environment - namespace the |BeanManager| was obtained, as defined in Section 8.3, "Decorator resolution". - - - - - The first argument is the set of bean types of the decorated bean. The annotations are qualifiers declared by the decorated bean. - - - - If two instances of the same non repeating qualifier type are given, an |IllegalArgumentException| is thrown. - - - - If an instance of an annotation that is not a qualifier type is given, an |IllegalArgumentException| is thrown. - - - - If the set of bean types is empty, an |IllegalArgumentException| is thrown. - - -
- -
- - The method |BeanManager.resolveInterceptors()| returns the ordered list of interceptors for a set of interceptor bindings and a type of - interception which are enabled in the module or library containing the class into which the |BeanManager| was injected or the class from whose - JNDI environment namespace the |BeanManager| was obtained, as defined in Section 9.5, "Interceptor resolution". - - - - - If two instances of the same non repeating interceptor binding type are given, an |IllegalArgumentException| is thrown. - - - - If no interceptor binding type instance is given, an |IllegalArgumentException| is thrown. - - - - If an instance of an annotation that is not an interceptor binding type is given, an |IllegalArgumentException| is thrown. - -
- -
- - A portable extension may test an annotation to determine if it is a qualifier type, scope type, stereotype or interceptor binding type, obtain - the set of meta-annotations declared by a stereotype or interceptor binding type, or determine if a scope type is a normal or passivating scope. - - - - Test qualifier type. - - - - Test scope type. - - - - Test stereotype. - - - - - - Test meta-annotations for stereotype. - - - - Test meta-annotations for interceptor binding type. - - - - Test obtaining a |ScopeType|. - - -
- -
- - A portable extension may determine if two qualifiers or two interceptor bindings are considered equivalent for the purposes of typesafe - resolution, as defined in Section 5.2.1, "Performing typesafe resolution". - - - Test equivalence of qualifiers using |BeanManager.areQualifiersEquivalent()|. - - - Test equivalence of interceptor bindings using |BeanManager.areInterceptorBindingsEquivalent()|. - - - - A portable extension may determine the hash code of a qualifier or and interceptor binding, ignoring any members annotated with - |@Nonbinding|. - - - Determine the hash code of a qualifier using |BeanManager.getQualifierHashCode()|. - - - Determine the hash code of an interceptor binding using |BeanManager.getInterceptorBindingHashCode()|. - - -
- -
- - The method |BeanManager.getContext()| retrieves an active context object associated with the a given scope, as defined in Section 6.5.1, "The - active context object for a scope". - - -
- -
- - The method `BeanContainer.getContexts()` retrieves all context objects, active and inactive, - associated with the given scope, as defined in Section 2.5, "Scopes and contexts". - - -
- -
- - The method |BeanManager.getELResolver()| returns the |jakarta.el.ELResolver| specified in Section 12.4, "Integration with Unified EL". - -
- -
- - The method |BeanManager.createAnnotatedType()| returns an |AnnotatedType| that may be used to read the annotations of a given Java class or - interface. - - -
- -
- - - The method |BeanManager.createInjectionTarget()| returns a container provided implementation of |InjectionTarget| for a given |AnnotatedType| - or throws an |IllegalArgumentException| if there is a definition error associated with any injection point of the type. - - - Check |InjectionTarget| is provided. - - - - Check |IllegalArgumentException| is thrown. - - - - - configure() method returns an AnnotatedTypeConfigurator as defined in AnnotatedTypeConfigurator SPI to configure - the AnnotatedType used to create the InjectionTargetFactory. Subsequent invocations of the configure() method - within one InjectionTargetFactory instance will always return the same AnnotatedTypeConfigurator instance. - - - - - Once |createInjectionTarget()| method has been invoked, any invocations of |configure()| throws an |IllegalStateException|. - - -
- -
- - The method |BeanManager.createProducer()| returns a container provided implementation of |Producer| for a given |AnnotatedMethod| or - |AnnotatedField| or throws an |IllegalArgumentException| if there is a definition error associated with the producer method or field. - - - Test that the method |BeanManager.createProducer()| returns a container provided implementation of |Producer| for a given - |AnnotatedMethod|. - - - - Test that the method |BeanManager.createProducer()| returns a container provided implementation of |Producer| for a given - |AnnotatedField|. - - - - Test that the method |BeanManager.createProducer()| throws an |IllegalArgumentException| if there is a definition error associated with - the producer method. - - - - Test that the method |BeanManager.createProducer()| throws an |IllegalArgumentException| if there is a definition error associated with - the producer field. - - - -
- -
- - The method |BeanManager.createInjectionPoint()| returns a container provided implementation of |InjectionPoint| for a given |AnnotatedField| - or |AnnotatedParameter| or throws an |IllegalArgumentException| if there is a definition error associated with the injection point. - - - Test that the method |BeanManager.createInjectionPoint()| returns a container provided implementation of |InjectionPoint| for a given - |AnnotatedField|. - - - - Test that the method |BeanManager.createInjectionPoint()| returns a container provided implementation of |InjectionPoint| for a given - |AnnotatedParameter|. - - - - Test that the method |BeanManager.createInjectionPoint()| throws an |IllegalArgumentException| if there is a definition error associated - with the injection point. - - - -
- -
- - The method |BeanManager.createBeanAttributes()| returns a container provided implementation of |BeanAttributes| by reading the annotations of - a given |AnnotatedType| or |AnnotatedMember|, according to the rules define in |Chapter 2, Concepts|, or throws an |IllegalArgumentException| if - there is a definition error associated with the declared bean attributes. - - - Test that the method |BeanManager.createBeanAttributes()| returns a container provided implementation of |BeanAttributes| by reading the - annotations of a given |AnnotatedType|. - - - - Test that the method |BeanManager.createBeanAttributes()| returns a container provided implementation of |BeanAttributes| by reading the - annotations of a given |AnnotatedMember|. - - - - Test that the method |BeanManager.createBeanAttributes()| throws an |IllegalArgumentException| if there is a definition error associated - with the declared bean attributes. - - - -
- -
- - The method |BeanManager.createBean()| returns a container provided implementation of |Bean|. The method accepts a |BeanAttributes|, which - determines the bean types, qualifiers, scope, name and stereotypes of the returned |Bean|, and the return values of |isAlternative()| and - |isNullable()|, and a class, which determines the return value of |Bean.getClass()|. - - - - Test the first version of the method |BeanManager.createBean()| that also accepts an |InjectionTarget|, which is used to create and destroy - instances of the bean, to perform dependency injection and lifecycle callbacks, and which determines the return value of - |Bean.getInjectionPoints()|. - - - - Test the second version of the method |BeanManager.createBean()| that also accepts a |Producer|, which is used to create and destroy instances - of the bean, and which determines the return value of |Bean.getInjectionPoints()|. - - -
- -
- - The method |BeanManager.getExtension()| returns the container's instance of an |Extension| class declared in |META-INF/services|, or throws an - |IllegalArgumentException| if the container has no instance of the given class. - - - Test that the method |BeanManager.getExtension()| returns the container's instance of an |Extension| class declared in - |META-INF/services|. - - - - Test that the method |BeanManager.getExtension()| throws an |IllegalArgumentException| if the container has no instance of the given - class. - - - -
- -
- - - The method BeanManager.getInterceptionFactory() returns an InterceptionFactory for the provided type - as defined in `Apply interceptor programmatically`. - - -
- -
- - - The method |BeanManager.createInstance()| returns an |Instance<Object>| to request bean instances - programmatically as described in "The Instance interface". - - - - - If no qualifier is passed to |Instance.select()| method, the |@Default| qualifier is assumed. - - -
- -
- - The interfaces |AnnotatedType|, |AnnotatedField|, |AnnotatedMethod|, |AnnotatedConstructor| and |AnnotatedParameter| in the package - |jakarta.enterprise.inject.spi| allow a portable extension to specify metadata that overrides the annotations that exist on a bean class. The - portable extension is responsible for implementing the interfaces, thereby exposing the metadata to the container. - - Statement of intent. In fact some assertions in this section do test metadata constructed by container as defined in sections "11.3.18. - Obtaining an AnnotatedType for a class" and "11.5.6. ProcessAnnotatedType event". - - - - - The interface |jakarta.enterprise.inject.spi.AnnotatedType| exposes the |Class| object and members. - - Test that |getConstructors()| returns all default-access, public, protected or private constructors declared for the type. - - - Test that |getMethods()| returns all default-access, public, protected or private methods declared on the type and those declared on any - supertypes. - - - - The container should call |AnnotatedMethod.getJavaMember().getDeclaringClass()| to determine the type in the type hierarchy that declared - the method. - - - - Test that |getFields()| returns all default-access, public, protected or private fields declared on the type and those declared on any - supertypes. - - - - - - When determining annotations on a type, the container must only consider the special inheritance rules defined for scope types in Section 4.1, - "Inheritance of type-level metadata". - - - - - The interface |jakarta.enterprise.inject.spi.Annotated| exposes the overriding annotations and type declarations. - - |getBaseType()| returns the type of the program element. - - - - |getTypeClosure()| returns all types to which the base type should be considered assignable. - - - - |getAnnotation()| returns the program element annotation of the given annotation type, or a null value. - - - - |getAnnotations()| returns all annotations of the program element. - - - - |isAnnotationPresent()| returns |true| if the program element has an annotation of the given annotation type, or |false| otherwise. - - - - - - The container must use the operations of |Annotated| and its subinterfaces to discover program element types and annotations. The container - must not directly call the Java Reflection API. In particular, the container must call |Annotated.getBaseType()| to determine the type of an - injection point, event parameter or disposed parameter, call |Annotated.getTypeClosure()| to determine the bean types of any kind of bean, call - |Annotated.getAnnotations()| to determine the scope, qualifiers, stereotypes and interceptor bindings of a bean, call - |Annotated.isAnnotationPresent()| and |Annotated.getAnnotation()| to read any bean annotations defined by this specification, and call - |AnnotatedType.getConstructors()|, |AnnotatedType.getMethods()| and |AnnotatedType.getFields()| to determine the members of a bean class. - - - - Check that the container uses the operations of |Annotated| and its subinterfaces to discover program element types and annotations. and - that the container does not use the Java Reflection API. - - - - - Check that |getBaseType()| is used to determine the type of _a field injection point_. The base type should be different from the original - type specified in the class definition - - - - - Check that |getBaseType()| is used to determine the type of _an initializer method injection point_. The base type should be different - from the original type specified in the class definition - - - - - Check that |getBaseType()| is used to determine the type of _a constructor injection point_. The base type should be different from the - original type specified in the class definition - - - - - Check that |getBaseType()| is used to determine the type of _a producer method injection point_. The base type should be different from - the original type specified in the class definition - - - - - Check that |getBaseType()| is used to determine the type of _a observer method injection point_. The base type should be different from - the original type specified in the class definition - - - - - Check that |getBaseType()| is used to determine the type of _a disposer method injection point_. The base type should be different from - the original type specified in the class definition - - - - - Check that |getBaseType()| is used to determine the type of _an event parameter_. The base type should be different from the original type - specified in the class definition - - - - - Check that |getBaseType()| is used to determine the type of _disposed parameter_. The base type should be different from the original type - specified in the class definition - - - - - Check that a |getTypeClosure()| is used to determine the bean types for a managed bean. The type closure should be different from the - original type specified in the class definition. - - - - - Check that a |getTypeClosure()| is used to determine the bean types for a producer field. The type closure should be different from the - original type specified in the class definition. - - - - - Check that a |getTypeClosure()| is used to determine the bean types for a producer method. The type closure should be different from the - original type specified in the class definition. - - - - - Check that |getAnnotations()| is used to determine the bean scope. The annotations should be different from the original type specified in - the class definition. - - - - - Check that |getAnnotations()| is used to determine the bean qualifiers. The annotations should be different from the original type - specified in the class definition. - - - - - Check that |getAnnotations()| is used to determine the bean stereotypes. The annotations should be different from the original type - specified in the class definition. - - - - - Check that |getAnnotations()| is used to determine the bean interceptors. The annotations should be different from the original type - specified in the class definition. - - - - - Check that |isAnnotationPresent()| returns the provided annotations - No testable behavior - - - - Check that a previously non-inject-annotated constructor is used by the container to instantiate a bean. - - - - Check that a qualifier added to a constructor parameter is used by the container to instantiate a bean. - - - - Check that a previously non-inject-annotated field is injected. - - - - Check that an extra qualifier is applied to a field. - - - - Check that |@Produces| added creates a producer field. - - - - Check that a previously non-inject-annotated method is injected. - - - - Check that an extra qualifier is applied to an injectable method - - - - Check that |@Produces| added creates a producer method - - - - Check that an extra qualifier is applied to a producer method. - - - - Check that a qualifer added to a producer method parameter is applied. - - - - Check that |@Disposes| added to a parameter creates a disposes method - - - - Check that an extra qualifier is applied to a disposes method parameter. - - - - - - Check that |@Observes| added to a parameter creates a observer method - - - - Check that an extra qualifier is applied to an observes method parameter. - - - - Check that a qualifer added to a observes method injectable parameter is applied. - - - -
- -
- - - This SPI is composed of the following interfaces: - - `jakarta.enterprise.inject.spi.builder.AnnotatedTypeConfigurator` to configure an AnnotatedType - - - `jakarta.enterprise.inject.spi.builder.AnnotatedFieldConfigurator` to configure an AnnotatedField - - - `jakarta.enterprise.inject.spi.builder.AnnotatedConstructorConfigurator` to configure an AnnotatedConstructor - - - - `jakarta.enterprise.inject.spi.builder.AnnotatedParameterConfigurator` to configure an AnnotatedParameter - - - - - - |AnnotatedTypeConfigurator| is the entry point for this SPI. - - Test |getAnnotated()| returns the original AnnotatedType with which this configurator was initialized. - - - - Test |add()| adds an annotation to the configured element. - - - - Test |remove()| method removes annotations that match the specified predicate from the configured element. - - - - Test |removeAll()| removes all annotations from the configured element. - - - - Test |methods()| returns a set of |AnnotatedMethodConfigurator| to configure annotations on methods. - - - - Test |filterMethods()| returns a `Stream < AnnotatedMethodsConfigurator >` filtered by applying the provided Predicate on - methods(). - - - - - Test |fields()| returns a set of |AnnotatedFieldConfigurator| to configure annotations on fields. - - - - Test |filterFields()| returns a `Stream < AnnotatedFieldConfigurator >` filtered by applying the provided Predicate on fields(). - - - - - Test |constructors()| returns a set of |AnnotatedConstructorConfigurator| to configure annotations on constructors. - - - - Test |filterConstructors()| returns a |Stream `<AnnotatedConstructorConfigurator >`| filtered by applying the provided Predicate on - Constructors(). - - - -
- -
- - - AnnotatedMethodConfigurator - - Test |getAnnotated()| returns the original `AnnotatedMethod` with which this configurator was initialized. - - - - Test add() adds an annotation to the configured element. - - - - Test |remove()| method removes annotations that match the specified predicate from the configured element. - - - - Test |removeAll()| removes all annotations from the configured element. - - - - Test |params()| returns a list of AnnotatedParameterConfigurator to configure annotations on parameters. - - - - Test |filterParams(Predicate `< AnnotatedParameter <T >>` predicate)| returns a `Stream <AnnotatedParameterConfigurator>` - filtered by applying the provided Predicate on params(). - - - -
- -
- - - AnnotatedConstructorConfigurator - - Test |getAnnotated()| returns the original `AnnotatedConstructor` with which this configurator was initialized. - - - - Test |add()| adds an annotation to the configured element. - - - - Test |remove()| method removes annotations that match the specified predicate from the configured element. - - - - Test |removeAll()| removes all annotations from the configured element. - - - - Test |params()| returns a list of AnnotatedParameterConfigurator to configure annotations on parameters. - - - - Test |filterParams(Predicate `< AnnotatedParameter <T >>` predicate)| returns a `Stream <AnnotatedParameterConfigurator>` - filtered by applying the provided Predicate on params(). - - - -
- -
- - AnnotatedParameterConfigurator - - Test |getAnnotated()| returns the original `AnnotatedParameter` with which this configurator was initialized. - - - - Test |add()| adds an annotation to the configured element. - - - - Test |remove()| method removes annotations that match the specified predicate from the configured element. - - - - Test |removeAll()| removes all annotations from the configured element. - - - -
- -
- - AnnotatedFieldConfigurator - - Test |getAnnotated()| returns the original `AnnotatedField` with which this configurator was initialized. - - - - Test |add()| adds an annotation to the configured element. - - - - Test |remove()| method removes annotations that match the specified predicate from the configured element. - - - - Test |removeAll()| removes all annotations from the configured element. - - - -
- -
- - During the application initialization process, the container fires a series of events, allowing portable extensions to integrate with the - container initialization process defined in Section 12.2, "Application initialization lifecycle". - - Generic statement - - - - Observer methods of these events must belong to extensions. An extension is a service provider of the service - |jakarta.enterprise.inject.spi.Extension| declared in |META-INF/services|. - - - - - Service providers may have observer methods, which may observer any event, including any container lifecycle event, and obtain an injected - |BeanManager| reference. - - - - - An extension may use |BeanManager.fireEvent()| to deliver events to observer methods defined on extensions. - - - - The container is not required to deliver events fired during application initialization to observer methods defined on beans. - Non-portable behavior - - - - Any decorators associated with BeanManager will not be applied. - - - - The container instantiates a single instance of each extension at the beginning of the application initialization process and maintains a - reference to it until the application shuts down. The container delivers event notifications to this instance by calling its observer methods. - - - - - - If an extension declares a static observer method whose event parameter type is a container lifecycle event, or is |java.lang.Object| and the - event parameter has either no qualifiers or a single qualifier |@Any|, non-portable behavior results. - - - - - The notification order for observer methods within extensions follows the same ordering rule as defined in Observer ordering for non-extension - observers. The priority of an observer method may be declared using the @Priority annotation. - - - - - For each service provider, the container must provide a bean of scope |@ApplicationScoped| and qualifier |@Default|, supporting injection of a - reference to the service provider instance. The bean types of this bean include the class of the service provider and all superclases and - interfaces. - - - - - As these lifecycle events are fired, the container must also execute build compatible extensions. Which phase - of build compatible extensions should be executed when is indicated in the description of the corresponding - lifecycle events. Build compatible extensions annotated @SkipIfPortableExtensionPresent must be ignored in - CDI Full, if given portable extension is present. - - -
- -
- - The container must fire an event before it begins the bean discovery process. The event object must be of type - |jakarta.enterprise.inject.spi.BeforeBeanDiscovery|. - - - - - |addQualifier()| declares an annotation type as a qualifier type. - - Test |Class| method parameter. - - - Test |AnnotatedType| method parameter. - - - - - |addScope()| declares an annotation type as a scope type. - - - - - - |addInterceptorBinding()| declares an annotation type as an interceptor binding type, and specifies its meta-annotations. - - Test |Class| method parameter. - - - Test |AnnotatedType| method parameter. - - - - - |addAnnotatedType()| adds a given |AnnotatedType| to the set of types which will be scanned during bean discovery, with an optional - identifier. - - - Test the |addAnnotatedType()| method. - - - Test that more than one |AnnotatedType| may use the same base type. - - - Test adding |AnnotatedType| if any other |AnnotatedType| with the same identifier already exists in the set of types. - - - - - Test |AnnotatedTypeConfigurator<?> addAnnotatedType(String id)| returns a new AnnotatedTypeConfigurator as defined in - AnnotatedTypeConfigurator interface to easily configure the AnnotatedType which will be added at the end of the observer invocation. - The returned AnnotatedTypeConfigurator is initialized with type and annotations of the provided class. - - - - - |configureQualifier()| returns a new |AnnotatedTypeConfigurator| as defined in - AnnotatedTypeConfigurator SPI to configure a new |AnnotatedType| and declares it as a qualifier type. - - - - - |configureInterceptorBinding()| returns a new |AnnotatedTypeConfigurator| as defined in - |AnnotatedTypeConfigurator| SPI to configure a new |AnnotatedType| and declares it as an interceptor - binding. - - - - - If any observer method of the |BeforeBeanDiscovery| event throws an exception, the exception is treated as a definition error by the - container. - - - - If any BeforeBeanDiscovery method is called outside of the observer method invocation, an IllegalStateException is thrown. - - -
- -
- - The container must fire an event when it has fully completed the type discovery process and before it begins the bean discovery process. The - event object must be of type |jakarta.enterprise.inject.spi.AfterTypeDiscovery|. - - - - - |getAlternatives()| returns list of enabled alternatives for the application, sorted by priority in ascending order. Alternatives enabled for - a bean archive are not included. - - - - - |getInterceptors()| returns the list of enabled interceptors for the application, sorted by priority in ascending order. Interceptors enabled - for a bean archive are not included. - - - - - |getDecorators()| returns list of enabled decorators for the application, sorted by priority in ascending order. Decorators enabled for a bean - archive are not included. - - - - - |addAnnotatedType()| adds a given AnnotatedType to the set of types which will be scanned during bean discovery, with an identifier. - - - - Test |AnnotatedTypeConfigurator<?> addAnnotatedType(String id)| returns a new AnnotatedTypeConfigurator as defined in - AnnotatedTypeConfigurator interface to easily configure the AnnotatedType which will be added at the end of observer invocation. - The returned AnnotatedTypeConfigurator is initialized with type and annotations of the provided class. - - - - - If an alternative, interceptor or decorator is added using |AfterTypeDiscovery.addAnnotatedType()|, non-portable behavior results. - Non-portable behavior - - - - Any observer of this event is permitted to add classes to, or remove classes from, the list of alternatives, list of interceptors or list of - decorators. The container must use the final values of these collections, after all observers of |AfterTypeDiscovery| have been called, to - determine the order of the enabled alternatives, interceptors, and decorators for application. - - - Test the final values of the list of alternatives. - - - Test the final values of the list of interceptors. - - - Test the final values of the list of decorators. - - - - - The initial values of these collections is defined by the |@Priority| annotation. - - Test the initial values of the list of alternatives. - - - Test the initial values of the list of interceptors. - - - Test the initial values of the list of decorators. - - - - - If any observer method of an |AfterTypeDiscovery| event throws an exception, the exception is treated as a definition error by the - container. - - - - - If any AfterTypeDiscovery method is called outside of the observer method invocation, an IllegalStateException is thrown. - -
- -
- - The container must fire an event when it has fully completed the bean discovery process, validated that there are no definition errors - relating to the discovered beans, and registered |Bean| and |ObserverMethod| objects for the discovered beans, but before detecting deployment - problems. The event object must be of type |jakarta.enterprise.inject.spi.AfterBeanDiscovery|. - - - - - |addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after all observers have - been notified. - - - - - |addBean()| fires an event of type |ProcessSyntheticBean| containing the given |Bean| and then registers the |Bean| with the container, - thereby making - it available for injection into other beans. The given |Bean| may implement |Interceptor| or |Decorator|. - - - - Check that |ProcessSyntheticBean| is fired - - - - Check that a bean is registered - - - - Check that a decorator is registered - - - - Check that an interceptor is registered - - - - - Test |BeanConfigurator<?> addBean()| returns a new BeanConfigurator as defined in BeanConfigurator interface to easily configure the - Bean which will be added at the end of observer invocation. - - - - - |addObserverMethod()| fires an event of type |ProcessSyntheticObserverMethod| containing the given |ObserverMethod| and then registers the - |ObserverMethod| with the container, thereby making it available for event notifications. - - - Check that the |ProcessSynthethicObserverMethod| is fired - - - Check that the observer method is registered - - - - - If the given ObserverMethod does not override either |ObserverMethod.notify(T)| or - |ObserverMethod.notify(EventContext<T>)|, the container automatically detects the problem and treats it as a definition error. - - - - - Test |ObserverMethodConfigurator<?> addObserverMethod()| returns a new ObserverMethodConfigurator as defined in - ObserverMethodConfigurator interface to easily configure the ObserverMethod which will be added at the end of observer invocation. - - - - - If the container is unable to process the |ObserverMethodConfigurator| it - automatically detects the problem and treats it as a deployment problem. - - - - - |addContext()| registers a custom |Context| object with the container. - Right now only the registration process is tested - - - - If any observer method of the |AfterBeanDiscovery| event throws an exception, the exception is treated as a definition error by the - container. - - - - - |getAnnotatedType()| returns the |AnnotatedType| discovered or added during container initialization. If the |id| passed is null, the - container should substitute the container generated id. - - - - - |getAnnotatedTypes()| returns the |AnnotatedType|s discovered or added during container initialization. - - - - A portable extension may take advantage of this event to register beans, interceptors, decorators, observer methods and custom context objects - with the container. - - See d*, e* and f - - - - If any AfterBeanDiscovery method is called outside of the observer method invocation, an IllegalStateException is thrown. - - -
- -
- - With BeanConfigurator you can perform all the operations defined in BeanAttributesConfigurator interface plus the following: - - Initialize the bean metadata with one of its |read()| methods. It can be done from an existing - |BeanAttributes| or by reading metadata on a given |AnnotatedType|, according to the rules defined in - Concepts. - - - - Set the class of the bean with |beanClass| method. - - - Add an injection point for the bean with |addInjectionPoint| method. - - - Add multiple injection points for the bean with |addInjectionPoints| methods. - - - Replace all injection points for the bean with |injectionPoints| methods. - - - Make the bean implements `PassivationCapable` and set its id with |id| method. - - - Set a callback to create a bean instance with createWith() or produceWith() method. - - - Set a callback to destroy a bean instance with destroyWith() or disposeWith() method. - - - Set the priority of the bean, if it is an alternative, with priority() method. - - - - If a |BeanConfigurator| has no scope specified, the default scope rules, defined in the Default Scope rules apply. - -
- -
- - `ObserverMethodConfigurator` must be initialized from a `java.lang.reflect.Method`, `AnnotatedMethod` or an existing `ObserverMethod` with one - of its `read()` methods. - - - Test initialization of `ObserverMethodConfigurator` from a `java.lang.reflect.Method`. - - - Test initialization of `ObserverMethodConfigurator` from a `AnnotatedMethod`. - - - Test initialization of `ObserverMethodConfigurator` from an existing `ObserverMethod`. - - - - - With ObserverMethodConfigurator you can perform the following operations: - - Set the `ObserverMethod` bean class with |beanClass| method. - - - If the class of the bean is not set, the extension class is used. - Defined in javadoc of |beanClass| method - - - Set the type of the observed event with |observedType| method. - - - Add a qualifier with |addQualifier| method. - - - Set or add multiple qualifiers with |addQualifiers| and |qualifiers| methods. - - - Set the `Reception` type with |reception| method. - - - Set the `TransactionPhase` type with |transactionPhase| method. - - - Set the priority with |priority| method. - - - Define the `Consumer` to call on notification with |notifyWith| method. - - - Make the observer asynchronous with |async| method. - - - -
- -
- - The container must fire an event after it has validated that there are no deployment problems and before creating contexts or processing - requests. The event object must be of type |jakarta.enterprise.inject.spi.AfterDeploymentValidation|. - - - - - |addDeploymentProblem()| registers a deployment problem with the container, causing the container to abort deployment after all observers have - been notified. - - - - - If any observer method of the |AfterDeploymentValidation| event throws an exception, the exception is treated as a deployment problem by the - container. - - - - - The container must not allow any request to be processed by the deployment until all observers of this event return. - - - - If any AfterDeploymentValidation method is called outside of the observer method invocation,an IllegalStateException is thrown. - -
- -
- - The container must fire a final event after it has finished processing requests and destroyed all contexts. The event object must be of type - |jakarta.enterprise.inject.spi.BeforeShutdown|. - - - - - If any observer method of the |BeforeShutdown| event throws an exception, the exception is ignored by the container. - This is not testable in a portable way - the only way would be to check successful undeploy. - -
- -
- - - The container must fire an event, before it processes a type, for every Java class, interface (excluding the special kind of interface - declaration annotation type) or enum discovered. - - - Test class discovered in a bean archive. - - - Test interface discovered in a bean archive. - - - Test enum discovered in a bean archive. - - - Test class added by |BeforeBeanDiscovery.addAnnotatedType()|. - - - Test interface added by |BeforeBeanDiscovery.addAnnotatedType()|. - - - Test enum added by |BeforeBeanDiscovery.addAnnotatedType()|. - - - Excluding the special kind of interface declaration annotation type. - - - - - An event is not fired for any type annotated with |@Vetoed|, or in a package annotated with |@Vetoed|. - - Test |@Vetoed| class discovered in a bean archive. - - - Test |@Vetoed| interface discovered in a bean archive. - - - Test |@Vetoed| class added by |BeforeBeanDiscovery.addAnnotatedType()|. - - - Test |@Vetoed| interface added by |BeforeBeanDiscovery.addAnnotatedType()|. - - - Test |@Vetoed| package. - - - - - The event object must be of type |jakarta.enterprise.inject.spi.ProcessAnnotatedType<X>|, where X is the class, for types discovered in a - bean archive, or of type |jakarta.enterprise.inject.spi.ProcessSyntheticAnnotatedType<X>| for types added by - |BeforeBeanDiscovery.addAnnotatedType()|. - - - - - The annotation |@WithAnnotations| may be applied to the event parameter. If the annotation is applied, the container must only deliver - |ProcessAnnotatedType| events for types which contain at least one of the annotations specified. The annotation can appear on the annotated - type, or on any member, or any parameter of any member of the annotated type, as defined in Section 11.4. - - - Test annotation on the annotated type. - - - Test annotation on the field declared by the annotated type. - - - Test annotation on the method declared by the annotated type. - - - Test annotation on the constructor declared by the annotated type. - - - Test annotation on the parameter of the method declared by the annotated type. - - - Test annotation on the parameter of the constructor declared by the annotated type. - - - - - The annotation may be applied as a meta-annotation on any annotation considered. - - - - If the |@WithAnnotations| annotation is applied to any other event parameter, the container automatically detects the problem and treats it as - a definition error. - - - - - |getAnnotatedType()| returns the |AnnotatedType| object that will be used by the container to read the declared annotations. - - - - |setAnnotatedType()| replaces the |AnnotatedType|. - - - - |configureAnnotatedType()| returns an |AnnotatedTypeConfigurator| (as defined in AnnotatedTypeConfigurator interface) initialized with the - |AnnotatedType| processed by the event to easily configure the AnnotatedType which will be used to replace the original one at the end of - observer invocation. - - - - - |configureAnnotatedType()| method always returns the same |AnnotatedTypeConfigurator|. - - - - - |veto()| forces the container to ignore the type. - - - - |getSource()| returns the |Extension| instance that added the annotated type. - - - - Any observer of this event is permitted to wrap and/or replace the |AnnotatedType|. The container must use the final value of this property, - after all observers have been called, as the only source of types and annotations for the the program elements. - - - Test replacing |AnnotatedType| added by |BeforeBeanDiscovery.addAnnotatedType()|. - - - - - Any observer of this event is permitted to wrap and/or replace the |AnnotatedType| by calling either |setAnnotatedType()| or - |configureAnnotatedType()|. - If both methods are called within an observer notification an |IllegalStateException| is thrown. - - - - - If any observer method of a |ProcessAnnotatedType| event throws an exception, the exception is treated as a definition error by the - container. - - - - - If any ProcessAnnotatedType method is called outside of the observer method invocation, an IllegalStateException is thrown. - -
- -
- - - The container must fire an event for every injection point of every bean, interceptor and decorator. The event object must be of type - |jakarta.enterprise.inject.spi.ProcessInjectionPoint<T, X>| where |T| is the bean class and |X| is the declared type of the injection point. - - - - - |getInjectionPoint()| returns the |InjectionPoint| object that will be used by the container to perform injection. - - - - |setInjectionPoint()| replaces the |InjectionPoint|. - - - - |configureInjectionPoint()| returns an |InjectionPointConfigurator| (as defined in InjectionPointConfigurator interface) initialized with the - |InjectionPoint| processed by the event to easily configure the InjectionPoint which will be used to replace the original one at the end of - observer invocation. - - - - - |configureInjectionPoint()| method always returns the same |InjectionPointConfigurator|. - - - - |addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is - complete. - - - - - Any observer of this event is permitted to wrap and/or replace the |InjectionPoint|. The container must use the final value of this property, - after all observers have been called, whenever it performs injection upon the injection point. - - - - - Any observer of this event is permitted to wrap and/or replace the |AnnotatedType| by calling either |setAnnotatedType()| or - |configureAnnotatedType()|. - If both methods are called within an observer notification an |IllegalStateException| is thrown. - - - - - If any observer method of a |ProcessInjectionPoint| event throws an exception, the exception is treated as a definition error by the - container. - - - - - If any |ProcessInjectionPoint| method is called outside of the observer method invocation, an |IllegalStateException| is thrown. - - -
- -
- - With |InjectionPointConfigurator| you can perform the following operation: - - Set the type of `InjectionPoint` with |type| method. - - - Add a qualifier with |addQualifier| method. - - - Set or add multiple qualifiers with |addQualifiers| and |qualifiers| methods. - - - Make the injection point delegate with |delegate| method. - - - Make the injection point a transient field with |transientField| method. - - - -
- -
- - The container must fire an event for every bean, interceptor or decorator. The event object must be of type - |jakarta.enterprise.inject.spi.ProcessInjectionTarget<X>|, where |x| is the managed bean class. - - - Test event is fired for a managed bean - - - - - |getAnnotatedType()| returns the |AnnotatedType| representing the managed bean class. - - Test type for a managed bean - - - - - |getInjectionTarget()| returns the |InjectionTarget| object that will be used by the container to perform injection. - - - - |setInjectionTarget()| replaces the |InjectionTarget|. - - - - |addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is - complete. - - - - - Any observer of this event is permitted to wrap and/or replace the |InjectionTarget|. The container must use the final value of this property, - after all observers have been called, whenever it performs injection upon the managed bean. - - - Test type for a managed bean - - - - - If any observer method of a |ProcessInjectionTarget| event throws an exception, the exception is treated as a definition error by the - container. - - - - - If any ProcessInjectionTarget method is called outside of the observer method invocation, an IllegalStateException is thrown. - -
- -
- - - The container must fire an event for each enabled bean, interceptor or decorator deployed in a bean archive, before registering the |Bean| - object. No event is fired for any |@New| qualified bean, defined in Section 3.14, "@New qualified beans" or beans added programmatically using - |AfterBeanDiscovery.addBean()| or for any built-in beans. The event object must be of type |jakarta.enterprise.inject.spi.ProcessBeanAttributes<T>| - where |T| is the bean class of the bean, the return type of the producer method, or the type of the producer field. - - - Event is fired for enabled bean. - - - Event is fired for enabled interceptor. - - - Event is fired for enabled decorator. - - - - No event is fired for beans added programmatically using |AfterBeanDiscovery.addBean()|. - - - No event is fired for any built-in bean. - - - - - |getAnnotated()| returns the |AnnotatedType| representing the bean class, the |AnnotatedMethod| representing the producer field, or the - |AnnotatedField| representing the producer field. - - - Test managed bean. - - - Test producer method. - - - Test producer field. - - - - - |getBeanAttributes()| returns the |BeanAttributes| object that will be used by the container to manage instances of the bean. - - - - |setBeanAttributes()| replaces the |BeanAttributes|. - - - - |configureBeanAttributes()| returns a |BeanAttributesConfigurator| (as defined in BeanAttributesConfigurator interface) initialized with the - |BeanAttributes| processed by the event to easily configure the |BeanAttributes| which will be used to replace the original one at the end of - observer invocation. - - - - - |configureBeanAttributes()| method always returns the same |BeanAttributesConfigurator| - - - - |addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is - complete. - - - - - |veto()| forces the container to ignore the bean. - - - - |ignoreFinalMethods()| method instructs the container to ignore all non-static, final methods with public, - protected or default visibility declared on any bean type of the specific bean during validation of - injection points that require proxyable bean type. These method should never be invoked upon - bean instances. Otherwise, unpredictable behavior results. It will bypass standard rules defined in - Unproxyable bean types. - - - - - Any observer of this event is permitted to wrap and/or replace the |BeanAttributes|. The container must use the final value of this property, - after all observers have been called, to manage instances of the bean. Changes to BeanAttributes are not propagated to the annotated type from - which the bean definition was created. - - - Test the final value of this property is used. - - - Test the changes are not propagated. - - - - - If any observer method of a |ProcessBeanAttributes| event throws an exception, the exception is treated as a definition error by the - container. - - - - - Any observer of this event is permitted to wrap and/or replace the |AnnotatedType| by calling either |setAnnotatedType()| or - |configureAnnotatedType()|. - If both methods are called within an observer notification an |IllegalStateException| is thrown. - - - - - Any bean which has its bean attributes altered must have it’s definition validated during deployment validation. - - - - If any ProcessBeanAttributes method is called outside of the observer method invocation, an IllegalStateException is thrown. - -
- -
- - |BeanAttributesConfigurator| is obtainable during |ProcessBeanAttributes| event and is therefore - automatically initialized from existing |BeanAttributes|. - - - - - With `BeanAttributesConfigurator` you can perform the following operation: - - Add type with |addType| or |addTransitiveTypeClosure| methods. - - - Set multiple types with |types| methods. - - - Set scope with |scope| method. - - - Add a qualifier with |addQualifier| method. - - - Set or add multiple qualifiers with |addQualifiers| and |qualifiers| methods. - - - Add a stereotype with |addStereotype| method. - - - Set or add multiple stereotypes with |addStereotypes| and |stereotypes| methods. - - - Set the bean name |name| method. - - - Make the bean an alternative with |alternative| methods. - - - -
- -
- - The container must fire an event for each bean, interceptor or decorator deployed in a bean archive, after firing the |ProcessBeanAttributes| - for the bean and before registering the |Bean| object. No event is fired for any |@New| qualified bean, defined in Section 3.12, "@New qualified - beans". - - - - - For a managed bean with bean class |X|, the container must raise an event of type |ProcessManagedBean<X>|. - - - - Test |ProcessManagedBean| is fired after |ProcessBeanAttributes|. - - - - For a producer method with method return type |X| of a bean with bean class |T|, the container must raise an event of type - |ProcessProducerMethod<T, X>|. - - - - - Test |ProcessProducerMethod| is fired after |ProcessBeanAttributes|. - - - - For a producer field with field type |X| of a bean with bean class |T|, the container must raise an event of type |ProcessProducerField<T, - X>|. - - - - - Test |ProcessProducerField| is fired after |ProcessBeanAttributes|. - - - - For a custom implementation of |Bean|, the container must raise an event of type |ProcessSyntheticBean <X>|. - - - - Resources are considered to be producer fields. - - - - The interface |jakarta.enterprise.inject.spi.ProcessBean| is a supertype of all these event types. - - Test |ProcessManagedBean| - - - Test |ProcessProducerMethod| - - - Test |ProcessProducerField| - - - - - |getAnnotated()| returns the |AnnotatedType| representing the bean class, the |AnnotatedMethod| representing the producer method, or the - |AnnotatedField| representing the producer field. If invoked upon a |ProcessSyntheticBean| event, non-portable behavior results and the returned - value - should be ignored. - - - Test |ProcessManagedBean| - - - Test |ProcessProducerMethod| - - - Test |ProcessProducerField| - - - - - |getBean()| returns the |Bean| object that is about to be registered. The |Bean| may implement |Interceptor| or |Decorator|. - - Test |ProcessManagedBean| - - - Test |ProcessProducerMethod| - - - Test |ProcessProducerField| - - - - - |addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is - complete. - - - - - If any observer method of a |ProcessBean| event throws an exception, the exception is treated as a definition error by the container. - - - - Check the |getAnnotatedProducerMethod()| - - - - Check the |getAnnotatedDisposesParameter()| - - - - Check the |getAnnotatedBeanClass()| - - Check for managed bean - - - - - Check the |getAnnotatedProducerField()| - - - - If any ProcessBean method is called outside of the observer method invocation, an IllegalStateException is thrown. - - -
- -
- - The container must fire an event for each producer method or field of each enabled bean, including resources. - - Test producer method - - - Test producer field - - - Test resource producer field - - - - - The event object must be of type |jakarta.enterprise.inject.spi.ProcessProducer<T, X>|, where |T| is the bean class of the bean that - declares the producer method or field and |X| is the return type of the producer method or the type of the producer field. - - - Test producer method - - - Test producer field - - - - - |getAnnotatedMember()| returns the |AnnotatedField| representing the producer field or the |AnnotatedMethod| representing the producer - method. - - - Test producer method - - - Test producer field - - - - - |getProducer()| returns the |Producer| object that will be used by the container to call the producer method or read the producer field. - - - Test producer method - - - Test producer field - - - - - |setProducer()| replaces the |Producer|. - - - - |configureProducer()| returns a |ProducerConfigurator| (as defined in ProducerConfigurator interface) - initialized with the |Producer| processed by this event to configure the |Producer| that will replace the - original one at the end of the observer invocation. Each call returns the same configurator instance - within an observer notification - - - - - |addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is - complete. - - - - - Any observer of this event is permitted to wrap and/or replace the |Producer| by calling either - |setProducer()| or |configureProducer()|. If both methods are called within an observer notification an - IllegalStateException is thrown. The container must use the final value of this property, after - all observers have been called, whenever it calls the producer or disposer. - - - Test producer method - - - Test producer field - - - If both methods |setProducer()| and |configureProducer()| are called within an observer notification an - IllegalStateException is thrown. - - - - - - If any observer method of a |ProcessProducer| event throws an exception, the exception is treated as a definition error by the container. - - - - - If any ProcessProducer method is called outside of the observer method invocation, an IllegalStateException is thrown. - -
- -
- - With |ProducerConfigurator| you can perform the following operations: - - Set a callback to produce a new instance with |produceWith()| method. - - - Set a callback to destroy the produced instance with |disposeWith()| method. - - - -
- -
- - The container must fire an event for each observer method of each enabled bean, before registering the |ObserverMethod| object. The event - object must be of type |jakarta.enterprise.inject.spi.ProcessObserverMethod<T, X>| where |T| is the bean class of the bean that declares the - observer method and |X| is the observed event type of the observer method. - - - - - - For a custom implementation of jakarta.enterprise.inject.spi.ObserverMethod, the container must raise an event of type - |jakarta.enterprise.inject.spi.ProcessSyntheticObserverMethod<T, X>|, where |T| is the observed - event type of the observer method and |X| is the return value of |ObserverMethod.getBeanClass()|. - - - - - |getAnnotatedMethod()| returns the |AnnotatedMethod| representing the observer method. If invoked - upon a |ProcessSyntheticObserverMethod| event, non-portable behavior results and the returned - value should be ignored. - - - - - |getObserverMethod()| returns the |ObserverMethod| object that will be used by the container to call the observer method. - - - - |addDefinitionError()| registers a definition error with the container, causing the container to abort deployment after bean discovery is - complete. - - - - - |setObserverMethod()| replaces the ObserverMethod. - - - - |configureObserverMethod()| returns an |ObserverMethodConfigurator| (as defined in - ObserverMethodConfigurator interface) initialized with the ObserverMethod processed by the event to easily configure the |ObserverMethod| which - will be used to replace the original one at the end of observer invocation. - - - - - |configureObserverMethod()| method always returns the same |ObserverMethodConfigurator| - - - - |veto()| forces the container to ignore the ObserverMethod. - - - - |getSource()| returns the |Extension| instance that added the observer method. - - - - Any observer of this event is permitted to wrap and/or replace the |AnnotatedType| by calling either |setAnnotatedType()| or - |configureAnnotatedType()|. - If both methods are called within an observer notification an |IllegalStateException| is thrown. - - - - - If any observer method of a |ProcessObserverMethod| event throws an exception, the exception is treated as a definition error by the - container. - - - - - If any |ProcessObserverMethod| method is called outside of the observer method invocation, an |IllegalStateException| is thrown. - -
- -
- - - CDI 2.0 introduced the following Configurators interface: - - |AnnotatedTypeConfigurator| for |AnnotatedType| configuration. - Tested in related lifecycle event. - - - |InjectionPointConfigurator| for |InjectionPoint| configuration - Tested in related lifecycle event. - - - |BeanAttributesConfigurator| for |BeanAttributes| configuration - Tested in related lifecycle event. - - - - |ObserverMethodConfigurator| for |ObserverMethod| configuration. - Tested in related lifecycle event. - - - |ProducerConfigurator| interface for |Producer| configuration - - - The container must provide implementation for all these configurators and make them available in matching container lifecycle events as - defined in `Container lifecycle events`. - - - - -
- -
- - - Method |ignoreFinalMethods()| instructs the container to ignore all non-static, final methods with public, - protected or default visibility declared by any class in the type hierarchy of the intercepted - instance during invocation of createInterceptedInstance() method. Ignored methods should never - be invoked upon the wrapper instance. Otherwise, unpredictable behavior results. - - - - - Method configure() returns an |AnnotatedTypeConfigurator| (as defined in AnnotatedTypeConfigurator SPI) initialized with the |AnnotatedType| - created either for the class passed to |BeanManager.createInterceptionFactory(CreationalContext, Class)| or derived from the InterceptionFactory - parameter injection point. The method always return the same AnnotatedTypeConfigurator - - - - Method |createInterceptedInstance()| - - - returns a wrapper instance whose method invocations are intercepted by method interceptors and forwarded to a provided instance. - - - - - can be only called once, subsequent calls will throw an |IllegalStateException|. - - - - - If it is called at the type of the instance which is not proxyable as defined in `Unproxyable - bean types` an |UnproxyableResolutionException| exception is thrown. - - - - - If the provided instance is an internal container construct (such as client proxy), non-portable behavior results. - - - - - - - An |InterceptionFactory| can be obtain be calling |BeanManager.createInterceptionFactory| as defined in `Obtain an InterceptionFactory` - - - - - The container must provide a bean with scope `@Dependent`, bean type |InterceptionFactory| and qualifier `@Default`. - - - - - If an injection point of type |InterceptionFactory| and qualifier |@Default| exists and is not a parameter of - a producer method, the container automatically detects the problem and treats it as a definition error. - - -
- -
- - When an application is started, the container must perform bean discovery, detect definition errors and deployment problems and raise events - that allow portable extensions to integrate with the deployment lifecycle. - - - - - Bean discovery is the process of determining: - - The bean archives that exist in the application, and the beans they contain - - - Which alternatives, interceptors and decorators are enabled for each bean archive - - - The ordering of enabled interceptors and decorators - - - - - Additional beans may be registered programmatically with the container by the application or a portable extension after the automatic bean - discovery completes. Portable extensions may even integrate with the process of building the |Bean| object for a bean, to enhance the - container’s - built-in functionality. - - - -
- -
- - Bean classes of enabled beans must be deployed in bean archives. - - - - An archive which contains a |beans.xml| file with the |bean-discovery-mode| of |none| is not a bean archive. - - - - An archive which contains an extension and no |beans.xml| file is not a bean archive. - - - - An explicit bean archive is an archive which contains a |beans.xml| file with a version number of 1.1 (or later), with the - |bean-discovery-mode| of |all|, or with no version number, or that is an empty file. - - - Test an archive which contains a |beans.xml| file with a version number of 1.1 (or later), with the |bean-discovery-mode| of |all|. - - - Test an archive which contains a |beans.xml| file with no version number. - - - Test an archive which contains an empty |beans.xml|. - - - - - An implicit bean archive is any other archive which contains one or more bean classes with a bean defining annotation as defined in Section - 2.5.1, “Bean defining annotations”. - - - - - When determining which archives are bean archives, the container must consider: - - Library jars - Covered elsewhere in this section. - - - Directories in the JVM classpath. - Covered elsewhere in this section - - - - - The |beans.xml| file must be named: - - |META-INF/beans.xml| - Covered elsewhere in this section. - - - - - If |beans.xml| file with version 1.1 is used, the |bean-discovery-mode| attribute is required. - As defined in beans_1_1.xsd. - - - - For compatibility with Contexts and Dependency 1.0, products must contain an option to cause an archive to be ignored by the container when no - |beans.xml| is present. - - Implementation specific. - - - - If a bean class is deployed in two different bean archives, non-portable behaviour results. Portable applications must deploy each bean class - in no more than one bean archive. - - Describes undefined behavior - - - - Explicit bean archives may contain classes which are not deployed as beans. For example a bean archive might contain an abstract class not - annotated with @Decorator. - - - - - Implicit bean archives are likely to contain classes which are not deployed as beans. - - - - An extension may be deployed in any archive, including those that are not bean archives. - - -
- -
- - When an application is started, the container performs the following steps. - Description - - - - First, the container must search for service providers for the service |jakarta.enterprise.inject.spi.Extension| defined in Section 11.5, - "Container lifecycle events", instantiate a single instance of each service provider, and search the service provider class for observer methods - of initialization events. - - - - - Next, the container must fire an event of type |BeforeBeanDiscovery|, as defined in Section 11.5.1, "BeforeBeanDiscovery event". - - - - Next, the container must perform type discovery, as defined in Section 12.4.1, “Type discovery” - - - - Next, the container must fire an event of type |AfterTypeDiscovery|, as defined in Section 11.5.2., "AfterTypeDiscovery event". - - - - Next, the container must perform bean discovery, as defined in Section 12.4.3, “Bean discovery” - - - - Next, the container must fire an event of type |AfterBeanDiscovery|, as defined in Section 11.5.2, "AfterBeanDiscovery event", and abort - initialization of the application if any observer registers a definition error. - - - - - Next, the container must detect deployment problems by validating bean dependencies and specialization and abort initialization of the - application if any deployment problems exist, as defined in Section 2.9, "Problems detected automatically by the container". - - - - - Next, the container must fire an event of type |AfterDeploymentValidation|, as defined in Section 11.5.3, "AfterDeploymentValidation event", - and abort initialization of the application if any observer registers a deployment problem. - - - - - Finally, the container begins directing requests to the application. - Can only check the inverse, that requests aren't directed to the application before - -
- -
- - When an application is stopped, the container performs the following steps: - - First, the container must destroy all contexts. - - - Finally, the container must fire an event of type |BeforeShutdown|, as defined in Section 11.5.4, "BeforeShutdown event". - - - -
- -
- - The container automatically discovers managed beans (according to the rules of Section 3.1.1, "Which Java classes are managed beans?") in bean - archives and searches the bean classes for producer methods, producer fields, disposer methods and observer methods. - - Statement of intent - -
- -
- - First the container must discover types. The container discovers: - - The container discovers each Java class, interface or enum deployed in an explicit bean archive. - - - - The container discovers each Java class with a bean defining annotation in an implicit bean archive. - - - - - For every type discovered the container must create an |AnnotatedType| representing the type and fire an event of type |ProcessAnnotatedType|, - as defined in Section 11.5.6. - - - Check managed bean - - - - - If an extension calls |BeforeBeanDiscovery.addAnnotatedType()| or |AfterTypeDiscovery.addAnnotatedType()|, the type passed must be added to - the set of discovered types. - - - -
- -
- - Exclude filters are defined by <exclude> elements in the |beans.xml| for the bean archive as children of the <scan> element. - - - By default an exclude filter is active. - - - An exclude filter is not active if the definition contains a child element named <if-class-available> with a name attribute, and the - classloader for the bean archive can load a class for that name. - - - - An exclude filter is not active if the definition contains a child element named <if-class-not-available> with a name attribute, and - the classloader for the bean archive cannot load a class for that name. - - - - An exclude filter is not active if the definition contains a child element named <if-system-property> with a name attribute, and - there is no system property defined for that name. - - - - An exclude filter is not active if the definition contains a child element named <if-system-property> with a name attribute and a - value attribute, and there is no system property defined for that name with that value. - - - - - - The type is excluded from discovery if the fully qualified name of the type being discovered matches the value of the name attribute of the - exclude filter. - - - - - The type is excluded from discovery if the package name of the type being discovered matches the value of the name attribute with a suffix - ".*" of the exclude filter. - - - - - The type is excluded from discovery if the package name of the type being discovered starts with the value of the name attribute with a suffix - ".**" of the exclude filter. - - -
- -
- - - If an explicit bean archive contains the <trim/> element in its beans.xml file, types that don’t have - either a bean defining annotation (as defined in Bean defining annotations) or any scope annotation, - are removed from the set of discovered types. - - -
- -
- - For every type in the set of discovered types (as defined in Type discovery), the container must: - - - Inspect the type metadata to determine if it is a bean. - No consequence - - - - detect definition errors by validating the class and its metadata. - Tested elsewhere - - - - if the class is a managed bean, fire an event of type ProcessInjectionPoint for each injection point in the class, as defined in - ProcessInjectionPoint event. - - - - - if the class is a managed bean, fire an event of type ProcessInjectionTarget, as defined in ProcessInjectionTarget event. - - - - determine which alternatives, interceptors and decorators are enabled, according to the rules defined in Enabled and disabled beans, - Interceptor enablement and ordering and Decorator enablement and ordering. - - - - - if the class is an enabled bean, interceptor or decorator, fire an event of type ProcessBeanAttributes, as defined in - ProcessBeanAttributes event. - - - - - if the class is an enabled bean, interceptor or decorator and if ProcessBeanAttributes.veto() wasn’t called in previous step, fire an - event which is a subtype of ProcessBean, as defined in ProcessBean event. - - - - - - For each enabled bean, the container must search the class for producer methods and fields, as defined in Producer methods and in Producer - fields, including resources, and for each producer: - - - if it is a producer method, fire an event of type ProcessInjectionPoint for each injection point in the method parameters, as defined in - ProcessInjectionPoint event - - - - fire an event of type ProcessProducer, as defined in ProcessProducer event. - - - if the producer method or field is enabled, fire an event of type ProcessBeanAttributes, as defined in ProcessBeanAttributes event - - - if the producer method or field is enabled and if ProcessBeanAttributes.veto() wasn’t called in previous step, fire an event which is a - subtype of ProcessBean, as defined in ProcessBean event. - - - - - - For each enabled bean, the container must search for disposer methods as defined in Disposer methods, and for each disposer method fire an - event of type ProcessInjectionPoint for each injection point in the method parameters, as defined in ProcessInjectionPoint event. - - - - - For each enabled bean, the container must search the class for observer methods, and for each observer method: - - fire an event of type ProcessInjectionPoint for each injection point in the method parameters, as defined in ProcessInjectionPoint event - - - - fire an event of type ProcessObserverMethod, as defined in ProcessObserverMethod event. - - - - - For each enabled bean that is not an interceptor or decorator, the container registers an instance of the |Bean| interface defined in Section - 11.1, "The Bean interface". - - Checked above - - - - For each enabled interceptor, the container registers an instance of the |Interceptor| interface as defined in Section 11.1.2, "The - Interceptor interface". - - Checked above - - - - For each enabled decorator, the container registers an instance of the |Decorator| interface defined in Section 11.1.1, "The Decorator - interface". - - Checked above - - - - For each observer method of every enabled bean, the container registers an instance of the |ObserverMethod| interface defined in Section - 11.1.3, "The ObserverMethod interface". - - -
- - -
- - In Java SE, the CDI container must be explicitly bootstrapped by the application. This is performed with `SeContainerInitializer` abstract - class and its static method `newInstance()`. - - - - - `SeContainerInitializer` is a service provider of the service jakarta.enterprise.inject.se.SeContainerInitializer declared in META-INF/services. - It allows the configuration of the CDI container before its bootstrapping. - - - - - The `SeContainerInitializer.initialize()` method bootstraps the container and returns a `SeContainer` instance. - - - Unless specified differently each method of `SeContainerInitializer` returns the current `SeContainerInitializer` object. - - |newInstance()| static method returns an instance of the implementation of `SeContainerInitializer` discovered by java service-provider. - Each call returns a new instance of `SeContainerInitializer`. - - - - |addBeanClasses()| add classes to the the synthetic bean archive - - - |addPackages()| add packages content to the synthetic bean archive. Versions exist by providing classes in the wished package or Package - objects themselves. Other version of the method allows recursive addition - - - - |addExtensions()| add the provided extensions (class or instance) to the synthetic bean archive. - - - |enableInterceptors()| adds interceptor classes to the list of enabled interceptors for the synthetic bean archive. - - - |enableDecorators()| adds decorator classes to the list of enabled decorators for the synthetic bean archive. - - - |selectAlternatives()| adds alternatives classes to the list of selected alternatives for the synthetic bean archive. - - - |selectAlternativeStereotypes()| adds alternative stereotype classes to the list of selected alternative stereotypes for the synthetic - bean archive. - - - - |addProperty()| add a configuration property for the container - - - |setProperties()| set the Map of configuration properties for the container. replace previous properties. - - - |disableDiscovery()| deactivate automatic type scanning and discovery. All bean archive will be ignored except the implicit bean - archive. - - - - |setClassLoader()| change the default class loader for the container - - - |initialize()| bootstrap the container and returns a `SeContainer` as defined in `SeContainer interface`. - - - - - Every invocation of the `SeContainerInitializer.initialize()` method returns a new `SeContainer` instance. - - - - The application context is started automatically by the container on start up. - -
- -
- - A CDI implementation is required to provide an implementation of `SeContainerInitializer` declared as a service-provider. `newInstance()` - static method uses java service-provider to obtain an implementation of `SeContainerInitializer` and return an instance of it. There must be - exactly one provider available, otherwise an `IllegalStateException` is thrown. - - Exceptional states tested in CDI API. - - - `SeContainerInitializer` configuration allows explicit addition of elements to the set of automatically discovered elements. These additions - are done in an internal synthetic bean archive that is added to the set of bean archives discovered by the container during deployment. - - - - This synthetic bean archive behaves like an explicit bean archive (as defined in Bean archives). - -
- -
- - The |jakarta.enterprise.inject.se.SeContainer| interface provides access to the |BeanManager| and programmatic lookup as defined in The Instance - interface. - - - - - |SeContainer| extends |AutoCloseable|, so when dereferenced, it should shutdown automatically. - - - - 'SeContainer' methods: - - |close()| method explicitly shutdown the container. If it is called and the container was already shutdown, it throws an - |IllegalStateException|. - - - - |isRunning()| method returns true if called before container shutdown and false after. - - - |getBeanManager()| method returns the |BeanManager| (as defined in The BeanManager object) for the running container. if it is called and - the container was already shutdown, it throws an |IllegalStateException|. - - - - - - - |SeContainer| implements |jakarta.enterprise.inject.Instance| and therefore might be used to perform - programmatic lookup as defined in "The Instance interface". If no qualifier is passed to - |SeContainer.select()| method, the |@Default| qualifier is assumed. - - - - - If any |Instance.select()| method is called and the container was already shutdown, the |IllegalStateException| is thrown. - -
- -
-
- -
- -
- -
- - The application context is shared between all the beans that execute within the same container - - - - An event with qualifier @Initialized(ApplicationScoped.class) is fired when the application context is initialized - - - - An event with qualifier @Destroyed(ApplicationScoped.class) is fired when the application is destroyed - - - - The event payload is any java.lang.Object - -
- -
-
- -
- - - An archive which doesn’t contain a beans.xml file can’t be discovered as an implicit bean archive unless: - - Application is launched with system property jakarta.enterprise.inject.scan.implicit set to true - - - the container was initialized with a parameter map containing an entry with jakarta.enterprise.inject.scan.implicit as key and Boolean.TRUE - as value - - - - -
- -
- -
- -
- -
- -
- - In Java SE, while the access to CDI container and `BeanManager` described in `Obtaining a reference to the CDI container` is available, the - preferred way to access them is through `SeContainer` interface as described in `SeContainer interface`. - - -
- - -
-
- -
-
- -
- - The bean types of a bean may be restricted by annotating the bean class or producer method or field with the annotation - |@jakarta.enterprise.inject.Typed|. When a |@Typed| annotation is explicitly specified, only the types whose classes are explicitly listed using - the |value| member, together with |java.lang.Object| are bean types of the bean. - - - Check session bean - - - - - If a bean class or producer method or field specifies a |@Typed| annotation, and the |value| member specifies a class which does not - correspond to a type in the unrestricted set of bean types of a bean, the container automatically detects the problem and treats it as a - definition error. - - - Check session bean - - -
- -
-
- -
- - When running in Jakarta EE, the implementations of the @RequestScoped, @ApplicationScoped and @SessionScoped annotations provided by the - container, represent the standard scopes defined by the Java Servlets specification. - - -
- -
- - When running in Jakarta EE, If the bean discovery mode is annotated, the container must extend the rules defined in Default bean discovery mode - with: - - - bean classes of EJB sessions beans, are discovered - - - producer methods that are on an EJB session bean are discovered - - - producer fields that are on an EJB session bean are discovered - - - disposer methods that are on an EJB session bean are discovered - - - observer methods that are on an EJB session bean are discovered. - - -
- -
- - A bean with a name may be referred to by its name in Unified EL expressions. - -
- -
- - In the circumstances listed in 2.6.2 "Default bean names", the rule for determining default name for an EJB session bean are defined in 17.2.5 - "Default bean - name for a session bean". - - -
- -
-
- -
- -
- - A top-level Java class is not a managed bean if it is annotated with any of the EJB component-defining annotations - - - - A top-level Java class is not a managed bean if it is declared as an EJB bean class in |ejb-jar.xml| - -
- -
- - - A session bean is a bean that is implemented by a session bean with an EJB 3.x client view that is not annotated with |@Vetoed| or in a - package annotated |@Vetoed|. - - - - - The basic lifecycle and semantics of EJB session beans are defined by the EJB specification. - This is a reference to the EJB specification - - - - A stateless session bean must belong to the |@Dependent| pseudo-scope - - - - A singleton bean must belong to either the |@ApplicationScoped| scope or to the |@Dependent| pseudo-scope - - - - If a session bean specifies an illegal scope, the container automatically detects the problem and treats it as a definition error. - - - - A stateful session bean may have any scope. - No way of testing the real intent of this statement, so we check that a SFSB may be scoped - - - - When a contextual instance of a session bean is obtained via the dependency injection service, the behavior of - |SessionContext.getInvokedBusinessInterface()| is specific to the container implementation. Portable applications should not rely upon the value - returned by this method. - - This is describing non-portable behavior - - - - If the bean class of a session bean is annotated |@Interceptor|, the container automatically detects the problem and treats it as a definition - error. - - - - - If the bean class of a session bean is annotated |@Decorator|, the container automatically detects the problem and treats it as a definition - error. - - - - - If the session bean class is a generic type, it must have scope |@Dependent|. If a session bean with a parameterized bean class declares any - scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error. - - - - - If packages annotated |@Vetoed| are split across classpath entries, non-portable behavior results. An application can prevent packages being - split across jars by sealing the package as defined by the Extension Mechanism Architecture. - - Non-portable behavior. - - -
- -
- - If a session bean is a stateful session bean, and the scope is |@Dependent|, the application may call any EJB remove method of a contextual - instance of the session bean. - - - - - If a session bean is a stateful session bean, and the scope is not |@Dependent|, the application may not directly call any EJB remove method - of any instance of the session bean. If the application directly calls an EJB remove method of any contextual instance of a session bean that is - a stateful session bean and declares any scope other than |@Dependent|, an |UnsupportedOperationException| is thrown - - - - - If the application directly calls an EJB remove method of a contextual instance of a session bean that is a stateful session bean and has - scope |@Dependent| then no parameters are passed to the method by the container. - - - - - If the application directly calls an EJB remove method of a contextual instance of a session bean that is a stateful session bean and has - scope |@Dependent| then the container ignores the instance instead of destroying it when |Contextual.destroy()| is called, as defined in Section - 6.5, "Lifecycle of stateful session beans" - - -
- -
- - The unrestricted set of bean types for a session bean contains all local interfaces of the bean and their superinterfaces. - - - - If the session bean has a no-interface view, the set of bean types contains the bean class and all superclasses. - - - - |java.lang.Object| is a bean type of every session bean - - - - Remote interfaces are not included in the set of bean types - - - - The resulting set of bean types for a session bean consists only of legal bean types, all other types are - removed from the set of bean types. - - -
- -
- - A session bean does not require any special annotations apart from the component-defining annotation (or XML declaration) required by the EJB - specification. - - - - - A bean class may also specify a scope, name, stereotypes and/or qualifiers. - - - Test a bean class with a scope. - - - - Test a bean class with a name. - - - - Test a bean class with a stereotype. - - - - Test a bean class with a qualifier. - - - - - A session bean class may extend another bean class. - -
- -
- - If a bean class of a session bean X is annotated |@Specializes|, then the bean class of X must directly extend the bean class of another - session bean Y. Then X directly specializes Y, as defined in Section 4.3 "Specialization". - - - - - If the bean class of X does not directly extend the bean class of another session bean, the container automatically detects the problem and - treats it as a definition error. - - - - - When an enabled bean specializes a second bean, we can be certain that the second bean is never instantiated or called by the container. Even - if the second bean defines a producer or observer method, the method will never be called. - - - The second bean is never instantiated. - - -
- -
- - The default name for a session bean is the unqualified class name of the session bean class, after converting the first character to lower - case. - - -
- -
- - If the bean is a session bean, the producer method must be either a business method exposed by a local business interface of the EJB or a - static method of the bean class - - - - - If a producer method X is annotated |@Specializes|, then it must be non-static and directly override another producer method Y. Then X - directly specializes Y, as defined in Section 4.3 "Specialization". - - -
- -
- - If a non-static method of a session bean class is annotated |@Produces|, and the method is not a business method exposed by a local business - interface of the session bean, the - container automatically detects the problem and treats it as a definition error. - - - - - When the container calls a producer method, if the method is non-static the container must obtain a contextual instance of the bean which - declares the method, as defined by Section 6.5.2 "Contextual instance of a bean", then invoke the method upon this instance. - - -
- -
- - If the bean is a session bean, the producer field must be a static field of the bean class. - -
- -
- - If a non-static field of a session bean class is annotated |@Produces|, the container automatically detects the problem and treats it as a - definition error. - - -
- -
- - If the bean is a session bean, the disposer method must be a business method exposed by a local business interface of the EJB or a static - method of the bean class. - - -
- -
- - If a non-static method of a session bean class has a parameter annotated |@Disposes|, and the method is not a business method exposed by a - local business interface of the session - bean, the container automatically detects the problem and treats it as a definition error. - - -
- -
- - - The instance used by the container to service an invocation of a Jakarta EE component will not be the same instance obtained when using - |@Inject|, instantiated by the container to invoke a producer method, observer method or disposer method, or instantiated by the container to - access the value of a producer field. - - - Test instance obtained using |@Inject|. - - - Test instance instantiated by the container to invoke a producer method. - - - Test instance instantiated by the container to invoke a disposer method. - - - Test instance instantiated by the container to invoke a observer method. - - - Test instance instantiated by the container to access the value of a producer field. - - - -
- - -
- - The container is not required to support resources with scope other than |@Dependent|. - Statement about non-portable behavior - - - - A resource may not declare a bean EL name - Doesn't mention the consequences of this - -
- -
- - A resource may be declared by specifying a Jakarta EE component environment injection annotation as part of a producer field declaration. The - producer field may be static. - - Introductory text for the following assertions - - - - For a Jakarta EE resource, |@Resource| must be specified. - - - - For a persistence context, |@PersistenceContext| must be specified. - - - - For a persistence unit, |@PersistenceUnit| must be specified. - - - - For a remote EJB, |@EJB| must be specified. - - - - For a web service, |@WebServiceRef| must be specified. - - - - The injection annotation specifies the metadata needed to obtain the resources, entity manager, entity manager factory, remote EJB instance or - web service reference from the component environment. - - This is defined in other specs - - - - The bean type and qualifiers of the resource are determined by the producer field declaration. - - - - If the producer field declaration specifies an EL name, the container automatically detects the problem and treats it as a definition error. - - - - - If the matching object in the Jakarta EE component environment is not of the same type as the producer field declaration, the container - automatically detects the problem and treats it as a definition error. - - - -
- -
- - The unrestricted set of bean types for a resource is determined by the declared type of the producer field, as specified by Section 3.4.1, - "Bean types of a producer field". - - - Check @Resource - - - Check @PersistenceContext - - - Check @PersistenceUnit - - - - Check @WebServiceRef - - - - The resulting set of bean types for a resource consists only of legal bean types, all other types are - removed from the set of bean types. - - -
- -
- - A Jakarta EE or embeddable EJB container must provide a bean with qualifier |@Default| and bean type |jakarta.transaction.UserTransaction|, - allowing injection of a reference to the JTA |UserTransaction|. - - - - - A Jakarta EE or embeddable EJB container must provide a bean with qualifier |@Default| and bean type |javax.security.Principal|, allowing - injection of a |Principal| representing the current caller identity. - - - - - A servlet container must provide a bean with qualifier |@Default| and bean type |jakarta.servlet.http.HttpServletRequest|, allowing injection of - a reference to the |HttpServletRequest|. This bean is passivation capable dependency, as defined in Section 6.6.2, "Passivation capable - dependencies". - - - - - A servlet container must provide a bean with qualifier |@Default| and bean type |jakarta.servlet.http.HttpSession|, allowing injection of a - reference to the |HttpSession|. This bean is passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies". - - - - - A servlet container must provide a bean with qualifier |@Default| and bean type |jakarta.servlet.ServletContext|, allowing injection of a - reference to the |ServletContext|. This bean is passivation capable dependency, as defined in Section 6.6.2, "Passivation capable dependencies". - - - - - If a Jakarta EE component class has an injection point of type |UserTransaction| and qualifier |@Default|, and may not validly make use of the - JTA |UserTransaction| according to the Jakarta EE platform specification, the container automatically detects the problem and treats it as a - definition error. - - -
- -
- - An injected field is a non-static, non-final field of a bean class or of any other classes supporting injection. - - - Test a Jakarta EE component class. - - - -
- -
- - An initializer method is a default-access, public, protected or private, non-abstract, non-static, non-generic method of a bean class or of - any Jakarta EE component class supporting injection. - - - - Test a Jakarta EE component class. - - - - - If the bean is a session bean, the initializer method is not required to be a business method of the session bean. - - - - All initializer method parameters are injection points. - -
- -
- - For each session bean, a second bean exists which has the same bean class. - - - - For each session bean, a second bean exists which has the same bean types. - - - - For each session bean, a second bean exists which has the same bean constructor. - - - - For each session bean, a second bean exists which has the same initializer methods. - - - - For each session bean, a second bean exists which has the same injected fields. - - - - For each session bean, a second bean exists which has the same interceptor bindings. - - - - This second bean has scope |@Dependent|. - - - - This second bean has exactly one qualifier: |@jakarta.enterprise.inject.New(X.class)| where |x| is the bean class. - - - - This second bean has no bean name. - - - - This second bean has no stereotypes. - - - - This second bean has no observer methods. - - - - This second bean has no producer methods. - - - - This second bean has no disposer methods. - - - - Note that this second bean exists, and may be enabled and available for injection even if the first bean is disabled, as defined by Section - 5.1.2, “Enabled and disabled beans” or if the bean class is deployed outside of a bean deployment archive, as defined in Section 12.1, “Bean - deployment archives”, and is therefore not discovered during the bean discovery process defined in Chapter 12, Packaging and deployment. The - container discovers |@New| qualified beans by inspecting injection points of other enabled beans. - - - Check that @New on a field injection point (which is a session bean class) outside the BDA, but in the classpath causes a session bean - with qualifier @New and the given type to be created - - - - Check that @New on a initializer method injection point (which is a session bean class) outside the BDA, but in the classpath causes a - session bean with qualifier @New and the given type to be created - - - - Check that @New on a constructor injection point (which is a session bean class) outside the BDA, but in the classpath causes a session - bean with qualifier @New and the given type to be created - - - - Check that @New on a producer method injection point (which is a session bean class) outside the BDA, but in the classpath causes a - session bean with qualifier @New and the given type to be created - - - - Check that @New on a observer method injection point (which is a session bean class) outside the BDA, but in the classpath causes a - session bean with qualifier @New and the given type to be created - - - - Check that @New on a disposer method injection point (which is a session bean class) outside the BDA, but in the classpath causes a - session bean with qualifier @New and the given type to be created - - - -
- -
- - Suppose a class X is extended directly or indirectly by the bean class of a managed bean Y. If X is annotated with a qualifier type, - stereotype or interceptor binding type Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y - nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z. - - - - Test qualifier type for directly extended session bean annotated |@Inherited| is inherited. - - - - Test qualifier type for directly extended session bean not annotated |@Inherited| is not inherited. - - - - Test stereotype for directly extended session bean annotated |@Inherited| is inherited. - - - - Test stereotype for directly extended session bean not annotated |@Inherited| is not inherited. - - - - Test interceptor binding type for directly extended session bean annotated |@Inherited| is inherited. - - - - Test interceptor binding type for directly extended session bean not annotated |@Inherited| is not inherited. - - - - Test qualifier type for indirectly extended session bean annotated |@Inherited| is inherited. - - - - Test qualifier type for indirectly extended session bean not annotated |@Inherited| is not inherited. - - - - Test stereotype for indirectly extended session bean annotated |@Inherited| is inherited. - - - - Test stereotype for indirectly extended session bean not annotated |@Inherited| is not inherited. - - - - Test interceptor binding type for indirectly extended session bean annotated |@Inherited| is inherited. - - - - Test interceptor binding type for indirectly extended session bean not annotated |@Inherited| is not inherited. - - - - - Suppose a class X is extended directly or indirectly by the bean class of a managed bean Y. If X is annotated with a scope type Z then Y - inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass - of X and a superclass of Y declares a scope type. - - - Test scope type for directly extended session bean annotated |@Inherited| is inherited. - - - - Test scope type for directly extended session bean not annotated |@Inherited| is not inherited. - - - - Test scope type for indirectly extended session bean annotated |@Inherited| is inherited. - - - - Test scope type for indirectly extended session bean not annotated |@Inherited| is not inherited. - - - - For class X which is extended _directly_ by the bean class of a _session_ bean Y, a scope type explicitly declared by X and inherited by Y - from X takes precedence over default scopes of stereotypes declared or inherited by Y. - - - - - For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, a scope type explicitly declared by X and inherited by Y - from X takes precedence over default scopes of stereotypes declared or inherited by Y. - - -
- -
- - - Suppose a class X is extended directly or indirectly by the bean class of a managed bean. If X declares an injected field x then Y inherits - x. - - - - Check session bean X _directly_ extends session bean Y - - - - - - - Suppose a class X is extended directly or indirectly by the bean class of a managed bean Y. If X declares an initializer, non-static observer, - @PostConstruct or @PreDestroy method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a subclass of X and a - superclass of Y overrides the method x(). - - - Check session bean X _directly_ extends session bean Y with _|@PostConstruct|_ - - - - Check session bean X _indirectly_ extends session bean Y with _|@PostConstruct|_ - - - - Check session bean X _directly_ extends session bean Y with _|@PostDestroy|_ - - - - Check session bean X _indirectly_ extends session bean Y with _|@PostDestroy|_ - - - - Check session bean X _directly_ extends session bean Y with a _non-static observer method_ - - - - Check session bean X _indirectly_ extends session bean Y with a _non-static observer method_ - - - - Check session bean X _directly_ extends session bean Y with a _initializer method_ - - - - Check session bean X _indirectly_ extends session bean Y with a _initializer method_ - - - - - - Suppose a class X is extended directly or indirectly by the bean class of a managed bean. If X declares a non-static method x() annotated with - an interceptor binding type Z then Y inherits the binding if and only if neither Y nor any intermediate class that is a subclass of X and a - superclass of Y overrides the method x(). - - - - Check session bean X _directly_ extends managed bean Y - - - - Check session bean X _indirectly_ extends managed bean Y - - - - - - Suppose a class X is extended directly or indirectly by the bean class of a managed bean or session bean Y. If X declares an initializer, - non-static observer, @PostConstruct or @PreDestroy method x() then Y inherits x() if and only if neither Y nor any intermediate class that is a - subclass of X and a superclass of Y overrides the method x(). - - - Check session bean X _directly_ extends session bean Y with a _non-static producer method_ - - - - Check session bean X _directly_ extends session bean Y with a _non-static disposer method_ - - - - Check session bean X _indirectly_ extends session bean Y with a _non-static producer method_ - - - - Check session bean X _indirectly_ extends session bean Y with a _non-static disposer method_ - - - - -
- -
-
- -
- - - A bean X is said to specialize another bean Y if X directly specializes Y. - - - - A bean X that specializes bean Y will include all qualifiers of Y, together with all qualifiers declared explicitly by X. - - - - A bean X that specializes bean Y will have the same name as Y if Y has a name. - - - - If Y has a bean name and X declares a bean name explicitly the container automatically detects the problem and treats it as a definition - error. - - - Test that a specializing enterprise bean with a name throws a definition exception. - - -
- -
- -
- - A bean is available for injection in a certain module if the bean is not an interceptor or decorator, the bean is enabled, the bean is either - not an alternative, or the module is a bean archive and the bean is a selected alternative of the bean archive, and the bean class is required - to be accessible to classes in the module, according to the class accessibility requirements of the module architecture. - - - Check an enabled session bean can be injected - - - - Check a disabled session bean is not injectable - - - - Check a specialized session bean is not injectable - - - - Check a selected alternative being session bean is injected - - - -
- -
- - - A stereotype may declare an |@Alternative| annotation, which specifies that every bean with the stereotype is an alternative. - - - - An alternative may be given a priority for the application by placing the |@Priority| annotation on the bean class of a session bean. - - Test |@Priority| on the bean class of a session bean. - - -
- -
- - - An alternative may be explicitly declared using the |<alternatives>| element of the |beans.xml| file of the bean archive. The |<alternative>| - element contains a list of bean classes and stereotypes. - - Statement of intent. - - - - An alternative is selected for the bean archive if the alternative is a session bean and the bean class of the bean is listed. - - Test selected session bean. - - -
- - -
- - The container must validate all injection points of all enabled beans, all observer methods, all disposer methods and all other Jakarta EE - component classes supporting injection when the application is initialized to ensure that there are no unsatisfied or ambiguous dependencies. If - an unsatisfied or ambiguous dependency exists, the container automatically detects the problem and treats it as a deployment problem. - - - - Test ambiguous dependency for Jakarta EE component. - - -
- -
- - An EL name resolves to a bean if the name can be resolved to a bean according to rules in 5.3, "Name resolution", and the bean is available - for injection in the war containing the JSP or JSF page with the EL expression. - - - -
- -
- -
- -
- - The container is required to perform dependency injection whenever it creates a contextual instance of a session bean. - - - - The container is required to perform dependency injection whenever it instantiates non-contextual instances of session beans (for example, - session beans obtained by the application from JNDI or injected using |@EJB|). - - - - - The container is required to perform dependency injection whenever it instantiates instances of any other Jakarta EE component class supporting - injection. - - - Test injection into a servlet listener - - - Test injection into a tag handler - - - Test injection into a tag library listener - - - Test injection into an EJB Interceptor - - - Test injection into a WS endpoint - - - Test injection into a servlet - - - Test injection into a filter - - - - - A Jakarta EE 5 container is not required to support injection for non-contextual objects. - - -
- -
- - - The bean constructor may be identified by annotating the constructor |@Inject| - - Test an @Inject constructor is used on a session bean - - - - - When the container instantiates a session bean with a constructor annotated |@Inject|, the container calls this constructor, passing an - injectable reference to each parameter. If there is no constructor annotated |@Inject|, the container calls the constructor with no parameters. - - - Test session bean with a constructor annotated |@Inject|. - - - Test constructor with no parameters is used for a session bean - - - - -
- -
- - When the container creates a new instance of session bean the container must: Initialize the values of all injected fields. The container sets - the value of each injected field to an injectable reference. Call all initializer methods, passing an injectable reference to each parameter. - - - Test session bean fields injected - - - Test session bean initializer methods called - - - Test Servlet fields injected - - - Test Servlet initializer methods called - - - Test Servlet Filter fields injected - - - Test Servlet Filter initializer methods called - - - Test Servlet Listener fields injected - - - Test Servlet Listener initializer methods called - - - Test non-contextual session bean fields injected - - - Test non-contextual session bean initializer methods called - - - Test tag handler fields injected - - - Test tag handler initializer methods called - - - Test EJB interceptor fields injected - - - Test EJB interceptor initializer methods called - - - Test WS endpoint fields injected - - - Test WS endpoint bean initializer methods called - - - Test tag handler listener fields injected - - - Test tag handler listener initializer methods called - - - Test JSF managed bean fields injected - - - Test JSF managed bean initializer methods called - - - - - The container must ensure that: Initializer methods declared by a class X in the type hierarchy of the bean are called after all injected - fields declared by X or by superclasses of X have been initialized, and after all Jakarta EE component environment resource dependencies declared - by X or by superclasses of X have been injected. Any |@PostConstruct| callback declared by a class X in the type hierarchy of the bean is called - after all initializer methods declared by X or by superclasses of X have been called, after all injected fields declared by X or by superclasses - of X have been initialized, and after all Jakarta EE component environment resource dependencies declared by X - or by superclasses of X have been injected. Any servlet |init()| method is called after all initializer methods have been called, all injected - fields have been initialized and all Jakarta EE component environment resource dependencies have been injected. - - - Test session bean initializer methods called after injected field of X - - - Test session bean initializer methods called after injected field of superclass of X - - - Test session bean initializer methods called after EE resource injection of X - - - Test session bean initializer methods called after EE resource injection of superclass of X - - - Test session bean @PostConstruct called after initializer of X - - - Test session bean @PostConstruct called after initializer of superclass of X - - - Test managed bean initializer methods called after EE resource injection of X - - - Test managed bean initializer methods called after EE resource injection of superclass of X - - - Servlet |init()| method called after initializer method - - - Servlet |init()| method called after injected fields - - - Servlet |init()| method called after Jakarta EE resource injection - - - Servlet Filter |init()| method called after initializer method - - - Servlet Filter |init()| method called after injected fields - - - Servlet Filter |init()| method called after Jakarta EE resource injection - - -
- -
- - When the container destroys an instance of a bean, the container destroys all dependent objects, as defined in Section 6.4.2, "Destruction of - objects with scope @Dependent", after the |@PreDestroy| callback completes. - - -
- -
- - Interceptor and decorator instances associated with Jakarta EE components that are not considered beans - (as defined by this specification) cannot obtain information about the beans they intercept and - decorate (as defined in Bean metadata) and thus null is injected into relevant injection points. - - -
- -
- -
- - When a bean is declared to have |@Dependent| scope, when a unified EL expression in a JSF or JSP page that refers to the bean by its EL name - is evaluated, at most one instance of the bean is instantiated. This instance exists to service just a single evaluation of the EL expression. - It is reused if the bean EL name appears multiple times in the EL expression, but is never reused when the EL expression is evaluated again, or - when another EL expression is evaluated. - - -
- -
- -
- -
- - - The container must ensure that all dependent objects of a non-contextual instance of a bean or other Jakarta EE component class are destroyed - when the instance is destroyed by the container. - - - Test with a Jakarta EE component. - - - - The container must ensure that all |@Dependent| scoped contextual instances created during evaluation of a Unified EL expression in a JSP or - JSF page are destroyed when the evaluation completes. - - -
- -
- - Suppose a Unified EL expression in a JSF or JSP page refers to a bean with scope |@Dependent| by its EL name. Each time the EL expression is - evaluated the bean is instantiated at most once, and the resulting instance is reused for every appearance of the EL name, and the resulting - instance is destroyed when the evaluation completes. - - - - - Portable extensions that integrate with the container via Unified EL should also ensure that these rules are enforced. - -
- -
- -
- - - As defined by the EJB specification, a stateful session bean is passivation capable if interceptors and decorators of the bean are passivation - capable, and the stateful session bean does not have the |passivationCapable| flag set to false. - - - Test a passivation capable stateful session bean with |passivationCapable| flag set to true. - - - Test a stateful session bean with |passivationCapable| flag set to false. - - - - - As defined by the EJB specification, a stateless session bean or a singleton session bean is not passivation capable. - Not possible to test - a stateless session bean must belong to the @Dependent pseudo-scope, a singleton bean must belong to either the - @ApplicationScscope or to the @Dependent pseudo-scope. - - -
- -
- - - The container must guarantee that all stateless session beans are passivation capable dependencies. - - - - The container must guarantee that all singleton session beans are passivation capable dependencies. - - - - The container must guarantee that all passivation capable stateful session beans are passivation capable dependencies. - - - - The container must guarantee that all resources are passivation capable dependencies. - - Test resource for a Jakarta EE resource. - - - Test resource for a persistence unit. - - - Test resource for a persistence context. - - - Test resource for a remote EJB. - - - Test resource for a web service. - - - -
- -
- - - If a stateful session bean which declares a passivating scope, or a built-in bean is not passivation capable then the container automatically - detects the problem and treats it as a deployment problem. - - - Test non-transient injected field. - - - Test stateful session bean. - - - - - If a stateful session bean which declares a passivating scope has a non-transient injected field that does not resolve to a passivation - capable dependency, then the container automatically detects the problem and treats it as a deployment problem. - - - - - If a stateful session bean has an interceptor or decorator with a non-transient injected field that does not resolve to a passivation capable - dependency, then the container automatically detects the problem and treats it as a deployment problem. - - - Test an interceptor with an injected field. - - - Test a decorator with an injected field. - - - - - If a bean which declares a passivating scope type has a decorator or interceptor which is not a passivation capable dependency, the container - automatically detects the problem and treats it as a deployment problem. - - - Test a stateful session bean with decorator which is not a passivation capable dependency. - - - Test a stateful session bean with interceptor which is not a passivation capable dependency. - - - - - Stateful session bean which does not declare a passivating scope needn't be passivation capable. - This was not allowed in CDI 1.0 - - - - If a producer method or field of scope |@Dependent| returns an unserializable object for injection into an injection point that requires a - passivation capable dependency, the container must throw an |IllegalProductException| - - - - Test for a runtime exception with a producer method. - - - - Test for a runtime exception with a producer field. - - -
- -
- - The built-in request and application context objects are active during servlet, web service and EJB invocations, and the built in session and - request context objects are active during servlet and web service invocations. For other kinds of invocations, a portable extension may define a - custom context object for any or all of the built-in scopes. - - -
- -
- - - The request scope is active during the |service()| method of any servlet in the web application, during the |doFilter()| method of any servlet - filter and when the container calls any |ServletRequestListener| or |AsyncListener|. - - - Check |service()| method. - - - Check |doFilter()| method. - - - Check |ServletRequestListener|. - - - - - - The request scope is active during any Jakarta EE web service invocation. - - - - The request scope is active during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB, during any - call to an EJB timeout method and during message delivery to any EJB message-driven bean. - - - - Test the request scope is active during a remote method invocation of any EJB. - - - - Test the request scope is active during any asynchronous method invocation of any EJB. - - - - Test the request scope is active during any call to an EJB timeout method. - - - - Test the request scope is active during message delivery to any EJB message-driven bean. - - - - - The request context is destroyed at the end of the servlet request, after the |service()| method and all |doFilter()| methods, and all - |requestDestroyed()| and |onComplete()| notifications return. - - - Check |service()| method. - - - Check |doFilter()| methods. - - - Check |requestDestroyed()| notification. - - - Check |onComplete()| notification. - - - - - The request context is destroyed after the web service invocation completes. - - - - The request context is destroyed after the EJB remote method invocation, asynchronous method invocation, timeout or message delivery - completes. - - - - Test the request context is destroyed after an EJB remote method invocation. - - - - Test the request context is destroyed after an EJB asynchronous method invocation. - - - - Test the request context is destroyed after the EJB timeout. - - - - Test the request context is destroyed after the message delivery completes. - - - - - An event with qualifier |@Initialized(RequestScoped.class)| is fired when the request context is initialized and an event with qualifier - |@Destroyed(RequestScoped.class)| when the request context is destroyed. - - - The event payload is the |ServletRequest| if the context is initialized or destroyed due to a servlet request. - - - The event payload is the |ServletRequest| if the context is initialized or destroyed due to a web service invocation. - - - The event payload is the |java.lang.Object| if the context is initialized or destroyed due to a EJB remote method invocation. - - - The event payload is the |java.lang.Object| if the context is initialized or destroyed due to a EJB asynchronous method invocation. - - - The event payload is the |java.lang.Object| if the context is initialized or destroyed due to a EJB timeout method invocation. - - - The event payload is the |java.lang.Object| if the context is initialized or destroyed due to a message delivery to any EJB message-driven - bean. - - - - -
-
- - The session scope is active during the |service()| method of any servlet in the web application. - - - - The session scope is active during the |doFilter()| method of any servlet filter. - - - - The session scope is active when the container calls any |HttpSessionListener|. - - - - - - The session scope is active when the container calls any |ServletRequestListener|. - - - - The session context is shared between all servlet requests that occur in the same HTTP servlet session. - - - - The session context is destroyed at the very end of any request in which |invalidate()| was called, after all filters and - |ServletRequestListeners| have been called. - - - - - The session context is destroyed when the |HTTPSession| times out, after all |HttpSessionListener|s have been called. - - - - An event with the |HttpSession| as payload and with qualifier |@Initialized(SessionScoped.class)| is synchronously fired when the session - context is - initialized. - - - - - An event with the |HttpSession| as payload and with qualifier |@BeforeDestroyed(SessionScoped.class)| is synchronously - fired when the session context is about to be destroyed, i.e. before the actual destruction. - - - - - An event with the |HttpSession| as payload and with qualifier |@Destroyed(SessionScoped.class)| is synchronously fired when the session - context is - destroyed. - - - -
- -
- - The application scope is active during the |service()| method of any servlet in the web application, during the |doFilter()| method of any - servlet filter and when the container calls any |ServletContextListener|, |HttpSessionListener|, |AsyncListener| or |ServletRequestListener|. - - - Check service method - - - - Check filter. - - - - Check |ServletContextListener|. - - - - - - Check |AsyncListener| - - - - Check |ServletRequestListener| - - - - - The application scope is active during any Jakarta EE web service invocation. - - - - The application scope is also active during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB, - during any call to an EJB timeout method and during message delivery to any EJB message-driven bean. - - - Test remote method invocation - - - - Test asynchronous method invocation - - - - Test EJB timeout method - - - - Test message delivery to any EJB message-driven bean. - - - - - The application scope is active when the disposer method or |@PreDestroy| callback of any bean with any normal scope other than - |@ApplicationScoped| is called. - - - Test disposer method - - - Test |@PreDestroy| method - - - - - The application scope is active during |@PostConstruct| callback of any bean. - - - - The application context is shared between all servlet requests, asynchronous observer method notifications, web service invocations, EJB - remote method invocations, EJB asynchronous method invocations, EJB timeouts and message deliveries to message driven beans that execute within - the same application. - - A single test needs check *all* these request types - - - - The application context is destroyed when the application is shut down. - - - - An event with qualifier |@Initialized(ApplicationScoped.class)| is fired when the application context is initialized and an event with - qualifier |@Destroyed(ApplicationScoped.class)| is fired when the application is destroyed. - - - The event payload is the |ServletContext| if the application is a web application deployed to a Servlet container. - - - the |java.lang.Object| for other types of application. - - - -
- -
- - - The conversation scope is active during all Servlet requests. - - Test JSF request. - - - Test non-JSF servlet request. - Test required since CDI 1.0 defined conversation for JSF requests only. - - - - - An event with qualifier |@Initialized(ConversationContext.class)| is fired when the conversation context is initialized. An event with - qualifier |@BeforeDestroyed(ConversationScoped.class)| is synchronously fired when the conversation is about to be destroyed, i.e. before the - actual destruction.An event with qualifier |@Destroyed(ConversationScoped.class)| is fired when the conversation is destroyed. The event payload - is the conversation id if the conversation context is destroyed and is not associated with a current Servlet request, the |ServletRequestEvent| - if the application is a web application deployed to a Servlet container, any |java.lang.Object| for other types of application. - - - An event with the |ServletRequest| as the payload and with qualifier |@Initialized(ConversationContext.class)| is synchronously fired when - the - conversation context is initialized. - - - - An event with the |ServletRequest| as the payload and with qualifier |@BeforeDestroyed(ConversationScoped.class)| - is synchronously fired when the conversation is about to be destroyed - - - - An event with the |ServletRequest| as the payload and with qualifier |@Destroyed(ConversationContext.class)| is synchronously fired when - the - conversation context is destroyed. - - - - An event with the conversation id as the payload and with qualifier |@Destroyed(ConversationContext.class)| is fired when the conversation - context is destroyed and is not associated with a current Servlet request. - - - - - - Any Servlet request has exactly one associated conversation. - We have no portable way how to test it - - - - The container provides a filter with the name "CDI Conversation Filter", which may be mapped in |web.xml|, allowing the user alter when the - conversation is associated with the servlet request. - - - - - If this filter is not mapped in any |web.xml| in the application, the conversation associated with a Servlet request is determined at the - beginning of the request before calling any |service()| method of any servlet in the web application, calling the |doFilter()| method of any - servlet filter in the web application and before the container calls any |ServletRequestListener| or |AsyncListener| in the web application. - - - Test |service()| method of a servlet. - This may only be tested indirectly - - - Test |doFilter()| method of a servlet filter. - This may only be tested indirectly - - - Test |ServletRequestListener|. - This may only be tested indirectly - - - Test |AsyncListener|. - This may only be tested indirectly - - - - - By default, a conversation is transient. - - - - A transient conversation may be marked long-running by calling |Conversation.begin()| - - - - A long-running conversation may be marked transient by calling |Conversation.end()| - - - - All long-running conversations have a string-valued unique identifier, _which may be set by the application_ when the conversation is marked - long-running~, or generated by the container~ - - - - - All long-running conversations have a string-valued unique identifier, _which may be_ ~set by the application when the conversation is marked - long-running, or~ _generated by the container_ - - - - - If the conversation associated with the current Servlet request is in the transient state at the end of a Servlet request, it is destroyed, - and the conversation context is also destroyed. - - - - - If the conversation associated with the current Servlet request is in the long-running state at the end of a Servlet request, it is not - destroyed. - - - - - The long-running conversation associated with a request may be propagated to any Servlet request via use of a request parameter named |cid| - containing the unique identifier of the conversation. In this case, the application must manage this request parameter. - - - - - The long-running conversation context associated with a request that renders a JSF view is automatically propagated to any faces request (JSF - form submission) that originates from that rendered page. - - - - - The long-running conversation context associated with a request that results in a JSF redirect (via a navigation rule) is automatically - propagated to the resulting non-faces request, and to any other subsequent request to the same URL. This is accomplished via use of a request - parameter named |cid| containing the unique identifier of the conversation. - - - - - When no conversation is propagated to a Servlet request, or if a request parameter named |conversationPropagation| has the value |none| the - request is associated with a new transient conversation. - - - The request is associated with a new transient conversation. - - - Test request parameter named |conversationPropagation|. - - - - - All long-running conversations are scoped to a particular HTTP servlet session and may not cross session boundaries. - - - - When the HTTP servlet session is invalidated, all long-running conversation contexts created during the current session are destroyed, after - the servlet |service()| method completes. - - - - - The container is permitted to arbitrarily destroy any long-running conversation that is associated with no current JSF request, in order to - conserve resources - - In other words, this is unspecified - - - - The conversation timeout, which may be specified by calling |Conversation.setTimeout()| is a hint to the container that a conversation should - not be destroyed if it has been active within the last given interval in milliseconds. - - Not required - - - - If the propagated conversation cannot be restored, the container must associate the request with a new transient conversation and throw an - exception of type |jakarta.enterprise.context.NonexistentConversationException|. - - - - - The container ensures that a long-running conversation may be associated with at most one request at a time, by blocking or rejecting - concurrent requests. If the container rejects a request, it must associate the request with a new transient conversation and throw an exception - of type |jakarta.enterprise.context.BusyConversationException|. - - - Test the container blocks the concurrent request. - This assertion may turn in testable=false, as the container is not actually required to reject the concurrent requests. - - - -
- -
- -
- -
- - When the application invokes a business method of a session bean via an EJB remote or local reference, the invocation is treated as a business - method invocation. - - - - Invocation of EJB timer service timeouts by the container are not business method invocations, but are intercepted by interceptors for EJB - timeouts. - - - - - Invocations of message listener methods of message-driven beans during message delivery are business method invocations. - - Verify message listener methods are intercepted - - - - - If, and only if, the invocation is a business method invocation it passes through method interceptors and decorators, and in the case of a - session bean, it is subject to EJB services such a declarative transaction management, concurrency, security and asynchronicity, as defined by - the EJB specification. - - - - Verify that a session bean's business methods are intercepted - - - - Verify that a session bean's business methods are decorated - - - - Verify that a session bean's business methods receive EJB services - This is tested by the EJB TCK - - - - Verify that a non-contextual session bean's business methods are intercepted - - - - Verify that a non-contextual session bean's business methods are decorated - - - - -
- -
- - When the |create()| method of a |Bean| object that represents a stateful session bean that is called, the container creates and returns a - container-specific internal local reference to a new session bean instance. The reference must be passivation capable. This reference is not - directly exposed to the application. - - It's not possible to test container-specific internal local reference that is not directly exposed to the application. - - - - Before injecting or returning a contextual instance to the application, the container transforms its internal reference into an object that - implements the bean types expected by the application and delegates method invocations to the underlying stateful session bean instance. This - object must be passivation capable. - - - - - When the |destroy()| method is called, and if the underlying EJB was not already removed by direct invocation of a remove method by the - application, the container removes the stateful session bean. The |@PreDestroy| callback must be invoked by the container. - - -
- -
- - When the |create()| method of a Bean object that represents a stateless session or singleton session bean is called, the container - creates and returns a container-specific internal local reference to the session bean. This reference is not directly exposed to the - application. - - It's not possible to test container-specific internal local reference that is not directly exposed to the application. - - - - Before injecting or returning a contextual instance to the application, the container transforms its internal reference into an object that - implements the bean types expected by the application and delegates method invocations to the underlying session bean. This object must be - passivation capable. - - - - - When the |destroy()| method is called, the container simply discards this internal reference. - -
- -
- - When the |create()| method of a |Bean| object that represents a resource is called, the container creates and returns a container-specific - internal reference to the Jakarta EE component environment resource, entity manager, entity manager factory, remote EJB instance or web service - reference. This reference is not directly exposed to the application. - - - - Check Jakarta EE component environment resource - - - - Check Entity Manager - - - - Check Entity Manager Factory - - - - Check Remote EJB instance - - - Check Web Service Reference - - - - - Before injecting or returning a contextual instance to the application, the container transforms its internal reference into an object that - implements the bean types expected by the application and delegates method invocations to the underlying resource, entity manager, entity - manager factory, remote EJB instance or web service reference. This object must be passivation capable. - - - - Check delegations to underlying Jakarta EE component environment resource - - - - Check injected Jakarta EE component environment resource is passivation capable - - - - Check delegations to underlying Entity Manager - - - - Check injected Entity Manager is passivation capable - - - - Check delegations to Entity Manager Factory - - - - Check injected Entity Manager Factory is passivation capable - - - - Check delegations to underlying Remote EJB instance - - - - Check injected Remote EJB instance is passivation capable - - - - Check delegations to underlying Web Service Reference - - - - Check injected Web Service Reference is passivation capable - - - - - The container must perform ordinary Jakarta EE component environment injection upon any non-static field that functions as a resource - declaration, as defined by the Jakarta EE platform and Common Annotations for the Java platform specifications. - - - Check @Resource injection - - - - - The container is not required to perform Jakarta EE component environment injection upon a static field. Portable applications should not rely - upon the value of a static field that functions as a resource declaration. - - Defines non-portable behavior - - - - References to EJBs and web services are always dependent scoped and a new instance must be obtained for every injection performed. - - - - For an entity manager associated with a resource definition, it must behave as though it were injected directly using |@PersistencContext|. - - Verify that this assertion is testable. - - - - When the |destroy()| method of a bean which represents a remote stateful EJB reference is called, the container will not automatically destroy - the EJB reference. - - - -
- -
- - - When running in Jakarta EE, the container must extend the rules defined for managed beans in Decorators to EJB session beans. - - - - A decorator may be enabled for the entire application by applying the |@Priority| annotation, along with a priority value, on the decorator - class. - - - - - Decorators with the smaller priority values are called first. - - - - A decorator may be explicitly enabled by listing its bean class under the |<decorators>| element of the beans.xml file of the bean - archive. - - - - - A decorator is declared by annotating the bean class with the |@jakarta.decorator.Decorator| stereotype. - - - - Decorators are called after interceptors. - - - - The order of the decorator declarations determines the decorator ordering. Decorators which occur earlier in the list are called first. - - -
- -
- - - Whenever a business method is invoked on an instance of a bean with decorators, the container intercepts the business method invocation and, - after processing all interceptors of the method, invokes decorators of the bean. The container searches for the first decorator of the instance - that implements the method that is being invoked as a business method. If such decorator exists, the container calls the method of the - decorator. - - - Test decorator of session bean is called . - - - Test injected HttpServletRequest - - - Test injected HttpSession - - - Test injected ServletContext - - - Test injected InjectionPoint - - - Test injected Principal - - - Test injected UserTransaction - - - - - The decorator class may be abstract. - - - - Decorators of a session bean must comply with the bean provider programming restrictions defined by the EJB specification. - - - - Decorators of a stateful session bean must comply with the rules for instance passivation and conversational state defined by the EJB - specification. - - -
- - -
- - A stereotype may declare one interceptor bindings. - -
- -
- - For a custom implementation of the Interceptor interface defined in Section 11.1.2. "The Interceptor interface", the container also calls - intercepts() to - determine if the interceptor intercepts an EJB timeout method invocation. - - -
- -
- -
- - An observer method may also be a non-abstract method of an EJB session bean class. It must be either a business method exposed by a local - business interface of the EJB or a - static method of the bean class. - - - -
- -
- - If a non-static method of a session bean class has a parameter annotated |@Observes|, and the method is not a business method exposed by a - local business interface of the - EJB, the container automatically detects the problem and treats it as a definition error. - - -
- -
- - The transaction and security contexts for a business method exposed by a local business interface of an EJB session bean also depend upon the - transaction attribute and @RunAs descriptor, if any. - - - - - All kinds of observers are called in the same client security context as the invocation of Event.fire() or Event.fireAsync() or - BeanManager.fireEvent(). - - - -
- -
- -
- -
- -
- -
- - When Running in Jakarta EE, the container must extend the rules defined in Section 11.1.2 "The Interceptor interface" and must also ensure that - PRE_PASSIVATE, - POST_ACTIVATE and AROUND_TIMEOUT InterceptorType values are linked to EJB lifecycle callback or timeout method. - - -
- -
- - When running in Jakarta EE, the container must extend the rules defined for InjectionTarget in The Producer and InjectionTarget interfaces and - must also ensure that: - - - when inject() is called, The container performs Jakarta EE component environment injection, according to the semantics required by the Java - EE platform specification, sets the value of all injected fields, and calls all initializer methods, as defined in Injection of fields and - initializer methods in Jakarta EE. - - - - @PostConstruct callback is called according to the semantics required by the Jakarta EE platform specification. - - - @PreDestroy callback is called according to the semantics required by the Jakarta EE platform specification. - - - -
- -
- -
- -
- - Jakarta EE components may obtain an instance of |BeanManager| from JNDI by looking up the name |java:comp/BeanManager|. - - - - When running in Jakarta EE, when initialize method of CDIProvider is called an UnsupportedOperationException is thrown. - - -
- -
- - The method |BeanManager.wrapExpressionFactory()| returns a wrapper |jakarta.el.ExpressionFactory| that delegates |MethodExpression| and - |ValueExpression| creation to the given |ExpressionFactory|. - - - - - When a Unified EL expression is evaluated using a |MethodExpression| or |ValueExpression| returned by the wrapper |ExpressionFactory|, the - rules defined in Section 6.4.3, "Dependent pseudo-scope and Unified EL" are enforced by the container. - - -
- -
- - The container must use the operations of |Annotated| and its subinterfaces to discover program element types and annotations. The container - must not directly call the Java Reflection API. In particular, the container must call |Annotated.getBaseType()| to determine the type of an - injection point, event parameter or disposed parameter, call |Annotated.getTypeClosure()| to determine the bean types of any kind of bean, call - |Annotated.getAnnotations()| to determine the scope, qualifiers, stereotypes and interceptor bindings of a bean, call - |Annotated.isAnnotationPresent()| and |Annotated.getAnnotation()| to read any bean annotations defined by this specification, and call - |AnnotatedType.getConstructors()|, |AnnotatedType.getMethods()| and |AnnotatedType.getFields()| to determine the members of a bean class. - - - - Check that a |getTypeClosure()| is used to determine the bean types for a session bean. The type closure should be different from the - original type specified in the class definition. - - - -
- -
- -
- -
- - When running in Jakarta EE, the container must also fire an event for every injection point of every Jakarta EE component class supporting injection - that may be instantiated by the container at runtime, including every EJB session or message-driven - bean. - - -
- -
- - The container must fire an event for every bean, interceptor or decorator. The event object must be of type - |jakarta.enterprise.inject.spi.ProcessInjectionTarget<X>|, where |x| is the managed bean class. - - - Test event is fired for a session bean - - - Test event is fired for a message driven bean - - - Test event is fired for a servlet listener - - - Test event is fired for a tag handler - - - Test event is fired for a tag library listener - - - Test event is fired for an EJB Interceptor - - - Test event is fired for a WS endpoint - - - Test event is fired for a servlet - - - Test event is fired for a filter - - - Test supertype for a servlet listener - See 10.2. Observer resolution - - - Test supertype and subtype for a tag handler - See 10.2. Observer resolution - - - Test supertype and subtype for a servlet - See 10.2. Observer resolution| - - - - |getAnnotatedType()| returns the |AnnotatedType| representing the managed bean class. - - Test type for a session bean - - - Test type for a message driven bean - - - Test type for a servlet listener - - - Test type for a tag handler - - - Test type for a tag library listener - - - Test type for an EJB Interceptor - - - Test type for a WS endpoint - - - Test type for a servlet - - - Test type for a filter - - - - - Any observer of this event is permitted to wrap and/or replace the |InjectionTarget|. The container must use the final value of this property, - after all observers have been called, whenever it performs injection upon the managed bean, session bean or other Jakarta EE component class - supporting injection. - - - Test type for a session bean - - - Test type for a servlet listener - - - Test type for a tag handler - - - Test type for a tag library listener - - - Test type for an EJB Interceptor - - - Test type for a WS endpoint - - - Test type for a servlet - - - Test type for a filter - - -
- -
- - |getAnnotated()| returns the |AnnotatedType| representing the bean class or session bean class, the |AnnotatedMethod| representing the - producer field, or the |AnnotatedField| representing the producer field. - - - Test session bean. - - - -
- -
- - For a session bean with bean class |X|, the container must raise an event of type |ProcessSessionBean<X>|. - - - - Test |ProcessSessionBean| is fired after |ProcessBeanAttributes|. - - - - The interface |jakarta.enterprise.inject.spi.ProcessBean| is a supertype of all these event types. - - Test |ProcessSessionBean| - - - - - |getAnnotated()| returns the |AnnotatedType| representing the bean class, the |AnnotatedMethod| representing the producer method, or the - |AnnotatedField| representing the producer field. - - - Test |ProcessSessionBean| - - - - - |getBean()| returns the |Bean| object that is about to be registered. The |Bean| may implement |Interceptor| or |Decorator|. - - Test |ProcessSessionBean| - - - - - |getEjbName()| returns the EJB name of the session bean. - - - - |getSessionBeanType()| returns a |jakarta.enterprise.inject.spi.SessionBeanType| representing the kind of session bean. - - - - Check the |getAnnotatedSessionBeanClass()| - - - - Check the |getAnnotatedBeanClass()| - - Check for session bean - - -
- -
- -
- -
- - When determining which archives are bean archives, the container must consider: - - Library jars, EJB jars or application client jars. - Covered elsewhere in this section. - - - The WEB-INF/classes directory of a war. - Covered elsewhere in this section - - - Directories in the JVM classpath. - Covered elsewhere in this section - - - - A Jakarta EE container is required by the Jakarta EE specification to support Jakarta EE modules. Other containers may or may not provide support for - war, EJB jar or rar bean archives. - - Covered elsewhere in this section. - - - - The |beans.xml| file must be named: - - In a war, |WEB-INF/beans.xml| or |WEB-INF/classes/META-INF/beans.xml| - WEB-INF/beans.xml - by default all TCK web archive deployments. - - - - - If a war has a file named |beans.xml| in both the |WEB-INF| directory and in the |WEB-INF/classes/META-INF| directory, then non-portable - behavior results. Portable applications must have a beans.xml file in only one of the |WEB-INF| or the |WEB-INF/classes/META-INF| directories. - - Non-portable behaviour. - - - - In an application deployed as an ear, the container searches every bean archive bundled with or referenced by the ear, including bean archives - bundled with or referenced by wars, EJB jars and rars contained in the ear. The bean archives might be library jars, EJB jars or war - |WEB-INF/classes| directories. - - - Test an EJB jar in an EAR. - - - Test a bundled library in an EAR. - - - Test a bundled library in a WAR. - - - Test a rar in an EAR. - - - Test a war in an EAR. - - - Test an installed library. - - - - - In an application deployed as a war, the container searches every bean archive bundled with or referenced by the war. The bean archives might - be library jars or the |WEB-INF/classes| directory. - - - Test |WEB-INF/classes| directory. - - - Test bundled library. - - - Test an installed library. - - - - - In an application deployed as an EJB jar, the container searches the EJB jar, if it is a bean archive, and every bean archive referenced by - the EJB jar. - - - Test classes in the EJB jar. - - - - - In an application deployed as a rar, the container searches every bean archive bundled with or referenced by the rar. - - - - An embeddable EJB container searches each bean archive in the JVM classpath that is listed in the value of the embeddable container - initialization property |jakarta.ejb.embeddable.modules|, or every bean archive in the JVM classpath if the property is not specified. The bean - archives might be directories, library jars or EJB jars. - - - - - An explicit bean archive is an archive which contains a |beans.xml| file with a version number of 1.1 (or later), with the - |bean-discovery-mode| of |all|, or with no version number, or that is an empty file. - - - Test an archive which contains a |beans.xml| file with a version number of 1.1, with the |bean-discovery-mode| of |all|. - - - Test an archive which contains a |beans.xml| file with no version number. - - - Test an archive which contains an empty |beans.xml|. - - - - - An archive which contains a |beans.xml| file with the |bean-discovery-mode| of |none| is not a bean archive. - - - - An archive which contains an extension and no |beans.xml| file is not a bean archive. - - -
- -
- - For every type discovered the container must create an |AnnotatedType| representing the type and fire an event of type |ProcessAnnotatedType|, - as defined in Section 11.5.6. - - - Check session bean - - - Check JSF managed beans - - - Check servlet listener - - - Check tag handler - - - Check tag library listener - - - Check EJB Interceptor - - - Check WS endpoint - - - Check servlet - - - Check filter - - -
- -
- - The container discovers each session bean. - - - - For every type in the set of discovered types (as defined in Type discovery), the container must fire an event of type ProcessInjectionTarget, - as defined in ProcessInjectionTarget event, - - - Check session bean - - - Check JSF managed beans - - - Check servlet listener - - - Check tag handler - - - Check tag library listener - - - Check EJB Interceptor - - - Check WS endpoint - - - Check servlet - - - Check filter - - - - - For each Java class in any bean archive, the container must, if the class is an enabled bean, interceptor or decorator, create a |Bean| object - that implements the rules defined in Section 7.3.1, "Lifecycle of managed beans", and fire an event which is a subtype of |ProcessBean|, as - defined in Section 11.5.8, "ProcessBean event". - - - Check a session bean - - -
- -
- - When running in Jakarta EE, the container must extend the rules defined in "Trimmed bean archive" and - must ensure that EJB session beans are not removed from the set of discovered types. - - -
- -
- - The container must provide a Unified EL |ELResolver| to the servlet engine and JSF implementation that resolves bean EL names using the rules - of name resolution defined in 5.3, "Name resolution" and resolving ambiguities according to Section 5.3.1, "Ambiguous names". - - - - - If a name used in an EL expression does not resolve to any bean, the |ELResolver| must return a null value. - - - - - - - Otherwise, if a name used in an EL expression resolves to exactly one bean, the |ELResolver| must return a contextual instance of the bean, as - defined in Section 6.5.2, "Contextual instance of a bean". - - -
- - diff --git a/web/src/main/resources/tck-audit-int.xml b/web/src/main/resources/tck-audit-int.xml deleted file mode 100644 index 711fc6d478..0000000000 --- a/web/src/main/resources/tck-audit-int.xml +++ /dev/null @@ -1,1088 +0,0 @@ - - -
-
- -
-
- -
-
- - -
- - - An interceptor method may be declared in the target class, in an interceptor class associated with the target class, or in a superclass of the - target class or interceptor class. - - - Interceptor method may be defined on an interceptor class associated with the target class. - - - Interceptor method may be defined in the target class. - - - Interceptor method may be defined in a super class of the target class. - - - - - - Any number of interceptor classes may be associated with a target class. - It's not possible to test all the combinations, we only test few basic scenarios. - - - - An interceptor class must not be |abstract| and must have a |public| no-arg constructor. - INTERCEPTORS_SPEC-22 - - - - This specification defines the interceptor method types listed below. Extension specifications may define additional interceptor method - types. - - - Around-invoke interceptor methods (annotated with the |jakarta.interceptor.AroundInvoke| annotation). Around-invoke interceptor methods - interpose on the invocation of business methods. - - - - Around-timeout interceptor methods (annotated with the |jakarta.interceptor.AroundTimeout| annotation). Around-timeout interceptor methods - interpose on the invocation of timeout methods, in response to timer events. - - - - Post-construct interceptor methods (annotated with the |jakarta.annotation.PostConstruct| annotation). Post-construct interceptor methods - are invoked after dependency injection has been completed on the target instance. - - Tested in "Interceptor Methods for Lifecycle Event Callbacks" section. - - - - Pre-destroy interceptor methods (annotated with the |jakarta.annotation.PreDestroy| annotation). Pre-destroy interceptor methods are invoked - before the target instance and all interceptor instances associated with it are destroyed by the container. - - - - - Around-construct interceptor methods (annotated with the |jakarta.interceptor.AroundConstruct| annotation). Around-construct interceptor - methods - interpose on the invocation of the constructor of the target instance. - - - - - - - Up to one interceptor method of each interceptor method type may be defined in the same class. More specifically, up to one around-invoke - interceptor method, one around-timeout interceptor method, and one lifecycle callback interceptor method for each of the different lifecycle - events may be defined in the same class. Only the interceptor methods of the interceptor class that are relevant for the given invocation - context are invoked. For example, when a business method is invoked, around-invoke interceptor methods are invoked, but any - around-construct, around-timeout, post-construct, or pre-destroy methods are ignored. - - - - - Interceptor methods and interceptor classes may be defined for a class by means of metadata annotations or, optionally, by means of a - deployment descriptor. - - Tested in several other sections - - - - Interceptors classes may be associated with the target class using either interceptor binding or the |Interceptors| annotation. Typically only - one interceptor association type is used for any component. - - Tested in sections 3.3 and 4 - - - - An extension specification may use a deployment descriptor to specify the invocation order of interceptors or to override the order specified - in metadata annotations. A deployment descriptor can be optionally used to define default interceptors or to associate interceptors with the - target class. For example, the EJB specification requires support for the ejb-jar.xml deployment descriptor and the CDI specification requires - supports for the beans.xml deployment descriptor. - - The ejb-jar.xml deployment descriptor is tested within the EJB TCK. The beans.xml deployment descriptor is tested within the CDI TCK, section - 9.4 Interceptor enablement and ordering. - - - -
- - -
- - - The lifecycle of an interceptor instance is the same as that of the target class instance with which it is associated. - Tested within 2.2 ba) and 2.2 bb). - - - - Except as noted below, when the target instance is created, a corresponding interceptor instance is created for each associated interceptor - class. - - - - These interceptor instances are destroyed if the target instance fails to be created or when it is removed. - Unable to test whether an instance is really destroyed. - - - - An interceptor instance may be the target of dependency injection. Dependency injection is performed when the interceptor instance is created, - using the naming context of the associated target class. - - Tested within 2.2.1 a). - - - - With the exception of around-construct lifecycle callback interceptor methods, no interceptor methods are invoked until after dependency - injection has been completed on both the interceptor instances an the target instance. - - Implied by 2.3 ba) and 2.3 c). - If the PostConstruct callback is defined on the interceptor class, it is not invoked when the interceptor instance itself is created. - - - - Post-construct interceptor methods for the target instance are invoked after dependency injection has - been completed on the target instance. - - Tested in 2.3 e). - - - - - Pre-destroy interceptor methods are invoked before the target instance and all interceptor instances - associated with it are destroyed. - - - - - The following rules apply specifically to around-construct lifecycle callback interceptor methods: - - |Around-construct| lifecycle callback interceptor methods are invoked after dependency injection has been completed on the instances of - all interceptor classes associated with the target class. - - - - Injection of the target component into interceptor instances that are invoked during the |AroundConstruct| lifecycle callback is not - supported. - - - - The target instance is created after the last interceptor method in the around-construct interceptor chain invokes the - |InvocationContext.proceed| method. If the constructor for the target instance supports injection, such constructor injection is performed. - If the |InvocationContext.proceed| method is not invoked by an interceptor method, the target instance will not be created. - - - - The |AroundConstruct| interceptor method can access the constructed instance using the |InvocationContext.getTarget| method after the - |InvocationContext.proceed| completes. - - - - Dependency injection on the target instance is not completed until after invocation of all interceptor methods in the |AroundConstruct| - interceptor chain complete successfully. Around-construct lifecycle callback interceptor methods should therefore exercise caution when - invoking methods of the target instance since dependency injection on the target instance will not have been completed. - - INTERCEPTORS_SPEC-26 - - -
- - -
- - - An interceptor class shares the enterprise naming context of its associated target class. Annotations and/or XML deployment descriptor - elements for dependency injection or for direct JNDI lookup refer to this shared naming context. - - - - - Around-invoke and around-timeout interceptor methods run in the same Java thread as the associated target method. - - - - Around-construct interceptor methods run in the same Java thread as the target constructor. - - - - It is possible to carry state across multiple interceptor method invocations for a single method invocation or lifecycle callback event in the - context data of the |InvocationContext| object. The |InvocationContext| object also provides information that enables interceptor methods to - control the behavior of the interceptor invocation chain, including whether the next method in the chain is invoked and the values of its - parameters and result. - - - -
- - -
- - - The InvocationContext object provides information that enables interceptor methods to control the behavior of the invocation chain. - Statement of intent - - - - The same |InvocationContext| instance is passed to each interceptor method for a given target class method or lifecycle event - interception. This allows an interceptor to save information in the context data property of the InvocationContext that can be subsequently - retrieved in other interceptors as a means to pass contextual data between interceptors. The contextual data is not sharable across separate - target class method invocations or lifecycle callback events. - - - - - If interceptors are invoked as a result of the invocation on a web service endpoint, the map returned by getContextData() will be the JAX-WS - MessageContext. - - - - - The getTarget method returns the associated target instance. For the |AroundConstruct| lifecycle callback interceptor method, |getTarget| - returns |null| if called before the proceed method returns. - - - - - The |getTimer| method returns the timer object associated with a timeout method invocation. - Duplicate of 2.7 f) - - - - The |getTimer| method returns |null| for around-invoke methods and lifecycle callback interceptor methods. - - - - The |getMethod| method returns the method of the target class for which the interceptor was invoked. - - - - In a lifecycle callback interceptor for which there is no corresponding lifecycle callback method on the target class or in the - |AroundConstruct| lifecycle callback interceptor method, getMethod returns |null|. - - - - - The |getParameters| method returns the parameters of the method or constructor invocation. If the |setParameters| method has been called, - getParameters returns the values to which the parameters have been set. - - - - - The |setParameters| method modifies the parameters used for the target class method or constructor invocation. Modifying the parameter values - does not affect the determination of the method or the constructor that is invoked on the target class. The parameter types must match the types - for the target class method or constructor, and the number of parameters supplied must equal the number of parameters on the target class method - or constructor, or the |IllegalArgumentException| is thrown. - - - Test |setParameters| method modifies the parameters used. - - - Test invalid number of parameters. - - - Test invalid parameter types. - - - - - The |proceed| method causes the invocation of the next interceptor method in the chain, or, when called from the last around-invoke or - around-timeout interceptor method, the target class method. - - - Test around-invoke interceptor method. - - - Test around-timeout interceptor method. - - - - - For |AroundConstruct| lifecycle callback interceptor methods, the invocation of the last interceptor method in the chain causes the target - instance to be created. - - - - - Interceptor methods must always call the |InvocationContext.proceed| method or no subsequent interceptor methods, target class method, or - lifecycle callback methods will be invoked, or the target instance will not be created. - - - - - If a method is of type void, the invocation of the |proceed| method returns |null|. - - - - For all other lifecycle callback interceptor methods, if there is no callback method defined on the target class, the invocation of proceed in - the last interceptor method in the chain is a no-op, and null is returned. - - - - - In case of the |PostConstruct| interceptor, if there is no callback method defined on the target class, the invocation of - |InvocationContext.proceed| method in the last interceptor method in the chain validates the target instance. - - Unclear meaning of validation. - - - - - The |getInterceptorBindings| method returns the set of interceptor binding - annotations for the method or constructor whose invocation is being intercepted. - In case there is no target method or target constructor, interceptor binding - annotations applied to the target class are returned. All interceptor binding - annotations are returned, including interceptor binding annotations that associate - interceptors of a different interceptor method type, as well as interceptor - binding annotations that associate no interceptor. - - - - - - The |getInterceptorBinding| method returns the single annotation of given type - present in the set of interceptor bindings returned by |getInterceptorBindings()|. - - -
- -
- - - Interceptor methods are allowed to throw runtime exceptions or any checked exceptions that the associated target method allows within its - throws clause. - - - - - Interceptor methods are allowed to catch and suppress exceptions and to recover by calling the |InvocationContext.proceed| method. - - Interceptor method is allowed to catch and suppress exceptions. - - - Interceptor method is allowed to recover by calling the |InvocationContext.proceed| method. - - - - - The invocation of the |InvocationContext.proceed| method will throw the same exception as any thrown by the associated target method unless an - interceptor further down the Java call stack has caught it and thrown a different exception. - - - - - Exceptions and initialization and/or cleanup operations should typically be handled in try/catch/finally blocks around the proceed method. - - - -
- -
- - - Interceptor methods that interpose on business method invocations are denoted by the |AroundInvoke| annotation. - - - - Around-invoke methods may be defined on interceptor classes and/or the target class and/or superclasses of the target class or the interceptor - classes. However, only one around-invoke method may be defined on a given class. - - - - - Around-invoke methods can have |public|, |private|, |protected|, or |package| level access. - - Test |public| level access. - - - Test |private| level access. - - - Test |protected| level access. - - - Test |package| level access. - - - - - An around-invoke method must not be declared as |abstract|, |final| or |static|. - INTERCEPTORS_SPEC-22 - - - - An around-invoke method can invoke any component or resource that the method it is intercepting can invoke. - - - - In general, an around-invoke method invocation occurs within the same transaction and security context as the method on which it is - interposing. However, note that the transaction context may be changed by transactional interceptors in the invocation chain. - - - Test transaction context. - - - Test security context. - - - -
- -
- - - The |AroundConstruct| annotation denotes lifecycle callback interceptor methods that interpose on invocation of the target instance’s - constructor. - - - - - The |PostConstruct| annotation denotes lifecycle callback interceptor methods that are invoked after the target instance has been constructed - and dependency injection on that instance has been completed, but before any business method or other event can be invoked on the target - instance. - - - - - The |PreDestroy| annotation denotes lifecycle callback interceptor methods that interpose on the target instance’s removal. - - - - The |AroundConstruct| interceptor methods may be only defined on interceptor classes and/or superclasses of interceptor classes. The - |AroundConstruct| callback should not be defined on the target class. - - INTERCEPTORS_SPEC-22 - - - - All other interceptor methods that interpose on the target instance lifecycle event callbacks can be defined on an interceptor class and/or - directly on the target class. - - - Test |PostConstruct| interceptor method. - - - Test |PreDestroy| interceptor method. - - - - - A single lifecycle callback interceptor method may be used to interpose on multiple callback events. - - - - Lifecycle callback interceptor methods are invoked in an unspecified security context. - - - - Lifecycle callback interceptor methods are invoked in a transaction context determined by their target class and/or method. - - - - |AroundConstruct| lifecycle callback interceptor methods may be defined on superclasses of interceptor classes. All other lifecycle callback - interceptor methods may be defined on superclasses of the target class or of interceptor classes. However, a given class may not have more than - one lifecycle callback interceptor method for the same lifecycle event. Any subset or combination of lifecycle callback annotations may - otherwise be specified on a target class or interceptor class. - - - - - If a lifecycle callback interceptor method returns a value, it is ignored by the container. - - - - Lifecycle callback interceptor methods can have |public|, |private|, |protected|, or |package| level access. - - Test |public| level access. - - - Test |private| level access. - - - Test |protected| level access. - - - Test |package| level access. - - - - - A lifecycle callback interceptor method must not be declared as |abstract|, |final| or |static|. - INTERCEPTORS_SPEC-22 - - -
- -
- - - Lifecycle callback interceptor methods may throw runtime exceptions, but not checked exceptions. - - - - A lifecycle callback interceptor method (other than a method on the target class or its superclasses) may catch an exception thrown by another - lifecycle callback interceptor method in the invocation chain, and clean up before returning. - - - - - The |PreDestroy| callbacks are not invoked when the target instance and the interceptors are discarded as a result of such exceptions: the - lifecycle callback interceptor methods in the chain should perform any necessary clean-up operations as the interceptor chain unwinds. - - - -
- -
- - Interceptor methods that interpose on timeout methods are denoted by the |AroundTimeout| annotation. - Tested within the CDI TCK, 7.2 Container invocations and interception. - - - - Around-timeout methods may be defined on interceptor classes and/or the target class and/or superclasses of the target class or interceptor - classes. However, only one around-timeout method may be defined on a given class. - - - Test interceptor classes and/or superclasses. - Partially tested within the CDI TCK, 7.2 Container invocations and interception. - - - Test target class and/or superclasses. - - - - - Around-timeout methods can have |public|, |private|, |protected|, or |package| level access. An around-timeout method must not be declared as - |abstract|, |final| or |static|. - - INTERCEPTORS_SPEC-22 - - - - An around-timeout method can invoke any component or resource that its corresponding timeout method can invoke. - - - - An around-timeout method invocation occurs within the same transaction and security context as the timeout method on which it is - interposing. - - - Test transaction context. - - - Test security context. - - - - - The |InvocationContext.getTimer| method allows an around-timeout method to retrieve the timer object associated with the timeout. - -
- -
- - - Method-level interceptors are interceptor classes associated with a specific business or timeout method of the target class. - - - - Constructor-level interceptors are interceptor classes associated with a constructor of the target class. - - - - Only the interceptor methods of the interceptor class that are relevant for the context in which the interceptor is bound are invoked. For - example, if the interceptor is bound only to a business method, any |AroundConstruct|, |AroundTimeout|, |PostConstruct|, or |PreDestroy| methods - on the interceptor are not called. - - - - - Method-level interceptors may not be associated with a lifecycle callback method of the target class. - INTERCEPTORS_SPEC-22 - - - - The same interceptor may be applied to more than one business or timeout method of the target class. - - - - The applicability of a method-level interceptor to more than one method of an associated target class does not affect the relationship between - the interceptor instance and the target class - only a single instance of the interceptor class is created per target class instance. - - - -
- -
- - Default interceptors are interceptors that apply to a set of target classes. If a deployment descriptor is supported, it may be used to define - default interceptors and their relative ordering. - - Should be tested in the EJB TCK. - -
- -
- - - Interceptor bindings are intermediate annotations that may be used to associate interceptors with any component that is not itself an - interceptor. - - Statement of intent - - -
- -
- - - An interceptor binding type is a Java annotation defined as |Retention(RUNTIME)|. Typically an interceptor binding is defined as - |Target({TYPE, METHOD, CONSTRUCTOR})| or any subset of valid target types. - - - - - An interceptor binding type may be declared by specifying the |InterceptorBinding| meta-annotation. - - -
- -
- - - An interceptor binding type may declare other interceptor bindings. - - - - Interceptor bindings are transitive - an interceptor binding declared by an interceptor binding type is inherited by all components and other - interceptor binding types that declare that interceptor binding type. - - - - - An interceptor binding type can only be applied to an interceptor binding type defining a superset of it's target types. For example - interceptor binding types declared |Target(TYPE)| may not be applied to interceptor binding types declared |Target({TYPE, METHOD})|. - - INTERCEPTORS_SPEC-21 - - -
- -
- - - An extension specification may define other sources of interceptor bindings, such as via a CDI stereotype. - - -
- -
- - - The interceptor bindings of an interceptor are specified by annotating the interceptor class with the binding types and the |Interceptor| - annotation and are called the set of interceptor bindings for the interceptor. - - - - - An interceptor class may declare multiple interceptor bindings. - - - - Multiple interceptors may declare the same interceptor bindings. - - - - An extension specification may define other ways of declaring an interceptor. - - - - If an interceptor does not declare an |Interceptor| annotation, it could be bound to components using |Interceptors| annotation or a - deployment descriptor file. - - - - - All interceptors declared using the |Interceptor| annotation should specify at least one interceptor binding. If an interceptor declared using - the |Interceptor| annotation does not declare any interceptor binding, non-portable behavior results. - - Non-portable mode - - - - With the exception of |AroundConstruct| lifecycle callback interceptors, an interceptor for lifecycle callbacks may only declare interceptor - binding types that are defined as |Target(TYPE)|. - - INTERCEPTORS_SPEC-22 - - -
- -
- - - An interceptor may be bound to a component by annotating the component class, a method, or constructor of the component class, with the - interceptor binding type. - - - Test a component class. - - - Test a method. - - - Test a constructor. - - - - - A component class, method, or constructor of a component class may declare multiple interceptor bindings. - - Test a component class. - - - Test a method. - - - Test a constructor. - - - - - The set of interceptor bindings for a method or constructor are those declared at class level combined with those declared at method or - constructor level. - - - - - An interceptor binding declared on a method or constructor replaces an interceptor binding of the same type declared at class level or - inherited from a superclass. - - - Test a constructor. - - - Test a method. - - - - - An extension specification may define additional rules for combining interceptor bindings, such as interceptors defined via a CDI - stereotype. - - - - - If the component class declares or inherits a class level interceptor binding, it must not be declared |final|, or have any non-|static|, - non-|private|, |final| methods. If a component has a class-level interceptor binding and is declared |final| or has a non-|static|, - non-|private|, |final| method, the container automatically detects the problem and treats it as a definition error. - - Tested within the CDI TCK, 9.3 Binding an interceptor to a bean. - - - - If a non-|static|, non-|private| method of a component class declares a method level interceptor binding, neither the method nor the component - class may be declared |final|. If a non-|static|, non-|private|, |final| method of a component has a method level interceptor binding, the - container automatically detects the problem and treats it as a definition error. - - Tested within the CDI TCK, 9.3 Binding an interceptor to a bean. - - -
- -
- - - The process of matching interceptors to a certain lifecycle callback method, timeout method, business method or a constructor of a certain - component is called interceptor resolution. - - Statement of intent - - - - For a lifecycle callback, the interceptor bindings include the interceptor bindings declared or inherited by the component at the class level, - including, recursively, interceptor bindings declared as meta-annotations of other interceptor bindings. - - - - - For a business method, timeout method, or constructor the interceptor bindings include the interceptor bindings declared or inherited by the - component at the class level, including, recursively, interceptor bindings declared as meta-annotations of other interceptor bindings, together - with all interceptor bindings declared on the constructor or method, including, recursively, interceptor bindings declared as meta-annotations - of other interceptor bindings. - - - Test a business method. - - - Test a timeout method. - - - Test a constructor. - - - - - An interceptor is bound to a method or constructor if: - - The method or constructor has all the interceptor bindings of the interceptor. A method or constructor has an interceptor binding of an - interceptor if it has an interceptor binding with (a) the same type and (b) the same annotation member value for each member. An extension - specification may further refine this rule. For example the CDI specification adds the |jakarta.enterprise.util.Nonbinding| annotation, - causing member values to be ignored by the resolution process. - - - - The interceptor intercepts the given kind of lifecycle callback or business method. - - - The interceptor is enabled. - - - -
- -
- - - An interceptor class may specify multiple interceptor bindings. - - -
- -
- - - Interceptor binding types may have annotation members. - - - - Annotation member values are compared using the equals method. - - - - Array-valued or annotation-valued members of an interceptor binding type are not supported. An extension specification may add support for - these member types. For example the CDI specification adds the |jakarta.enterprise.util.Nonbinding| annotation, allowing array-valued or - annotation-valued members to be used on the annotation type, but ignored by the resolution process. - - Testing |jakarta.enterprise.util.Nonbinding| annotation. - - - - If the set of interceptor bindings of a component class or interceptor, including bindings inherited from stereotypes and other interceptor - bindings, has two instances of a certain interceptor binding type and the instances have different values of some annotation member, the - container automatically detects the problem and treats it as a definition error. - - - -
- -
- - - The |Interceptors| annotation can be used to denote interceptor classes and associate one or more interceptor classes with a target class, - and/or one or more of its methods, and/or a constructor of the target class. - - - - - Method-level around-invoke and around-timeout interceptors can be defined by applying the |Interceptors| annotation to the method for which - the interceptors are to be invoked. - - - - - Constructor-level interceptors can be defined by applying the |Interceptors| annotation to the constructor for which the interceptors are to - be invoked. - - - - - Constructor- and method-level interceptors are invoked in addition to any default interceptors and interceptors defined for - the target class (and its superclasses). - - Tested in section 5. - - - - If multiple interceptors are defined for the target class in the Interceptors annotation, they are invoked in the order in which they are - specified. See Chapter 5 for the rules on interceptors ordering. - - Tested in section 5. - - - - The Interceptor annotation is ignored on interceptor classes bound using the Interceptors - annotation. - - - - - - An extension specification may support the use of a deployment descriptor to associate interceptor classes with a target class, and/or method or - constructor of a target class, and to specify the order of interceptor invocation or override metadata specified by annotations. - - -
- -
-
- -
- - - - Interceptors declared using the |Interceptors| annotation are enabled by that annotation. Using the |Interceptors| annotation to associate - interceptor classes with a target class or a method or constructor of a target class enables them for that target class, method, or constructor. - The order in which the interceptor classes are specified in the |Interceptors| annotation controls interceptor ordering (see Section 5.2). - - - - - An extension specification may define alternative mechanisms (e.g., a deployment descriptor such as the CDI beans.xml or the EJB ejb-jar.xml - deployment descriptor) to enable and order interceptors, to override the order specified by means of annotations, or to disable interceptors. - - - -
- -
- - Default interceptors are invoked first. - - Default interceptors are invoked in the order defined by the extension specification (e.g., by their order in the deployment - descriptor). - - - - If a default interceptor class has superclasses, interceptor methods declared in the interceptor class’s superclasses are invoked before - the interceptor method declared in the interceptor class itself, most general superclass first. - - - - - Interceptors declared by applying the Interceptors annotation at class-level to the target class are invoked next. - - Interceptor methods declared in the interceptor classes listed in the |Interceptors| annotation are invoked in the same order as the - specification of the interceptor classes in that annotation. - - - - - If an interceptor class declared by applying the Interceptors annotation at class-level has superclasses, interceptor methods declared in - the interceptor class’s superclasses are invoked before the interceptor method declared in the interceptor class itself, most general - superclass first. - - - - - - Interceptors declared by applying the Interceptors annotation at method- or constructor-level are invoked next. - - Interceptor methods declared in the interceptor classes listed in the Interceptors annotation are invoked in the same order as the - specification of the interceptor classes in that annotation. - - - - - If an interceptor class declared by applying the |Interceptors| annotation at method- or constructor-level has superclasses, interceptor - methods declared in the interceptor class’s superclasses are invoked before the interceptor method declared in the interceptor class itself, - most general superclass first. - - - - - - Interceptors declared using interceptor bindings are invoked next. - - - All interceptors specified using interceptor binding annotations visible on the target class (e.g., specified on the class or visible on the - class because they were declared with the Inherited annotation) are combined with all binding annotations on the target method and sorted by - the priorities specified by the |Priority| annotation; and then the interceptor methods are invoked in order of priority. The |Priority| - annotation is described in Section 5.2.1. - - - - - If an interceptor class declared using interceptor bindings has superclasses, interceptor methods declared in the interceptor class’s - superclasses are invoked before the interceptor method declared in the interceptor class itself, most general superclass first. - - - - - Interceptor methods declared in the target class or in any superclass of the target class are invoked last. - - - If the target class has superclasses, interceptor methods declared in the target class’s superclasses are invoked before an interceptor - method declared in the target class itself, most general superclass first. - - - - - - If an interceptor method is overridden by another method (regardless whether that method is itself an interceptor method), it will not be - invoked. - - -
- -
- - - The |Priority| annotation can be used to enable and order interceptors associated with components that use interceptor bindings. The required - value element of the |Priority| annotation determines the ordering. Interceptors with smaller priority values are called first. - - Tested within the CDI TCK, section 9.4 Interceptor enablement and ordering. - - - - If more than one interceptor has the same priority, the relative order of these interceptor is undefined. - Undefined behaviour. - - - - The |Priority| annotation is ignored on interceptors bound to a component using the |Interceptors| annotation. - INTERCEPTORS_SPEC-23 - -
- -
- - - Interceptors may be excluded from execution by means of the |ExcludeClassInterceptors| annotation and the |ExcludeDefaultInterceptors| - annotation. - - Tested separately in the following assertions - - - - - The |ExcludeClassInterceptors| annotation can be used to exclude the invocation of the class-level interceptors defined by means of the - |Interceptors| annotation. - - - - - - The |ExcludeDefaultInterceptors| annotation can be used to exclude the invocation of default interceptors for a target class or—when applied to - a target class constructor or method—to exclude the invocation of default interceptors for a particular constructor or method. - - Should be tested in the EJB TCK. - - - - - An extension specification may define other means for excluding interceptors from execution, such as by means of a deployment descriptor. - - - -
- -
diff --git a/web/src/main/resources/tck-audit-mb.xml b/web/src/main/resources/tck-audit-mb.xml deleted file mode 100644 index 4b82ba6c6a..0000000000 --- a/web/src/main/resources/tck-audit-mb.xml +++ /dev/null @@ -1,235 +0,0 @@ - - -
- -
- -
- -
- -
- - A Managed Bean can be declared by annotating its class with the |jakarta.annotation.ManagedBean| annotation. - - Verify a top-level class - - - - Verify a static inner class - - - - - - - A Managed Bean must not be: a final class, an abstract class, a non-static inner class or a generic class. - - - Test that a managed bean may not be a final class. - Doesn't define any error condition - - - - Test that a managed bean may not be an abstract class. - Doesn't define any error condition - - - - Test that a managed bean may not be a non-static inner class. - Doesn't define any error condition - - - - Test that a managed bean may not be a generic class. - Doesn't define any error condition - - - - - A Managed Bean may not be serializable, unlike a regular JavaBean component. - Doesn't define any error condition - - - - Managed Bean implementations must support Managed Beans that have a no-argument constructor. - -
- -
- - A Managed Bean may optionally have a name, a |String|. - Verify the name is optional - - - - The name can be specified using an element of the |ManagedBean| annotation. - - - - Managed Bean names must be unique within a Jakarta EE module. It is an error if a Jakarta EE module contains an EJB component and a Managed Bean with the same name. - The behaviour here is unspecified. - - - - For each named Managed Bean, Jakarta EE containers must make available the following entries in JNDI, using the same naming schema used for EJB components. In the application namespace: |java:app/<module-name>/<bean-name>|. In the module namespace of the module containing the Managed Bean: |java:module/<bean-name>|. - - - Test that the application namespace entry exists. - - - - Test that the module namespace entry exists. - - - - - Jakarta EE applications may obtain a new instance of a Managed Bean by looking up the corresponding names in JNDI or by using resource injection. See Section MB.2.3, "[Injection of] Managed Bean References" for more details. - - - Test obtaining a new instance via JNDI lookup. - - - - Test obtaining a new instance via resource injection. - - - -
- -
- - Managed Beans may use the |jakarta.annotation.PostConstruct| and |jakarta.annotation.PreDestroy| annotations to identify methods to be called back by the container at the appropriate points in the bean's lifecycle. - - - Test the |jakarta.annotation.PostConstruct| annotation. - - - - Test the |jakarta.annotation.PreDestroy| annotation. - - - - - In a Jakarta EE implementation, a Managed Bean may use any of the resource injection functionality laid out in Chapter EE.5 of the Jakarta EE Platform specification, "Resources, Naming and Injection". - - Check @Resource injection - - - Check @EJB injection - - - - - A Managed Bean does not have its own component-scoped "|java:comp|" namespace. For this reason, Managed Beans should define resources in the "|java:module|" namespace or above. JNDI lookup operations from a method defined on a Managed Bean will use the naming context of that method's caller. - Check that lookup does use the naming context of the method's caller - -
- -
- - Method invocations on a Managed Bean execute in the same thread as the caller. - -
- -
- - A Managed Bean may use interceptors as defined in the Interceptor specification. - No way to verify as spec doesn't provide a way to bind interceptors to a bean - -
- -
- - Specifications that build on the present one (called here an "extension specification") may modify some of the aspects of the basic model, as detailed in the rest of this section. - -
- -
- testable="false"> - An extension specification may provide ways to declare a Managed Bean that go beyond those in Section MB.2.1.1, "Component Definition". - - - - An extension specification may allow a Managed Bean to declare constructors with complex signatures, thus dropping the requirement that a no-argument constructor be present. - -
- -
- - An extension specification may offer alternative ways to name a Managed Bean, e.g. as a side-effect of placing some other annotation on the bean class, but, if specified, the |ManagedBean(name="...")| annotation takes priority, and with it the rules in Section MB.2.1.2, "Naming". - - - - Of course an extension specification may also introduce one or more additional namespaces in which some or all Managed Beans get registered, either with the Managed Bean name defined in Section MB.2.1.2, "Naming" or with an independently defined name. - -
- -
- - An extension specification may define its own lifecycle model, adding e.g. pooling, sharing of instances, etc., beyond the basic model described in Section MB.2.1.3, "Lifecycle and Resource Injection". - - - - An extension specification may allow Managed Beans to have their own "|java:comp|" namespace. - -
- -
- - An extension specification may add its own threading requirements, overriding any requirements set in Section MB.2.1.4, "Threading". For example, invocations on a [proxy for] a Managed Bean may be performed using a different thread than the caller's. - -
- -
- - An extension specification may add its own interceptor-like facilities to the predefined one. For example, an extension specification may allow declaring type-safe interceptors, defined using a different set of APIs than those in the |jakarta.interceptor| package. - -
- -
- - An instance of a named Managed Bean can be obtained by looking up its name in JNDI using the same naming scheme used for EJB components: |java:app/<module-name>/<bean-name>|, |java:module/<bean-name>|. The latter will only work within the module the Managed Bean is declared in. Each such lookup must return a new instance. - - - Test that the latter lookup only works within the Managed Bean's module. - - - - Test that each lookup returns a new instance. - - - - - The |@Resource| annotation can be used to request the injection of a Managed Bean given either its type or its name. If no name is specified, the type must be the Managed Bean class itself. If a name is specified, then the type of the resource can be any of the types that the Managed Bean class implements, including any of its interfaces. - - - Test injection with no name. - - - - Test injection with a name. - - -
- -
- - The Application Component Provider is responsible for requesting injection of a Managed Bean, or by looking it up in JNDI using an appropriate name. - What is this about? - -
- -
- - The Jakarta EE Product Provider is responsible for providing appropriate instances of the requested Managed Bean class as required by this specification. - -
- -
diff --git a/web/src/main/resources/tck-tests.xml b/web/src/main/resources/tck-tests.xml deleted file mode 100644 index d320a955f2..0000000000 --- a/web/src/main/resources/tck-tests.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/web/src/test/java/org/jboss/cdi/tck/test/ExclusionListsTest.java b/web/src/test/java/org/jboss/cdi/tck/test/ExclusionListsTest.java deleted file mode 100644 index c8500b8a75..0000000000 --- a/web/src/test/java/org/jboss/cdi/tck/test/ExclusionListsTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2023, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.test; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; - -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import org.testng.annotations.Test; -import org.xmlunit.builder.DiffBuilder; -import org.xmlunit.diff.ComparisonResult; -import org.xmlunit.diff.ComparisonType; -import org.xmlunit.diff.Diff; -import org.xmlunit.diff.DifferenceEvaluators; - -public class ExclusionListsTest { - @Test - public void compareExclusionLists() throws IOException { - List xmls = new ArrayList<>(); - ExclusionListsTest.class.getClassLoader().getResources("tck-tests.xml").asIterator().forEachRemaining(xmls::add); - assertEquals(xmls.size(), 2); - URL control = xmls.stream().filter(it -> !it.toString().contains("web")).findFirst().orElseThrow(); - URL test = xmls.stream().filter(it -> it.toString().contains("web")).findFirst().orElseThrow(); - - Diff diff = DiffBuilder.compare(control) - .withTest(test) - .checkForSimilar() - .ignoreComments() - .ignoreWhitespace() - .withDifferenceEvaluator(DifferenceEvaluators.chain( - DifferenceEvaluators.Default, - (comparison, outcome) -> { - if (outcome != ComparisonResult.DIFFERENT) { - return outcome; - } - if (comparison.getType() == ComparisonType.CHILD_NODELIST_LENGTH - && (Integer) comparison.getControlDetails().getValue() < (Integer) comparison - .getTestDetails().getValue()) { - return ComparisonResult.SIMILAR; - } - if (comparison.getType() == ComparisonType.CHILD_LOOKUP - && comparison.getControlDetails().getValue() == null - && comparison.getTestDetails().getValue() != null) { - return ComparisonResult.SIMILAR; - } - return outcome; - })) - .build(); - assertFalse(diff.hasDifferences(), - "Exclusion list in `web` must contain the exclusion list in `impl` as a prefix:\n" + diff.fullDescription()); - } -} diff --git a/web/src/test/java/org/jboss/cdi/tck/test/porting/DummyBeans.java b/web/src/test/java/org/jboss/cdi/tck/test/porting/DummyBeans.java deleted file mode 100644 index 88b2139e65..0000000000 --- a/web/src/test/java/org/jboss/cdi/tck/test/porting/DummyBeans.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.test.porting; - -import java.io.IOException; - -import org.jboss.cdi.tck.spi.Beans; - -public class DummyBeans implements Beans { - - @Override - public boolean isProxy(Object instance) { - throw new UnsupportedOperationException(); - } - - @Override - public byte[] passivate(Object instance) throws IOException { - throw new UnsupportedOperationException(); - } - - @Override - public Object activate(byte[] bytes) throws IOException, ClassNotFoundException { - throw new UnsupportedOperationException(); - } - -} diff --git a/web/src/test/java/org/jboss/cdi/tck/test/porting/DummyContexts.java b/web/src/test/java/org/jboss/cdi/tck/test/porting/DummyContexts.java deleted file mode 100644 index bd93cb3e9a..0000000000 --- a/web/src/test/java/org/jboss/cdi/tck/test/porting/DummyContexts.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.test.porting; - -import jakarta.enterprise.context.spi.Context; - -import org.jboss.cdi.tck.spi.Contexts; - -public class DummyContexts implements Contexts { - - @Override - public void setActive(Context context) { - throw new UnsupportedOperationException(); - } - - @Override - public void setInactive(Context context) { - throw new UnsupportedOperationException(); - } - - @Override - public Context getRequestContext() { - throw new UnsupportedOperationException(); - } - - @Override - public Context getDependentContext() { - throw new UnsupportedOperationException(); - } - - @Override - public void destroyContext(Context context) { - throw new UnsupportedOperationException(); - } - -} diff --git a/web/src/test/java/org/jboss/cdi/tck/test/porting/DummyContextuals.java b/web/src/test/java/org/jboss/cdi/tck/test/porting/DummyContextuals.java deleted file mode 100644 index ec8ae002f0..0000000000 --- a/web/src/test/java/org/jboss/cdi/tck/test/porting/DummyContextuals.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2023, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.test.porting; - -import jakarta.enterprise.context.spi.Context; - -import org.jboss.cdi.tck.spi.Contextuals; - -public class DummyContextuals implements Contextuals { - @Override - public Inspectable create(T instance, Context context) { - throw new UnsupportedOperationException(); - } -} diff --git a/web/src/test/java/org/jboss/cdi/tck/test/porting/DummyCreationalContexts.java b/web/src/test/java/org/jboss/cdi/tck/test/porting/DummyCreationalContexts.java deleted file mode 100644 index 2f880a25ba..0000000000 --- a/web/src/test/java/org/jboss/cdi/tck/test/porting/DummyCreationalContexts.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2023, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.test.porting; - -import jakarta.enterprise.context.spi.Contextual; - -import org.jboss.cdi.tck.spi.CreationalContexts; - -public class DummyCreationalContexts implements CreationalContexts { - @Override - public Inspectable create(Contextual contextual) { - throw new UnsupportedOperationException(); - } -} diff --git a/web/src/test/java/org/jboss/cdi/tck/test/porting/DummyEL.java b/web/src/test/java/org/jboss/cdi/tck/test/porting/DummyEL.java deleted file mode 100644 index 3aa22ae70d..0000000000 --- a/web/src/test/java/org/jboss/cdi/tck/test/porting/DummyEL.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2013, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.test.porting; - -import jakarta.el.ELContext; -import jakarta.enterprise.inject.spi.BeanManager; - -import org.jboss.cdi.tck.spi.EL; - -public class DummyEL implements EL { - - @Override - public T evaluateValueExpression(BeanManager beanManager, String expression, Class expectedType) { - throw new UnsupportedOperationException(); - } - - @Override - public T evaluateMethodExpression(BeanManager beanManager, String expression, Class expectedType, - Class[] expectedParamTypes, - Object[] expectedParams) { - throw new UnsupportedOperationException(); - } - - @Override - public ELContext createELContext(BeanManager beanManager) { - throw new UnsupportedOperationException(); - } - -} diff --git a/web/src/test/java/org/jboss/cdi/tck/test/shrinkwrap/descriptors/ejb/EjbJarDescriptorBuilderTest.java b/web/src/test/java/org/jboss/cdi/tck/test/shrinkwrap/descriptors/ejb/EjbJarDescriptorBuilderTest.java deleted file mode 100644 index f3ce6df980..0000000000 --- a/web/src/test/java/org/jboss/cdi/tck/test/shrinkwrap/descriptors/ejb/EjbJarDescriptorBuilderTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jboss.cdi.tck.test.shrinkwrap.descriptors.ejb; - -import static org.jboss.cdi.tck.shrinkwrap.descriptors.ejb.EjbJarDescriptorBuilder.MessageDriven.newMessageDriven; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; - -import javax.xml.XMLConstants; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.Source; -import javax.xml.transform.stream.StreamSource; -import javax.xml.validation.Schema; -import javax.xml.validation.SchemaFactory; -import javax.xml.validation.Validator; - -import org.apache.commons.lang.StringUtils; -import org.jboss.cdi.tck.shrinkwrap.descriptors.ejb.EjbJarDescriptorBuilder; -import org.jboss.cdi.tck.tests.context.jms.QueueMessageDrivenBean; -import org.jboss.cdi.tck.tests.context.jms.TopicMessageDrivenBean; -import org.jboss.shrinkwrap.descriptor.api.DescriptorExportException; -import org.jboss.shrinkwrap.descriptor.api.ejbjar31.EjbJarDescriptor; -import org.testng.annotations.Test; -import org.w3c.dom.ls.LSInput; -import org.w3c.dom.ls.LSResourceResolver; -import org.xml.sax.ErrorHandler; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; - -/** - * - * @author Martin Kouba - */ -public class EjbJarDescriptorBuilderTest { - - @Test - public void testDescriptorIsValid() throws ParserConfigurationException, SAXException, DescriptorExportException, - IOException { - - EjbJarDescriptor ejbJarDescriptor = new EjbJarDescriptorBuilder().messageDrivenBeans( - newMessageDriven("TestQueue", QueueMessageDrivenBean.class.getName()) - .addActivationConfigProperty("acknowledgeMode", "Auto-acknowledge") - .addActivationConfigProperty("destinationType", "jakarta.jms.Queue") - .addActivationConfigProperty("destinationLookup", "test_queue"), - newMessageDriven("TestTopic", TopicMessageDrivenBean.class.getName()) - .addActivationConfigProperty("acknowledgeMode", "Auto-acknowledge") - .addActivationConfigProperty("destinationType", "jakarta.jms.Topic") - .addActivationConfigProperty("destinationLookup", "test_topic")) - .build(); - - SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); - schemaFactory.setResourceResolver(new LSResourceResolver() { - - @Override - public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) { - try { - if (systemId.startsWith("http")) { - // Ugly workaround for xml.xsd - systemId = StringUtils.substringAfterLast(systemId, "/"); - } - return new Input(publicId, systemId, new FileInputStream(new File("src/test/resources/xsd", systemId))); - } catch (FileNotFoundException e) { - throw new IllegalStateException(); - } - } - }); - schemaFactory.setErrorHandler(new ErrorHandler() { - - @Override - public void warning(SAXParseException exception) throws SAXException { - } - - @Override - public void fatalError(SAXParseException exception) throws SAXException { - throw exception; - } - - @Override - public void error(SAXParseException exception) throws SAXException { - throw exception; - } - }); - - Source schemaFile = new StreamSource(new FileInputStream(new File("src/test/resources/xsd", "ejb-jar_3_1.xsd"))); - Schema schema = schemaFactory.newSchema(schemaFile); - Validator validator = schema.newValidator(); - validator.validate(new StreamSource(new ByteArrayInputStream(ejbJarDescriptor.exportAsString().getBytes()))); - } - -} diff --git a/web/src/test/java/org/jboss/cdi/tck/test/shrinkwrap/descriptors/ejb/Input.java b/web/src/test/java/org/jboss/cdi/tck/test/shrinkwrap/descriptors/ejb/Input.java deleted file mode 100644 index f7ba2b4476..0000000000 --- a/web/src/test/java/org/jboss/cdi/tck/test/shrinkwrap/descriptors/ejb/Input.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2012, Red Hat, Inc., and individual contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jboss.cdi.tck.test.shrinkwrap.descriptors.ejb; - -import java.io.InputStream; -import java.io.Reader; - -import org.w3c.dom.ls.LSInput; - -/** - * - * @author Martin Kouba - */ -public class Input implements LSInput { - - private String publicId; - - private String systemId; - - private InputStream inputStream; - - public Input(String publicId, String systemId, InputStream inputStream) { - super(); - this.publicId = publicId; - this.systemId = systemId; - this.inputStream = inputStream; - } - - @Override - public Reader getCharacterStream() { - return null; - } - - @Override - public void setCharacterStream(Reader characterStream) { - } - - @Override - public InputStream getByteStream() { - return inputStream; - } - - @Override - public void setByteStream(InputStream byteStream) { - } - - @Override - public String getStringData() { - return null; - } - - @Override - public void setStringData(String stringData) { - } - - @Override - public String getSystemId() { - return systemId; - } - - @Override - public void setSystemId(String systemId) { - } - - @Override - public String getPublicId() { - return publicId; - } - - @Override - public void setPublicId(String publicId) { - } - - @Override - public String getBaseURI() { - return null; - } - - @Override - public void setBaseURI(String baseURI) { - } - - @Override - public String getEncoding() { - return null; - } - - @Override - public void setEncoding(String encoding) { - } - - @Override - public boolean getCertifiedText() { - return false; - } - - @Override - public void setCertifiedText(boolean certifiedText) { - } - -} diff --git a/web/src/test/resources/META-INF/cdi-tck.properties b/web/src/test/resources/META-INF/cdi-tck.properties deleted file mode 100644 index 7ac375a3cb..0000000000 --- a/web/src/test/resources/META-INF/cdi-tck.properties +++ /dev/null @@ -1,9 +0,0 @@ -# CDI TCK configuration to run test from IDE -# Alter the path accordingly (absolute or relative from the tck/impl dir) -org.jboss.cdi.tck.libraryDirectory=../../../weld/core/jboss-tck-runner/1.1/target/dependency/lib -# JNDI DS -org.jboss.cdi.tck.testDataSource=java:jboss/datasources/ExampleDS -# JNDI JMS -org.jboss.cdi.tck.testJmsConnectionFactory=java:/ConnectionFactory -org.jboss.cdi.tck.testJmsQueue=java:/queue/test -org.jboss.cdi.tck.testJmsTopic=java:/topic/test \ No newline at end of file diff --git a/web/src/test/resources/xsd/ejb-jar_3_1.xsd b/web/src/test/resources/xsd/ejb-jar_3_1.xsd deleted file mode 100644 index 8c097627a9..0000000000 --- a/web/src/test/resources/xsd/ejb-jar_3_1.xsd +++ /dev/null @@ -1,3247 +0,0 @@ - - - - - - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - - Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved. - - The contents of this file are subject to the terms of either the - GNU General Public License Version 2 only ("GPL") or the Common - Development and Distribution License("CDDL") (collectively, the - "License"). You may not use this file except in compliance with - the License. You can obtain a copy of the License at - https://glassfish.dev.java.net/public/CDDL+GPL.html or - glassfish/bootstrap/legal/LICENSE.txt. See the License for the - specific language governing permissions and limitations under the - License. - - When distributing the software, include this License Header - Notice in each file and include the License file at - glassfish/bootstrap/legal/LICENSE.txt. Sun designates this - particular file as subject to the "Classpath" exception as - provided by Sun in the GPL Version 2 section of the License file - that accompanied this code. If applicable, add the following - below the License Header, with the fields enclosed by brackets [] - replaced by your own identifying information: - "Portions Copyrighted [year] [name of copyright owner]" - - Contributor(s): - - If you wish your version of this file to be governed by only the - CDDL or only the GPL Version 2, indicate your decision by adding - "[Contributor] elects to include this software in this - distribution under the [CDDL or GPL Version 2] license." If you - don't indicate a single choice of license, a recipient has the - option to distribute your version of this file under either the - CDDL, the GPL Version 2 or to extend the choice of license to its - licensees as provided above. However, if you add GPL Version 2 - code and therefore, elected the GPL Version 2 license, then the - option applies only if the new code is made subject to such - option by the copyright holder. - - - - - - - - ... - - - The instance documents may indicate the published version of - the schema using the xsi:schemaLocation attribute for the - Java EE namespace with the following location: - - http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd - - ]]> - - - - - - - The following conventions apply to all Java EE - deployment descriptor elements unless indicated otherwise. - - - In elements that specify a pathname to a file within the - same JAR file, relative filenames (i.e., those not - starting with "/") are considered relative to the root of - the JAR file's namespace. Absolute filenames (i.e., those - starting with "/") also specify names in the root of the - JAR file's namespace. In general, relative names are - preferred. The exception is .war files where absolute - names are preferred for consistency with the Servlet API. - - - - - - - - - - - - - - This is the root of the ejb-jar deployment descriptor. - - - - - - - - The ejb-name element contains the name of an enterprise - bean. The name must be unique within the ejb-jar or - .war file. - - - - - - - - - - - The keyref indicates the references from - relationship-role-source must be to a specific ejb-name - defined within the scope of enterprise-beans element. - - - - - - - - - - - A role-name-key is specified to allow the references - from the security-role-refs. - - - - - - - - - - - The keyref indicates the references from - security-role-ref to a specified role-name. - - - - - - - - - - - - - - - - The access-timeoutType represents the maximum amount of - time (in a given time unit) that the container should wait for - a concurrency lock before throwing a timeout exception to the - client. - - A timeout value of 0 means concurrent access is not permitted. - - A timeout value of -1 means wait indefinitely to acquire a lock. - - - - - - - - - - - - - - - - - - The async-methodType element specifies that a session - bean method has asynchronous invocation semantics. - - - - - - - - - - - - - - - - - - The activation-configType defines information about the - expected configuration properties of the message-driven bean - in its operational environment. This may include information - about message acknowledgement, message selector, expected - destination type, etc. - - The configuration information is expressed in terms of - name/value configuration properties. - - The properties that are recognized for a particular - message-driven bean are determined by the messaging type. - - - - - - - - - - - - - - - - - - The activation-config-propertyType contains a name/value - configuration property pair for a message-driven bean. - - The properties that are recognized for a particular - message-driven bean are determined by the messaging type. - - - - - - - - - The activation-config-property-name element contains - the name for an activation configuration property of - a message-driven bean. - - For JMS message-driven beans, the following property - names are recognized: acknowledgeMode, - messageSelector, destinationType, subscriptionDurability - - - - - - - - - The activation-config-property-value element - contains the value for an activation configuration - property of a message-driven bean. - - - - - - - - - - - - - - - - The around-invoke type specifies a method on a - class to be called during the around invoke portion of an - ejb invocation. Note that each class may have only one - around invoke method and that the method may not be - overloaded. - - If the class element is missing then - the class defining the callback is assumed to be the - interceptor class or component class in scope at the - location in the descriptor in which the around invoke - definition appears. - - - - - - - - - - - - - - - - - The around-timeout type specifies a method on a - class to be called during the around-timeout portion of - a timer timeout callback. Note that each class may have - only one around-timeout method and that the method may not - be overloaded. - - If the class element is missing then - the class defining the callback is assumed to be the - interceptor class or component class in scope at the - location in the descriptor in which the around-timeout - definition appears. - - - - - - - - - - - - - - - - - The assembly-descriptorType defines - application-assembly information. - - The application-assembly information consists of the - following parts: the definition of security roles, the - definition of method permissions, the definition of - transaction attributes for enterprise beans with - container-managed transaction demarcation, the definition - of interceptor bindings, a list of - methods to be excluded from being invoked, and a list of - exception types that should be treated as application exceptions. - - All the parts are optional in the sense that they are - omitted if the lists represented by them are empty. - - Providing an assembly-descriptor in the deployment - descriptor is optional for the ejb-jar or .war file producer. - - - - - - - - - - - - - - - - - - - - - - - The cmp-fieldType describes a container-managed field. The - cmp-fieldType contains an optional description of the field, - and the name of the field. - - - - - - - - - - The field-name element specifies the name of a - container managed field. - - The name of the cmp-field of an entity bean with - cmp-version 2.x must begin with a lowercase - letter. This field is accessed by methods whose - names consists of the name of the field specified by - field-name in which the first letter is uppercased, - prefixed by "get" or "set". - - The name of the cmp-field of an entity bean with - cmp-version 1.x must denote a public field of the - enterprise bean class or one of its superclasses. - - - - - - - - - - - - - - - - The cmp-versionType specifies the version of an entity bean - with container-managed persistence. It is used by - cmp-version elements. - - The value must be one of the two following: - - 1.x - 2.x - - - - - - - - - - - - - - - - - - - The cmr-fieldType describes the bean provider's view of - a relationship. It consists of an optional description, and - the name and the class type of a field in the source of a - role of a relationship. The cmr-field-name element - corresponds to the name used for the get and set accessor - methods for the relationship. The cmr-field-type element is - used only for collection-valued cmr-fields. It specifies the - type of the collection that is used. - - - - - - - - - - The cmr-field-name element specifies the name of a - logical relationship field in the entity bean - class. The name of the cmr-field must begin with a - lowercase letter. This field is accessed by methods - whose names consist of the name of the field - specified by cmr-field-name in which the first - letter is uppercased, prefixed by "get" or "set". - - - - - - - - - - - - - - - - - The cmr-field-type element specifies the class of a - collection-valued logical relationship field in the entity - bean class. The value of an element using cmr-field-typeType - must be either: java.util.Collection or java.util.Set. - - - - - - - - - - - - - - - - - - - The concurrency-management-typeType specifies the way concurrency - is managed for a singleton or stateful session bean. - - The concurrency management type must be one of the following: - - Bean - Container - - Bean managed concurrency can only be specified for a singleton bean. - - - - - - - - - - - - - - - - - - - The concurrent-lock-typeType specifies how the container must - manage concurrent access to a method of a Singleton bean - with container-managed concurrency. - - The container managed concurrency lock type must be one - of the following : - - Read - Write - - - - - - - - - - - - - - - - - - - The concurrent-methodType specifies information about a method - of a bean with container managed concurrency. - - The optional lock element specifies the kind of concurrency - lock asssociated with the method. - - The optional access-timeout element specifies the amount of - time (in a given time unit) the container should wait for a - concurrency lock before throwing an exception to the client. - - - - - - - - - - - - - - - - - - - The container-transactionType specifies how the container - must manage transaction scopes for the enterprise bean's - method invocations. It defines an optional description, a - list of method elements, and a transaction attribute. The - transaction attribute is to be applied to all the specified - methods. - - - - - - - - - - - - - - - - - - - The depends-onType is used to express initialization - ordering dependencies between Singleton components. - The depends-onType specifies the names of one or more - Singleton beans in the same application as the referring - Singleton, each of which must be initialized before - the referring bean. - - Each dependent bean is expressed using ejb-link syntax. - The order in which dependent beans are initialized at - runtime is not guaranteed to match the order in which - they are listed. - - - - - - - - - - - - - - - - com.wombat.empl.EmployeeServiceBean - - ]]> - - - - - - - - - - - - - - - The ejb-jarType defines the root element of the EJB - deployment descriptor. It contains - - - an optional description of the ejb-jar file - - an optional display name - - an optional icon that contains a small and a large - icon file name - - an optional module name. Only applicable to - stand-alone ejb-jars or ejb-jars packaged in an ear. - Ignored if specified for an ejb-jar.xml within a .war. - In that case, standard .war module-name rules apply. - - structural information about all included - enterprise beans that is not specified through - annotations - - structural information about interceptor classes - - a descriptor for container managed relationships, - if any. - - an optional application-assembly descriptor - - an optional name of an ejb-client-jar file for the - ejb-jar. - - - - - - - - - - - - - - The ejb-relation-name contains the name of a - relation. The name must be unique within - relationships. - - - - - - - - - - - - Providing an assembly-descriptor in the deployment - descriptor is optional for the ejb-jar or .war file - producer. - - - - - - - - employee_service_client.jar - - - ]]> - - - - - - - - - The version specifies the version of the - EJB specification that the instance document must - comply with. This information enables deployment tools - to validate a particular EJB Deployment - Descriptor with respect to a specific version of the EJB - schema. - - - - - - - - - The metadata-complete attribute defines whether this - deployment descriptor and other related deployment - descriptors for this module (e.g., web service - descriptors) are complete, or whether the class - files available to this module and packaged with - this application should be examined for annotations - that specify deployment information. - - If metadata-complete is set to "true", the deployment - tool must ignore any annotations that specify deployment - information, which might be present in the class files - of the application. - - If metadata-complete is not specified or is set to - "false", the deployment tool must examine the class - files of the application for annotations, as - specified by the specifications. - - - - - - - - - - - - - - EmployeeService - - ]]> - - - - - - - - - - - - - - - The ejb-relationType describes a relationship between two - entity beans with container-managed persistence. It is used - by ejb-relation elements. It contains a description; an - optional ejb-relation-name element; and exactly two - relationship role declarations, defined by the - ejb-relationship-role elements. The name of the - relationship, if specified, is unique within the ejb-jar - file. - - - - - - - - - - The ejb-relation-name element provides a unique name - within the ejb-jar file for a relationship. - - - - - - - - - - - - - - - - - - Product-LineItem - - product-has-lineitems - - One - - ProductEJB - - - - - ]]> - - - - - - - - - The ejb-relationship-role-name element defines a - name for a role that is unique within an - ejb-relation. Different relationships can use the - same name for a role. - - - - - - - - - - The cascade-delete element specifies that, within a - particular relationship, the lifetime of one or more - entity beans is dependent upon the lifetime of - another entity bean. The cascade-delete element can - only be specified for an ejb-relationship-role - element contained in an ejb-relation element in - which the other ejb-relationship-role - element specifies a multiplicity of One. - - - - - - - - - - - - - - - - - - The enterprise-beansType declares one or more enterprise - beans. Each bean can be a session, entity or message-driven - bean. - - - - - - - - - - The ejb-ref-name element contains the name of - an EJB reference. The EJB reference is an entry in - the component's environment and is relative to the - java:comp/env context. The name must be unique within - the component. - - It is recommended that name be prefixed with "ejb/". - - - - - - - - - - - The ejb-ref-name element contains the name of an EJB - reference. The EJB reference is an entry in the - component's environment and is relative to the - java:comp/env context. The name must be unique - within the component. - - It is recommended that name is prefixed with "ejb/". - - - - - - - - - - - The resource-env-ref-name element specifies the name - of a resource environment reference; its value is - the environment entry name used in the component - code. The name is a JNDI name relative to the - java:comp/env context and must be unique within an - component. - - - - - - - - - - - The message-destination-ref-name element specifies the name - of a message destination reference; its value is - the message destination reference name used in the component - code. The name is a JNDI name relative to the - java:comp/env context and must be unique within an - component. - - - - - - - - - - - The res-ref-name element specifies the name of a - resource manager connection factory reference. The name - is a JNDI name relative to the java:comp/env context. - The name must be unique within an component. - - - - - - - - - - - The env-entry-name element contains the name of a - component's environment entry. The name is a JNDI - name relative to the java:comp/env context. The - name must be unique within an component. - - - - - - - - - - - - - The ejb-ref-name element contains the name of - an EJB reference. The EJB reference is an entry in - the component's environment and is relative to the - java:comp/env context. The name must be unique within - the component. - - It is recommended that name be prefixed with "ejb/". - - - - - - - - - - - The ejb-ref-name element contains the name of an EJB - reference. The EJB reference is an entry in the - component's environment and is relative to the - java:comp/env context. The name must be unique - within the component. - - It is recommended that name is prefixed with "ejb/". - - - - - - - - - - - The resource-env-ref-name element specifies the name - of a resource environment reference; its value is - the environment entry name used in the component - code. The name is a JNDI name relative to the - java:comp/env context and must be unique within an - component. - - - - - - - - - - - The message-destination-ref-name element specifies the name - of a message destination reference; its value is - the message destination reference name used in the component - code. The name is a JNDI name relative to the - java:comp/env context and must be unique within an - component. - - - - - - - - - - - The res-ref-name element specifies the name of a - resource manager connection factory reference. The name - is a JNDI name relative to the java:comp/env context. - The name must be unique within an component. - - - - - - - - - - - The env-entry-name element contains the name of a - component's environment entry. The name is a JNDI - name relative to the java:comp/env context. The - name must be unique within an component. - - - - - - - - - - - - - The ejb-ref-name element contains the name of - an EJB reference. The EJB reference is an entry in - the component's environment and is relative to the - java:comp/env context. The name must be unique within - the component. - - It is recommended that name be prefixed with "ejb/". - - - - - - - - - - - The ejb-ref-name element contains the name of an EJB - reference. The EJB reference is an entry in the - component's environment and is relative to the - java:comp/env context. The name must be unique - within the component. - - It is recommended that name is prefixed with "ejb/". - - - - - - - - - - - The resource-env-ref-name element specifies the name - of a resource environment reference; its value is - the environment entry name used in the component - code. The name is a JNDI name relative to the - java:comp/env context and must be unique within an - component. - - - - - - - - - - - The message-destination-ref-name element specifies the name - of a message destination reference; its value is - the message destination reference name used in the component - code. The name is a JNDI name relative to the - java:comp/env context and must be unique within an - component. - - - - - - - - - - - The res-ref-name element specifies the name of a - resource manager connection factory reference. The name - is a JNDI name relative to the java:comp/env context. - The name must be unique within an component. - - - - - - - - - - - The env-entry-name element contains the name of a - component's environment entry. The name is a JNDI - name relative to the java:comp/env context. The - name must be unique within an component. - - - - - - - - - - - - - - - - - - - The entity-beanType declares an entity bean. The declaration - consists of: - - - an optional description - - an optional display name - - an optional icon element that contains a small and a large - icon file name - - a unique name assigned to the enterprise bean - in the deployment descriptor - - an optional mapped-name element that can be used to provide - vendor-specific deployment information such as the physical - jndi-name of the entity bean's remote home interface. This - element is not required to be supported by all implementations. - Any use of this element is non-portable. - - the names of the entity bean's remote home - and remote interfaces, if any - - the names of the entity bean's local home and local - interfaces, if any - - the entity bean's implementation class - - the optional entity bean's persistence management type. If - this element is not specified it is defaulted to Container. - - the entity bean's primary key class name - - an indication of the entity bean's reentrancy - - an optional specification of the - entity bean's cmp-version - - an optional specification of the entity bean's - abstract schema name - - an optional list of container-managed fields - - an optional specification of the primary key - field - - an optional declaration of the bean's environment - entries - - an optional declaration of the bean's EJB - references - - an optional declaration of the bean's local - EJB references - - an optional declaration of the bean's web - service references - - an optional declaration of the security role - references - - an optional declaration of the security identity - to be used for the execution of the bean's methods - - an optional declaration of the bean's - resource manager connection factory references - - an optional declaration of the bean's - resource environment references - - an optional declaration of the bean's message - destination references - - an optional set of query declarations - for finder and select methods for an entity - bean with cmp-version 2.x. - - The optional abstract-schema-name element must be specified - for an entity bean with container-managed persistence and - cmp-version 2.x. - - The optional primkey-field may be present in the descriptor - if the entity's persistence-type is Container. - - The optional cmp-version element may be present in the - descriptor if the entity's persistence-type is Container. If - the persistence-type is Container and the cmp-version - element is not specified, its value defaults to 2.x. - - The optional home and remote elements must be specified if - the entity bean cmp-version is 1.x. - - The optional home and remote elements must be specified if - the entity bean has a remote home and remote interface. - - The optional local-home and local elements must be specified - if the entity bean has a local home and local interface. - - Either both the local-home and the local elements or both - the home and the remote elements must be specified. - - The optional query elements must be present if the - persistence-type is Container and the cmp-version is 2.x and - query methods other than findByPrimaryKey have been defined - for the entity bean. - - The other elements that are optional are "optional" in the - sense that they are omitted if the lists represented by them - are empty. - - At least one cmp-field element must be present in the - descriptor if the entity's persistence-type is Container and - the cmp-version is 1.x, and none must not be present if the - entity's persistence-type is Bean. - - - - - - - - - - - - - - - - - - The prim-key-class element contains the - fully-qualified name of an - entity bean's primary key class. - - If the definition of the primary key class is - deferred to deployment time, the prim-key-class - element should specify java.lang.Object. - - - - - - - - - The reentrant element specifies whether an entity - bean is reentrant or not. - - The reentrant element must be one of the two - following: true or false - - - - - - - - - - The abstract-schema-name element specifies the name - of the abstract schema type of an entity bean with - cmp-version 2.x. It is used in EJB QL queries. - - For example, the abstract-schema-name for an entity - bean whose local interface is - com.acme.commerce.Order might be Order. - - - - - - - - - - The primkey-field element is used to specify the - name of the primary key field for an entity with - container-managed persistence. - - The primkey-field must be one of the fields declared - in the cmp-field element, and the type of the field - must be the same as the primary key type. - - The primkey-field element is not used if the primary - key maps to multiple container-managed fields - (i.e. the key is a compound key). In this case, the - fields of the primary key class must be public, and - their names must correspond to the field names of - the entity bean class that comprise the key. - - - - - - - - - - - - - - - - - - - - The exclude-listType specifies one or more methods which - the Assembler marks to be uncallable. - - If the method permission relation contains methods that are - in the exclude list, the Deployer should consider those - methods to be uncallable. - - - - - - - - - - - - - - - - - - The application-exceptionType declares an application - exception. The declaration consists of: - - - the exception class. When the container receives - an exception of this type, it is required to - forward this exception as an applcation exception - to the client regardless of whether it is a checked - or unchecked exception. - - an optional rollback element. If this element is - set to true, the container must rollback the current - transaction before forwarding the exception to the - client. If not specified, it defaults to false. - - an optional inherited element. If this element is - set to true, subclasses of the exception class type - are also automatically considered application - exceptions (unless overriden at a lower level). - If set to false, only the exception class type is - considered an application-exception, not its - exception subclasses. If not specified, this - value defaults to true. - - - - - - - - - - - - - - - - - - - The interceptorsType element declares one or more interceptor - classes used by components within this ejb-jar or .war. The declaration - consists of : - - - An optional description. - - One or more interceptor elements. - - - - - - - - - - - - - - - - - - The interceptorType element declares information about a single - interceptor class. It consists of : - - - An optional description. - - The fully-qualified name of the interceptor class. - - An optional list of around invoke methods declared on the - interceptor class and/or its super-classes. - - An optional list of around timeout methods declared on the - interceptor class and/or its super-classes. - - An optional list environment dependencies for the interceptor - class and/or its super-classes. - - An optional list of post-activate methods declared on the - interceptor class and/or its super-classes. - - An optional list of pre-passivate methods declared on the - interceptor class and/or its super-classes. - - - - - - - - - - - - - - - - - - - - - - - * - INTERCEPTOR - - - Specifying the ejb-name as the wildcard value "*" designates - default interceptors (interceptors that apply to all session and - message-driven beans contained in the ejb-jar or .war). - - 2. - - EJBNAME - INTERCEPTOR - - - This style is used to refer to interceptors associated with the - specified enterprise bean(class-level interceptors). - - 3. - - EJBNAME - INTERCEPTOR - - METHOD - - - - This style is used to associate a method-level interceptor with - the specified enterprise bean. If there are multiple methods - with the same overloaded name, the element of this style refers - to all the methods with the overloaded name. Method-level - interceptors can only be associated with business methods of the - bean class. Note that the wildcard value "*" cannot be used - to specify method-level interceptors. - - 4. - - EJBNAME - INTERCEPTOR - - METHOD - - PARAM-1 - PARAM-2 - ... - PARAM-N - - - - - This style is used to associate a method-level interceptor with - the specified method of the specified enterprise bean. This - style is used to refer to a single method within a set of methods - with an overloaded name. The values PARAM-1 through PARAM-N - are the fully-qualified Java types of the method's input parameters - (if the method has no input arguments, the method-params element - contains no method-param elements). Arrays are specified by the - array element's type, followed by one or more pair of square - brackets (e.g. int[][]). - - ]]> - - - - - - - - - - - - - - - - - - - - - - - - The interceptor-orderType element describes a total ordering - of interceptor classes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The message-driven element declares a message-driven - bean. The declaration consists of: - - - an optional description - - an optional display name - - an optional icon element that contains a small and a large - icon file name. - - a name assigned to the enterprise bean in - the deployment descriptor - - an optional mapped-name element that can be used to provide - vendor-specific deployment information such as the physical - jndi-name of destination from which this message-driven bean - should consume. This element is not required to be supported - by all implementations. Any use of this element is non-portable. - - the message-driven bean's implementation class - - an optional declaration of the bean's messaging - type - - an optional declaration of the bean's timeout method for - handling programmatically created timers - - an optional declaration of timers to be automatically created at - deployment time - - the optional message-driven bean's transaction management - type. If it is not defined, it is defaulted to Container. - - an optional declaration of the bean's - message-destination-type - - an optional declaration of the bean's - message-destination-link - - an optional declaration of the message-driven bean's - activation configuration properties - - an optional list of the message-driven bean class and/or - superclass around-invoke methods. - - an optional list of the message-driven bean class and/or - superclass around-timeout methods. - - an optional declaration of the bean's environment - entries - - an optional declaration of the bean's EJB references - - an optional declaration of the bean's local EJB - references - - an optional declaration of the bean's web service - references - - an optional declaration of the security role - references - - an optional declaration of the security - identity to be used for the execution of the bean's - methods - - an optional declaration of the bean's - resource manager connection factory - references - - an optional declaration of the bean's resource - environment references. - - an optional declaration of the bean's message - destination references - - - - - - - - - - - - The ejb-class element specifies the fully qualified name - of the bean class for this ejb. It is required unless - there is a component-defining annotation for the same - ejb-name. - - - - - - - - - The messaging-type element specifies the message - listener interface of the message-driven bean. - - - - - - - - - The timeout-method element specifies the method that - will receive callbacks for programmatically - created timers. - - - - - - - - - - - - - - - - - - - - - - - - - - - EJBNAME - * - - - This style is used to refer to all the methods of the - specified enterprise bean's business, home, component, - and/or web service endpoint interfaces. - - 2. - - EJBNAME - METHOD - - - This style is used to refer to the specified method of - the specified enterprise bean. If there are multiple - methods with the same overloaded name, the element of - this style refers to all the methods with the overloaded - name. - - 3. - - EJBNAME - METHOD - - PARAM-1 - PARAM-2 - ... - PARAM-n - - - - This style is used to refer to a single method within a - set of methods with an overloaded name. PARAM-1 through - PARAM-n are the fully-qualified Java types of the - method's input parameters (if the method has no input - arguments, the method-params element contains no - method-param elements). Arrays are specified by the - array element's type, followed by one or more pair of - square brackets (e.g. int[][]). If there are multiple - methods with the same overloaded name, this style refers - to all of the overloaded methods. - - Examples: - - Style 1: The following method element refers to all the - methods of the EmployeeService bean's business, home, - component, and/or web service endpoint interfaces: - - - EmployeeService - * - - - Style 2: The following method element refers to all the - create methods of the EmployeeService bean's home - interface(s). - - - EmployeeService - create - - - Style 3: The following method element refers to the - create(String firstName, String LastName) method of the - EmployeeService bean's home interface(s). - - - EmployeeService - create - - java.lang.String - java.lang.String - - - - The following example illustrates a Style 3 element with - more complex parameter types. The method - foobar(char s, int i, int[] iar, mypackage.MyClass mycl, - mypackage.MyClass[][] myclaar) would be specified as: - - - EmployeeService - foobar - - char - int - int[] - mypackage.MyClass - mypackage.MyClass[][] - - - - The optional method-intf element can be used when it becomes - necessary to differentiate between a method that is multiply - defined across the enterprise bean's business, home, component, - and/or web service endpoint interfaces with the same name and - signature. However, if the same method is a method of both the - local business interface, and the local component interface, - the same attribute applies to the method for both interfaces. - Likewise, if the same method is a method of both the remote - business interface and the remote component interface, the same - attribute applies to the method for both interfaces. - - For example, the method element - - - EmployeeService - Remote - create - - java.lang.String - java.lang.String - - - - can be used to differentiate the create(String, String) - method defined in the remote interface from the - create(String, String) method defined in the remote home - interface, which would be defined as - - - EmployeeService - Home - create - - java.lang.String - java.lang.String - - - - and the create method that is defined in the local home - interface which would be defined as - - - EmployeeService - LocalHome - create - - java.lang.String - java.lang.String - - - - The method-intf element can be used with all three Styles - of the method element usage. For example, the following - method element example could be used to refer to all the - methods of the EmployeeService bean's remote home interface - and the remote business interface. - - - EmployeeService - Home - * - - - ]]> - - - - - - - - - - - - - - - - - - - - - The method-intf element allows a method element to - differentiate between the methods with the same name and - signature that are multiply defined across the home and - component interfaces (e.g, in both an enterprise bean's - remote and local interfaces or in both an enterprise bean's - home and remote interfaces, etc.); the component and web - service endpoint interfaces, and so on. - - Local applies to the local component interface, local business - interfaces, and the no-interface view. - - Remote applies to both remote component interface and the remote - business interfaces. - - ServiceEndpoint refers to methods exposed through a web service - endpoint. - - Timer refers to the bean's timeout callback methods. - - MessageEndpoint refers to the methods of a message-driven bean's - message-listener interface. - - The method-intf element must be one of the following: - - Home - Remote - LocalHome - Local - ServiceEndpoint - Timer - MessageEndpoint - - - - - - - - - - - - - - - - - - - - - - - - The method-nameType contains a name of an enterprise - bean method or the asterisk (*) character. The asterisk is - used when the element denotes all the methods of an - enterprise bean's client view interfaces. - - - - - - - - - - - - - - - - The method-paramsType defines a list of the - fully-qualified Java type names of the method parameters. - - - - - - - - - The method-param element contains a primitive - or a fully-qualified Java type name of a method - parameter. - - - - - - - - - - - - - - - - The method-permissionType specifies that one or more - security roles are allowed to invoke one or more enterprise - bean methods. The method-permissionType consists of an - optional description, a list of security role names or an - indicator to state that the method is unchecked for - authorization, and a list of method elements. - - The security roles used in the method-permissionType - must be defined in the security-role elements of the - deployment descriptor, and the methods must be methods - defined in the enterprise bean's business, home, component - and/or web service endpoint interfaces. - - - - - - - - - - - - The unchecked element specifies that a method is - not checked for authorization by the container - prior to invocation of the method. - - - - - - - - - - - - - - - - - - The multiplicityType describes the multiplicity of the - role that participates in a relation. - - The value must be one of the two following: - - One - Many - - - - - - - - - - - - - - - - - - - The persistence-typeType specifies an entity bean's persistence - management type. - - The persistence-type element must be one of the two following: - - Bean - Container - - - - - - - - - - - - - - - - - - - The queryType defines a finder or select - query. It contains - - an optional description of the query - - the specification of the finder or select - method it is used by - - an optional specification of the result type - mapping, if the query is for a select method - and entity objects are returned. - - the EJB QL query string that defines the query. - - Queries that are expressible in EJB QL must use the ejb-ql - element to specify the query. If a query is not expressible - in EJB QL, the description element should be used to - describe the semantics of the query and the ejb-ql element - should be empty. - - The result-type-mapping is an optional element. It can only - be present if the query-method specifies a select method - that returns entity objects. The default value for the - result-type-mapping element is "Local". - - - - - - - - - - - - - - - - - - - - Method finds large orders - - findLargeOrders - - - - SELECT OBJECT(o) FROM Order o - WHERE o.amount > 1000 - - - - ]]> - - - - - - - - - - - - - - - - - The relationship-role-sourceType designates the source of a - role that participates in a relationship. A - relationship-role-sourceType is used by - relationship-role-source elements to uniquely identify an - entity bean. - - - - - - - - - - - - - - - - - - The relationshipsType describes the relationships in - which entity beans with container-managed persistence - participate. The relationshipsType contains an optional - description; and a list of ejb-relation elements, which - specify the container managed relationships. - - - - - - - - - - - The ejb-relationship-role-name contains the name of a - relationship role. The name must be unique within - a relationship, but can be reused in different - relationships. - - - - - - - - - - - - - - - - - - - The result-type-mappingType is used in the query element to - specify whether an abstract schema type returned by a query - for a select method is to be mapped to an EJBLocalObject or - EJBObject type. - - The value must be one of the following: - - Local - Remote - - - - - - - - - - - - - - - - - - - The security-identityType specifies whether the caller's - security identity is to be used for the execution of the - methods of the enterprise bean or whether a specific run-as - identity is to be used. It contains an optional description - and a specification of the security identity to be used. - - - - - - - - - - - The use-caller-identity element specifies that - the caller's security identity be used as the - security identity for the execution of the - enterprise bean's methods. - - - - - - - - - - - - - - - - - - The session-beanType declares an session bean. The - declaration consists of: - - - an optional description - - an optional display name - - an optional icon element that contains a small and a large - icon file name - - a name assigned to the enterprise bean - in the deployment description - - an optional mapped-name element that can be used to provide - vendor-specific deployment information such as the physical - jndi-name of the session bean's remote home/business interface. - This element is not required to be supported by all - implementations. Any use of this element is non-portable. - - the names of all the remote or local business interfaces, - if any - - the names of the session bean's remote home and - remote interfaces, if any - - the names of the session bean's local home and - local interfaces, if any - - an optional declaration that this bean exposes a - no-interface view - - the name of the session bean's web service endpoint - interface, if any - - the session bean's implementation class - - the session bean's state management type - - an optional declaration of a stateful session bean's timeout value - - an optional declaration of the session bean's timeout method for - handling programmatically created timers - - an optional declaration of timers to be automatically created at - deployment time - - an optional declaration that a Singleton bean has eager - initialization - - an optional declaration of a Singleton/Stateful bean's concurrency - management type - - an optional declaration of the method locking metadata - for a Singleton with container managed concurrency - - an optional declaration of the other Singleton beans in the - application that must be initialized before this bean - - an optional declaration of the session bean's asynchronous - methods - - the optional session bean's transaction management type. - If it is not present, it is defaulted to Container. - - an optional declaration of a stateful session bean's - afterBegin, beforeCompletion, and/or afterCompletion methods - - an optional list of the session bean class and/or - superclass around-invoke methods. - - an optional list of the session bean class and/or - superclass around-timeout methods. - - an optional declaration of the bean's - environment entries - - an optional declaration of the bean's EJB references - - an optional declaration of the bean's local - EJB references - - an optional declaration of the bean's web - service references - - an optional declaration of the security role - references - - an optional declaration of the security identity - to be used for the execution of the bean's methods - - an optional declaration of the bean's resource - manager connection factory references - - an optional declaration of the bean's resource - environment references. - - an optional declaration of the bean's message - destination references - - The elements that are optional are "optional" in the sense - that they are omitted when if lists represented by them are - empty. - - The service-endpoint element may only be specified if the - bean is a stateless session bean. - - - - - - - - - - - - - - - - - - The local-bean element declares that this - session bean exposes a no-interface Local client view. - - - - - - - - - The service-endpoint element contains the - fully-qualified name of the enterprise bean's web - service endpoint interface. The service-endpoint - element may only be specified for a stateless - session bean. The specified interface must be a - valid JAX-RPC service endpoint interface. - - - - - - - - - The ejb-class element specifies the fully qualified name - of the bean class for this ejb. It is required unless - there is a component-defining annotation for the same - ejb-name. - - - - - - - - - - - The timeout-method element specifies the method that - will receive callbacks for programmatically - created timers. - - - - - - - - - - The init-on-startup element specifies that a Singleton - bean has eager initialization. - This element can only be specified for singleton session - beans. - - - - - - - - - - - - The init-method element specifies the mappings for - EJB 2.x style create methods for an EJB 3.x bean. - This element can only be specified for stateful - session beans. - - - - - - - - - The remove-method element specifies the mappings for - EJB 2.x style remove methods for an EJB 3.x bean. - This element can only be specified for stateful - session beans. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The session-typeType describes whether the session bean is a - singleton, stateful or stateless session. It is used by - session-type elements. - - The value must be one of the three following: - - Singleton - Stateful - Stateless - - - - - - - - - - - - - - - - - - - - The stateful-timeoutType represents the amount of time - a stateful session bean can be idle(not receive any client - invocations) before it is eligible for removal by the container. - - A timeout value of 0 means the bean is immediately eligible for removal. - - A timeout value of -1 means the bean will never be removed due to timeout. - - - - - - - - - - - - - - - - - - The time-unit-typeType represents a time duration at a given - unit of granularity. - - The time unit type must be one of the following : - - Days - Hours - Minutes - Seconds - Milliseconds - Microseconds - Nanoseconds - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The timerType specifies an enterprise bean timer. Each - timer is automatically created by the container upon - deployment. Timer callbacks occur based on the - schedule attributes. All callbacks are made to the - timeout-method associated with the timer. - - A timer can have an optional start and/or end date. If - a start date is specified, it takes precedence over the - associated timer schedule such that any matching - expirations prior to the start time will not occur. - Likewise, no matching expirations will occur after any - end date. Start/End dates are specified using the - XML Schema dateTime type, which follows the ISO-8601 - standard for date(and optional time-within-the-day) - representation. - - An optional flag can be used to control whether - this timer has persistent(true) delivery semantics or - non-persistent(false) delivery semantics. If not specified, - the value defaults to persistent(true). - - A time zone can optionally be associated with a timer. - If specified, the timer's schedule is evaluated in the context - of that time zone, regardless of the default time zone in which - the container is executing. Time zones are specified as an - ID string. The set of required time zone IDs is defined by - the Zone Name(TZ) column of the public domain zoneinfo database. - - An optional info string can be assigned to the timer and - retrieved at runtime through the Timer.getInfo() method. - - The timerType can only be specified on stateless session - beans, singleton session beans, and message-driven beans. - - - - - - - - - - - - - - - - - - - - - - - - The trans-attributeType specifies how the container must - manage the transaction boundaries when delegating a method - invocation to an enterprise bean's business method. - - The value must be one of the following: - - NotSupported - Supports - Required - RequiresNew - Mandatory - Never - - - - - - - - - - - - - - - - - - - - - - - The transaction-typeType specifies an enterprise bean's - transaction management type. - - The transaction-type must be one of the two following: - - Bean - Container - - - - - - - - - - - - diff --git a/web/src/test/resources/xsd/javaee_6.xsd b/web/src/test/resources/xsd/javaee_6.xsd deleted file mode 100644 index f5195c3dcc..0000000000 --- a/web/src/test/resources/xsd/javaee_6.xsd +++ /dev/null @@ -1,2422 +0,0 @@ - - - - - - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - - Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved. - - The contents of this file are subject to the terms of either the - GNU General Public License Version 2 only ("GPL") or the Common - Development and Distribution License("CDDL") (collectively, the - "License"). You may not use this file except in compliance with - the License. You can obtain a copy of the License at - https://glassfish.dev.java.net/public/CDDL+GPL.html or - glassfish/bootstrap/legal/LICENSE.txt. See the License for the - specific language governing permissions and limitations under the - License. - - When distributing the software, include this License Header - Notice in each file and include the License file at - glassfish/bootstrap/legal/LICENSE.txt. Sun designates this - particular file as subject to the "Classpath" exception as - provided by Sun in the GPL Version 2 section of the License file - that accompanied this code. If applicable, add the following - below the License Header, with the fields enclosed by brackets [] - replaced by your own identifying information: - "Portions Copyrighted [year] [name of copyright owner]" - - Contributor(s): - - If you wish your version of this file to be governed by only the - CDDL or only the GPL Version 2, indicate your decision by adding - "[Contributor] elects to include this software in this - distribution under the [CDDL or GPL Version 2] license." If you - don't indicate a single choice of license, a recipient has the - option to distribute your version of this file under either the - CDDL, the GPL Version 2 or to extend the choice of license to its - licensees as provided above. However, if you add GPL Version 2 - code and therefore, elected the GPL Version 2 license, then the - option applies only if the new code is made subject to such - option by the copyright holder. - - - - - - - - The following definitions that appear in the common - shareable schema(s) of Java EE deployment descriptors should be - interpreted with respect to the context they are included: - - Deployment Component may indicate one of the following: - java ee application; - application client; - web application; - enterprise bean; - resource adapter; - - Deployment File may indicate one of the following: - ear file; - war file; - jar file; - rar file; - - - - - - - - - - - - - This group keeps the usage of the contained description related - elements consistent across Java EE deployment descriptors. - - All elements may occur multiple times with different languages, - to support localization of the content. - - - - - - - - - - - - - - - This group keeps the usage of the contained JNDI environment - reference elements consistent across Java EE deployment descriptors. - - - - - - - - - - - - - - - - - - - - - - - - This group collects elements that are common to most - JNDI resource elements. - - - - - - - - - - The JNDI name to be looked up to resolve a resource reference. - - - - - - - - - - - - This group collects elements that are common to all the - JNDI resource elements. It does not include the lookup-name - element, that is only applicable to some resource elements. - - - - - - - - - A product specific name that this resource should be - mapped to. The name of this resource, as defined by the - resource's name element or defaulted, is a name that is - local to the application component using the resource. - (It's a name in the JNDI java:comp/env namespace.) Many - application servers provide a way to map these local - names to names of resources known to the application - server. This mapped name is often a global JNDI name, - but may be a name of any form. - - Application servers are not required to support any - particular form or type of mapped name, nor the ability - to use mapped names. The mapped name is - product-dependent and often installation-dependent. No - use of a mapped name is portable. - - - - - - - - - - - - - - - - Configuration of a DataSource. - - - - - - - - - Description of this DataSource. - - - - - - - - - The name element specifies the JNDI name of the - data source being defined. - - - - - - - - - DataSource, XADataSource or ConnectionPoolDataSource - implementation class. - - - - - - - - - Database server name. - - - - - - - - - Port number where a server is listening for requests. - - - - - - - - - Name of a database on a server. - - - - - - - - url property is specified - along with other standard DataSource properties - such as serverName, databaseName - and portNumber, the more specific properties will - take precedence and url will be ignored. - - ]]> - - - - - - - - User name to use for connection authentication. - - - - - - - - - Password to use for connection authentication. - - - - - - - - - JDBC DataSource property. This may be a vendor-specific - property or a less commonly used DataSource property. - - - - - - - - - Sets the maximum time in seconds that this data source - will wait while attempting to connect to a database. - - - - - - - - - Set to false if connections should not participate in - transactions. - - - - - - - - - Isolation level for connections. - - - - - - - - - Number of connections that should be created when a - connection pool is initialized. - - - - - - - - - Maximum number of connections that should be concurrently - allocated for a connection pool. - - - - - - - - - Minimum number of connections that should be concurrently - allocated for a connection pool. - - - - - - - - - The number of seconds that a physical connection should - remain unused in the pool before the connection is - closed for a connection pool. - - - - - - - - - The total number of statements that a connection pool - should keep open. - - - - - - - - - - - - - - - - The description type is used by a description element to - provide text describing the parent element. The elements - that use this type should include any information that the - Deployment Component's Deployment File file producer wants - to provide to the consumer of the Deployment Component's - Deployment File (i.e., to the Deployer). Typically, the - tools used by such a Deployment File consumer will display - the description when processing the parent element that - contains the description. - - The lang attribute defines the language that the - description is provided in. The default value is "en" (English). - - - - - - - - - - - - - - - This type defines a dewey decimal that is used - to describe versions of documents. - - - - - - - - - - - - - - - - Employee Self Service - - - The value of the xml:lang attribute is "en" (English) by default. - - ]]> - - - - - - - - - - - - - - - - EmployeeRecord - - ../products/product.jar#ProductEJB - - ]]> - - - - - - - - - - - - - - - The ejb-local-refType is used by ejb-local-ref elements for - the declaration of a reference to an enterprise bean's local - home or to the local business interface of a 3.0 bean. - The declaration consists of: - - - an optional description - - the EJB reference name used in the code of the Deployment - Component that's referencing the enterprise bean. - - the optional expected type of the referenced enterprise bean - - the optional expected local interface of the referenced - enterprise bean or the local business interface of the - referenced enterprise bean. - - the optional expected local home interface of the referenced - enterprise bean. Not applicable if this ejb-local-ref refers - to the local business interface of a 3.0 bean. - - optional ejb-link information, used to specify the - referenced enterprise bean - - optional elements to define injection of the named enterprise - bean into a component field or property. - - - - - - - - - - - - - - - - - - - - - - ejb/Payroll - - ]]> - - - - - - - - - - - - - - - The ejb-refType is used by ejb-ref elements for the - declaration of a reference to an enterprise bean's home or - to the remote business interface of a 3.0 bean. - The declaration consists of: - - - an optional description - - the EJB reference name used in the code of - the Deployment Component that's referencing the enterprise - bean. - - the optional expected type of the referenced enterprise bean - - the optional remote interface of the referenced enterprise bean - or the remote business interface of the referenced enterprise - bean - - the optional expected home interface of the referenced - enterprise bean. Not applicable if this ejb-ref - refers to the remote business interface of a 3.0 bean. - - optional ejb-link information, used to specify the - referenced enterprise bean - - optional elements to define injection of the named enterprise - bean into a component field or property - - - - - - - - - - - - - - - - - - - - - - - The ejb-ref-typeType contains the expected type of the - referenced enterprise bean. - - The ejb-ref-type designates a value - that must be one of the following: - - Entity - Session - - - - - - - - - - - - - - - - - - - This type is used to designate an empty - element when used. - - - - - - - - - - - - - - The env-entryType is used to declare an application's - environment entry. The declaration consists of an optional - description, the name of the environment entry, a type - (optional if the value is injected, otherwise required), and - an optional value. - - It also includes optional elements to define injection of - the named resource into fields or JavaBeans properties. - - If a value is not specified and injection is requested, - no injection will occur and no entry of the specified name - will be created. This allows an initial value to be - specified in the source code without being incorrectly - changed when no override has been specified. - - If a value is not specified and no injection is requested, - a value must be supplied during deployment. - - This type is used by env-entry elements. - - - - - - - - - minAmount - - ]]> - - - - - - - java.lang.Integer - - ]]> - - - - - - - 100.00 - - ]]> - - - - - - - - - - - - - - - java.lang.Boolean - java.lang.Class - com.example.Color - - ]]> - - - - - - - - - - - - - - - The elements that use this type designate the name of a - Java class or interface. The name is in the form of a - "binary name", as defined in the JLS. This is the form - of name used in Class.forName(). Tools that need the - canonical name (the name used in source code) will need - to convert this binary name to the canonical name. - - - - - - - - - - - - - - - - This type defines four different values which can designate - boolean values. This includes values yes and no which are - not designated by xsd:boolean - - - - - - - - - - - - - - - - - - - - - The icon type contains small-icon and large-icon elements - that specify the file names for small and large GIF, JPEG, - or PNG icon images used to represent the parent element in a - GUI tool. - - The xml:lang attribute defines the language that the - icon file names are provided in. Its value is "en" (English) - by default. - - - - - - - - employee-service-icon16x16.jpg - - ]]> - - - - - - - employee-service-icon32x32.jpg - - ]]> - - - - - - - - - - - - - - - - An injection target specifies a class and a name within - that class into which a resource should be injected. - - The injection target class specifies the fully qualified - class name that is the target of the injection. The - Java EE specifications describe which classes can be an - injection target. - - The injection target name specifies the target within - the specified class. The target is first looked for as a - JavaBeans property name. If not found, the target is - looked for as a field name. - - The specified resource will be injected into the target - during initialization of the class by either calling the - set method for the target property or by setting a value - into the named field. - - - - - - - - - - - - - - The following transaction isolation levels are allowed - (see documentation for the java.sql.Connection interface): - TRANSACTION_READ_UNCOMMITTED - TRANSACTION_READ_COMMITTED - TRANSACTION_REPEATABLE_READ - TRANSACTION_SERIALIZABLE - - - - - - - - - - - - - - - - - - - The java-identifierType defines a Java identifier. - The users of this type should further verify that - the content does not contain Java reserved keywords. - - - - - - - - - - - - - - - - - - This is a generic type that designates a Java primitive - type or a fully qualified name of a Java interface/type, - or an array of such types. - - - - - - - - - - - - - - - - - : - - Example: - - jdbc:mysql://localhost:3307/testdb - - ]]> - - - - - - - - - - - - - - - - - The jndi-nameType type designates a JNDI name in the - Deployment Component's environment and is relative to the - java:comp/env context. A JNDI name must be unique within the - Deployment Component. - - - - - - - - - - - - - - - com.aardvark.payroll.PayrollHome - - ]]> - - - - - - - - - - - - - - - The lifecycle-callback type specifies a method on a - class to be called when a lifecycle event occurs. - Note that each class may have only one lifecycle callback - method for any given event and that the method may not - be overloaded. - - If the lifefycle-callback-class element is missing then - the class defining the callback is assumed to be the - component class in scope at the place in the descriptor - in which the callback definition appears. - - - - - - - - - - - - - - - - - The listenerType indicates the deployment properties for a web - application listener bean. - - - - - - - - - - The listener-class element declares a class in the - application must be registered as a web - application listener bean. The value is the fully - qualified classname of the listener class. - - - - - - - - - - - - - - - - The localType defines the fully-qualified name of an - enterprise bean's local interface. - - - - - - - - - - - - - - - - The local-homeType defines the fully-qualified - name of an enterprise bean's local home interface. - - - - - - - - - - - - - - - - This type is a general type that can be used to declare - parameter/value lists. - - - - - - - - - - The param-name element contains the name of a - parameter. - - - - - - - - - The param-value element contains the value of a - parameter. - - - - - - - - - - - - - - - - The elements that use this type designate either a relative - path or an absolute path starting with a "/". - - In elements that specify a pathname to a file within the - same Deployment File, relative filenames (i.e., those not - starting with "/") are considered relative to the root of - the Deployment File's namespace. Absolute filenames (i.e., - those starting with "/") also specify names in the root of - the Deployment File's namespace. In general, relative names - are preferred. The exception is .war files where absolute - names are preferred for consistency with the Servlet API. - - - - - - - - - - - - - - - - myPersistenceContext - - - - - myPersistenceContext - - PersistenceUnit1 - - Extended - - - ]]> - - - - - - - - - The persistence-context-ref-name element specifies - the name of a persistence context reference; its - value is the environment entry name used in - Deployment Component code. The name is a JNDI name - relative to the java:comp/env context. - - - - - - - - - The Application Assembler(or BeanProvider) may use the - following syntax to avoid the need to rename persistence - units to have unique names within a Java EE application. - - The Application Assembler specifies the pathname of the - root of the persistence.xml file for the referenced - persistence unit and appends the name of the persistence - unit separated from the pathname by #. The pathname is - relative to the referencing application component jar file. - In this manner, multiple persistence units with the same - persistence unit name may be uniquely identified when the - Application Assembler cannot change persistence unit names. - - - - - - - - - - Used to specify properties for the container or persistence - provider. Vendor-specific properties may be included in - the set of properties. Properties that are not recognized - by a vendor must be ignored. Entries that make use of the - namespace jakarta.persistence and its subnamespaces must not - be used for vendor-specific properties. The namespace - jakarta.persistence is reserved for use by the specification. - - - - - - - - - - - - - - - - - The persistence-context-typeType specifies the transactional - nature of a persistence context reference. - - The value of the persistence-context-type element must be - one of the following: - Transaction - Extended - - - - - - - - - - - - - - - - - - - Specifies a name/value pair. - - - - - - - - - - - - - - - - - - - - myPersistenceUnit - - - - - myPersistenceUnit - - PersistenceUnit1 - - - - ]]> - - - - - - - - - The persistence-unit-ref-name element specifies - the name of a persistence unit reference; its - value is the environment entry name used in - Deployment Component code. The name is a JNDI name - relative to the java:comp/env context. - - - - - - - - - The Application Assembler(or BeanProvider) may use the - following syntax to avoid the need to rename persistence - units to have unique names within a Java EE application. - - The Application Assembler specifies the pathname of the - root of the persistence.xml file for the referenced - persistence unit and appends the name of the persistence - unit separated from the pathname by #. The pathname is - relative to the referencing application component jar file. - In this manner, multiple persistence units with the same - persistence unit name may be uniquely identified when the - Application Assembler cannot change persistence unit names. - - - - - - - - - - - - - - - - com.wombat.empl.EmployeeService - - ]]> - - - - - - - - - - - - - - - jms/StockQueue - - jakarta.jms.Queue - - - - ]]> - - - - - - - - - The resource-env-ref-name element specifies the name - of a resource environment reference; its value is - the environment entry name used in - the Deployment Component code. The name is a JNDI - name relative to the java:comp/env context and must - be unique within a Deployment Component. - - - - - - - - - The resource-env-ref-type element specifies the type - of a resource environment reference. It is the - fully qualified name of a Java language class or - interface. - - - - - - - - - - - - - - - - - jdbc/EmployeeAppDB - javax.sql.DataSource - Container - Shareable - - - ]]> - - - - - - - - - The res-ref-name element specifies the name of a - resource manager connection factory reference. - The name is a JNDI name relative to the - java:comp/env context. - The name must be unique within a Deployment File. - - - - - - - - - The res-type element specifies the type of the data - source. The type is specified by the fully qualified - Java language class or interface - expected to be implemented by the data source. - - - - - - - - - - - - - - - - - - - The res-authType specifies whether the Deployment Component - code signs on programmatically to the resource manager, or - whether the Container will sign on to the resource manager - on behalf of the Deployment Component. In the latter case, - the Container uses information that is supplied by the - Deployer. - - The value must be one of the two following: - - Application - Container - - - - - - - - - - - - - - - - - - - The res-sharing-scope type specifies whether connections - obtained through the given resource manager connection - factory reference can be shared. The value, if specified, - must be one of the two following: - - Shareable - Unshareable - - The default value is Shareable. - - - - - - - - - - - - - - - - - - - The run-asType specifies the run-as identity to be - used for the execution of a component. It contains an - optional description, and the name of a security role. - - - - - - - - - - - - - - - - - - The role-nameType designates the name of a security role. - - The name must conform to the lexical rules for a token. - - - - - - - - - - - - - - - - - This role includes all employees who are authorized - to access the employee service application. - - employee - - - ]]> - - - - - - - - - - - - - - - - - The security-role-refType contains the declaration of a - security role reference in a component's or a - Deployment Component's code. The declaration consists of an - optional description, the security role name used in the - code, and an optional link to a security role. If the - security role is not specified, the Deployer must choose an - appropriate security role. - - - - - - - - - - The value of the role-name element must be the String used - as the parameter to the - EJBContext.isCallerInRole(String roleName) method or the - HttpServletRequest.isUserInRole(String role) method. - - - - - - - - - The role-link element is a reference to a defined - security role. The role-link element must contain - the name of one of the security roles defined in the - security-role elements. - - - - - - - - - - - - - - - - This type adds an "id" attribute to xsd:QName. - - - - - - - - - - - - - - - - - - This type adds an "id" attribute to xsd:boolean. - - - - - - - - - - - - - - - - - - This type adds an "id" attribute to xsd:NMTOKEN. - - - - - - - - - - - - - - - - - - This type adds an "id" attribute to xsd:anyURI. - - - - - - - - - - - - - - - - - - This type adds an "id" attribute to xsd:integer. - - - - - - - - - - - - - - - - - - This type adds an "id" attribute to xsd:positiveInteger. - - - - - - - - - - - - - - - - - - This type adds an "id" attribute to xsd:nonNegativeInteger. - - - - - - - - - - - - - - - - - - This type adds an "id" attribute to xsd:string. - - - - - - - - - - - - - - - - - - This is a special string datatype that is defined by Java EE as - a base type for defining collapsed strings. When schemas - require trailing/leading space elimination as well as - collapsing the existing whitespace, this base type may be - used. - - - - - - - - - - - - - - - - - - This simple type designates a boolean with only two - permissible values - - - true - - false - - - - - - - - - - - - - - - - - - The url-patternType contains the url pattern of the mapping. - It must follow the rules specified in Section 11.2 of the - Servlet API Specification. This pattern is assumed to be in - URL-decoded form and must not contain CR(#xD) or LF(#xA). - If it contains those characters, the container must inform - the developer with a descriptive error message. - The container must preserve all characters including whitespaces. - - - - - - - - - - - - - - - - CorporateStocks - - - - ]]> - - - - - - - - - The message-destination-name element specifies a - name for a message destination. This name must be - unique among the names of message destinations - within the Deployment File. - - - - - - - - - A product specific name that this message destination - should be mapped to. Each message-destination-ref - element that references this message destination will - define a name in the namespace of the referencing - component or in one of the other predefined namespaces. - Many application servers provide a way to map these - local names to names of resources known to the - application server. This mapped name is often a global - JNDI name, but may be a name of any form. Each of the - local names should be mapped to this same global name. - - Application servers are not required to support any - particular form or type of mapped name, nor the ability - to use mapped names. The mapped name is - product-dependent and often installation-dependent. No - use of a mapped name is portable. - - - - - - - - - The JNDI name to be looked up to resolve the message destination. - - - - - - - - - - - - - - - - jms/StockQueue - - jakarta.jms.Queue - - Consumes - - CorporateStocks - - - - ]]> - - - - - - - - - The message-destination-ref-name element specifies - the name of a message destination reference; its - value is the environment entry name used in - Deployment Component code. - - - - - - - - - - - - - - - - - - - - The message-destination-usageType specifies the use of the - message destination indicated by the reference. The value - indicates whether messages are consumed from the message - destination, produced for the destination, or both. The - Assembler makes use of this information in linking producers - of a destination with its consumers. - - The value of the message-destination-usage element must be - one of the following: - Consumes - Produces - ConsumesProduces - - - - - - - - - - - - - - - - - - - jakarta.jms.Queue - - - ]]> - - - - - - - - - - - - - - - The message-destination-linkType is used to link a message - destination reference or message-driven bean to a message - destination. - - The Assembler sets the value to reflect the flow of messages - between producers and consumers in the application. - - The value must be the message-destination-name of a message - destination in the same Deployment File or in another - Deployment File in the same Java EE application unit. - - Alternatively, the value may be composed of a path name - specifying a Deployment File containing the referenced - message destination with the message-destination-name of the - destination appended and separated from the path name by - "#". The path name is relative to the Deployment File - containing Deployment Component that is referencing the - message destination. This allows multiple message - destinations with the same name to be uniquely identified. - - - - - - - - - diff --git a/web/src/test/resources/xsd/javaee_web_services_client_1_3.xsd b/web/src/test/resources/xsd/javaee_web_services_client_1_3.xsd deleted file mode 100644 index f4bf729a99..0000000000 --- a/web/src/test/resources/xsd/javaee_web_services_client_1_3.xsd +++ /dev/null @@ -1,737 +0,0 @@ - - - - - - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - - Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved. - - The contents of this file are subject to the terms of either the - GNU General Public License Version 2 only ("GPL") or the Common - Development and Distribution License("CDDL") (collectively, the - "License"). You may not use this file except in compliance with - the License. You can obtain a copy of the License at - https://glassfish.dev.java.net/public/CDDL+GPL.html or - glassfish/bootstrap/legal/LICENSE.txt. See the License for the - specific language governing permissions and limitations under the - License. - - When distributing the software, include this License Header - Notice in each file and include the License file at - glassfish/bootstrap/legal/LICENSE.txt. Sun designates this - particular file as subject to the "Classpath" exception as - provided by Sun in the GPL Version 2 section of the License file - that accompanied this code. If applicable, add the following - below the License Header, with the fields enclosed by brackets [] - replaced by your own identifying information: - "Portions Copyrighted [year] [name of copyright owner]" - - Contributor(s): - - If you wish your version of this file to be governed by only the - CDDL or only the GPL Version 2, indicate your decision by adding - "[Contributor] elects to include this software in this - distribution under the [CDDL or GPL Version 2] license." If you - don't indicate a single choice of license, a recipient has the - option to distribute your version of this file under either the - CDDL, the GPL Version 2 or to extend the choice of license to its - licensees as provided above. However, if you add GPL Version 2 - code and therefore, elected the GPL Version 2 license, then the - option applies only if the new code is made subject to such - option by the copyright holder. - - - - - - - - (C) Copyright International Business Machines Corporation 2002 - - - - - - - - - - - - The service-ref element declares a reference to a Web - service. It contains optional description, display name and - icons, a declaration of the required Service interface, - an optional WSDL document location, an optional set - of JAX-RPC mappings, an optional QName for the service element, - an optional set of Service Endpoint Interfaces to be resolved - by the container to a WSDL port, and an optional set of handlers. - - - - - - - - - - The service-ref-name element declares logical name that the - components in the module use to look up the Web service. It - is recommended that all service reference names start with - "service/". - - - - - - - - - The service-interface element declares the fully qualified class - name of the JAX-RPC Service interface the client depends on. - In most cases the value will be javax.xml.rpc.Service. A JAX-RPC - generated Service Interface class may also be specified. - - - - - - - - - The service-ref-type element declares the type of the service-ref - element that is injected or returned when a JNDI lookup is done. - This must be either a fully qualified name of Service class or - the fully qualified name of service endpoint interface class. - This is only used with JAX-WS runtime where the corresponding - @WebServiceRef annotation can be used to denote both a Service - or a Port. - - If this is not specified, then the type of service-ref element - that is injected or returned when a JNDI lookup is done is - always a Service interface/class. - - - - - - - - - The wsdl-file element contains the URI location of a WSDL - file. The location is relative to the root of the module. - - - - - - - - - The jaxrpc-mapping-file element contains the name of a file that - describes the JAX-RPC mapping between the Java interaces used by - the application and the WSDL description in the wsdl-file. The - file name is a relative path within the module file. - - This is not required when JAX-WS based runtime is used. - - - - - - - - - The service-qname element declares the specific WSDL service - element that is being refered to. It is not specified if no - wsdl-file is declared. - - - - - - - - - The port-component-ref element declares a client dependency - on the container for resolving a Service Endpoint Interface - to a WSDL port. It optionally associates the Service Endpoint - Interface with a particular port-component. This is only used - by the container for a Service.getPort(Class) method call. - - - - - - - - - - Declares the handler for a port-component. Handlers can - access the init-param name/value pairs using the - HandlerInfo interface. If port-name is not specified, the - handler is assumed to be associated with all ports of the - service. - - To be used with JAX-RPC based runtime only. - - - - - - - - - To be used with JAX-WS based runtime only. - - - - - - - - - - - - - - - - - - The port-component-ref element declares a client dependency - on the container for resolving a Service Endpoint Interface - to a WSDL port. It optionally associates the Service Endpoint - Interface with a particular port-component. This is only used - by the container for a Service.getPort(Class) method call. - - - - - - - - - The service-endpoint-interface element defines a fully qualified - Java class that represents the Service Endpoint Interface of a - WSDL port. - - - - - - - - - Used to enable or disable SOAP MTOM/XOP mechanism on the client - side for a port-component. - - Not to be specified for JAX-RPC runtime - - - - - - - - - When MTOM is enabled, binary data above this size in bytes - should be XOP encoded or sent as attachment. Default value is 0. - - Not to be specified for JAX-RPC runtime - - - - - - - - - This specifies the WS-Addressing requirements for a JAX-WS - web service. It corresponds to jakarta.xml.ws.soap.Addressing - annotation or its feature jakarta.xml.ws.soap.AddressingFeature. - - See the addressingType for more information. - - Not to be specified for JAX-RPC runtime - - - - - - - - - Corresponds to the jakarta.xml.ws.RespectBinding annotation - or its corresponding jakarta.xml.ws.RespectBindingFeature web - service feature. This is used to control whether a JAX-WS - implementation must respect/honor the contents of the - wsdl:binding in the WSDL that is associated with the service. - - Not to be specified for JAX-RPC runtime - - - - - - - - - The port-component-link element links a port-component-ref - to a specific port-component required to be made available - by a service reference. - - The value of a port-component-link must be the - port-component-name of a port-component in the same module - or another module in the same application unit. The syntax - for specification follows the syntax defined for ejb-link - in the EJB 2.0 specification. - - - - - - - - - - - - - - - - The handler-chains element defines the handlerchains associated with this - service or service endpoint. - - - - - - - - - - - - - - - - - The handler-chain element defines the handlerchain. - Handlerchain can be defined such that the handlers in the - handlerchain operate,all ports of a service, on a specific - port or on a list of protocol-bindings. The choice of elements - service-name-pattern, port-name-pattern and protocol-bindings - are used to specify whether the handlers in handler-chain are - for a service, port or protocol binding. If none of these - choices are specified with the handler-chain element then the - handlers specified in the handler-chain will be applied on - everything. - - - - - - - - - - - - - - - - - - - Defines the type used for specifying a list of - protocol-bindingType(s). For e.g. - - ##SOAP11_HTTP ##SOAP12_HTTP ##XML_HTTP - - - - - - - - - - - Defines the type used for specifying the URI for the - protocol binding used by the port-component. For - portability one could use one of the following tokens that - alias the standard binding types: - - ##SOAP11_HTTP - ##SOAP11_HTTP_MTOM - ##SOAP12_HTTP - ##SOAP12_HTTP_MTOM - ##XML_HTTP - - Other specifications could define tokens that start with ## - to alias new standard binding URIs that are introduced. - - - - - - - - - - - Defines the type that is used for specifying tokens that - start with ## which are used to alias existing standard - protocol bindings and support aliases for new standard - binding URIs that are introduced in future specifications. - - The following tokens alias the standard protocol binding - URIs: - - ##SOAP11_HTTP = "http://schemas.xmlsoap.org/wsdl/soap/http" - ##SOAP11_HTTP_MTOM = - "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true" - ##SOAP12_HTTP = "http://www.w3.org/2003/05/soap/bindings/HTTP/" - ##SOAP12_HTTP_MTOM = - "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true" - ##XML_HTTP = "http://www.w3.org/2004/08/wsdl/http" - - - - - - - - - - - - - This is used to specify the QName pattern in the - attribute service-name-pattern and port-name-pattern in - the handler-chain element - - For example, the various forms acceptable here for - service-name-pattern attribute in handler-chain element - are : - - Exact Name: service-name-pattern="ns1:EchoService" - - In this case, handlers specified in this - handler-chain element will apply to all ports with - this exact service name. The namespace prefix must - have been declared in a namespace declaration - attribute in either the start-tag of the element - where the prefix is used or in an an ancestor - element (i.e. an element in whose content the - prefixed markup occurs) - - - Pattern : service-name-pattern="ns1:EchoService*" - - In this case, handlers specified in this - handler-chain element will apply to all ports whose - Service names are like EchoService1, EchoServiceFoo - etc. The namespace prefix must have been declared in - a namespace declaration attribute in either the - start-tag of the element where the prefix is used or - in an an ancestor element (i.e. an element in whose - content the prefixed markup occurs) - - Wild Card : service-name-pattern="*" - - In this case, handlers specified in this handler-chain - element will apply to ports of all service names. - - The same can be applied to port-name attribute in - handler-chain element. - - - - - - - - - - - - - - - - This specifies the WS-Addressing requirements for a JAX-WS web service. - It corresponds to jakarta.xml.ws.soap.Addressing annotation or its - feature jakarta.xml.ws.soap.AddressingFeature. - - If the "enabled" element is "true", WS-Addressing is enabled. - It means that the endpoint supports WS-Addressing but does not require - its use. The default value for "enabled" is "true". - - If the WS-Addressing is enabled and the "required" element is "true", - it means that the endpoint requires WS-Addressing. The default value - for "required" is "false". - - If WS-Addressing is enabled, the "responses" element determines - if an endpoint requires the use of only anonymous responses, - or only non-anonymous responses, or all. The value of the "responses" - element must be one of the following: - - ANONYMOUS - NON_ANONYMOUS - ALL - - The default value for the "responses" is ALL. - - - - - - - - - - - - - - - - - - If WS-Addressing is enabled, this type determines if an endpoint - requires the use of only anonymous responses, or only non-anonymous - responses, or all. - - - - - - - - - - - - - - - - - - - - Corresponds to the jakarta.xml.ws.RespectBinding annotation - or its corresponding jakarta.xml.ws.RespectBindingFeature web - service feature. This is used to control whether a JAX-WS - implementation must respect/honor the contents of the - wsdl:binding in the WSDL that is associated with the service. - - If the "enabled" element is "true", wsdl:binding in the - associated WSDL, if any, must be respected/honored. - - - - - - - - - - - - - - - - Declares the handler for a port-component, service-ref. Handlers can - access the init-param name/value pairs using the HandlerInfo interface. - - Used in: port-component, service-ref - - - - - - - - - - Defines the name of the handler. The name must be unique within the - module. - - - - - - - - - Defines a fully qualified class name for the handler implementation. - - - - - - - - - Not to be specified for JAX-WS runtime - - - - - - - - - Defines the QName of a SOAP header that will be processed by the - handler. - - Not to be specified for JAX-WS runtime - - - - - - - - - The soap-role element contains a SOAP actor definition that the - Handler will play as a role. - - - - - - - - - The port-name element defines the WSDL port-name that a - handler should be associated with. If port-name is not - specified, the handler is assumed to be associated with - all ports of the service. - - Not to be specified for JAX-WS runtime - - - - - - - - - - - - - - - - Defines the name of the handler. The name must be unique - within the module. - - - - - - - - - - - diff --git a/web/src/test/resources/xsd/xml.xsd b/web/src/test/resources/xsd/xml.xsd deleted file mode 100644 index aea7d0db0a..0000000000 --- a/web/src/test/resources/xsd/xml.xsd +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - -
-

About the XML namespace

- -
-

- This schema document describes the XML namespace, in a form - suitable for import by other schema documents. -

-

- See - http://www.w3.org/XML/1998/namespace.html and - - http://www.w3.org/TR/REC-xml for information - about this namespace. -

-

- Note that local names in this namespace are intended to be - defined only by the World Wide Web Consortium or its subgroups. - The names currently defined in this namespace are listed below. - They should not be used with conflicting semantics by any Working - Group, specification, or document instance. -

-

- See further below in this document for more information about how to refer to this schema document from your own - XSD schema documents and about the - namespace-versioning policy governing this schema document. -

-
-
-
-
- - - - -
- -

lang (as an attribute name)

-

- denotes an attribute whose value - is a language code for the natural language of the content of - any element; its value is inherited. This name is reserved - by virtue of its definition in the XML specification.

- -
-
-

Notes

-

- Attempting to install the relevant ISO 2- and 3-letter - codes as the enumerated possible values is probably never - going to be a realistic possibility. -

-

- See BCP 47 at - http://www.rfc-editor.org/rfc/bcp/bcp47.txt - and the IANA language subtag registry at - - http://www.iana.org/assignments/language-subtag-registry - for further information. -

-

- The union allows for the 'un-declaration' of xml:lang with - the empty string. -

-
-
-
- - - - - - - - - -
- - - - -
- -

space (as an attribute name)

-

- denotes an attribute whose - value is a keyword indicating what whitespace processing - discipline is intended for the content of the element; its - value is inherited. This name is reserved by virtue of its - definition in the XML specification.

- -
-
-
- - - - - - -
- - - -
- -

base (as an attribute name)

-

- denotes an attribute whose value - provides a URI to be used as the base for interpreting any - relative URIs in the scope of the element on which it - appears; its value is inherited. This name is reserved - by virtue of its definition in the XML Base specification.

- -

- See http://www.w3.org/TR/xmlbase/ - for information about this attribute. -

-
-
-
-
- - - - -
- -

id (as an attribute name)

-

- denotes an attribute whose value - should be interpreted as if declared to be of type ID. - This name is reserved by virtue of its definition in the - xml:id specification.

- -

- See http://www.w3.org/TR/xml-id/ - for information about this attribute. -

-
-
-
-
- - - - - - - - - - -
- -

Father (in any context at all)

- -
-

- denotes Jon Bosak, the chair of - the original XML Working Group. This name is reserved by - the following decision of the W3C XML Plenary and - XML Coordination groups: -

-
-

- In appreciation for his vision, leadership and - dedication the W3C XML Plenary on this 10th day of - February, 2000, reserves for Jon Bosak in perpetuity - the XML name "xml:Father". -

-
-
-
-
-
- - - -
-

About this schema document

- -
-

- This schema defines attributes and an attribute group suitable - for use by schemas wishing to allow xml:base, - xml:lang, xml:space or - xml:id attributes on elements they define. -

-

- To enable this, such a schema must import this schema for - the XML namespace, e.g. as follows: -

-
-          <schema . . .>
-           . . .
-           <import namespace="http://www.w3.org/XML/1998/namespace"
-                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
-     
-

- or -

-
-           <import namespace="http://www.w3.org/XML/1998/namespace"
-                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
-     
-

- Subsequently, qualified reference to any of the attributes or the - group defined below will have the desired effect, e.g. -

-
-          <type . . .>
-           . . .
-           <attributeGroup ref="xml:specialAttrs"/>
-     
-

- will define a type which will schema-validate an instance element - with any of those attributes. -

-
-
-
-
- - - -
-

Versioning policy for this schema document

-
-

- In keeping with the XML Schema WG's standard versioning - policy, this schema document will persist at - - http://www.w3.org/2009/01/xml.xsd. -

-

- At the date of issue it can also be found at - - http://www.w3.org/2001/xml.xsd. -

-

- The schema document at that URI may however change in the future, - in order to remain compatible with the latest version of XML - Schema itself, or with the XML namespace itself. In other words, - if the XML Schema or XML namespaces change, the version of this - document at - http://www.w3.org/2001/xml.xsd - - will change accordingly; the version at - - http://www.w3.org/2009/01/xml.xsd - - will not change. -

-

- Previous dated (and unchanging) versions of this schema - document are at: -

- -
-
-
-
- -
-