You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2014/10/01 18:33:19 UTC

svn commit: r1628758 - in /tomee/tomee/trunk/examples: ./ arquillian-jpa/ arquillian-jpa/src/ arquillian-jpa/src/main/ arquillian-jpa/src/main/java/ arquillian-jpa/src/main/java/org/ arquillian-jpa/src/main/java/org/superbiz/ arquillian-jpa/src/main/ja...

Author: rmannibucau
Date: Wed Oct  1 16:33:18 2014
New Revision: 1628758

URL: http://svn.apache.org/r1628758
Log:
TOMEE-1369 arquillian-persistence sample

Added:
    tomee/tomee/trunk/examples/arquillian-jpa/
    tomee/tomee/trunk/examples/arquillian-jpa/README.md
    tomee/tomee/trunk/examples/arquillian-jpa/pom.xml
    tomee/tomee/trunk/examples/arquillian-jpa/src/
    tomee/tomee/trunk/examples/arquillian-jpa/src/main/
    tomee/tomee/trunk/examples/arquillian-jpa/src/main/java/
    tomee/tomee/trunk/examples/arquillian-jpa/src/main/java/org/
    tomee/tomee/trunk/examples/arquillian-jpa/src/main/java/org/superbiz/
    tomee/tomee/trunk/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/
    tomee/tomee/trunk/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/
    tomee/tomee/trunk/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/User.java
    tomee/tomee/trunk/examples/arquillian-jpa/src/main/resources/
    tomee/tomee/trunk/examples/arquillian-jpa/src/main/resources/META-INF/
    tomee/tomee/trunk/examples/arquillian-jpa/src/main/resources/META-INF/beans.xml
    tomee/tomee/trunk/examples/arquillian-jpa/src/main/resources/META-INF/persistence.xml
    tomee/tomee/trunk/examples/arquillian-jpa/src/test/
    tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/
    tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/
    tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/
    tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/
    tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/
    tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/
    tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
    tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/
    tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/arquillian.xml
    tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/datasets/
    tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/datasets/expected-users.yml
    tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/datasets/users.yml
Modified:
    tomee/tomee/trunk/examples/pom.xml

Added: tomee/tomee/trunk/examples/arquillian-jpa/README.md
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/arquillian-jpa/README.md?rev=1628758&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/arquillian-jpa/README.md (added)
+++ tomee/tomee/trunk/examples/arquillian-jpa/README.md Wed Oct  1 16:33:18 2014
@@ -0,0 +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
+
+

Added: tomee/tomee/trunk/examples/arquillian-jpa/pom.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/arquillian-jpa/pom.xml?rev=1628758&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/arquillian-jpa/pom.xml (added)
+++ tomee/tomee/trunk/examples/arquillian-jpa/pom.xml Wed Oct  1 16:33:18 2014
@@ -0,0 +1,115 @@
+<!-- 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. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.superbiz</groupId>
+  <artifactId>arquillian-jpa</artifactId>
+  <name>OpenEJB :: Examples :: Arquillian Persistence Extension Sample</name>
+  <version>1.0.0-SNAPSHOT</version>
+
+  <properties>
+    <arquillian.version>1.1.5.Final</arquillian.version>
+    <arquillian-persistence.version>1.0.0.Alpha7</arquillian-persistence.version>
+    <tomee.version>2.0.0-SNAPSHOT</tomee.version>
+
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <defaultGoal>install</defaultGoal>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.1</version>
+        <configuration>
+          <source>1.7</source>
+          <target>1.7</target>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <repositories>
+    <repository>
+      <id>apache-m2-snapshot</id>
+      <name>Apache Snapshot Repository</name>
+      <url>https://repository.apache.org/content/groups/snapshots</url>
+    </repository>
+  </repositories>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.openejb</groupId>
+      <artifactId>javaee-api</artifactId>
+      <version>7.0-SNAPSHOT</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.11</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.openejb</groupId>
+      <artifactId>openejb-core</artifactId>
+      <version>5.0.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.openejb</groupId>
+      <artifactId>arquillian-tomee-remote</artifactId>
+      <version>${tomee.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.arquillian.junit</groupId>
+      <artifactId>arquillian-junit-container</artifactId>
+      <version>${arquillian.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.arquillian.config</groupId>
+      <artifactId>arquillian-config-api</artifactId>
+      <version>${arquillian.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.arquillian.extension</groupId>
+      <artifactId>arquillian-persistence-dbunit</artifactId>
+      <version>${arquillian-persistence.version}</version>
+      <scope>test</scope>
+      <exclusions>
+        <exclusion>
+          <artifactId>arquillian-transaction-jta</artifactId>
+          <groupId>org.jboss.arquillian.extension</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+  </dependencies>
+
+  <!--
+  This section allows you to configure where to publish libraries for sharing.
+  It is not required and may be deleted.  For more information see:
+  http://maven.apache.org/plugins/maven-deploy-plugin/
+  -->
+  <distributionManagement>
+    <repository>
+      <id>localhost</id>
+      <url>file://${basedir}/target/repo/</url>
+    </repository>
+    <snapshotRepository>
+      <id>localhost</id>
+      <url>file://${basedir}/target/snapshot-repo/</url>
+    </snapshotRepository>
+  </distributionManagement>
+</project>

Added: tomee/tomee/trunk/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/User.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/User.java?rev=1628758&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/User.java (added)
+++ tomee/tomee/trunk/examples/arquillian-jpa/src/main/java/org/superbiz/arquillian/persistence/User.java Wed Oct  1 16:33:18 2014
@@ -0,0 +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;
+    }
+}

Added: tomee/tomee/trunk/examples/arquillian-jpa/src/main/resources/META-INF/beans.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/arquillian-jpa/src/main/resources/META-INF/beans.xml?rev=1628758&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/arquillian-jpa/src/main/resources/META-INF/beans.xml (added)
+++ tomee/tomee/trunk/examples/arquillian-jpa/src/main/resources/META-INF/beans.xml Wed Oct  1 16:33:18 2014
@@ -0,0 +1,19 @@
+<!--
+
+    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.
+-->
+<beans>
+</beans>
\ No newline at end of file

Added: tomee/tomee/trunk/examples/arquillian-jpa/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/arquillian-jpa/src/main/resources/META-INF/persistence.xml?rev=1628758&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/arquillian-jpa/src/main/resources/META-INF/persistence.xml (added)
+++ tomee/tomee/trunk/examples/arquillian-jpa/src/main/resources/META-INF/persistence.xml Wed Oct  1 16:33:18 2014
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="
+              http://java.sun.com/xml/ns/persistence
+              http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+             version="2.0">
+  <persistence-unit name="demoApplicationPU">
+    <jta-data-source>demoDataSource</jta-data-source>
+    <class>org.superbiz.arquillian.persistence.User</class>
+    <exclude-unlisted-classes>true</exclude-unlisted-classes>
+    <properties>
+      <property name="openejb.jpa.init-entitymanager" value="true" />
+      <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
+    </properties>
+  </persistence-unit>
+</persistence>

Added: tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java?rev=1628758&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java (added)
+++ tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java Wed Oct  1 16:33:18 2014
@@ -0,0 +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.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)
+    @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
+    }
+}

