EOL
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/52567075 Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/52567075 Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/52567075 Branch: refs/heads/tomee-1.7.3-prepare Commit: 52567075302c76542c4fa448095a9f918f54893c Parents: 8a62db6 Author: [email protected] <[email protected]> Authored: Fri Dec 4 17:14:18 2015 +0100 Committer: [email protected] <[email protected]> Committed: Fri Dec 4 17:14:18 2015 +0100 ---------------------------------------------------------------------- LIBRARIES | 194 +- .../embedded/MultipleDeploymentsTest.java | 164 +- .../arquillian/remote/RemoteTomEEContainer.java | 714 ++++---- .../conf/Catalina/localhost/ROOT.xml | 82 +- .../conf/Catalina/localhost/ROOT.xml | 82 +- .../arquillian/tests/jms/DummyManagedBean.java | 112 +- .../arquillian/tests/jms/JMSInjectionTest.java | 158 +- .../tests/jsf/jpa/DummyManagedBean.java | 88 +- .../tests/jsf/jpa/JPAInjectionTest.java | 154 +- .../arquillian/webapp/TomEEWebappContainer.java | 494 ++--- assembly/openejb-standalone/README.html | 42 +- .../src/main/assembly/component.xml | 42 +- .../src/main/assembly/dos.xml | 250 +-- .../src/main/assembly/unix.xml | 246 +-- .../src/main/resources/Start.bat | 66 +- .../src/main/resources/Stop.bat | 66 +- .../main/resources/service.install.as.admin.bat | 300 +-- .../main/resources/service.remove.as.admin.bat | 96 +- .../classic/EntityManagerFactoryCallable.java | 202 +-- .../bval/BeanValidationAppendixInterceptor.java | 410 ++--- .../apache/openejb/cdi/OpenEJBLifecycle.java | 838 ++++----- .../apache/openejb/cipher/PasswordCipher.java | 102 +- .../openejb/cipher/PlainTextPasswordCipher.java | 108 +- .../openejb/cipher/StaticDESPasswordCipher.java | 194 +- .../apache/openejb/classloader/FalseFilter.java | 58 +- .../openejb/config/DeploymentFilterable.java | 66 +- .../org/apache/openejb/config/RemoteServer.java | 1428 +++++++-------- .../openejb/config/rules/CheckAnnotations.java | 190 +- .../rules/CheckIncorrectPropertyNames.java | 168 +- .../injection/FallbackPropertyInjector.java | 48 +- .../openejb/persistence/QueryOperation.java | 48 +- .../resource/activemq/ActiveMQFactory.java | 308 ++-- .../openejb/resource/jdbc/RoutedDataSource.java | 258 +-- .../resource/jdbc/cipher/PasswordCipher.java | 58 +- .../jdbc/cipher/PlainTextPasswordCipher.java | 44 +- .../jdbc/cipher/StaticDESPasswordCipher.java | 46 +- .../resource/jdbc/router/AbstractRouter.java | 84 +- .../openejb/resource/jdbc/router/Router.java | 74 +- .../openejb/rest/ThreadLocalContextManager.java | 192 +- .../openejb/testng/PropertiesBuilder.java | 94 +- .../apache/openejb/util/CollectionsUtil.java | 60 +- .../org/apache/openejb/util/LogStreamAsync.java | 448 ++--- .../org/apache/openejb/util/NetworkUtil.java | 868 ++++----- .../org/apache/openejb/util/Slf4jLogStream.java | 218 +-- .../openejb/util/Slf4jLogStreamFactory.java | 80 +- .../src/main/resources/META-INF/ejb-jar.xml | 40 +- .../src/main/resources/META-INF/openejb-jar.xml | 52 +- .../org.apache.openejb.cli/validate.examples | 102 +- .../main/resources/openejb-version.properties | 42 +- .../openejb/config/rules/Messages_hi.properties | 1712 +++++++++--------- .../PersistenceUnitLinkResolverTest.java | 88 +- .../openejb/activemq/KahaDBSupportTest.java | 88 +- .../openejb/assembler/DeployerEjbTest.java | 566 +++--- .../BeanValidationAppendixInterceptorTest.java | 408 ++--- .../openejb/config/AnnotationDeployerTest.java | 1100 +++++------ .../config/rules/CheckAnnotationTest.java | 174 +- .../config/rules/CheckCdiEnabledTest.java | 86 +- .../config/rules/CheckDependsOnTest.java | 152 +- .../rules/CheckIncorrectPropertyNameTest.java | 98 +- .../config/rules/CheckMissingClassTest.java | 368 ++-- .../config/rules/CheckNoBusinessMethodTest.java | 396 ++-- .../config/rules/CheckNoCreateMethodsTest.java | 560 +++--- .../rules/CheckPersistenceContextUsageTest.java | 198 +- .../rules/CheckPersistenceUnitUsageTest.java | 192 +- .../config/rules/CheckWrongClassTypeTest.java | 82 +- .../openejb/config/rules/InvokeMethod.java | 402 ++-- .../org/apache/openejb/config/rules/Key.java | 64 +- .../org/apache/openejb/config/rules/Keys.java | 62 +- .../rules/MistakenResourceRefUsageTest.java | 110 +- .../openejb/config/rules/ValidationRunner.java | 176 +- .../PermitAllWithDenyAllOnClassTest.java | 176 +- .../org/apache/openejb/jpa/JTAPuAndBmtTest.java | 308 ++-- .../apache/openejb/junit/PreDestroyTest.java | 164 +- .../openejb/resource/URLAsResourceTest.java | 142 +- .../resource/jdbc/DynamicDataSourceTest.java | 658 +++---- .../jdbc/driver/AlternateDriverJarTest.java | 260 +-- .../apache/openejb/test/annotated/Green.java | 66 +- .../org/apache/openejb/test/annotated/Red.java | 64 +- .../apache/openejb/test/annotated/Yellow.java | 80 +- .../openejb/util/BeanTypeComparisonTest.java | 70 +- .../openejb/util/CollectionsUtilTest.java | 68 +- .../apache/openejb/util/NetworkUtilTest.java | 264 +-- .../resources/META-INF/jpa-test-mappings.xml | 42 +- .../resources/META-INF/org.acme/service-jar.xml | 42 +- .../META-INF/org.router/service-jar.xml | 56 +- .../cmp/itest-2.2/itest-2.2-openejb-jar.xml | 40 +- .../itest-2.2/itest-2.2-pojo-openejb-jar.xml | 528 +++--- .../itest-2.2/itest-2.2-sun-cmp-mappings.xml | 40 +- .../cmp/itest-2.2/itest-2.2-sun-ejb-jar.xml | 38 +- .../apache/openejb/jee/jpa/CollectionTable.java | 386 ++-- .../openejb/jee/jpa/ElementCollection.java | 1154 ++++++------ .../apache/openejb/jee/jpa/LockModeType.java | 130 +- .../org/apache/openejb/jee/jpa/MapKeyClass.java | 150 +- .../apache/openejb/jee/jpa/MapKeyColumn.java | 582 +++--- .../openejb/jee/jpa/MapKeyJoinColumn.java | 486 ++--- .../org/apache/openejb/jee/jpa/OrderColumn.java | 342 ++-- .../common/CompatibilityDescriptionGroup.java | 260 +-- .../openejb/jee/was/v6/common/Description.java | 586 +++--- .../jee/was/v6/common/DescriptionGroup.java | 680 +++---- .../openejb/jee/was/v6/common/DisplayName.java | 600 +++--- .../openejb/jee/was/v6/common/EJBLocalRef.java | 198 +- .../openejb/jee/was/v6/common/EjbRef.java | 816 ++++----- .../openejb/jee/was/v6/common/EjbRefEnum.java | 130 +- .../openejb/jee/was/v6/common/EnvEntry.java | 728 ++++---- .../openejb/jee/was/v6/common/EnvEntryEnum.java | 158 +- .../openejb/jee/was/v6/common/IconType.java | 618 +++---- .../openejb/jee/was/v6/common/Identity.java | 638 +++---- .../jee/was/v6/common/JNDIEnvRefsGroup.java | 558 +++--- .../openejb/jee/was/v6/common/Listener.java | 222 +-- .../jee/was/v6/common/MessageDestination.java | 184 +- .../was/v6/common/MessageDestinationRef.java | 786 ++++---- .../v6/common/MessageDestinationUsageEnum.java | 136 +- .../jee/was/v6/common/ObjectFactory.java | 950 +++++----- .../openejb/jee/was/v6/common/ParamValue.java | 678 +++---- .../apache/openejb/jee/was/v6/common/QName.java | 642 +++---- .../openejb/jee/was/v6/common/ResAuthEnum.java | 132 +- .../jee/was/v6/common/ResSharingScopeEnum.java | 130 +- .../jee/was/v6/common/ResourceEnvRef.java | 792 ++++---- .../openejb/jee/was/v6/common/ResourceRef.java | 834 ++++----- .../was/v6/common/RunAsSpecifiedIdentity.java | 172 +- .../jee/was/v6/common/SecurityIdentity.java | 598 +++--- .../openejb/jee/was/v6/common/SecurityRole.java | 678 +++---- .../jee/was/v6/common/SecurityRoleRef.java | 684 +++---- .../jee/was/v6/common/UseCallerIdentity.java | 98 +- .../openejb/jee/was/v6/common/package-info.java | 36 +- .../jee/was/v6/commonbnd/AbstractAuthData.java | 488 ++--- .../jee/was/v6/commonbnd/BasicAuthData.java | 184 +- .../jee/was/v6/commonbnd/EjbRefBinding.java | 630 +++---- .../commonbnd/MessageDestinationRefBinding.java | 634 +++---- .../jee/was/v6/commonbnd/ObjectFactory.java | 372 ++-- .../openejb/jee/was/v6/commonbnd/Property.java | 602 +++--- .../was/v6/commonbnd/ResourceEnvRefBinding.java | 634 +++---- .../was/v6/commonbnd/ResourceRefBinding.java | 804 ++++---- .../jee/was/v6/commonbnd/package-info.java | 36 +- .../openejb/jee/was/v6/ecore/EAnnotation.java | 378 ++-- .../openejb/jee/was/v6/ecore/EAttribute.java | 134 +- .../apache/openejb/jee/was/v6/ecore/EClass.java | 422 ++--- .../openejb/jee/was/v6/ecore/EClassifier.java | 134 +- .../openejb/jee/was/v6/ecore/EDataType.java | 134 +- .../apache/openejb/jee/was/v6/ecore/EEnum.java | 158 +- .../openejb/jee/was/v6/ecore/EEnumLiteral.java | 134 +- .../openejb/jee/was/v6/ecore/EFactory.java | 88 +- .../openejb/jee/was/v6/ecore/EModelElement.java | 158 +- .../openejb/jee/was/v6/ecore/ENamedElement.java | 134 +- .../openejb/jee/was/v6/ecore/EObject.java | 476 ++--- .../openejb/jee/was/v6/ecore/EOperation.java | 276 +-- .../openejb/jee/was/v6/ecore/EPackage.java | 310 ++-- .../openejb/jee/was/v6/ecore/EParameter.java | 88 +- .../openejb/jee/was/v6/ecore/EReference.java | 290 +-- .../was/v6/ecore/EStringToStringMapEntry.java | 560 +++--- .../jee/was/v6/ecore/EStructuralFeature.java | 344 ++-- .../openejb/jee/was/v6/ecore/ETypedElement.java | 374 ++-- .../openejb/jee/was/v6/ecore/ObjectFactory.java | 774 ++++---- .../openejb/jee/was/v6/ecore/package-info.java | 36 +- .../jee/was/v6/ejb/AcknowledgeModeEnum.java | 130 +- .../jee/was/v6/ejb/ActivationConfig.java | 636 +++---- .../was/v6/ejb/ActivationConfigProperty.java | 574 +++--- .../jee/was/v6/ejb/AssemblyDescriptor.java | 828 ++++----- .../openejb/jee/was/v6/ejb/CMPAttribute.java | 216 +-- .../apache/openejb/jee/was/v6/ejb/CMRField.java | 230 +-- .../jee/was/v6/ejb/ContainerManagedEntity.java | 636 +++---- .../openejb/jee/was/v6/ejb/DestinationEnum.java | 130 +- .../apache/openejb/jee/was/v6/ejb/EJBJar.java | 402 ++-- .../jee/was/v6/ejb/EJBMethodCategory.java | 484 ++--- .../openejb/jee/was/v6/ejb/EJBRelation.java | 728 ++++---- .../jee/was/v6/ejb/EJBRelationshipRole.java | 946 +++++----- .../openejb/jee/was/v6/ejb/EnterpriseBean.java | 852 ++++----- .../apache/openejb/jee/was/v6/ejb/Entity.java | 328 ++-- .../openejb/jee/was/v6/ejb/ExcludeList.java | 668 +++---- .../openejb/jee/was/v6/ejb/MessageDriven.java | 666 +++---- .../was/v6/ejb/MessageDrivenDestination.java | 574 +++--- .../openejb/jee/was/v6/ejb/MethodElement.java | 1218 ++++++------- .../jee/was/v6/ejb/MethodElementEnum.java | 146 +- .../jee/was/v6/ejb/MethodPermission.java | 822 ++++----- .../jee/was/v6/ejb/MethodTransaction.java | 708 ++++---- .../jee/was/v6/ejb/MultiplicityEnum.java | 130 +- .../openejb/jee/was/v6/ejb/ObjectFactory.java | 968 +++++----- .../apache/openejb/jee/was/v6/ejb/Query.java | 760 ++++---- .../openejb/jee/was/v6/ejb/QueryMethod.java | 88 +- .../openejb/jee/was/v6/ejb/Relationships.java | 666 +++---- .../jee/was/v6/ejb/ReturnTypeMappingEnum.java | 130 +- .../openejb/jee/was/v6/ejb/RoleSource.java | 710 ++++---- .../apache/openejb/jee/was/v6/ejb/Session.java | 352 ++-- .../openejb/jee/was/v6/ejb/SessionEnum.java | 130 +- .../was/v6/ejb/SubscriptionDurabilityEnum.java | 130 +- .../was/v6/ejb/TransactionAttributeEnum.java | 146 +- .../openejb/jee/was/v6/ejb/TransactionEnum.java | 130 +- .../openejb/jee/was/v6/ejb/package-info.java | 36 +- .../v6/ejbbnd/CMPConnectionFactoryBinding.java | 672 +++---- .../jee/was/v6/ejbbnd/CMPResAuthEnum.java | 130 +- .../jee/was/v6/ejbbnd/EJBJarBinding.java | 830 ++++----- .../was/v6/ejbbnd/EnterpriseBeanBinding.java | 1142 ++++++------ .../was/v6/ejbbnd/MessageDrivenBeanBinding.java | 266 +-- .../jee/was/v6/ejbbnd/ObjectFactory.java | 256 +-- .../openejb/jee/was/v6/ejbbnd/package-info.java | 36 +- .../openejb/jee/was/v6/java/ArrayType.java | 276 +-- .../apache/openejb/jee/was/v6/java/Block.java | 626 +++---- .../apache/openejb/jee/was/v6/java/Comment.java | 88 +- .../apache/openejb/jee/was/v6/java/Field.java | 376 ++-- .../openejb/jee/was/v6/java/Initializer.java | 628 +++---- .../openejb/jee/was/v6/java/JavaClass.java | 1028 +++++------ .../openejb/jee/was/v6/java/JavaDataType.java | 92 +- .../openejb/jee/was/v6/java/JavaEvent.java | 92 +- .../openejb/jee/was/v6/java/JavaPackage.java | 92 +- .../openejb/jee/was/v6/java/JavaParameter.java | 180 +- .../jee/was/v6/java/JavaParameterEnum.java | 108 +- .../jee/was/v6/java/JavaVisibilityEnum.java | 108 +- .../apache/openejb/jee/was/v6/java/Method.java | 680 +++---- .../openejb/jee/was/v6/java/ObjectFactory.java | 528 +++--- .../openejb/jee/was/v6/java/Statement.java | 88 +- .../openejb/jee/was/v6/java/TypeKind.java | 108 +- .../openejb/jee/was/v6/java/package-info.java | 36 +- .../v6/webservice/clientbnd/ObjectFactory.java | 134 +- .../webservice/clientbnd/ServiceRefBinding.java | 634 +++---- .../v6/webservice/clientbnd/package-info.java | 36 +- .../was/v6/wsclient/ComponentScopedRefs.java | 592 +++--- .../openejb/jee/was/v6/wsclient/Handler.java | 532 +++--- .../jee/was/v6/wsclient/ObjectFactory.java | 290 +-- .../jee/was/v6/wsclient/PortComponentRef.java | 646 +++---- .../openejb/jee/was/v6/wsclient/ServiceRef.java | 552 +++--- .../jee/was/v6/wsclient/WebServicesClient.java | 614 +++---- .../jee/was/v6/wsclient/package-info.java | 36 +- .../org/apache/openejb/jee/was/v6/xmi/Add.java | 202 +-- .../org/apache/openejb/jee/was/v6/xmi/Any.java | 210 +-- .../apache/openejb/jee/was/v6/xmi/Delete.java | 88 +- .../openejb/jee/was/v6/xmi/Difference.java | 868 ++++----- .../openejb/jee/was/v6/xmi/Documentation.java | 1104 +++++------ .../openejb/jee/was/v6/xmi/Extension.java | 508 +++--- .../apache/openejb/jee/was/v6/xmi/Import.java | 88 +- .../openejb/jee/was/v6/xmi/MetaModel.java | 88 +- .../apache/openejb/jee/was/v6/xmi/Model.java | 88 +- .../openejb/jee/was/v6/xmi/ObjectFactory.java | 518 +++--- .../jee/was/v6/xmi/PackageReference.java | 528 +++--- .../apache/openejb/jee/was/v6/xmi/Replace.java | 202 +-- .../org/apache/openejb/jee/was/v6/xmi/XMI.java | 424 ++--- .../openejb/jee/was/v6/xmi/package-info.java | 36 +- .../src/test/resources/daytrader-original.xml | 40 +- .../eclipselink/OpenEJBServerPlatform.java | 112 +- doap_tomee.rdf | 306 ++-- .../cdi/produces/field/ConsoleHandler.java | 74 +- .../cdi/produces/field/DatabaseHandler.java | 76 +- .../cdi/produces/field/FileHandler.java | 76 +- .../superbiz/cdi/produces/field/LogFactory.java | 88 +- .../superbiz/cdi/produces/field/LogHandler.java | 50 +- .../org/superbiz/cdi/produces/field/Logger.java | 50 +- .../superbiz/cdi/produces/field/LoggerImpl.java | 74 +- .../src/main/resources/META-INF/beans.xml | 48 +- .../superbiz/cdi/produces/field/LoggerTest.java | 134 +- 248 files changed, 41057 insertions(+), 41057 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/52567075/LIBRARIES ---------------------------------------------------------------------- diff --git a/LIBRARIES b/LIBRARIES index 331ad82..4e0a839 100644 --- a/LIBRARIES +++ b/LIBRARIES @@ -1,98 +1,98 @@ -apache-tomee 1.7.0 webprofile - - D gson-2.1.jar [180.11 ko] - D static-tomee-bootstrap-1.6.0.2.jar [132.15 ko] - D static-tomee-jquery-1.6.0.2.jar [163.05 ko] - D xbean-asm4-shaded-3.15.jar [128.36 ko] - A FastInfoset-1.2.12.jar [293.86 ko] - A el-api.jar [55.43 ko] - A istack-commons-runtime-2.16.jar [23.19 ko] - A jaxb-core-2.2.7.jar [221.75 ko] - A quartz-openejb-shade-2.2.1.jar [1237.12 ko] - A xbean-asm5-shaded-3.18.jar [144.47 ko] - - change: +0.81 MB - total : 29.85 MB - - -apache-tomee 1.7.0 jaxrs - - D gson-2.1.jar [180.11 ko] - D static-tomee-bootstrap-1.6.0.2.jar [132.15 ko] - D static-tomee-jquery-1.6.0.2.jar [163.05 ko] - D xbean-asm4-shaded-3.15.jar [128.36 ko] - A FastInfoset-1.2.12.jar [293.86 ko] - A cxf-rt-management-2.6.14.jar [67.43 ko] - A el-api.jar [55.43 ko] - A istack-commons-runtime-2.16.jar [23.19 ko] - A jaxb-core-2.2.7.jar [221.75 ko] - A quartz-openejb-shade-2.2.1.jar [1237.12 ko] - A xbean-asm5-shaded-3.18.jar [144.47 ko] - - change: +0.88 MB - total : 33.14 MB - - -apache-tomee 1.7.0 plus - - D gson-2.1.jar [180.11 ko] - D serializer-2.7.1.jar [278.28 ko] - D static-tomee-bootstrap-1.6.0.2.jar [132.15 ko] - D static-tomee-jquery-1.6.0.2.jar [163.05 ko] - D xalan-2.7.1.jar [3176.15 ko] - D xbean-asm4-shaded-3.15.jar [128.36 ko] - D xercesImpl-2.11.0.jar [1367.76 ko] - D xml-apis-1.4.01.jar [220.54 ko] - A FastInfoset-1.2.12.jar [293.86 ko] - A cxf-rt-management-2.6.14.jar [67.43 ko] - A el-api.jar [55.43 ko] - A istack-commons-runtime-2.16.jar [23.19 ko] - A jaxb-core-2.2.7.jar [221.75 ko] - A quartz-openejb-shade-2.2.1.jar [1237.12 ko] - A xbean-asm5-shaded-3.18.jar [144.47 ko] - - change: -3.44 MB - total : 41.98 MB - -apache-tomee 1.7.0 plume - - D gson-2.1.jar [180.11 ko] - D myfaces-api-2.1.13.jar [1190.07 ko] - D myfaces-impl-2.1.13.jar [2041.05 ko] - D serializer-2.7.1.jar [278.28 ko] - D static-tomee-bootstrap-1.6.0.2.jar [132.15 ko] - D static-tomee-jquery-1.6.0.2.jar [163.05 ko] - D tomee-myfaces-1.6.0.2.jar [30.38 ko] - D xalan-2.7.1.jar [3176.15 ko] - D xbean-asm4-shaded-3.15.jar [128.36 ko] - D xercesImpl-2.11.0.jar [1367.76 ko] - A FastInfoset-1.2.12.jar [293.86 ko] - A commonj.sdo-2.1.1.jar [21.01 ko] - A cxf-rt-management-2.6.14.jar [67.43 ko] - A eclipselink-2.4.2.jar [8650.47 ko] - A el-api.jar [55.43 ko] - A istack-commons-runtime-2.16.jar [23.19 ko] - A javax.faces-2.1.28.jar [2660.56 ko] - A jaxb-core-2.2.7.jar [221.75 ko] - A openejb-core-eclipselink-4.7.0.jar [11.52 ko] - A quartz-openejb-shade-2.2.1.jar [1237.12 ko] - A xbean-asm5-shaded-3.18.jar [144.47 ko] - - change: +3.87 MB - total : 49.29 MB - -openejb-standalone 4.7.0 - - D serializer-2.7.1.jar [278.28 ko] - D xalan-2.7.1.jar [3176.15 ko] - D xbean-asm4-shaded-3.15.jar [128.36 ko] - D xercesImpl-2.11.0.jar [1367.76 ko] - A FastInfoset-1.2.12.jar [293.86 ko] - A cxf-rt-management-2.6.14.jar [67.43 ko] - A istack-commons-runtime-2.16.jar [23.19 ko] - A jaxb-core-2.2.7.jar [221.75 ko] - A quartz-openejb-shade-2.2.1.jar [1237.12 ko] - A xbean-asm5-shaded-3.18.jar [144.47 ko] - - change: -2.92 MB +apache-tomee 1.7.0 webprofile + + D gson-2.1.jar [180.11 ko] + D static-tomee-bootstrap-1.6.0.2.jar [132.15 ko] + D static-tomee-jquery-1.6.0.2.jar [163.05 ko] + D xbean-asm4-shaded-3.15.jar [128.36 ko] + A FastInfoset-1.2.12.jar [293.86 ko] + A el-api.jar [55.43 ko] + A istack-commons-runtime-2.16.jar [23.19 ko] + A jaxb-core-2.2.7.jar [221.75 ko] + A quartz-openejb-shade-2.2.1.jar [1237.12 ko] + A xbean-asm5-shaded-3.18.jar [144.47 ko] + + change: +0.81 MB + total : 29.85 MB + + +apache-tomee 1.7.0 jaxrs + + D gson-2.1.jar [180.11 ko] + D static-tomee-bootstrap-1.6.0.2.jar [132.15 ko] + D static-tomee-jquery-1.6.0.2.jar [163.05 ko] + D xbean-asm4-shaded-3.15.jar [128.36 ko] + A FastInfoset-1.2.12.jar [293.86 ko] + A cxf-rt-management-2.6.14.jar [67.43 ko] + A el-api.jar [55.43 ko] + A istack-commons-runtime-2.16.jar [23.19 ko] + A jaxb-core-2.2.7.jar [221.75 ko] + A quartz-openejb-shade-2.2.1.jar [1237.12 ko] + A xbean-asm5-shaded-3.18.jar [144.47 ko] + + change: +0.88 MB + total : 33.14 MB + + +apache-tomee 1.7.0 plus + + D gson-2.1.jar [180.11 ko] + D serializer-2.7.1.jar [278.28 ko] + D static-tomee-bootstrap-1.6.0.2.jar [132.15 ko] + D static-tomee-jquery-1.6.0.2.jar [163.05 ko] + D xalan-2.7.1.jar [3176.15 ko] + D xbean-asm4-shaded-3.15.jar [128.36 ko] + D xercesImpl-2.11.0.jar [1367.76 ko] + D xml-apis-1.4.01.jar [220.54 ko] + A FastInfoset-1.2.12.jar [293.86 ko] + A cxf-rt-management-2.6.14.jar [67.43 ko] + A el-api.jar [55.43 ko] + A istack-commons-runtime-2.16.jar [23.19 ko] + A jaxb-core-2.2.7.jar [221.75 ko] + A quartz-openejb-shade-2.2.1.jar [1237.12 ko] + A xbean-asm5-shaded-3.18.jar [144.47 ko] + + change: -3.44 MB + total : 41.98 MB + +apache-tomee 1.7.0 plume + + D gson-2.1.jar [180.11 ko] + D myfaces-api-2.1.13.jar [1190.07 ko] + D myfaces-impl-2.1.13.jar [2041.05 ko] + D serializer-2.7.1.jar [278.28 ko] + D static-tomee-bootstrap-1.6.0.2.jar [132.15 ko] + D static-tomee-jquery-1.6.0.2.jar [163.05 ko] + D tomee-myfaces-1.6.0.2.jar [30.38 ko] + D xalan-2.7.1.jar [3176.15 ko] + D xbean-asm4-shaded-3.15.jar [128.36 ko] + D xercesImpl-2.11.0.jar [1367.76 ko] + A FastInfoset-1.2.12.jar [293.86 ko] + A commonj.sdo-2.1.1.jar [21.01 ko] + A cxf-rt-management-2.6.14.jar [67.43 ko] + A eclipselink-2.4.2.jar [8650.47 ko] + A el-api.jar [55.43 ko] + A istack-commons-runtime-2.16.jar [23.19 ko] + A javax.faces-2.1.28.jar [2660.56 ko] + A jaxb-core-2.2.7.jar [221.75 ko] + A openejb-core-eclipselink-4.7.0.jar [11.52 ko] + A quartz-openejb-shade-2.2.1.jar [1237.12 ko] + A xbean-asm5-shaded-3.18.jar [144.47 ko] + + change: +3.87 MB + total : 49.29 MB + +openejb-standalone 4.7.0 + + D serializer-2.7.1.jar [278.28 ko] + D xalan-2.7.1.jar [3176.15 ko] + D xbean-asm4-shaded-3.15.jar [128.36 ko] + D xercesImpl-2.11.0.jar [1367.76 ko] + A FastInfoset-1.2.12.jar [293.86 ko] + A cxf-rt-management-2.6.14.jar [67.43 ko] + A istack-commons-runtime-2.16.jar [23.19 ko] + A jaxb-core-2.2.7.jar [221.75 ko] + A quartz-openejb-shade-2.2.1.jar [1237.12 ko] + A xbean-asm5-shaded-3.18.jar [144.47 ko] + + change: -2.92 MB total : 30.12 MB \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tomee/blob/52567075/arquillian/arquillian-tomee-embedded/src/test/java/org/apache/openejb/arquillian/embedded/MultipleDeploymentsTest.java ---------------------------------------------------------------------- diff --git a/arquillian/arquillian-tomee-embedded/src/test/java/org/apache/openejb/arquillian/embedded/MultipleDeploymentsTest.java b/arquillian/arquillian-tomee-embedded/src/test/java/org/apache/openejb/arquillian/embedded/MultipleDeploymentsTest.java index e6b3a4d..d2329e2 100644 --- a/arquillian/arquillian-tomee-embedded/src/test/java/org/apache/openejb/arquillian/embedded/MultipleDeploymentsTest.java +++ b/arquillian/arquillian-tomee-embedded/src/test/java/org/apache/openejb/arquillian/embedded/MultipleDeploymentsTest.java @@ -1,82 +1,82 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.openejb.arquillian.embedded; - -import org.apache.tomee.catalina.environment.Hosts; -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.container.test.api.OperateOnDeployment; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; - -import javax.inject.Inject; - -@RunWith(Arquillian.class) -public class MultipleDeploymentsTest extends Assert { - - public static final String MSG = "HelloWorld"; - - @Deployment(name = "orange") - public static WebArchive orange() { - return ShrinkWrap.create(WebArchive.class, "orange.war") - .addClasses( - TestMe.class, - Hosts.class) - .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); - } - - @Deployment(name = "green") - public static WebArchive green() { - return ShrinkWrap.create(WebArchive.class, "green.war"); - } - - @Deployment(name = "blue") - public static WebArchive blue() { - return ShrinkWrap.create(WebArchive.class, "blue.war"); - } - - @Deployment(name = "yellow") - public static WebArchive yellow() { - return ShrinkWrap.create(WebArchive.class, "yellow.war"); - } - - @Test - @OperateOnDeployment("orange") - public void testOrange(final TestMe testMe) throws Exception { - assertNotNull(testMe); - assertEquals("Unexpected message", MSG, testMe.getMessage()); - } - - @Test - @OperateOnDeployment("green") - public void testMap() throws Exception { - // no-op - } - - public static class TestMe { - public TestMe() { - } - - public String getMessage() { - return MSG; - } - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.openejb.arquillian.embedded; + +import org.apache.tomee.catalina.environment.Hosts; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.OperateOnDeployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.inject.Inject; + +@RunWith(Arquillian.class) +public class MultipleDeploymentsTest extends Assert { + + public static final String MSG = "HelloWorld"; + + @Deployment(name = "orange") + public static WebArchive orange() { + return ShrinkWrap.create(WebArchive.class, "orange.war") + .addClasses( + TestMe.class, + Hosts.class) + .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); + } + + @Deployment(name = "green") + public static WebArchive green() { + return ShrinkWrap.create(WebArchive.class, "green.war"); + } + + @Deployment(name = "blue") + public static WebArchive blue() { + return ShrinkWrap.create(WebArchive.class, "blue.war"); + } + + @Deployment(name = "yellow") + public static WebArchive yellow() { + return ShrinkWrap.create(WebArchive.class, "yellow.war"); + } + + @Test + @OperateOnDeployment("orange") + public void testOrange(final TestMe testMe) throws Exception { + assertNotNull(testMe); + assertEquals("Unexpected message", MSG, testMe.getMessage()); + } + + @Test + @OperateOnDeployment("green") + public void testMap() throws Exception { + // no-op + } + + public static class TestMe { + public TestMe() { + } + + public String getMessage() { + return MSG; + } + } +} http://git-wip-us.apache.org/repos/asf/tomee/blob/52567075/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEContainer.java ---------------------------------------------------------------------- diff --git a/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEContainer.java b/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEContainer.java index aab4eff..37cfb02 100644 --- a/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEContainer.java +++ b/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEContainer.java @@ -1,357 +1,357 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.tomee.arquillian.remote; - -import org.apache.openejb.arquillian.common.ArquillianFilterRunner; -import org.apache.openejb.arquillian.common.ArquillianUtil; -import org.apache.openejb.arquillian.common.Files; -import org.apache.openejb.arquillian.common.IO; -import org.apache.openejb.arquillian.common.Setup; -import org.apache.openejb.arquillian.common.TomEEContainer; -import org.apache.openejb.assembler.Deployer; -import org.apache.openejb.assembler.DeployerEjb; -import org.apache.openejb.config.RemoteServer; -import org.apache.openejb.util.NetworkUtil; -import org.jboss.arquillian.container.spi.client.container.LifecycleException; -import org.jboss.arquillian.protocol.servlet.ServletMethodExecutor; -import org.jboss.shrinkwrap.api.Archive; - -import javax.naming.NamingException; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.TreeMap; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class RemoteTomEEContainer extends TomEEContainer<RemoteTomEEConfiguration> { - private static final Logger logger = Logger.getLogger(RemoteTomEEContainer.class.getName()); - - private static final String ARQUILLIAN_FILTER = "-Dorg.apache.openejb.servlet.filters=" + ArquillianFilterRunner.class.getName() + "=" + ServletMethodExecutor.ARQUILLIAN_SERVLET_MAPPING; - - private RemoteServer container; - private boolean shutdown; - private File tomeeHome; - private Collection<Archive<?>> containerArchives; - private final Properties deployerProperties = new Properties(); - - @Override - public void setup(final RemoteTomEEConfiguration configuration) { - super.setup(configuration); - - if (configuration.getDeployerProperties() != null) { - try { - final InputStream bytes = IO.read(configuration.getDeployerProperties().getBytes()); - IO.readProperties(bytes, deployerProperties); - } catch (final IOException e) { - logger.log(Level.SEVERE, "Can't parse <property name=\"properties\"> value '" + configuration.getProperties() + "'", e); - } - } - } - - @Override - public void start() throws LifecycleException { - // see if TomEE is already running by checking the http port - final int httpPort = configuration.getHttpPort(); - - if (Setup.isRunning(configuration.getHost(), httpPort)) { - - String host = "local"; - - if (!NetworkUtil.isLocalAddress(configuration.getHost())) { - //Supply at least this property so that the archive is transmitted on deploy - if (null == deployerProperties.getProperty(DeployerEjb.OPENEJB_USE_BINARIES)) { - deployerProperties.setProperty(DeployerEjb.OPENEJB_USE_BINARIES, "true"); - } - host = "remote"; - } - - logger.info(String.format("TomEE found running on %s port %s", host, httpPort)); - - return; - } - - shutdown = true; - - final String shutdownPort = System.getProperty(RemoteServer.SERVER_SHUTDOWN_PORT); - final String shutdownHost = System.getProperty(RemoteServer.SERVER_SHUTDOWN_HOST); - final String shutdownCommand = System.getProperty(RemoteServer.SERVER_SHUTDOWN_COMMAND); - final String debug = System.getProperty(RemoteServer.OPENEJB_SERVER_DEBUG); - final String debugPort = System.getProperty(RemoteServer.SERVER_DEBUG_PORT); - - try { - - configure(); - - final int stopPort = configuration.getStopPort(); - System.setProperty(RemoteServer.SERVER_SHUTDOWN_PORT, Integer.toString(stopPort)); - System.setProperty(RemoteServer.SERVER_SHUTDOWN_COMMAND, configuration.getStopCommand()); - System.setProperty(RemoteServer.SERVER_SHUTDOWN_HOST, configuration.getStopHost()); - - if (configuration.isDebug()) { - System.setProperty(RemoteServer.OPENEJB_SERVER_DEBUG, "true"); - System.setProperty(RemoteServer.SERVER_DEBUG_PORT, Integer.toString(configuration.getDebugPort())); - } - - container = new RemoteServer(); - container.setPortStartup(httpPort); - container.start(args(), "start", true); - container.killOnExit(); - - if (configuration.getProperties() != null) { - final Properties props = new Properties(); - IO.readProperties(IO.read(configuration.getProperties().getBytes()), props); - - containerArchives = ArquillianUtil.toDeploy(props); - for (final Archive<?> archive : containerArchives) { - deploy(archive); - } - } - } catch (final Exception e) { - container.destroy(); - logger.log(Level.SEVERE, "Unable to start remote container", e); - throw new LifecycleException("Unable to start remote container:" + e.getMessage(), e); - } finally { - resetSystemProperty(RemoteServer.SERVER_SHUTDOWN_PORT, shutdownPort); - resetSystemProperty(RemoteServer.SERVER_SHUTDOWN_HOST, shutdownHost); - resetSystemProperty(RemoteServer.SERVER_SHUTDOWN_COMMAND, shutdownCommand); - resetSystemProperty(RemoteServer.OPENEJB_SERVER_DEBUG, debug); - resetSystemProperty(RemoteServer.SERVER_DEBUG_PORT, debugPort); - } - } - - @Override - protected Properties getDeployerProperties() { - if (deployerProperties.isEmpty()) { - return null; - } - return deployerProperties; - } - - private List<String> args() { - String opts = configuration.getCatalina_opts(); - if (opts != null) { - opts = opts.trim(); - } - if (opts == null || opts.isEmpty()) { - return Arrays.asList("-Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=false", ARQUILLIAN_FILTER); - } - - final List<String> splitOnSpace = new ArrayList<String>(); - - final Iterator<String> it = new ArgsIterator(opts); - while (it.hasNext()) { - splitOnSpace.add(it.next()); - } - - if (!splitOnSpace.contains("-Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=true")) { - splitOnSpace.add("-Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=false"); - } - splitOnSpace.add(ARQUILLIAN_FILTER); - return splitOnSpace; - } - - private static void resetSystemProperty(final String key, final String value) { - if (value == null) { - System.getProperties().remove(key); - } else { - System.setProperty(key, value); - } - } - - private void configure() throws LifecycleException, IOException { - final File workingDirectory = new File(configuration.getDir()).getAbsoluteFile(); - - if (configuration.getCleanOnStartUp()) { - Files.delete(workingDirectory); - } - - if (workingDirectory.exists()) { - - Files.assertDir(workingDirectory); - - } else { - - Files.mkdir(workingDirectory); - Files.deleteOnExit(workingDirectory); - } - - Files.readable(workingDirectory); - Files.writable(workingDirectory); - - tomeeHome = Setup.findHome(workingDirectory); - - if (tomeeHome == null) { - tomeeHome = Setup.downloadAndUnpack(workingDirectory, configuration.getArtifactName()); - - logger.log(Level.INFO, "Downloaded container to: " + tomeeHome); - } - - Files.assertDir(tomeeHome); - Files.readable(tomeeHome); - Files.writable(tomeeHome); - - Setup.synchronizeFolder(tomeeHome, configuration.getConf(), "conf"); - Setup.synchronizeFolder(tomeeHome, configuration.getBin(), "bin"); - Setup.synchronizeFolder(tomeeHome, configuration.getLib(), "lib"); - Setup.addTomEELibraries(tomeeHome, configuration.getAdditionalLibs()); - - Setup.configureServerXml(tomeeHome, configuration); - - Setup.configureSystemProperties(tomeeHome, configuration); - - final String opts = configuration.getCatalina_opts(); - - Setup.exportProperties(tomeeHome, configuration, opts == null || (!opts.contains("-Xm") && !opts.matches(".*-XX:[^=]*Size=.*"))); - Setup.installArquillianBeanDiscoverer(tomeeHome); - - if (configuration.isRemoveUnusedWebapps()) { - Setup.removeUselessWebapps(tomeeHome); - } - - if (configuration.isSimpleLog() && noLoggingConfigProvided()) { - final File loggingProperties = Files.path(tomeeHome, "conf", "logging.properties"); - - final Properties logging = new Properties(); - logging.put("handlers", "java.util.logging.ConsoleHandler"); - logging.put(".handlers", "java.util.logging.ConsoleHandler"); - logging.put("java.util.logging.ConsoleHandler.level", "INFO"); - logging.put("java.util.logging.ConsoleHandler.formatter", "org.apache.tomee.jul.formatter.SimpleTomEEFormatter"); - - IO.writeProperties(loggingProperties, logging); - } - - if (logger.isLoggable(Level.FINE)) { - final Map<Object, Object> map = new TreeMap<Object, Object>(System.getProperties()); - for (final Map.Entry<Object, Object> entry : map.entrySet()) { - logger.log(Level.FINE, String.format("%s = %s\n", entry.getKey(), entry.getValue())); - } - } - } - - private boolean noLoggingConfigProvided() { - if (configuration.getConf() == null) { - return true; - } - - final File conf = new File(configuration.getConf()); - - return !(conf.exists() - && (new File(conf, "logging.properties").exists() - || new File(conf, "log4j.properties").exists() - || new File(conf, "log4j.xml").exists())); - } - - @Override - public void stop() throws LifecycleException { - ArquillianUtil.undeploy(this, containerArchives); - - // only stop the container if we started it - if (shutdown) { - Setup.removeArquillianBeanDiscoverer(tomeeHome); - container.destroy(); - } - } - - @Override - public Class<RemoteTomEEConfiguration> getConfigurationClass() { - return RemoteTomEEConfiguration.class; - } - - @Override - protected Deployer deployer() throws NamingException { - try { - return super.deployer(); - } catch (final RuntimeException ne) { - // some debug lines - if (Boolean.getBoolean("openejb.arquillian.debug")) { - container.kill3UNIX(); - LOGGER.info("Can't connect to deployer through: " + providerUrl()); - try { - LOGGER.info("Here is the server.xml:\n" + IO.slurp(new File(Setup.findHome(new File(configuration.getDir()).getAbsoluteFile()), "conf/server.xml"))); - } catch (final IOException ignored) { - // no-op - } - } - throw ne; - } - } - - private static class ArgsIterator implements Iterator<String> { - private final String string; - private int currentIndex; - - public ArgsIterator(final String opts) { - string = opts; - currentIndex = 0; - } - - @Override - public boolean hasNext() { - return string != null && currentIndex < string.length(); - } - - @Override - public String next() { - skipWhiteCharacters(); - - if (done()) { - throw new UnsupportedOperationException("No more element"); - } - - final char endChar; - if (string.charAt(currentIndex) == '"') { - currentIndex++; - endChar = '"'; - } else { - endChar = ' '; - } - - final int start = currentIndex; - int end = string.indexOf(endChar, currentIndex + 1); - if (end <= 0) { - end = string.length(); - } - - currentIndex = end + 1; - - return string.substring(start, end); - } - - private void skipWhiteCharacters() { - while (!done() && (string.charAt(currentIndex) == ' ' || string.charAt(currentIndex) == '\t')) { - currentIndex++; - } - } - - private boolean done() { - return currentIndex >= string.length(); - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.tomee.arquillian.remote; + +import org.apache.openejb.arquillian.common.ArquillianFilterRunner; +import org.apache.openejb.arquillian.common.ArquillianUtil; +import org.apache.openejb.arquillian.common.Files; +import org.apache.openejb.arquillian.common.IO; +import org.apache.openejb.arquillian.common.Setup; +import org.apache.openejb.arquillian.common.TomEEContainer; +import org.apache.openejb.assembler.Deployer; +import org.apache.openejb.assembler.DeployerEjb; +import org.apache.openejb.config.RemoteServer; +import org.apache.openejb.util.NetworkUtil; +import org.jboss.arquillian.container.spi.client.container.LifecycleException; +import org.jboss.arquillian.protocol.servlet.ServletMethodExecutor; +import org.jboss.shrinkwrap.api.Archive; + +import javax.naming.NamingException; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.TreeMap; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class RemoteTomEEContainer extends TomEEContainer<RemoteTomEEConfiguration> { + private static final Logger logger = Logger.getLogger(RemoteTomEEContainer.class.getName()); + + private static final String ARQUILLIAN_FILTER = "-Dorg.apache.openejb.servlet.filters=" + ArquillianFilterRunner.class.getName() + "=" + ServletMethodExecutor.ARQUILLIAN_SERVLET_MAPPING; + + private RemoteServer container; + private boolean shutdown; + private File tomeeHome; + private Collection<Archive<?>> containerArchives; + private final Properties deployerProperties = new Properties(); + + @Override + public void setup(final RemoteTomEEConfiguration configuration) { + super.setup(configuration); + + if (configuration.getDeployerProperties() != null) { + try { + final InputStream bytes = IO.read(configuration.getDeployerProperties().getBytes()); + IO.readProperties(bytes, deployerProperties); + } catch (final IOException e) { + logger.log(Level.SEVERE, "Can't parse <property name=\"properties\"> value '" + configuration.getProperties() + "'", e); + } + } + } + + @Override + public void start() throws LifecycleException { + // see if TomEE is already running by checking the http port + final int httpPort = configuration.getHttpPort(); + + if (Setup.isRunning(configuration.getHost(), httpPort)) { + + String host = "local"; + + if (!NetworkUtil.isLocalAddress(configuration.getHost())) { + //Supply at least this property so that the archive is transmitted on deploy + if (null == deployerProperties.getProperty(DeployerEjb.OPENEJB_USE_BINARIES)) { + deployerProperties.setProperty(DeployerEjb.OPENEJB_USE_BINARIES, "true"); + } + host = "remote"; + } + + logger.info(String.format("TomEE found running on %s port %s", host, httpPort)); + + return; + } + + shutdown = true; + + final String shutdownPort = System.getProperty(RemoteServer.SERVER_SHUTDOWN_PORT); + final String shutdownHost = System.getProperty(RemoteServer.SERVER_SHUTDOWN_HOST); + final String shutdownCommand = System.getProperty(RemoteServer.SERVER_SHUTDOWN_COMMAND); + final String debug = System.getProperty(RemoteServer.OPENEJB_SERVER_DEBUG); + final String debugPort = System.getProperty(RemoteServer.SERVER_DEBUG_PORT); + + try { + + configure(); + + final int stopPort = configuration.getStopPort(); + System.setProperty(RemoteServer.SERVER_SHUTDOWN_PORT, Integer.toString(stopPort)); + System.setProperty(RemoteServer.SERVER_SHUTDOWN_COMMAND, configuration.getStopCommand()); + System.setProperty(RemoteServer.SERVER_SHUTDOWN_HOST, configuration.getStopHost()); + + if (configuration.isDebug()) { + System.setProperty(RemoteServer.OPENEJB_SERVER_DEBUG, "true"); + System.setProperty(RemoteServer.SERVER_DEBUG_PORT, Integer.toString(configuration.getDebugPort())); + } + + container = new RemoteServer(); + container.setPortStartup(httpPort); + container.start(args(), "start", true); + container.killOnExit(); + + if (configuration.getProperties() != null) { + final Properties props = new Properties(); + IO.readProperties(IO.read(configuration.getProperties().getBytes()), props); + + containerArchives = ArquillianUtil.toDeploy(props); + for (final Archive<?> archive : containerArchives) { + deploy(archive); + } + } + } catch (final Exception e) { + container.destroy(); + logger.log(Level.SEVERE, "Unable to start remote container", e); + throw new LifecycleException("Unable to start remote container:" + e.getMessage(), e); + } finally { + resetSystemProperty(RemoteServer.SERVER_SHUTDOWN_PORT, shutdownPort); + resetSystemProperty(RemoteServer.SERVER_SHUTDOWN_HOST, shutdownHost); + resetSystemProperty(RemoteServer.SERVER_SHUTDOWN_COMMAND, shutdownCommand); + resetSystemProperty(RemoteServer.OPENEJB_SERVER_DEBUG, debug); + resetSystemProperty(RemoteServer.SERVER_DEBUG_PORT, debugPort); + } + } + + @Override + protected Properties getDeployerProperties() { + if (deployerProperties.isEmpty()) { + return null; + } + return deployerProperties; + } + + private List<String> args() { + String opts = configuration.getCatalina_opts(); + if (opts != null) { + opts = opts.trim(); + } + if (opts == null || opts.isEmpty()) { + return Arrays.asList("-Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=false", ARQUILLIAN_FILTER); + } + + final List<String> splitOnSpace = new ArrayList<String>(); + + final Iterator<String> it = new ArgsIterator(opts); + while (it.hasNext()) { + splitOnSpace.add(it.next()); + } + + if (!splitOnSpace.contains("-Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=true")) { + splitOnSpace.add("-Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=false"); + } + splitOnSpace.add(ARQUILLIAN_FILTER); + return splitOnSpace; + } + + private static void resetSystemProperty(final String key, final String value) { + if (value == null) { + System.getProperties().remove(key); + } else { + System.setProperty(key, value); + } + } + + private void configure() throws LifecycleException, IOException { + final File workingDirectory = new File(configuration.getDir()).getAbsoluteFile(); + + if (configuration.getCleanOnStartUp()) { + Files.delete(workingDirectory); + } + + if (workingDirectory.exists()) { + + Files.assertDir(workingDirectory); + + } else { + + Files.mkdir(workingDirectory); + Files.deleteOnExit(workingDirectory); + } + + Files.readable(workingDirectory); + Files.writable(workingDirectory); + + tomeeHome = Setup.findHome(workingDirectory); + + if (tomeeHome == null) { + tomeeHome = Setup.downloadAndUnpack(workingDirectory, configuration.getArtifactName()); + + logger.log(Level.INFO, "Downloaded container to: " + tomeeHome); + } + + Files.assertDir(tomeeHome); + Files.readable(tomeeHome); + Files.writable(tomeeHome); + + Setup.synchronizeFolder(tomeeHome, configuration.getConf(), "conf"); + Setup.synchronizeFolder(tomeeHome, configuration.getBin(), "bin"); + Setup.synchronizeFolder(tomeeHome, configuration.getLib(), "lib"); + Setup.addTomEELibraries(tomeeHome, configuration.getAdditionalLibs()); + + Setup.configureServerXml(tomeeHome, configuration); + + Setup.configureSystemProperties(tomeeHome, configuration); + + final String opts = configuration.getCatalina_opts(); + + Setup.exportProperties(tomeeHome, configuration, opts == null || (!opts.contains("-Xm") && !opts.matches(".*-XX:[^=]*Size=.*"))); + Setup.installArquillianBeanDiscoverer(tomeeHome); + + if (configuration.isRemoveUnusedWebapps()) { + Setup.removeUselessWebapps(tomeeHome); + } + + if (configuration.isSimpleLog() && noLoggingConfigProvided()) { + final File loggingProperties = Files.path(tomeeHome, "conf", "logging.properties"); + + final Properties logging = new Properties(); + logging.put("handlers", "java.util.logging.ConsoleHandler"); + logging.put(".handlers", "java.util.logging.ConsoleHandler"); + logging.put("java.util.logging.ConsoleHandler.level", "INFO"); + logging.put("java.util.logging.ConsoleHandler.formatter", "org.apache.tomee.jul.formatter.SimpleTomEEFormatter"); + + IO.writeProperties(loggingProperties, logging); + } + + if (logger.isLoggable(Level.FINE)) { + final Map<Object, Object> map = new TreeMap<Object, Object>(System.getProperties()); + for (final Map.Entry<Object, Object> entry : map.entrySet()) { + logger.log(Level.FINE, String.format("%s = %s\n", entry.getKey(), entry.getValue())); + } + } + } + + private boolean noLoggingConfigProvided() { + if (configuration.getConf() == null) { + return true; + } + + final File conf = new File(configuration.getConf()); + + return !(conf.exists() + && (new File(conf, "logging.properties").exists() + || new File(conf, "log4j.properties").exists() + || new File(conf, "log4j.xml").exists())); + } + + @Override + public void stop() throws LifecycleException { + ArquillianUtil.undeploy(this, containerArchives); + + // only stop the container if we started it + if (shutdown) { + Setup.removeArquillianBeanDiscoverer(tomeeHome); + container.destroy(); + } + } + + @Override + public Class<RemoteTomEEConfiguration> getConfigurationClass() { + return RemoteTomEEConfiguration.class; + } + + @Override + protected Deployer deployer() throws NamingException { + try { + return super.deployer(); + } catch (final RuntimeException ne) { + // some debug lines + if (Boolean.getBoolean("openejb.arquillian.debug")) { + container.kill3UNIX(); + LOGGER.info("Can't connect to deployer through: " + providerUrl()); + try { + LOGGER.info("Here is the server.xml:\n" + IO.slurp(new File(Setup.findHome(new File(configuration.getDir()).getAbsoluteFile()), "conf/server.xml"))); + } catch (final IOException ignored) { + // no-op + } + } + throw ne; + } + } + + private static class ArgsIterator implements Iterator<String> { + private final String string; + private int currentIndex; + + public ArgsIterator(final String opts) { + string = opts; + currentIndex = 0; + } + + @Override + public boolean hasNext() { + return string != null && currentIndex < string.length(); + } + + @Override + public String next() { + skipWhiteCharacters(); + + if (done()) { + throw new UnsupportedOperationException("No more element"); + } + + final char endChar; + if (string.charAt(currentIndex) == '"') { + currentIndex++; + endChar = '"'; + } else { + endChar = ' '; + } + + final int start = currentIndex; + int end = string.indexOf(endChar, currentIndex + 1); + if (end <= 0) { + end = string.length(); + } + + currentIndex = end + 1; + + return string.substring(start, end); + } + + private void skipWhiteCharacters() { + while (!done() && (string.charAt(currentIndex) == ' ' || string.charAt(currentIndex) == '\t')) { + currentIndex++; + } + } + + private boolean done() { + return currentIndex >= string.length(); + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + } +} http://git-wip-us.apache.org/repos/asf/tomee/blob/52567075/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/tomee-embedded/conf/Catalina/localhost/ROOT.xml ---------------------------------------------------------------------- diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/tomee-embedded/conf/Catalina/localhost/ROOT.xml b/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/tomee-embedded/conf/Catalina/localhost/ROOT.xml index 69d4c2b..bfd7fc8 100644 --- a/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/tomee-embedded/conf/Catalina/localhost/ROOT.xml +++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/tomee-embedded/conf/Catalina/localhost/ROOT.xml @@ -1,42 +1,42 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<!-- - - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<Context path="" crossContext="true"> - - <!-- JAAS --> - - <!--<Realm - className="org.apache.catalina.realm.JAASRealm" - appName="PortalRealm" - userClassNames="com.liferay.portal.kernel.security.jaas.PortalPrincipal" - roleClassNames="com.liferay.portal.kernel.security.jaas.PortalRole" - />--> - - <!-- - Uncomment the following to disable persistent sessions across reboots. - --> - - <!--<Manager pathname="" />--> - - <!-- - Uncomment the following to not use sessions. See the property - "session.disabled" in portal.properties. - --> - - <!--<Manager className="com.liferay.support.tomcat.session.SessionLessManagerBase" />--> +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<Context path="" crossContext="true"> + + <!-- JAAS --> + + <!--<Realm + className="org.apache.catalina.realm.JAASRealm" + appName="PortalRealm" + userClassNames="com.liferay.portal.kernel.security.jaas.PortalPrincipal" + roleClassNames="com.liferay.portal.kernel.security.jaas.PortalRole" + />--> + + <!-- + Uncomment the following to disable persistent sessions across reboots. + --> + + <!--<Manager pathname="" />--> + + <!-- + Uncomment the following to not use sessions. See the property + "session.disabled" in portal.properties. + --> + + <!--<Manager className="com.liferay.support.tomcat.session.SessionLessManagerBase" />--> </Context> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tomee/blob/52567075/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/tomee-remote/conf/Catalina/localhost/ROOT.xml ---------------------------------------------------------------------- diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/tomee-remote/conf/Catalina/localhost/ROOT.xml b/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/tomee-remote/conf/Catalina/localhost/ROOT.xml index 69d4c2b..bfd7fc8 100644 --- a/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/tomee-remote/conf/Catalina/localhost/ROOT.xml +++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-config-tests/src/test/resources/tomee-remote/conf/Catalina/localhost/ROOT.xml @@ -1,42 +1,42 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<!-- - - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<Context path="" crossContext="true"> - - <!-- JAAS --> - - <!--<Realm - className="org.apache.catalina.realm.JAASRealm" - appName="PortalRealm" - userClassNames="com.liferay.portal.kernel.security.jaas.PortalPrincipal" - roleClassNames="com.liferay.portal.kernel.security.jaas.PortalRole" - />--> - - <!-- - Uncomment the following to disable persistent sessions across reboots. - --> - - <!--<Manager pathname="" />--> - - <!-- - Uncomment the following to not use sessions. See the property - "session.disabled" in portal.properties. - --> - - <!--<Manager className="com.liferay.support.tomcat.session.SessionLessManagerBase" />--> +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<Context path="" crossContext="true"> + + <!-- JAAS --> + + <!--<Realm + className="org.apache.catalina.realm.JAASRealm" + appName="PortalRealm" + userClassNames="com.liferay.portal.kernel.security.jaas.PortalPrincipal" + roleClassNames="com.liferay.portal.kernel.security.jaas.PortalRole" + />--> + + <!-- + Uncomment the following to disable persistent sessions across reboots. + --> + + <!--<Manager pathname="" />--> + + <!-- + Uncomment the following to not use sessions. See the property + "session.disabled" in portal.properties. + --> + + <!--<Manager className="com.liferay.support.tomcat.session.SessionLessManagerBase" />--> </Context> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tomee/blob/52567075/arquillian/arquillian-tomee-tests/arquillian-tomee-jms-tests/src/test/java/org/apache/openejb/arquillian/tests/jms/DummyManagedBean.java ---------------------------------------------------------------------- diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-jms-tests/src/test/java/org/apache/openejb/arquillian/tests/jms/DummyManagedBean.java b/arquillian/arquillian-tomee-tests/arquillian-tomee-jms-tests/src/test/java/org/apache/openejb/arquillian/tests/jms/DummyManagedBean.java index b9d5b5a..7030ae9 100755 --- a/arquillian/arquillian-tomee-tests/arquillian-tomee-jms-tests/src/test/java/org/apache/openejb/arquillian/tests/jms/DummyManagedBean.java +++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-jms-tests/src/test/java/org/apache/openejb/arquillian/tests/jms/DummyManagedBean.java @@ -1,56 +1,56 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.openejb.arquillian.tests.jms; - -import javax.annotation.Resource; -import javax.faces.bean.ManagedBean; -import javax.jms.ConnectionFactory; -import javax.jms.Queue; -import javax.jms.Topic; - -@ManagedBean -public class DummyManagedBean { - @Resource - private Queue queue; - - @Resource - private Topic topic; - - @Resource - private ConnectionFactory connectionFactory; - - public String getFoo() { - if (queue != null) { - return "queueInjected"; - } - return "queueNotInjected"; - } - - public String getBoo() { - if (topic != null) { - return "topicInjected"; - } - return "topicNotInjected"; - } - - public String getBaz() { - if (connectionFactory != null) { - return "connectionFactoryInjected"; - } - return "connectionFactoryNotInjected"; - } -} +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.openejb.arquillian.tests.jms; + +import javax.annotation.Resource; +import javax.faces.bean.ManagedBean; +import javax.jms.ConnectionFactory; +import javax.jms.Queue; +import javax.jms.Topic; + +@ManagedBean +public class DummyManagedBean { + @Resource + private Queue queue; + + @Resource + private Topic topic; + + @Resource + private ConnectionFactory connectionFactory; + + public String getFoo() { + if (queue != null) { + return "queueInjected"; + } + return "queueNotInjected"; + } + + public String getBoo() { + if (topic != null) { + return "topicInjected"; + } + return "topicNotInjected"; + } + + public String getBaz() { + if (connectionFactory != null) { + return "connectionFactoryInjected"; + } + return "connectionFactoryNotInjected"; + } +} http://git-wip-us.apache.org/repos/asf/tomee/blob/52567075/arquillian/arquillian-tomee-tests/arquillian-tomee-jms-tests/src/test/java/org/apache/openejb/arquillian/tests/jms/JMSInjectionTest.java ---------------------------------------------------------------------- diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-jms-tests/src/test/java/org/apache/openejb/arquillian/tests/jms/JMSInjectionTest.java b/arquillian/arquillian-tomee-tests/arquillian-tomee-jms-tests/src/test/java/org/apache/openejb/arquillian/tests/jms/JMSInjectionTest.java index 30d8426..4d7ca40 100755 --- a/arquillian/arquillian-tomee-tests/arquillian-tomee-jms-tests/src/test/java/org/apache/openejb/arquillian/tests/jms/JMSInjectionTest.java +++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-jms-tests/src/test/java/org/apache/openejb/arquillian/tests/jms/JMSInjectionTest.java @@ -1,79 +1,79 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.openejb.arquillian.tests.jms; - -import org.apache.openejb.loader.IO; -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset; -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.webapp30.WebAppDescriptor; -import org.junit.Test; -import org.junit.runner.RunWith; - -import javax.faces.webapp.FacesServlet; -import java.io.IOException; -import java.net.URL; - -import static org.junit.Assert.assertTrue; - -@RunWith(Arquillian.class) -public class JMSInjectionTest { - - @ArquillianResource - private URL url; - - @Deployment(testable = false) - public static WebArchive getArchive() { - - return ShrinkWrap.create(WebArchive.class, "jsf-jms-test.war") - .addClasses(DummyManagedBean.class) - .addAsWebResource(new ClassLoaderAsset( - JMSInjectionTest.class.getPackage().getName().replace('.', '/').concat("/").concat("dummy.xhtml")), "dummy.xhtml") - .setWebXML(new StringAsset(Descriptors.create(WebAppDescriptor.class) - .version("3.0") - .createServlet() - .servletName("jsf") - .servletClass(FacesServlet.class.getName()) - .loadOnStartup(1) - .up() - .createServletMapping() - .servletName("jsf") - .urlPattern("*.xhtml") // not the default - .up() - .exportAsString())); - } - - @Test - public void testJMSInjection() throws Exception { - validateTest("queueInjected"); - validateTest("topicInjected"); - validateTest("connectionFactoryInjected"); - } - - private void validateTest(final String expectedOutput) throws IOException { - final String output = IO.slurp(new URL(url.toExternalForm() + "dummy.xhtml")); - assertTrue("Output should contain: " + expectedOutput + "; and not " + output, output.contains(expectedOutput)); - } - - -} +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.openejb.arquillian.tests.jms; + +import org.apache.openejb.loader.IO; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset; +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.webapp30.WebAppDescriptor; +import org.junit.Test; +import org.junit.runner.RunWith; + +import javax.faces.webapp.FacesServlet; +import java.io.IOException; +import java.net.URL; + +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class JMSInjectionTest { + + @ArquillianResource + private URL url; + + @Deployment(testable = false) + public static WebArchive getArchive() { + + return ShrinkWrap.create(WebArchive.class, "jsf-jms-test.war") + .addClasses(DummyManagedBean.class) + .addAsWebResource(new ClassLoaderAsset( + JMSInjectionTest.class.getPackage().getName().replace('.', '/').concat("/").concat("dummy.xhtml")), "dummy.xhtml") + .setWebXML(new StringAsset(Descriptors.create(WebAppDescriptor.class) + .version("3.0") + .createServlet() + .servletName("jsf") + .servletClass(FacesServlet.class.getName()) + .loadOnStartup(1) + .up() + .createServletMapping() + .servletName("jsf") + .urlPattern("*.xhtml") // not the default + .up() + .exportAsString())); + } + + @Test + public void testJMSInjection() throws Exception { + validateTest("queueInjected"); + validateTest("topicInjected"); + validateTest("connectionFactoryInjected"); + } + + private void validateTest(final String expectedOutput) throws IOException { + final String output = IO.slurp(new URL(url.toExternalForm() + "dummy.xhtml")); + assertTrue("Output should contain: " + expectedOutput + "; and not " + output, output.contains(expectedOutput)); + } + + +} http://git-wip-us.apache.org/repos/asf/tomee/blob/52567075/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/jpa/DummyManagedBean.java ---------------------------------------------------------------------- diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/jpa/DummyManagedBean.java b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/jpa/DummyManagedBean.java index ca23c05..edce25f 100644 --- a/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/jpa/DummyManagedBean.java +++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/jpa/DummyManagedBean.java @@ -1,44 +1,44 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.openejb.arquillian.tests.jsf.jpa; - -import javax.faces.bean.ManagedBean; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.PersistenceContext; -import javax.persistence.PersistenceUnit; - -@ManagedBean -public class DummyManagedBean { - @PersistenceUnit(unitName ="test-pu") - EntityManagerFactory emf; - - @PersistenceContext(unitName ="test-pu") - EntityManager em; - - public String getFoo() - { - if(emf!=null){return "emfInjected";} - return "emfNotInjected"; - } - - public String getBoo() - { - if(em!=null){return "emInjected";} - return "emNotInjected"; - } -} +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.openejb.arquillian.tests.jsf.jpa; + +import javax.faces.bean.ManagedBean; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.PersistenceContext; +import javax.persistence.PersistenceUnit; + +@ManagedBean +public class DummyManagedBean { + @PersistenceUnit(unitName ="test-pu") + EntityManagerFactory emf; + + @PersistenceContext(unitName ="test-pu") + EntityManager em; + + public String getFoo() + { + if(emf!=null){return "emfInjected";} + return "emfNotInjected"; + } + + public String getBoo() + { + if(em!=null){return "emInjected";} + return "emNotInjected"; + } +} http://git-wip-us.apache.org/repos/asf/tomee/blob/52567075/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/jpa/JPAInjectionTest.java ---------------------------------------------------------------------- diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/jpa/JPAInjectionTest.java b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/jpa/JPAInjectionTest.java index 179b03a..187ff49 100644 --- a/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/jpa/JPAInjectionTest.java +++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/jsf/jpa/JPAInjectionTest.java @@ -1,77 +1,77 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.openejb.arquillian.tests.jsf.jpa; - -import org.apache.openejb.arquillian.tests.jsf.JSFs; -import org.apache.openejb.loader.IO; -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.arquillian.test.api.ArquillianResource; -import org.jboss.shrinkwrap.api.asset.Asset; -import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset; -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.persistence20.PersistenceDescriptor; -import org.junit.Test; -import org.junit.runner.RunWith; - -import java.io.IOException; -import java.net.URL; - -import static org.junit.Assert.assertTrue; - -@RunWith(Arquillian.class) -public class JPAInjectionTest extends JSFs { - - @ArquillianResource - private URL url; - - @Deployment(testable = false) - public static WebArchive getArchive() { - PersistenceDescriptor persistenceDescriptor = Descriptors.create(PersistenceDescriptor.class) - .createPersistenceUnit() - .name("test-pu") - .transactionType("JTA") - .clazz(PersistenceDescriptor.class.getName()) - .jtaDataSource("test-ds") - .up(); - - - Asset persistenceAsset = new StringAsset(persistenceDescriptor.exportAsString()); - return base("jsf-jpa-test.war").addAsWebInfResource(persistenceAsset, "persistence.xml") - .addClasses(DummyManagedBean.class) - .addAsWebResource(new ClassLoaderAsset( - JPAInjectionTest.class.getPackage().getName().replace('.', '/').concat("/").concat("dummy.xhtml")), "dummy.xhtml"); - - - } - - @Test - public void testJPAInjection() throws Exception { - validateTest("emfInjected"); - validateTest("emInjected"); - } - - private void validateTest(final String expectedOutput) throws IOException { - final String output = IO.slurp(new URL(url.toExternalForm() + "dummy.xhtml")); - assertTrue("Output should contain: " + expectedOutput + "; and not " + output, output.contains(expectedOutput)); - } - - -} +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.openejb.arquillian.tests.jsf.jpa; + +import org.apache.openejb.arquillian.tests.jsf.JSFs; +import org.apache.openejb.loader.IO; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.asset.Asset; +import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset; +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.persistence20.PersistenceDescriptor; +import org.junit.Test; +import org.junit.runner.RunWith; + +import java.io.IOException; +import java.net.URL; + +import static org.junit.Assert.assertTrue; + +@RunWith(Arquillian.class) +public class JPAInjectionTest extends JSFs { + + @ArquillianResource + private URL url; + + @Deployment(testable = false) + public static WebArchive getArchive() { + PersistenceDescriptor persistenceDescriptor = Descriptors.create(PersistenceDescriptor.class) + .createPersistenceUnit() + .name("test-pu") + .transactionType("JTA") + .clazz(PersistenceDescriptor.class.getName()) + .jtaDataSource("test-ds") + .up(); + + + Asset persistenceAsset = new StringAsset(persistenceDescriptor.exportAsString()); + return base("jsf-jpa-test.war").addAsWebInfResource(persistenceAsset, "persistence.xml") + .addClasses(DummyManagedBean.class) + .addAsWebResource(new ClassLoaderAsset( + JPAInjectionTest.class.getPackage().getName().replace('.', '/').concat("/").concat("dummy.xhtml")), "dummy.xhtml"); + + + } + + @Test + public void testJPAInjection() throws Exception { + validateTest("emfInjected"); + validateTest("emInjected"); + } + + private void validateTest(final String expectedOutput) throws IOException { + final String output = IO.slurp(new URL(url.toExternalForm() + "dummy.xhtml")); + assertTrue("Output should contain: " + expectedOutput + "; and not " + output, output.contains(expectedOutput)); + } + + +}
