You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2015/09/25 12:43:06 UTC
[31/33] tomee git commit: Align SNAPSHOT versions & reformat examples
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/arquillian-jpa/README.md
----------------------------------------------------------------------
diff --git a/examples/arquillian-jpa/README.md b/examples/arquillian-jpa/README.md
index ae43e71..1bc2e9f 100644
--- a/examples/arquillian-jpa/README.md
+++ b/examples/arquillian-jpa/README.md
@@ -1,169 +1,169 @@
-Title: Arquillian Persistence Extension
-
-A sample showing how to use TomEE, Arquillian and its Persistence Extension.
-
-Note that it doesn't work with embedded containers (openejb, tomee-embedded)
-if you don't use workarounds like https://github.com/rmannibucau/persistence-with-openejb-and-arquillian
-(see src/test/resources folder).
-
-# Running (output)
-
- -------------------------------------------------------
- T E S T S
- -------------------------------------------------------
- Running org.superbiz.arquillian.test.persistence.PersistenceTest
- oct. 01, 2014 6:30:23 PM org.apache.openejb.arquillian.common.Setup findHome
- INFOS: Unable to find home in: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote
- oct. 01, 2014 6:30:23 PM org.apache.openejb.arquillian.common.MavenCache getArtifact
- INFOS: Downloading org.apache.openejb:apache-tomee:2.0.0-SNAPSHOT:zip:webprofile please wait...
- oct. 01, 2014 6:30:23 PM org.apache.openejb.arquillian.common.Zips unzip
- INFOS: Extracting '/home/rmannibucau/.m2/repository/org/apache/openejb/apache-tomee/2.0.0-SNAPSHOT/apache-tomee-2.0.0-SNAPSHOT-webprofile.zip' to '/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote'
- oct. 01, 2014 6:30:24 PM org.apache.tomee.arquillian.remote.RemoteTomEEContainer configure
- INFOS: Downloaded container to: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-2.0.0-SNAPSHOT
- INFOS - Server version: Apache Tomcat/8.0.14
- INFOS - Server built: Sep 24 2014 09:01:51
- INFOS - Server number: 8.0.14.0
- INFOS - OS Name: Linux
- INFOS - OS Version: 3.13.0-35-generic
- INFOS - Architecture: amd64
- INFOS - JVM Version: 1.7.0_67-b01
- INFOS - JVM Vendor: Oracle Corporation
- INFOS - The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
- INFOS - Initializing ProtocolHandler ["http-nio-52256"]
- INFOS - Using a shared selector for servlet write/read
- INFOS - Initializing ProtocolHandler ["ajp-nio-40071"]
- INFOS - Using a shared selector for servlet write/read
- INFOS - Using 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator'
- INFOS - ********************************************************************************
- INFOS - OpenEJB http://tomee.apache.org/
- INFOS - Startup: Wed Oct 01 18:30:26 CEST 2014
- INFOS - Copyright 1999-2013 (C) Apache OpenEJB Project, All Rights Reserved.
- INFOS - Version: 5.0.0-SNAPSHOT
- INFOS - Build date: 20141001
- INFOS - Build time: 04:53
- INFOS - ********************************************************************************
- INFOS - openejb.home = /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-2.0.0-SNAPSHOT
- INFOS - openejb.base = /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-2.0.0-SNAPSHOT
- INFOS - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@13158bbd
- INFOS - Succeeded in installing singleton service
- INFOS - openejb configuration file is '/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-2.0.0-SNAPSHOT/conf/tomee.xml'
- INFOS - Configuring Service(id=Tomcat Security Service, type=SecurityService, provider-id=Tomcat Security Service)
- INFOS - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
- INFOS - Configuring Service(id=demoDataSource, type=Resource, provider-id=Default JDBC Database)
- INFOS - Using 'openejb.system.apps=true'
- INFOS - Configuring enterprise application: openejb
- INFOS - Using openejb.deploymentId.format '{ejbName}'
- INFOS - Auto-deploying ejb openejb/Deployer: EjbDeployment(deployment-id=openejb/Deployer)
- INFOS - Auto-deploying ejb openejb/ConfigurationInfo: EjbDeployment(deployment-id=openejb/ConfigurationInfo)
- INFOS - Auto-deploying ejb MEJB: EjbDeployment(deployment-id=MEJB)
- INFOS - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container)
- INFOS - Auto-creating a container for bean openejb/Deployer: Container(type=STATELESS, id=Default Stateless Container)
- INFOS - Enterprise application "openejb" loaded.
- INFOS - Creating TransactionManager(id=Default Transaction Manager)
- INFOS - Creating SecurityService(id=Tomcat Security Service)
- INFOS - Creating Resource(id=demoDataSource)
- INFOS - Disabling testOnBorrow since no validation query is provided
- INFOS - Creating Container(id=Default Stateless Container)
- INFOS - Not creating another application classloader for openejb
- INFOS - Assembling app: openejb
- INFOS - Using 'openejb.jndiname.format={deploymentId}{interfaceType.openejbLegacyName}'
- INFOS - Jndi(name=openejb/DeployerBusinessRemote) --> Ejb(deployment-id=openejb/Deployer)
- INFOS - Jndi(name=global/openejb/openejb/Deployer!org.apache.openejb.assembler.Deployer) --> Ejb(deployment-id=openejb/Deployer)
- INFOS - Jndi(name=global/openejb/openejb/Deployer) --> Ejb(deployment-id=openejb/Deployer)
- INFOS - Jndi(name=openejb/ConfigurationInfoBusinessRemote) --> Ejb(deployment-id=openejb/ConfigurationInfo)
- INFOS - Jndi(name=global/openejb/openejb/ConfigurationInfo!org.apache.openejb.assembler.classic.cmd.ConfigurationInfo) --> Ejb(deployment-id=openejb/ConfigurationInfo)
- INFOS - Jndi(name=global/openejb/openejb/ConfigurationInfo) --> Ejb(deployment-id=openejb/ConfigurationInfo)
- INFOS - Jndi(name=MEJB) --> Ejb(deployment-id=MEJB)
- INFOS - Jndi(name=global/openejb/MEJB!javax.management.j2ee.ManagementHome) --> Ejb(deployment-id=MEJB)
- INFOS - Jndi(name=global/openejb/MEJB) --> Ejb(deployment-id=MEJB)
- INFOS - Created Ejb(deployment-id=openejb/Deployer, ejb-name=openejb/Deployer, container=Default Stateless Container)
- INFOS - Created Ejb(deployment-id=MEJB, ejb-name=MEJB, container=Default Stateless Container)
- INFOS - Created Ejb(deployment-id=openejb/ConfigurationInfo, ejb-name=openejb/ConfigurationInfo, container=Default Stateless Container)
- INFOS - Started Ejb(deployment-id=openejb/Deployer, ejb-name=openejb/Deployer, container=Default Stateless Container)
- INFOS - Started Ejb(deployment-id=MEJB, ejb-name=MEJB, container=Default Stateless Container)
- INFOS - Started Ejb(deployment-id=openejb/ConfigurationInfo, ejb-name=openejb/ConfigurationInfo, container=Default Stateless Container)
- INFOS - Deployed MBean(openejb.user.mbeans:application=openejb,group=org.apache.openejb.assembler.monitoring,name=JMXDeployer)
- INFOS - Deployed Application(path=openejb)
- INFOS - Creating ServerService(id=cxf-rs)
- INFOS - ** Bound Services **
- INFOS - NAME IP PORT
- INFOS - -------
- INFOS - Ready!
- INFOS - Initialization processed in 2589 ms
- INFOS - Importing a Tomcat Resource with id 'UserDatabase' of type 'org.apache.catalina.UserDatabase'.
- INFOS - Creating Resource(id=UserDatabase)
- INFOS - Démarrage du service Catalina
- INFOS - Starting Servlet Engine: Apache Tomcat (TomEE)/8.0.14 (2.0.0-SNAPSHOT)
- INFOS - Starting ProtocolHandler ["http-nio-52256"]
- INFOS - Starting ProtocolHandler ["ajp-nio-40071"]
- INFOS - Server startup in 140 ms
- oct. 01, 2014 6:30:30 PM org.apache.openejb.client.EventLogger log
- INFOS: RemoteInitialContextCreated{providerUri=http://localhost:52256/tomee/ejb}
- INFOS - Extracting jar: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest.war
- INFOS - Extracted path: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
- INFOS - using default host: localhost
- INFOS - ------------------------- localhost -> /UserPersistenceTest
- INFOS - Using 'openejb.session.manager=org.apache.tomee.catalina.session.QuickSessionManager'
- INFOS - Configuring enterprise application: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
- INFOS - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
- INFOS - Auto-creating a container for bean UserPersistenceTest_org.superbiz.arquillian.test.persistence.PersistenceTest: Container(type=MANAGED, id=Default Managed Container)
- INFOS - Creating Container(id=Default Managed Container)
- INFOS - Using directory /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-2.0.0-SNAPSHOT/temp for stateful session passivation
- INFOS - Configuring PersistenceUnit(name=demoApplicationPU)
- INFOS - Auto-creating a Resource with id 'demoDataSourceNonJta' of type 'DataSource for 'demoApplicationPU'.
- INFOS - Configuring Service(id=demoDataSourceNonJta, type=Resource, provider-id=demoDataSource)
- INFOS - Creating Resource(id=demoDataSourceNonJta)
- INFOS - Disabling testOnBorrow since no validation query is provided
- INFOS - Adjusting PersistenceUnit demoApplicationPU <non-jta-data-source> to Resource ID 'demoDataSourceNonJta' from 'null'
- INFOS - Enterprise application "/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest" loaded.
- INFOS - Assembling app: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
- INFOS - OpenJPA dynamically loaded a validation provider.
- INFOS - Starting OpenJPA 2.4.0-nonfinal-1598334
- INFOS - Using dictionary class "org.apache.openjpa.jdbc.sql.HSQLDictionary" (HSQL Database Engine 2.3.2 ,HSQL Database Engine Driver 2.3.2).
- INFOS - Connected to HSQL Database Engine version 2.2 using JDBC driver HSQL Database Engine Driver version 2.3.2.
- INFOS - SELECT SEQUENCE_SCHEMA, SEQUENCE_NAME FROM INFORMATION_SCHEMA.SYSTEM_SEQUENCES --> 0ms
- INFOS - CREATE TABLE User (id BIGINT NOT NULL, name VARCHAR(255), PRIMARY KEY (id)) --> 0ms
- INFOS - PersistenceUnit(name=demoApplicationPU, provider=org.apache.openjpa.persistence.PersistenceProviderImpl) - provider time 1075ms
- INFOS - Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@13158bbd
- INFOS - OpenWebBeans Container is starting...
- INFOS - Adding OpenWebBeansPlugin : [CdiPlugin]
- INFOS - Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
- INFOS - All injection points were validated successfully.
- INFOS - OpenWebBeans Container has started, it took 224 ms.
- INFOS - Deployed Application(path=/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest)
- INFOS - At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
- AVERTISSEMENT - Potential problem found: The configured data type factory 'class org.dbunit.dataset.datatype.DefaultDataTypeFactory' might cause problems with the current database 'HSQL Database Engine' (e.g. some datatypes may not be supported properly). In rare cases you might see this message because the list of supported database products is incomplete (list=[derby]). If so please request a java-class update via the forums.If you are using your own IDataTypeFactory extending DefaultDataTypeFactory, ensure that you override getValidDbProducts() to specify the supported database products.
- INFOS - insert into USER (ID, NAME) values (1, TomEE) --> 1ms
- INFOS - insert into USER (ID, NAME) values (1, 2)TomEE,Old) --> 0ms
- INFOS - SELECT COUNT(t0.id) FROM User t0 --> 0ms
- INFOS - SELECT t0.name FROM User t0 WHERE t0.id = 2 --> 0ms
- INFOS - UPDATE User SET name = OpenEJB WHERE id = 2 --> 1ms
- INFOS - select ID, NAME from USER order by ID --> 0ms
- INFOS - select ID, NAME from USER order by ID --> 0ms
- INFOS - select ID, NAME from USER order by ID --> 0ms
- INFOS - select ID, NAME from USER order by ID --> 0ms
- INFOS - delete from USER --> 0ms
- oct. 01, 2014 6:30:34 PM org.apache.openejb.client.EventLogger log
- INFOS: RemoteInitialContextCreated{providerUri=http://localhost:52256/tomee/ejb}
- INFOS - Undeploying app: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
- oct. 01, 2014 6:30:34 PM org.apache.openejb.arquillian.common.TomEEContainer undeploy
- INFOS: cleaning /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0
- Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 11.242 sec
- INFOS - A valid shutdown command was received via the shutdown port. Stopping the Server instance.
- INFOS - Pausing ProtocolHandler ["http-nio-52256"]
- INFOS - Pausing ProtocolHandler ["ajp-nio-40071"]
- INFOS - Arrêt du service Catalina
- INFOS - Stopping ProtocolHandler ["http-nio-52256"]
- INFOS - Stopping ProtocolHandler ["ajp-nio-40071"]
- INFOS - Stopping server services
- INFOS - Undeploying app: openejb
- INFOS - Closing DataSource: demoDataSource
- INFOS - Closing DataSource: demoDataSourceNonJta
- INFOS - Destroying ProtocolHandler ["http-nio-52256"]
- INFOS - Destroying ProtocolHandler ["ajp-nio-40071"]
-
- Results :
-
- Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
-
+Title: Arquillian Persistence Extension
+
+A sample showing how to use TomEE, Arquillian and its Persistence Extension.
+
+Note that it doesn't work with embedded containers (openejb, tomee-embedded)
+if you don't use workarounds like https://github.com/rmannibucau/persistence-with-openejb-and-arquillian
+(see src/test/resources folder).
+
+# Running (output)
+
+ -------------------------------------------------------
+ T E S T S
+ -------------------------------------------------------
+ Running org.superbiz.arquillian.test.persistence.PersistenceTest
+ oct. 01, 2014 6:30:23 PM org.apache.openejb.arquillian.common.Setup findHome
+ INFOS: Unable to find home in: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote
+ oct. 01, 2014 6:30:23 PM org.apache.openejb.arquillian.common.MavenCache getArtifact
+ INFOS: Downloading org.apache.openejb:apache-tomee:7.0.0-SNAPSHOT:zip:webprofile please wait...
+ oct. 01, 2014 6:30:23 PM org.apache.openejb.arquillian.common.Zips unzip
+ INFOS: Extracting '/home/rmannibucau/.m2/repository/org/apache/openejb/apache-tomee/7.0.0-SNAPSHOT/apache-tomee-7.0.0-SNAPSHOT-webprofile.zip' to '/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote'
+ oct. 01, 2014 6:30:24 PM org.apache.tomee.arquillian.remote.RemoteTomEEContainer configure
+ INFOS: Downloaded container to: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-7.0.0-SNAPSHOT
+ INFOS - Server version: Apache Tomcat/8.0.14
+ INFOS - Server built: Sep 24 2014 09:01:51
+ INFOS - Server number: 8.0.14.0
+ INFOS - OS Name: Linux
+ INFOS - OS Version: 3.13.0-35-generic
+ INFOS - Architecture: amd64
+ INFOS - JVM Version: 1.7.0_67-b01
+ INFOS - JVM Vendor: Oracle Corporation
+ INFOS - The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
+ INFOS - Initializing ProtocolHandler ["http-nio-52256"]
+ INFOS - Using a shared selector for servlet write/read
+ INFOS - Initializing ProtocolHandler ["ajp-nio-40071"]
+ INFOS - Using a shared selector for servlet write/read
+ INFOS - Using 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator'
+ INFOS - ********************************************************************************
+ INFOS - OpenEJB http://tomee.apache.org/
+ INFOS - Startup: Wed Oct 01 18:30:26 CEST 2014
+ INFOS - Copyright 1999-2013 (C) Apache OpenEJB Project, All Rights Reserved.
+ INFOS - Version: 7.0.0-SNAPSHOT
+ INFOS - Build date: 20141001
+ INFOS - Build time: 04:53
+ INFOS - ********************************************************************************
+ INFOS - openejb.home = /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-7.0.0-SNAPSHOT
+ INFOS - openejb.base = /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-7.0.0-SNAPSHOT
+ INFOS - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@13158bbd
+ INFOS - Succeeded in installing singleton service
+ INFOS - openejb configuration file is '/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-7.0.0-SNAPSHOT/conf/tomee.xml'
+ INFOS - Configuring Service(id=Tomcat Security Service, type=SecurityService, provider-id=Tomcat Security Service)
+ INFOS - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+ INFOS - Configuring Service(id=demoDataSource, type=Resource, provider-id=Default JDBC Database)
+ INFOS - Using 'openejb.system.apps=true'
+ INFOS - Configuring enterprise application: openejb
+ INFOS - Using openejb.deploymentId.format '{ejbName}'
+ INFOS - Auto-deploying ejb openejb/Deployer: EjbDeployment(deployment-id=openejb/Deployer)
+ INFOS - Auto-deploying ejb openejb/ConfigurationInfo: EjbDeployment(deployment-id=openejb/ConfigurationInfo)
+ INFOS - Auto-deploying ejb MEJB: EjbDeployment(deployment-id=MEJB)
+ INFOS - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container)
+ INFOS - Auto-creating a container for bean openejb/Deployer: Container(type=STATELESS, id=Default Stateless Container)
+ INFOS - Enterprise application "openejb" loaded.
+ INFOS - Creating TransactionManager(id=Default Transaction Manager)
+ INFOS - Creating SecurityService(id=Tomcat Security Service)
+ INFOS - Creating Resource(id=demoDataSource)
+ INFOS - Disabling testOnBorrow since no validation query is provided
+ INFOS - Creating Container(id=Default Stateless Container)
+ INFOS - Not creating another application classloader for openejb
+ INFOS - Assembling app: openejb
+ INFOS - Using 'openejb.jndiname.format={deploymentId}{interfaceType.openejbLegacyName}'
+ INFOS - Jndi(name=openejb/DeployerBusinessRemote) --> Ejb(deployment-id=openejb/Deployer)
+ INFOS - Jndi(name=global/openejb/openejb/Deployer!org.apache.openejb.assembler.Deployer) --> Ejb(deployment-id=openejb/Deployer)
+ INFOS - Jndi(name=global/openejb/openejb/Deployer) --> Ejb(deployment-id=openejb/Deployer)
+ INFOS - Jndi(name=openejb/ConfigurationInfoBusinessRemote) --> Ejb(deployment-id=openejb/ConfigurationInfo)
+ INFOS - Jndi(name=global/openejb/openejb/ConfigurationInfo!org.apache.openejb.assembler.classic.cmd.ConfigurationInfo) --> Ejb(deployment-id=openejb/ConfigurationInfo)
+ INFOS - Jndi(name=global/openejb/openejb/ConfigurationInfo) --> Ejb(deployment-id=openejb/ConfigurationInfo)
+ INFOS - Jndi(name=MEJB) --> Ejb(deployment-id=MEJB)
+ INFOS - Jndi(name=global/openejb/MEJB!javax.management.j2ee.ManagementHome) --> Ejb(deployment-id=MEJB)
+ INFOS - Jndi(name=global/openejb/MEJB) --> Ejb(deployment-id=MEJB)
+ INFOS - Created Ejb(deployment-id=openejb/Deployer, ejb-name=openejb/Deployer, container=Default Stateless Container)
+ INFOS - Created Ejb(deployment-id=MEJB, ejb-name=MEJB, container=Default Stateless Container)
+ INFOS - Created Ejb(deployment-id=openejb/ConfigurationInfo, ejb-name=openejb/ConfigurationInfo, container=Default Stateless Container)
+ INFOS - Started Ejb(deployment-id=openejb/Deployer, ejb-name=openejb/Deployer, container=Default Stateless Container)
+ INFOS - Started Ejb(deployment-id=MEJB, ejb-name=MEJB, container=Default Stateless Container)
+ INFOS - Started Ejb(deployment-id=openejb/ConfigurationInfo, ejb-name=openejb/ConfigurationInfo, container=Default Stateless Container)
+ INFOS - Deployed MBean(openejb.user.mbeans:application=openejb,group=org.apache.openejb.assembler.monitoring,name=JMXDeployer)
+ INFOS - Deployed Application(path=openejb)
+ INFOS - Creating ServerService(id=cxf-rs)
+ INFOS - ** Bound Services **
+ INFOS - NAME IP PORT
+ INFOS - -------
+ INFOS - Ready!
+ INFOS - Initialization processed in 2589 ms
+ INFOS - Importing a Tomcat Resource with id 'UserDatabase' of type 'org.apache.catalina.UserDatabase'.
+ INFOS - Creating Resource(id=UserDatabase)
+ INFOS - Démarrage du service Catalina
+ INFOS - Starting Servlet Engine: Apache Tomcat (TomEE)/8.0.14 (7.0.0-SNAPSHOT)
+ INFOS - Starting ProtocolHandler ["http-nio-52256"]
+ INFOS - Starting ProtocolHandler ["ajp-nio-40071"]
+ INFOS - Server startup in 140 ms
+ oct. 01, 2014 6:30:30 PM org.apache.openejb.client.EventLogger log
+ INFOS: RemoteInitialContextCreated{providerUri=http://localhost:52256/tomee/ejb}
+ INFOS - Extracting jar: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest.war
+ INFOS - Extracted path: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
+ INFOS - using default host: localhost
+ INFOS - ------------------------- localhost -> /UserPersistenceTest
+ INFOS - Using 'openejb.session.manager=org.apache.tomee.catalina.session.QuickSessionManager'
+ INFOS - Configuring enterprise application: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
+ INFOS - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+ INFOS - Auto-creating a container for bean UserPersistenceTest_org.superbiz.arquillian.test.persistence.PersistenceTest: Container(type=MANAGED, id=Default Managed Container)
+ INFOS - Creating Container(id=Default Managed Container)
+ INFOS - Using directory /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/apache-tomee-remote/apache-tomee-webprofile-7.0.0-SNAPSHOT/temp for stateful session passivation
+ INFOS - Configuring PersistenceUnit(name=demoApplicationPU)
+ INFOS - Auto-creating a Resource with id 'demoDataSourceNonJta' of type 'DataSource for 'demoApplicationPU'.
+ INFOS - Configuring Service(id=demoDataSourceNonJta, type=Resource, provider-id=demoDataSource)
+ INFOS - Creating Resource(id=demoDataSourceNonJta)
+ INFOS - Disabling testOnBorrow since no validation query is provided
+ INFOS - Adjusting PersistenceUnit demoApplicationPU <non-jta-data-source> to Resource ID 'demoDataSourceNonJta' from 'null'
+ INFOS - Enterprise application "/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest" loaded.
+ INFOS - Assembling app: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
+ INFOS - OpenJPA dynamically loaded a validation provider.
+ INFOS - Starting OpenJPA 2.4.0-nonfinal-1598334
+ INFOS - Using dictionary class "org.apache.openjpa.jdbc.sql.HSQLDictionary" (HSQL Database Engine 2.3.2 ,HSQL Database Engine Driver 2.3.2).
+ INFOS - Connected to HSQL Database Engine version 2.2 using JDBC driver HSQL Database Engine Driver version 2.3.2.
+ INFOS - SELECT SEQUENCE_SCHEMA, SEQUENCE_NAME FROM INFORMATION_SCHEMA.SYSTEM_SEQUENCES --> 0ms
+ INFOS - CREATE TABLE User (id BIGINT NOT NULL, name VARCHAR(255), PRIMARY KEY (id)) --> 0ms
+ INFOS - PersistenceUnit(name=demoApplicationPU, provider=org.apache.openjpa.persistence.PersistenceProviderImpl) - provider time 1075ms
+ INFOS - Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@13158bbd
+ INFOS - OpenWebBeans Container is starting...
+ INFOS - Adding OpenWebBeansPlugin : [CdiPlugin]
+ INFOS - Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
+ INFOS - All injection points were validated successfully.
+ INFOS - OpenWebBeans Container has started, it took 224 ms.
+ INFOS - Deployed Application(path=/home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest)
+ INFOS - At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
+ AVERTISSEMENT - Potential problem found: The configured data type factory 'class org.dbunit.dataset.datatype.DefaultDataTypeFactory' might cause problems with the current database 'HSQL Database Engine' (e.g. some datatypes may not be supported properly). In rare cases you might see this message because the list of supported database products is incomplete (list=[derby]). If so please request a java-class update via the forums.If you are using your own IDataTypeFactory extending DefaultDataTypeFactory, ensure that you override getValidDbProducts() to specify the supported database products.
+ INFOS - insert into USER (ID, NAME) values (1, TomEE) --> 1ms
+ INFOS - insert into USER (ID, NAME) values (1, 2)TomEE,Old) --> 0ms
+ INFOS - SELECT COUNT(t0.id) FROM User t0 --> 0ms
+ INFOS - SELECT t0.name FROM User t0 WHERE t0.id = 2 --> 0ms
+ INFOS - UPDATE User SET name = OpenEJB WHERE id = 2 --> 1ms
+ INFOS - select ID, NAME from USER order by ID --> 0ms
+ INFOS - select ID, NAME from USER order by ID --> 0ms
+ INFOS - select ID, NAME from USER order by ID --> 0ms
+ INFOS - select ID, NAME from USER order by ID --> 0ms
+ INFOS - delete from USER --> 0ms
+ oct. 01, 2014 6:30:34 PM org.apache.openejb.client.EventLogger log
+ INFOS: RemoteInitialContextCreated{providerUri=http://localhost:52256/tomee/ejb}
+ INFOS - Undeploying app: /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0/UserPersistenceTest
+ oct. 01, 2014 6:30:34 PM org.apache.openejb.arquillian.common.TomEEContainer undeploy
+ INFOS: cleaning /home/rmannibucau/dev/Apache/tomee-trunk/examples/arquillian-jpa/target/arquillian-test-working-dir/0
+ Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 11.242 sec
+ INFOS - A valid shutdown command was received via the shutdown port. Stopping the Server instance.
+ INFOS - Pausing ProtocolHandler ["http-nio-52256"]
+ INFOS - Pausing ProtocolHandler ["ajp-nio-40071"]
+ INFOS - Arrêt du service Catalina
+ INFOS - Stopping ProtocolHandler ["http-nio-52256"]
+ INFOS - Stopping ProtocolHandler ["ajp-nio-40071"]
+ INFOS - Stopping server services
+ INFOS - Undeploying app: openejb
+ INFOS - Closing DataSource: demoDataSource
+ INFOS - Closing DataSource: demoDataSourceNonJta
+ INFOS - Destroying ProtocolHandler ["http-nio-52256"]
+ INFOS - Destroying ProtocolHandler ["ajp-nio-40071"]
+
+ Results :
+
+ Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+
+
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/arquillian-jpa/pom.xml
----------------------------------------------------------------------
diff --git a/examples/arquillian-jpa/pom.xml b/examples/arquillian-jpa/pom.xml
index f23be7f..92f26b9 100644
--- a/examples/arquillian-jpa/pom.xml
+++ b/examples/arquillian-jpa/pom.xml
@@ -14,7 +14,7 @@
<groupId>org.superbiz</groupId>
<artifactId>arquillian-jpa</artifactId>
<name>OpenEJB :: Examples :: Arquillian Persistence Extension Sample</name>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<properties>
<arquillian.version>1.1.5.Final</arquillian.version>
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/User.java
----------------------------------------------------------------------
diff --git a/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/User.java b/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/User.java
index 0d9c1d7..65c0c67 100644
--- a/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/User.java
+++ b/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/User.java
@@ -1,43 +1,43 @@
-/**
- * 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.superbiz.arquillian.persistence;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-@Entity
-public class User {
- @Id
- private long id;
- private String name;
-
- public long getId() {
- return id;
- }
-
- public void setId(final long id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-}
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.arquillian.persistence;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class User {
+ @Id
+ private long id;
+ private String name;
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(final long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
----------------------------------------------------------------------
diff --git a/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java b/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
index a3bf408..4b68131 100644
--- a/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
+++ b/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
@@ -1,66 +1,63 @@
-/**
- * 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.superbiz.arquillian.test.persistence;
-
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.arquillian.persistence.ShouldMatchDataSet;
-import org.jboss.arquillian.persistence.UsingDataSet;
-import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
-import org.jboss.arquillian.transaction.api.annotation.Transactional;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.superbiz.arquillian.persistence.User;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-@RunWith(Arquillian.class)
-public class PersistenceTest
-{
- @Deployment
- public static Archive<?> createDeploymentPackage()
- {
- return ShrinkWrap.create(WebArchive.class, "UserPersistenceTest.war")
- .addPackage(User.class.getPackage())
- .addAsManifestResource(new ClassLoaderAsset("META-INF/persistence.xml"), "persistence.xml");
- }
-
- @PersistenceContext
- private EntityManager em;
-
- @Test
- @Transactional(TransactionMode.COMMIT) // default with persistence extension
- @UsingDataSet("datasets/users.yml")
- @ShouldMatchDataSet("datasets/expected-users.yml")
- public void seriouslyYouAlreadyForgotOpenEJB_questionMark() throws Exception
- {
- assertEquals(2, em.createQuery("select count(e) from User e",Number.class).getSingleResult().intValue());
-
- final User user = em.find(User.class, 2L);
- assertNotNull(user);
-
- user.setName("OpenEJB"); // @Transactional(TransactionMode.COMMIT) will commit it and datasets/expected-users.yml will check it
- }
-}
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.arquillian.test.persistence;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.persistence.ShouldMatchDataSet;
+import org.jboss.arquillian.persistence.UsingDataSet;
+import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
+import org.jboss.arquillian.transaction.api.annotation.Transactional;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.superbiz.arquillian.persistence.User;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(Arquillian.class)
+public class PersistenceTest {
+ @Deployment
+ public static Archive<?> createDeploymentPackage() {
+ return ShrinkWrap.create(WebArchive.class, "UserPersistenceTest.war")
+ .addPackage(User.class.getPackage())
+ .addAsManifestResource(new ClassLoaderAsset("META-INF/persistence.xml"), "persistence.xml");
+ }
+
+ @PersistenceContext
+ private EntityManager em;
+
+ @Test
+ @Transactional(TransactionMode.COMMIT) // default with persistence extension
+ @UsingDataSet("datasets/users.yml")
+ @ShouldMatchDataSet("datasets/expected-users.yml")
+ public void seriouslyYouAlreadyForgotOpenEJB_questionMark() throws Exception {
+ assertEquals(2, em.createQuery("select count(e) from User e", Number.class).getSingleResult().intValue());
+
+ final User user = em.find(User.class, 2L);
+ assertNotNull(user);
+
+ user.setName("OpenEJB"); // @Transactional(TransactionMode.COMMIT) will commit it and datasets/expected-users.yml will check it
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/async-methods/README.md
----------------------------------------------------------------------
diff --git a/examples/async-methods/README.md b/examples/async-methods/README.md
index ab5da1c..69c93ad 100644
--- a/examples/async-methods/README.md
+++ b/examples/async-methods/README.md
@@ -1,154 +1,154 @@
-Title: @Asynchronous Methods
-
-The @Asynchronous annotation was introduced in EJB 3.1 as a simple way of creating asynchronous processing.
-
-Every time a method annotated `@Asynchronous` is invoked by anyone it will immediately return regardless of how long the method actually takes. Each invocation returns a [Future][1] object that essentially starts out *empty* and will later have its value filled in by the container when the related method call actually completes. Returning a `Future` object is not required and `@Asynchronous` methods can of course return `void`.
-
-# Example
-
-Here, in `JobProcessorTest`,
-
-`final Future<String> red = processor.addJob("red");`
-proceeds to the next statement,
-
-`final Future<String> orange = processor.addJob("orange");`
-
-without waiting for the addJob() method to complete. And later we could ask for the result using the `Future<?>.get()` method like
-
-`assertEquals("blue", blue.get());`
-
-It waits for the processing to complete (if its not completed already) and gets the result. If you did not care about the result, you could simply have your asynchronous method as a void method.
-
-[Future][1] Object from docs,
-
-> A Future represents the result of an asynchronous computation. Methods are provided to check if the computation is complete, to wait for its completion, and to retrieve the result of the computation. The result can only be retrieved using method get when the computation has completed, blocking if necessary until it is ready. Cancellation is performed by the cancel method. Additional methods are provided to determine if the task completed normally or was cancelled. Once a computation has completed, the computation cannot be cancelled. If you would like to use a Future for the sake of cancellability but not provide a usable result, you can declare types of the form Future<?> and return null as a result of the underlying task
-
-
-
-# The code
- @Singleton
- public class JobProcessor {
- @Asynchronous
- @Lock(READ)
- @AccessTimeout(-1)
- public Future<String> addJob(String jobName) {
-
- // Pretend this job takes a while
- doSomeHeavyLifting();
-
- // Return our result
- return new AsyncResult<String>(jobName);
- }
-
- private void doSomeHeavyLifting() {
- try {
- Thread.sleep(SECONDS.toMillis(10));
- } catch (InterruptedException e) {
- Thread.interrupted();
- throw new IllegalStateException(e);
- }
- }
- }
-# Test
- public class JobProcessorTest extends TestCase {
-
- public void test() throws Exception {
-
- final Context context = EJBContainer.createEJBContainer().getContext();
-
- final JobProcessor processor = (JobProcessor) context.lookup("java:global/async-methods/JobProcessor");
-
- final long start = System.nanoTime();
-
- // Queue up a bunch of work
- final Future<String> red = processor.addJob("red");
- final Future<String> orange = processor.addJob("orange");
- final Future<String> yellow = processor.addJob("yellow");
- final Future<String> green = processor.addJob("green");
- final Future<String> blue = processor.addJob("blue");
- final Future<String> violet = processor.addJob("violet");
-
- // Wait for the result -- 1 minute worth of work
- assertEquals("blue", blue.get());
- assertEquals("orange", orange.get());
- assertEquals("green", green.get());
- assertEquals("red", red.get());
- assertEquals("yellow", yellow.get());
- assertEquals("violet", violet.get());
-
- // How long did it take?
- final long total = TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start);
-
- // Execution should be around 9 - 21 seconds
- // The execution time depends on the number of threads available for asynchronous execution.
- // In the best case it is 10s plus some minimal processing time.
- assertTrue("Expected > 9 but was: " + total, total > 9);
- assertTrue("Expected < 21 but was: " + total, total < 21);
-
- }
- }
-#Running
- -------------------------------------------------------
- T E S T S
- -------------------------------------------------------
- Running org.superbiz.async.JobProcessorTest
- Apache OpenEJB 4.0.0-SNAPSHOT build: 20110801-04:02
- http://tomee.apache.org/
- INFO - openejb.home = G:\Workspace\fullproject\openejb3\examples\async-methods
- INFO - openejb.base = G:\Workspace\fullproject\openejb3\examples\async-methods
- INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
- INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
- INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
- INFO - Found EjbModule in classpath: g:\Workspace\fullproject\openejb3\examples\async-methods\target\classes
- INFO - Beginning load: g:\Workspace\fullproject\openejb3\examples\async-methods\target\classes
- INFO - Configuring enterprise application: g:\Workspace\fullproject\openejb3\examples\async-methods
- INFO - Configuring Service(id=Default Singleton Container, type=Container, provider-id=Default Singleton Container)
- INFO - Auto-creating a container for bean JobProcessor: Container(type=SINGLETON, id=Default Singleton Container)
- INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
- INFO - Auto-creating a container for bean org.superbiz.async.JobProcessorTest: Container(type=MANAGED, id=Default Managed Container)
- INFO - Enterprise application "g:\Workspace\fullproject\openejb3\examples\async-methods" loaded.
- INFO - Assembling app: g:\Workspace\fullproject\openejb3\examples\async-methods
- INFO - Jndi(name="java:global/async-methods/JobProcessor!org.superbiz.async.JobProcessor")
- INFO - Jndi(name="java:global/async-methods/JobProcessor")
- INFO - Jndi(name="java:global/EjbModule100568296/org.superbiz.async.JobProcessorTest!org.superbiz.async.JobProcessorTest")
- INFO - Jndi(name="java:global/EjbModule100568296/org.superbiz.async.JobProcessorTest")
- INFO - Created Ejb(deployment-id=org.superbiz.async.JobProcessorTest, ejb-name=org.superbiz.async.JobProcessorTest, container=Default Managed Container)
- INFO - Created Ejb(deployment-id=JobProcessor, ejb-name=JobProcessor, container=Default Singleton Container)
- INFO - Started Ejb(deployment-id=org.superbiz.async.JobProcessorTest, ejb-name=org.superbiz.async.JobProcessorTest, container=Default Managed Container)
- INFO - Started Ejb(deployment-id=JobProcessor, ejb-name=JobProcessor, container=Default Singleton Container)
- INFO - Deployed Application(path=g:\Workspace\fullproject\openejb3\examples\async-methods)
- Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 13.305 sec
-
- Results :
-
- Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
-
- [INFO] ------------------------------------------------------------------------
- [INFO] BUILD SUCCESS
- [INFO] ------------------------------------------------------------------------
- [INFO] Total time: 21.097s
- [INFO] Finished at: Wed Aug 03 22:48:26 IST 2011
- [INFO] Final Memory: 13M/145M
- [INFO] ------------------------------------------------------------------------
-
-# How it works <small>under the covers</small>
-
-Under the covers what makes this work is:
-
- - The `JobProcessor` the caller sees is not actually an instance of `JobProcessor`. Rather it's a subclass or proxy that has all the methods overridden. Methods that are supposed to be asynchronous are handled differently.
- - Calls to an asynchronous method simply result in a `Runnable` being created that wraps the method and parameters you gave. This runnable is given to an [Executor][3] which is simply a work queue attached to a thread pool.
- - After adding the work to the queue, the proxied version of the method returns an implementation of `Future` that is linked to the `Runnable` which is now waiting on the queue.
- - When the `Runnable` finally executes the method on the *real* `JobProcessor` instance, it will take the return value and set it into the `Future` making it available to the caller.
-
-Important to note that the `AsyncResult` object the `JobProcessor` returns is not the same `Future` object the caller is holding. It would have been neat if the real `JobProcessor` could just return `String` and the caller's version of `JobProcessor` could return `Future<String>`, but we didn't see any way to do that without adding more complexity. So the `AsyncResult` is a simple wrapper object. The container will pull the `String` out, throw the `AsyncResult` away, then put the `String` in the *real* `Future` that the caller is holding.
-
-To get progress along the way, simply pass a thread-safe object like [AtomicInteger][4] to the `@Asynchronous` method and have the bean code periodically update it with the percent complete.
-
-#Related Examples
-
-For complex asynchronous processing, JavaEE's answer is `@MessageDrivenBean`. Have a look at the [simple-mdb](../simple-mdb/README.html) example
-
-[1]: http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html
-[3]: http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Executor.html
-[4]: http://download.oracle.com/javase/6/docs/api/java/util/concurrent/atomic/AtomicInteger.html
-
+Title: @Asynchronous Methods
+
+The @Asynchronous annotation was introduced in EJB 3.1 as a simple way of creating asynchronous processing.
+
+Every time a method annotated `@Asynchronous` is invoked by anyone it will immediately return regardless of how long the method actually takes. Each invocation returns a [Future][1] object that essentially starts out *empty* and will later have its value filled in by the container when the related method call actually completes. Returning a `Future` object is not required and `@Asynchronous` methods can of course return `void`.
+
+# Example
+
+Here, in `JobProcessorTest`,
+
+`final Future<String> red = processor.addJob("red");`
+proceeds to the next statement,
+
+`final Future<String> orange = processor.addJob("orange");`
+
+without waiting for the addJob() method to complete. And later we could ask for the result using the `Future<?>.get()` method like
+
+`assertEquals("blue", blue.get());`
+
+It waits for the processing to complete (if its not completed already) and gets the result. If you did not care about the result, you could simply have your asynchronous method as a void method.
+
+[Future][1] Object from docs,
+
+> A Future represents the result of an asynchronous computation. Methods are provided to check if the computation is complete, to wait for its completion, and to retrieve the result of the computation. The result can only be retrieved using method get when the computation has completed, blocking if necessary until it is ready. Cancellation is performed by the cancel method. Additional methods are provided to determine if the task completed normally or was cancelled. Once a computation has completed, the computation cannot be cancelled. If you would like to use a Future for the sake of cancellability but not provide a usable result, you can declare types of the form Future<?> and return null as a result of the underlying task
+
+
+
+# The code
+ @Singleton
+ public class JobProcessor {
+ @Asynchronous
+ @Lock(READ)
+ @AccessTimeout(-1)
+ public Future<String> addJob(String jobName) {
+
+ // Pretend this job takes a while
+ doSomeHeavyLifting();
+
+ // Return our result
+ return new AsyncResult<String>(jobName);
+ }
+
+ private void doSomeHeavyLifting() {
+ try {
+ Thread.sleep(SECONDS.toMillis(10));
+ } catch (InterruptedException e) {
+ Thread.interrupted();
+ throw new IllegalStateException(e);
+ }
+ }
+ }
+# Test
+ public class JobProcessorTest extends TestCase {
+
+ public void test() throws Exception {
+
+ final Context context = EJBContainer.createEJBContainer().getContext();
+
+ final JobProcessor processor = (JobProcessor) context.lookup("java:global/async-methods/JobProcessor");
+
+ final long start = System.nanoTime();
+
+ // Queue up a bunch of work
+ final Future<String> red = processor.addJob("red");
+ final Future<String> orange = processor.addJob("orange");
+ final Future<String> yellow = processor.addJob("yellow");
+ final Future<String> green = processor.addJob("green");
+ final Future<String> blue = processor.addJob("blue");
+ final Future<String> violet = processor.addJob("violet");
+
+ // Wait for the result -- 1 minute worth of work
+ assertEquals("blue", blue.get());
+ assertEquals("orange", orange.get());
+ assertEquals("green", green.get());
+ assertEquals("red", red.get());
+ assertEquals("yellow", yellow.get());
+ assertEquals("violet", violet.get());
+
+ // How long did it take?
+ final long total = TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start);
+
+ // Execution should be around 9 - 21 seconds
+ // The execution time depends on the number of threads available for asynchronous execution.
+ // In the best case it is 10s plus some minimal processing time.
+ assertTrue("Expected > 9 but was: " + total, total > 9);
+ assertTrue("Expected < 21 but was: " + total, total < 21);
+
+ }
+ }
+#Running
+ -------------------------------------------------------
+ T E S T S
+ -------------------------------------------------------
+ Running org.superbiz.async.JobProcessorTest
+ Apache OpenEJB 7.0.0-SNAPSHOT build: 20110801-04:02
+ http://tomee.apache.org/
+ INFO - openejb.home = G:\Workspace\fullproject\openejb3\examples\async-methods
+ INFO - openejb.base = G:\Workspace\fullproject\openejb3\examples\async-methods
+ INFO - Using 'javax.ejb.embeddable.EJBContainer=true'
+ INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+ INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+ INFO - Found EjbModule in classpath: g:\Workspace\fullproject\openejb3\examples\async-methods\target\classes
+ INFO - Beginning load: g:\Workspace\fullproject\openejb3\examples\async-methods\target\classes
+ INFO - Configuring enterprise application: g:\Workspace\fullproject\openejb3\examples\async-methods
+ INFO - Configuring Service(id=Default Singleton Container, type=Container, provider-id=Default Singleton Container)
+ INFO - Auto-creating a container for bean JobProcessor: Container(type=SINGLETON, id=Default Singleton Container)
+ INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+ INFO - Auto-creating a container for bean org.superbiz.async.JobProcessorTest: Container(type=MANAGED, id=Default Managed Container)
+ INFO - Enterprise application "g:\Workspace\fullproject\openejb3\examples\async-methods" loaded.
+ INFO - Assembling app: g:\Workspace\fullproject\openejb3\examples\async-methods
+ INFO - Jndi(name="java:global/async-methods/JobProcessor!org.superbiz.async.JobProcessor")
+ INFO - Jndi(name="java:global/async-methods/JobProcessor")
+ INFO - Jndi(name="java:global/EjbModule100568296/org.superbiz.async.JobProcessorTest!org.superbiz.async.JobProcessorTest")
+ INFO - Jndi(name="java:global/EjbModule100568296/org.superbiz.async.JobProcessorTest")
+ INFO - Created Ejb(deployment-id=org.superbiz.async.JobProcessorTest, ejb-name=org.superbiz.async.JobProcessorTest, container=Default Managed Container)
+ INFO - Created Ejb(deployment-id=JobProcessor, ejb-name=JobProcessor, container=Default Singleton Container)
+ INFO - Started Ejb(deployment-id=org.superbiz.async.JobProcessorTest, ejb-name=org.superbiz.async.JobProcessorTest, container=Default Managed Container)
+ INFO - Started Ejb(deployment-id=JobProcessor, ejb-name=JobProcessor, container=Default Singleton Container)
+ INFO - Deployed Application(path=g:\Workspace\fullproject\openejb3\examples\async-methods)
+ Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 13.305 sec
+
+ Results :
+
+ Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+
+ [INFO] ------------------------------------------------------------------------
+ [INFO] BUILD SUCCESS
+ [INFO] ------------------------------------------------------------------------
+ [INFO] Total time: 21.097s
+ [INFO] Finished at: Wed Aug 03 22:48:26 IST 2011
+ [INFO] Final Memory: 13M/145M
+ [INFO] ------------------------------------------------------------------------
+
+# How it works <small>under the covers</small>
+
+Under the covers what makes this work is:
+
+ - The `JobProcessor` the caller sees is not actually an instance of `JobProcessor`. Rather it's a subclass or proxy that has all the methods overridden. Methods that are supposed to be asynchronous are handled differently.
+ - Calls to an asynchronous method simply result in a `Runnable` being created that wraps the method and parameters you gave. This runnable is given to an [Executor][3] which is simply a work queue attached to a thread pool.
+ - After adding the work to the queue, the proxied version of the method returns an implementation of `Future` that is linked to the `Runnable` which is now waiting on the queue.
+ - When the `Runnable` finally executes the method on the *real* `JobProcessor` instance, it will take the return value and set it into the `Future` making it available to the caller.
+
+Important to note that the `AsyncResult` object the `JobProcessor` returns is not the same `Future` object the caller is holding. It would have been neat if the real `JobProcessor` could just return `String` and the caller's version of `JobProcessor` could return `Future<String>`, but we didn't see any way to do that without adding more complexity. So the `AsyncResult` is a simple wrapper object. The container will pull the `String` out, throw the `AsyncResult` away, then put the `String` in the *real* `Future` that the caller is holding.
+
+To get progress along the way, simply pass a thread-safe object like [AtomicInteger][4] to the `@Asynchronous` method and have the bean code periodically update it with the percent complete.
+
+#Related Examples
+
+For complex asynchronous processing, JavaEE's answer is `@MessageDrivenBean`. Have a look at the [simple-mdb](../simple-mdb/README.html) example
+
+[1]: http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html
+[3]: http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Executor.html
+[4]: http://download.oracle.com/javase/6/docs/api/java/util/concurrent/atomic/AtomicInteger.html
+
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/async-methods/src/main/java/org/superbiz/async/JobProcessor.java
----------------------------------------------------------------------
diff --git a/examples/async-methods/src/main/java/org/superbiz/async/JobProcessor.java b/examples/async-methods/src/main/java/org/superbiz/async/JobProcessor.java
index d543484..8389fcf 100644
--- a/examples/async-methods/src/main/java/org/superbiz/async/JobProcessor.java
+++ b/examples/async-methods/src/main/java/org/superbiz/async/JobProcessor.java
@@ -1,55 +1,55 @@
-/**
- * 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.superbiz.async;
-
-import javax.ejb.AccessTimeout;
-import javax.ejb.AsyncResult;
-import javax.ejb.Asynchronous;
-import javax.ejb.Lock;
-import javax.ejb.Singleton;
-import java.util.concurrent.Future;
-
-import static java.util.concurrent.TimeUnit.SECONDS;
-import static javax.ejb.LockType.READ;
-
-/**
- * @version $Revision$ $Date$
- */
-@Singleton
-public class JobProcessor {
-
- @Asynchronous
- @Lock(READ)
- @AccessTimeout(-1)
- public Future<String> addJob(String jobName) {
-
- // Pretend this job takes a while
- doSomeHeavyLifting();
-
- // Return our result
- return new AsyncResult<String>(jobName);
- }
-
- private void doSomeHeavyLifting() {
- try {
- Thread.sleep(SECONDS.toMillis(10));
- } catch (InterruptedException e) {
- Thread.interrupted();
- throw new IllegalStateException(e);
- }
- }
-}
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.async;
+
+import javax.ejb.AccessTimeout;
+import javax.ejb.AsyncResult;
+import javax.ejb.Asynchronous;
+import javax.ejb.Lock;
+import javax.ejb.Singleton;
+import java.util.concurrent.Future;
+
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static javax.ejb.LockType.READ;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@Singleton
+public class JobProcessor {
+
+ @Asynchronous
+ @Lock(READ)
+ @AccessTimeout(-1)
+ public Future<String> addJob(String jobName) {
+
+ // Pretend this job takes a while
+ doSomeHeavyLifting();
+
+ // Return our result
+ return new AsyncResult<String>(jobName);
+ }
+
+ private void doSomeHeavyLifting() {
+ try {
+ Thread.sleep(SECONDS.toMillis(10));
+ } catch (InterruptedException e) {
+ Thread.interrupted();
+ throw new IllegalStateException(e);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/async-methods/src/test/java/org/superbiz/async/JobProcessorTest.java
----------------------------------------------------------------------
diff --git a/examples/async-methods/src/test/java/org/superbiz/async/JobProcessorTest.java b/examples/async-methods/src/test/java/org/superbiz/async/JobProcessorTest.java
index 48cf4ee..e3bf30f 100644
--- a/examples/async-methods/src/test/java/org/superbiz/async/JobProcessorTest.java
+++ b/examples/async-methods/src/test/java/org/superbiz/async/JobProcessorTest.java
@@ -1,66 +1,66 @@
-/**
- * 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.superbiz.async;
-
-import junit.framework.TestCase;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.naming.Context;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @version $Revision$ $Date$
- */
-public class JobProcessorTest extends TestCase {
-
- public void test() throws Exception {
-
- final Context context = EJBContainer.createEJBContainer().getContext();
-
- final JobProcessor processor = (JobProcessor) context.lookup("java:global/async-methods/JobProcessor");
-
- final long start = System.nanoTime();
-
- // Queue up a bunch of work
- final Future<String> red = processor.addJob("red");
- final Future<String> orange = processor.addJob("orange");
- final Future<String> yellow = processor.addJob("yellow");
- final Future<String> green = processor.addJob("green");
- final Future<String> blue = processor.addJob("blue");
- final Future<String> violet = processor.addJob("violet");
-
- // Wait for the result -- 1 minute worth of work
- assertEquals("blue", blue.get());
- assertEquals("orange", orange.get());
- assertEquals("green", green.get());
- assertEquals("red", red.get());
- assertEquals("yellow", yellow.get());
- assertEquals("violet", violet.get());
-
- // How long did it take?
- final long total = TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start);
-
- // Execution should be around 9 - 21 seconds
- // The execution time depends on the number of threads available for asynchronous execution.
- // In the best case it is 10s plus some minimal processing time.
- assertTrue("Expected > 9 but was: " + total, total > 9);
- assertTrue("Expected < 21 but was: " + total, total < 21);
-
- }
-
-}
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.async;
+
+import junit.framework.TestCase;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.naming.Context;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class JobProcessorTest extends TestCase {
+
+ public void test() throws Exception {
+
+ final Context context = EJBContainer.createEJBContainer().getContext();
+
+ final JobProcessor processor = (JobProcessor) context.lookup("java:global/async-methods/JobProcessor");
+
+ final long start = System.nanoTime();
+
+ // Queue up a bunch of work
+ final Future<String> red = processor.addJob("red");
+ final Future<String> orange = processor.addJob("orange");
+ final Future<String> yellow = processor.addJob("yellow");
+ final Future<String> green = processor.addJob("green");
+ final Future<String> blue = processor.addJob("blue");
+ final Future<String> violet = processor.addJob("violet");
+
+ // Wait for the result -- 1 minute worth of work
+ assertEquals("blue", blue.get());
+ assertEquals("orange", orange.get());
+ assertEquals("green", green.get());
+ assertEquals("red", red.get());
+ assertEquals("yellow", yellow.get());
+ assertEquals("violet", violet.get());
+
+ // How long did it take?
+ final long total = TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start);
+
+ // Execution should be around 9 - 21 seconds
+ // The execution time depends on the number of threads available for asynchronous execution.
+ // In the best case it is 10s plus some minimal processing time.
+ assertTrue("Expected > 9 but was: " + total, total > 9);
+ assertTrue("Expected < 21 but was: " + total, total < 21);
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/async-postconstruct/pom.xml
----------------------------------------------------------------------
diff --git a/examples/async-postconstruct/pom.xml b/examples/async-postconstruct/pom.xml
index 1390e5b..16bb30f 100644
--- a/examples/async-postconstruct/pom.xml
+++ b/examples/async-postconstruct/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.superbiz</groupId>
<artifactId>async-postconstruct</artifactId>
<packaging>jar</packaging>
- <version>1.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<name>OpenEJB :: Examples :: @Asynchronous @PostConstrct</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/OlympicGamesManager.java
----------------------------------------------------------------------
diff --git a/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/OlympicGamesManager.java b/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/OlympicGamesManager.java
index 7293a5c..11ae3d3 100755
--- a/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/OlympicGamesManager.java
+++ b/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/OlympicGamesManager.java
@@ -1,32 +1,32 @@
-/**
- * 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.superbiz.designbycontract;
-
-import javax.ejb.Stateless;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
-
-@Stateless
-public class OlympicGamesManager {
-
- public String addSportMan(@Pattern(regexp = "^[A-Za-z]+$") String name, @Size(min = 2, max = 4) String country) {
- if (country.equals("USA")) {
- return null;
- }
- return new StringBuilder(name).append(" [").append(country).append("]").toString();
- }
-}
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.designbycontract;
+
+import javax.ejb.Stateless;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+
+@Stateless
+public class OlympicGamesManager {
+
+ public String addSportMan(@Pattern(regexp = "^[A-Za-z]+$") String name, @Size(min = 2, max = 4) String country) {
+ if (country.equals("USA")) {
+ return null;
+ }
+ return new StringBuilder(name).append(" [").append(country).append("]").toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManager.java
----------------------------------------------------------------------
diff --git a/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManager.java b/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManager.java
index fd56af0..fd4a963 100755
--- a/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManager.java
+++ b/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManager.java
@@ -1,26 +1,26 @@
-/**
- * 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.superbiz.designbycontract;
-
-import javax.ejb.Local;
-import javax.validation.constraints.Min;
-
-@Local
-public interface PoleVaultingManager {
-
- int points(@Min(120) int centimeters);
-}
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.designbycontract;
+
+import javax.ejb.Local;
+import javax.validation.constraints.Min;
+
+@Local
+public interface PoleVaultingManager {
+
+ int points(@Min(120) int centimeters);
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManagerBean.java
----------------------------------------------------------------------
diff --git a/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManagerBean.java b/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManagerBean.java
index c253c8c..7e4ddfb 100755
--- a/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManagerBean.java
+++ b/examples/bean-validation-design-by-contract/src/main/java/org/superbiz/designbycontract/PoleVaultingManagerBean.java
@@ -1,28 +1,28 @@
-/**
- * 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.superbiz.designbycontract;
-
-import javax.ejb.Stateless;
-
-@Stateless
-public class PoleVaultingManagerBean implements PoleVaultingManager {
-
- @Override
- public int points(int centimeters) {
- return centimeters - 120;
- }
-}
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.designbycontract;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class PoleVaultingManagerBean implements PoleVaultingManager {
+
+ @Override
+ public int points(int centimeters) {
+ return centimeters - 120;
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bval-evaluation-redeployment/WebApp1/pom.xml
----------------------------------------------------------------------
diff --git a/examples/bval-evaluation-redeployment/WebApp1/pom.xml b/examples/bval-evaluation-redeployment/WebApp1/pom.xml
index fa7cbfe..e7fb7ae 100644
--- a/examples/bval-evaluation-redeployment/WebApp1/pom.xml
+++ b/examples/bval-evaluation-redeployment/WebApp1/pom.xml
@@ -28,7 +28,6 @@
</parent>
<artifactId>WebApp1</artifactId>
- <version>1.1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>WebApp1</name>
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/ejb/BusinessBean.java
----------------------------------------------------------------------
diff --git a/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/ejb/BusinessBean.java b/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/ejb/BusinessBean.java
index bdc8324..0f49ed8 100644
--- a/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/ejb/BusinessBean.java
+++ b/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/ejb/BusinessBean.java
@@ -1,29 +1,29 @@
-/**
- * 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.superbiz.webapp1.ejb;
-
-import javax.ejb.Stateless;
-import javax.validation.constraints.Pattern;
-
-@Stateless
-public class BusinessBean {
-
- public void doStuff(@Pattern(regexp = "valid") final String txt) {
- System.out.println("Received: " + txt);
- }
-
-}
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.webapp1.ejb;
+
+import javax.ejb.Stateless;
+import javax.validation.constraints.Pattern;
+
+@Stateless
+public class BusinessBean {
+
+ public void doStuff(@Pattern(regexp = "valid") final String txt) {
+ System.out.println("Received: " + txt);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/f9f1b8ad/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/messages/ErrorList.java
----------------------------------------------------------------------
diff --git a/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/messages/ErrorList.java b/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/messages/ErrorList.java
index e1076c4..b5354da 100644
--- a/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/messages/ErrorList.java
+++ b/examples/bval-evaluation-redeployment/WebApp1/src/main/java/org/superbiz/webapp1/messages/ErrorList.java
@@ -1,37 +1,37 @@
-/**
- * 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.superbiz.webapp1.messages;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import java.util.ArrayList;
-import java.util.Collection;
-
-@XmlRootElement
-@XmlSeeAlso(ErrorResponse.class)
-public class ErrorList<T> extends ArrayList<T> {
-
- private static final long serialVersionUID = -8861634470374757349L;
-
- public ErrorList() {
- }
-
- public ErrorList(final Collection<? extends T> clctn) {
- addAll(clctn);
- }
-
-}
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.webapp1.messages;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import java.util.ArrayList;
+import java.util.Collection;
+
+@XmlRootElement
+@XmlSeeAlso(ErrorResponse.class)
+public class ErrorList<T> extends ArrayList<T> {
+
+ private static final long serialVersionUID = -8861634470374757349L;
+
+ public ErrorList() {
+ }
+
+ public ErrorList(final Collection<? extends T> clctn) {
+ addAll(clctn);
+ }
+
+}