Added: tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/arquillian.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/arquillian.xml?rev=1628758&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/arquillian.xml (added)
+++ tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/arquillian.xml Wed Oct  1 16:33:18 2014
@@ -0,0 +1,46 @@
+<?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.
+-->
+<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xmlns="http://jboss.org/schema/arquillian"
+            xsi:schemaLocation="http://jboss.org/schema/arquillian
+                                http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+
+  <extension qualifier="persistence">
+    <property name="defaultDataSource">openejb:Resource/demoDataSource</property>
+  </extension>
+
+  <container qualifier="tomee" default="true">
+    <configuration>
+      <property name="httpPort">-1</property>
+      <property name="stopPort">-1</property>
+      <property name="ajpPort">-1</property>
+      <property name="dir">target/apache-tomee-remote</property>
+      <property name="appWorkingDir">target/arquillian-test-working-dir</property>
+      <property name="properties">
+        demoDataSource = new://Resource?type=DataSource
+        demoDataSource.JdbcDriver = org.hsqldb.jdbcDriver
+        demoDataSource.JdbcUrl = jdbc:hsqldb:mem:arquillian
+        demoDataSource.UserName = sa
+        demoDataSource.Password =
+        demoDataSource.JtaManaged = true
+        demoDataSource.LogSql = true
+      </property>
+    </configuration>
+  </container>
+</arquillian>

Added: tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/datasets/expected-users.yml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/datasets/expected-users.yml?rev=1628758&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/datasets/expected-users.yml (added)
+++ tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/datasets/expected-users.yml Wed Oct  1 16:33:18 2014
@@ -0,0 +1,5 @@
+user:
+  - id: 1
+    name: TomEE
+  - id: 2
+    name: OpenEJB

Added: tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/datasets/users.yml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/datasets/users.yml?rev=1628758&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/datasets/users.yml (added)
+++ tomee/tomee/trunk/examples/arquillian-jpa/src/test/resources/datasets/users.yml Wed Oct  1 16:33:18 2014
@@ -0,0 +1,5 @@
+user:
+  - id: 1
+    name: TomEE
+  - id: 2
+    name: Old

Modified: tomee/tomee/trunk/examples/pom.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/pom.xml?rev=1628758&r1=1628757&r2=1628758&view=diff
==============================================================================
--- tomee/tomee/trunk/examples/pom.xml (original)
+++ tomee/tomee/trunk/examples/pom.xml Wed Oct  1 16:33:18 2014
@@ -36,6 +36,7 @@
     <module>application-composer</module>
     <module>applicationcomposer-jaxws-cdi</module>
     <module>applicationexception</module>
+    <module>arquillian-jpa</module>
     <module>async-methods</module>
     <module>async-postconstruct</module>
     <module>bean-validation-design-by-contract</module>