deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwellm...@apache.org
Subject deltaspike git commit: DELTASPIKE-1007 transactional tests for abstract repositories
Date Sun, 20 Dec 2015 12:55:30 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 5886504f9 -> e55bca67d


DELTASPIKE-1007 transactional tests for abstract repositories

added tests for @TransactionScoped beans

Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/e55bca67
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/e55bca67
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/e55bca67

Branch: refs/heads/master
Commit: e55bca67dce242427f531d642e61c769b67613c8
Parents: 5886504
Author: Harald Wellmann <hwellmann@apache.org>
Authored: Sun Dec 20 13:54:35 2015 +0100
Committer: Harald Wellmann <hwellmann@apache.org>
Committed: Sun Dec 20 13:55:02 2015 +0100

----------------------------------------------------------------------
 .../data/test/ee7/domain/EmbeddedSimple.java    |   5 +-
 .../deltaspike/data/test/ee7/domain/Simple.java |   3 +-
 .../data/test/ee7/domain/SuperSimple.java       |   6 +-
 ...ltaSpikeTransactionalRepositoryAbstract.java |  40 +++
 ...taSpikeTransactionalRepositoryInterface.java |   3 -
 .../JtaTransactionalRepositoryAbstract.java     |  96 +++++++
 .../JtaTransactionalRepositoryInterface.java    |   3 +-
 .../data/test/ee7/service/SimpleClientApp.java  |  29 +++
 .../data/test/ee7/service/SimpleClientDep.java  |  29 +++
 .../data/test/ee7/service/SimpleClientTx.java   |  30 +++
 .../data/test/ee7/service/SimpleHolderApp.java  |  27 ++
 .../data/test/ee7/service/SimpleHolderDep.java  |  27 ++
 .../data/test/ee7/service/SimpleHolderTx.java   |  25 ++
 ...pikeTransactionalRepositoryAbstractTest.java | 125 +++++++++
 ...ikeTransactionalRepositoryInterfaceTest.java | 125 +++++++++
 .../ee7/tx/DeltaSpikeTransactionalTest.java     | 138 ----------
 .../JtaTransactionalRepositoryAbstractTest.java | 255 +++++++++++++++++++
 ...JtaTransactionalRepositoryInterfaceTest.java | 138 ++++++++++
 .../data/test/ee7/tx/JtaTransactionalTest.java  | 139 ----------
 19 files changed, 958 insertions(+), 285 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/domain/EmbeddedSimple.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/domain/EmbeddedSimple.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/domain/EmbeddedSimple.java
index 516f245..277184e 100644
--- a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/domain/EmbeddedSimple.java
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/domain/EmbeddedSimple.java
@@ -18,11 +18,14 @@
  */
 package org.apache.deltaspike.data.test.ee7.domain;
 
+import java.io.Serializable;
+
 import javax.persistence.Embeddable;
 
 @Embeddable
-public class EmbeddedSimple
+public class EmbeddedSimple implements Serializable
 {
+    private static final long serialVersionUID = 1L;
 
     private String embedd;
 

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/domain/Simple.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/domain/Simple.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/domain/Simple.java
index 44cf969..96beace 100755
--- a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/domain/Simple.java
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/domain/Simple.java
@@ -41,11 +41,12 @@ import javax.persistence.TemporalType;
 @Table(name = "SIMPLE_TABLE")
 public class Simple extends SuperSimple
 {
-
     public static final String BY_NAME_LIKE = "simple.byNameLike";
     public static final String BY_NAME_ENABLED = "simple.byNameAndEnabled";
     public static final String BY_ID = "simple.byId";
 
+    private static final long serialVersionUID = 1L;
+    
     @Id
     @GeneratedValue
     private Long id;

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/domain/SuperSimple.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/domain/SuperSimple.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/domain/SuperSimple.java
index 10af87b..fae2038 100644
--- a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/domain/SuperSimple.java
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/domain/SuperSimple.java
@@ -18,11 +18,15 @@
  */
 package org.apache.deltaspike.data.test.ee7.domain;
 
+import java.io.Serializable;
+
 import javax.persistence.MappedSuperclass;
 
 @MappedSuperclass
-public class SuperSimple
+public class SuperSimple implements Serializable
 {
+    private static final long serialVersionUID = 1L;
+
     private String superName;
 
     public String getSuperName()

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/DeltaSpikeTransactionalRepositoryAbstract.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/DeltaSpikeTransactionalRepositoryAbstract.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/DeltaSpikeTransactionalRepositoryAbstract.java
new file mode 100644
index 0000000..56e8b56
--- /dev/null
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/DeltaSpikeTransactionalRepositoryAbstract.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.data.test.ee7.service;
+
+import static javax.persistence.LockModeType.PESSIMISTIC_READ;
+
+import org.apache.deltaspike.data.api.AbstractEntityRepository;
+import org.apache.deltaspike.data.api.Modifying;
+import org.apache.deltaspike.data.api.Query;
+import org.apache.deltaspike.data.api.Repository;
+import org.apache.deltaspike.data.test.ee7.domain.Simple;
+
+@Repository
+@org.apache.deltaspike.jpa.api.transaction.Transactional
+public abstract class DeltaSpikeTransactionalRepositoryAbstract extends AbstractEntityRepository<Simple, Long>
+{
+
+    @Query(lock = PESSIMISTIC_READ)
+    public abstract Simple findByName(String name);
+
+    @Modifying @Query("delete from Simple")
+    public abstract int deleteAll();
+
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/DeltaSpikeTransactionalRepositoryInterface.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/DeltaSpikeTransactionalRepositoryInterface.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/DeltaSpikeTransactionalRepositoryInterface.java
index 32f642a..3e5722e 100644
--- a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/DeltaSpikeTransactionalRepositoryInterface.java
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/DeltaSpikeTransactionalRepositoryInterface.java
@@ -35,9 +35,6 @@ public interface DeltaSpikeTransactionalRepositoryInterface extends EntityReposi
     @Query(lock = PESSIMISTIC_READ)
     Simple findByName(String name);
 
-    @Query(named = Simple.BY_NAME_LIKE)
-    Simple findByNameNoLock(String name);
-
     @Modifying @Query("delete from Simple")
     int deleteAll();
 

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/JtaTransactionalRepositoryAbstract.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/JtaTransactionalRepositoryAbstract.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/JtaTransactionalRepositoryAbstract.java
new file mode 100644
index 0000000..25483fb
--- /dev/null
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/JtaTransactionalRepositoryAbstract.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.data.test.ee7.service;
+
+import static javax.persistence.LockModeType.PESSIMISTIC_READ;
+
+import javax.inject.Inject;
+
+import org.apache.deltaspike.data.api.AbstractEntityRepository;
+import org.apache.deltaspike.data.api.Modifying;
+import org.apache.deltaspike.data.api.Query;
+import org.apache.deltaspike.data.api.Repository;
+import org.apache.deltaspike.data.api.SingleResultType;
+import org.apache.deltaspike.data.test.ee7.domain.Simple;
+
+@Repository
+@javax.transaction.Transactional
+public abstract class JtaTransactionalRepositoryAbstract 
+    extends AbstractEntityRepository<Simple, Long>
+{
+    @Inject
+    private SimpleHolderTx simpleHolderTx;
+
+    @Inject
+    private SimpleHolderApp simpleHolderApp;
+
+    @Inject
+    private SimpleHolderDep simpleHolderDep;
+
+    @Query(lock = PESSIMISTIC_READ, singleResult = SingleResultType.OPTIONAL)
+    public abstract Simple findOptionalByName(String name);
+
+    @Modifying @Query("delete from Simple")
+    public abstract int deleteAll();
+    
+    public Simple saveOnMatchTx(Simple simple)
+    {
+        if (simpleHolderTx.getSimple() == null)
+        {
+            return null;
+        }
+        
+        if (simple.getName().equals(simpleHolderTx.getSimple().getName()))
+        {
+            return save(simple);
+        }
+        
+        return null;
+    }
+
+    public Simple saveOnMatchApp(Simple simple)
+    {
+        if (simpleHolderApp.getSimple() == null)
+        {
+            return null;
+        }
+        
+        if (simple.getName().equals(simpleHolderApp.getSimple().getName()))
+        {
+            return save(simple);
+        }
+        
+        return null;
+    }
+
+    public Simple saveOnMatchDep(Simple simple)
+    {
+        if (simpleHolderDep.getSimple() == null)
+        {
+            return null;
+        }
+        
+        if (simple.getName().equals(simpleHolderDep.getSimple().getName()))
+        {
+            return save(simple);
+        }
+        
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/JtaTransactionalRepositoryInterface.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/JtaTransactionalRepositoryInterface.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/JtaTransactionalRepositoryInterface.java
index e28a011..4b86559 100755
--- a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/JtaTransactionalRepositoryInterface.java
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/JtaTransactionalRepositoryInterface.java
@@ -20,7 +20,6 @@ package org.apache.deltaspike.data.test.ee7.service;
 
 import static javax.persistence.LockModeType.PESSIMISTIC_READ;
 
-import org.apache.deltaspike.data.api.EntityManagerDelegate;
 import org.apache.deltaspike.data.api.EntityRepository;
 import org.apache.deltaspike.data.api.Modifying;
 import org.apache.deltaspike.data.api.Query;
@@ -29,7 +28,7 @@ import org.apache.deltaspike.data.test.ee7.domain.Simple;
 
 @Repository
 @javax.transaction.Transactional
-public interface JtaTransactionalRepositoryInterface extends EntityRepository<Simple, Long>, EntityManagerDelegate<Simple>
+public interface JtaTransactionalRepositoryInterface extends EntityRepository<Simple, Long>
 {
 
     @Query(lock = PESSIMISTIC_READ)

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleClientApp.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleClientApp.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleClientApp.java
new file mode 100644
index 0000000..bd27755
--- /dev/null
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleClientApp.java
@@ -0,0 +1,29 @@
+package org.apache.deltaspike.data.test.ee7.service;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+
+import org.apache.deltaspike.data.test.ee7.domain.Simple;
+
+@ApplicationScoped
+@javax.transaction.Transactional
+public class SimpleClientApp
+{
+    @Inject
+    private SimpleHolderApp simpleHolder;
+    
+    @Inject
+    private JtaTransactionalRepositoryAbstract repo;
+    
+    public Simple getSimple()
+    {
+        return simpleHolder.getSimple();
+    }
+    
+    public Simple createSimple(String name)
+    {
+        Simple simple = new Simple(name);
+        simpleHolder.setSimple(simple);
+        return repo.saveOnMatchApp(simple);
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleClientDep.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleClientDep.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleClientDep.java
new file mode 100644
index 0000000..7313a5d
--- /dev/null
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleClientDep.java
@@ -0,0 +1,29 @@
+package org.apache.deltaspike.data.test.ee7.service;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+
+import org.apache.deltaspike.data.test.ee7.domain.Simple;
+
+@ApplicationScoped
+@javax.transaction.Transactional
+public class SimpleClientDep
+{
+    @Inject
+    private SimpleHolderDep simpleHolder;
+    
+    @Inject
+    private JtaTransactionalRepositoryAbstract repo;
+    
+    public Simple getSimple()
+    {
+        return simpleHolder.getSimple();
+    }
+    
+    public Simple createSimple(String name)
+    {
+        Simple simple = new Simple(name);
+        simpleHolder.setSimple(simple);
+        return repo.saveOnMatchDep(simple);
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleClientTx.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleClientTx.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleClientTx.java
new file mode 100644
index 0000000..43141c6
--- /dev/null
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleClientTx.java
@@ -0,0 +1,30 @@
+package org.apache.deltaspike.data.test.ee7.service;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+
+import org.apache.deltaspike.data.test.ee7.domain.Simple;
+
+@ApplicationScoped
+@javax.transaction.Transactional
+public class SimpleClientTx
+{
+    @Inject
+    private SimpleHolderTx simpleHolder;
+    
+    @Inject
+    private JtaTransactionalRepositoryAbstract repo;
+    
+    public Simple getSimple()
+    {
+        return simpleHolder.getSimple();
+    }
+    
+    public Simple createSimple(String name)
+    {
+        Simple simple = new Simple(name);
+        simpleHolder.setSimple(simple);
+        return repo.saveOnMatchTx(simple);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleHolderApp.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleHolderApp.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleHolderApp.java
new file mode 100644
index 0000000..b2e20f4
--- /dev/null
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleHolderApp.java
@@ -0,0 +1,27 @@
+package org.apache.deltaspike.data.test.ee7.service;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.ApplicationScoped;
+
+import org.apache.deltaspike.data.test.ee7.domain.Simple;
+
+@ApplicationScoped
+public class SimpleHolderApp implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    private Simple simple;
+
+    
+    public Simple getSimple()
+    {
+        return simple;
+    }
+
+    
+    public void setSimple(Simple simple)
+    {
+        this.simple = simple;
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleHolderDep.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleHolderDep.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleHolderDep.java
new file mode 100644
index 0000000..9c3292b
--- /dev/null
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleHolderDep.java
@@ -0,0 +1,27 @@
+package org.apache.deltaspike.data.test.ee7.service;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.Dependent;
+
+import org.apache.deltaspike.data.test.ee7.domain.Simple;
+
+@Dependent
+public class SimpleHolderDep implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    private Simple simple;
+
+    
+    public Simple getSimple()
+    {
+        return simple;
+    }
+
+    
+    public void setSimple(Simple simple)
+    {
+        this.simple = simple;
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleHolderTx.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleHolderTx.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleHolderTx.java
new file mode 100644
index 0000000..7c4696d
--- /dev/null
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/service/SimpleHolderTx.java
@@ -0,0 +1,25 @@
+package org.apache.deltaspike.data.test.ee7.service;
+
+import java.io.Serializable;
+
+import org.apache.deltaspike.data.test.ee7.domain.Simple;
+
+@javax.transaction.TransactionScoped
+public class SimpleHolderTx implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    private Simple simple;
+
+    
+    public Simple getSimple()
+    {
+        return simple;
+    }
+
+    
+    public void setSimple(Simple simple)
+    {
+        this.simple = simple;
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/DeltaSpikeTransactionalRepositoryAbstractTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/DeltaSpikeTransactionalRepositoryAbstractTest.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/DeltaSpikeTransactionalRepositoryAbstractTest.java
new file mode 100644
index 0000000..4cb9ae3
--- /dev/null
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/DeltaSpikeTransactionalRepositoryAbstractTest.java
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.data.test.ee7.tx;
+
+import static org.apache.deltaspike.data.test.ee7.util.TestDeployments.initDeployment;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.apache.deltaspike.data.test.ee7.domain.Simple;
+import org.apache.deltaspike.data.test.ee7.service.DeltaSpikeTransactionalRepositoryAbstract;
+import org.apache.deltaspike.test.category.WebEE7ProfileCategory;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+@Category(WebEE7ProfileCategory.class)
+@RunWith(Arquillian.class)
+public class DeltaSpikeTransactionalRepositoryAbstractTest
+{
+
+    public static String DS_PROPERTIES_WITH_ENV_AWARE_TX_STRATEGY
+            = "globalAlternatives.org.apache.deltaspike.jpa.spi.transaction.TransactionStrategy="
+            + "org.apache.deltaspike.jpa.impl.transaction.EnvironmentAwareTransactionStrategy";
+    
+    private static final String NAME = "should_run_in_transaction";
+
+    @Deployment
+    public static Archive<?> deployment()
+    {
+        return initDeployment()
+                .addClass(DeltaSpikeTransactionalRepositoryAbstract.class)
+                .addClass(TransactionalQueryRunnerWrapper.class)
+                .addPackage(Simple.class.getPackage())
+                .addAsWebInfResource(new StringAsset(DS_PROPERTIES_WITH_ENV_AWARE_TX_STRATEGY),
+                    "classes/META-INF/apache-deltaspike.properties");
+    }
+
+    @Inject
+    private DeltaSpikeTransactionalRepositoryAbstract repository;
+
+    @Produces
+    @PersistenceContext
+    private EntityManager entityManager;
+
+    @Inject
+    private TransactionalQueryRunnerWrapper wrapper;
+
+    @Test
+    @InSequence(1)
+    public void should_run_modifying_in_transaction() throws Exception
+    {
+        // when
+        repository.deleteAll();
+
+        // then
+        assertTrue(wrapper.isRunInTx());
+    }
+
+    @Test
+    @InSequence(2)
+    public void should_save_in_transaction() throws Exception
+    {
+        // given
+        Simple simple = new Simple(NAME);
+
+        // when
+        simple = repository.save(simple);
+
+        // then
+        assertNotNull(simple.getId());
+        assertTrue(wrapper.isRunInTx());
+    }
+
+    @Test
+    @InSequence(3)
+    public void should_find_with_lockmode_in_transaction() throws Exception
+    {
+        // when
+        Simple simple = repository.findByName(NAME);
+
+        // then
+        assertNotNull(simple);
+        assertTrue(wrapper.isRunInTx());
+    }
+
+    @Test
+    @InSequence(10)
+    public void should_cleanup() throws Exception
+    {
+        repository.deleteAll();
+    }
+
+    @Before
+    public void init()
+    {
+        wrapper.reset();
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/DeltaSpikeTransactionalRepositoryInterfaceTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/DeltaSpikeTransactionalRepositoryInterfaceTest.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/DeltaSpikeTransactionalRepositoryInterfaceTest.java
new file mode 100644
index 0000000..3ba7aec
--- /dev/null
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/DeltaSpikeTransactionalRepositoryInterfaceTest.java
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.data.test.ee7.tx;
+
+import static org.apache.deltaspike.data.test.ee7.util.TestDeployments.initDeployment;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.apache.deltaspike.data.test.ee7.domain.Simple;
+import org.apache.deltaspike.data.test.ee7.service.DeltaSpikeTransactionalRepositoryInterface;
+import org.apache.deltaspike.test.category.WebEE7ProfileCategory;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+@Category(WebEE7ProfileCategory.class)
+@RunWith(Arquillian.class)
+public class DeltaSpikeTransactionalRepositoryInterfaceTest
+{
+
+    public static String DS_PROPERTIES_WITH_ENV_AWARE_TX_STRATEGY
+            = "globalAlternatives.org.apache.deltaspike.jpa.spi.transaction.TransactionStrategy="
+            + "org.apache.deltaspike.jpa.impl.transaction.EnvironmentAwareTransactionStrategy";
+    
+    private static final String NAME = "should_run_in_transaction";
+
+    @Deployment
+    public static Archive<?> deployment()
+    {
+        return initDeployment()
+                .addClass(DeltaSpikeTransactionalRepositoryInterface.class)
+                .addClass(TransactionalQueryRunnerWrapper.class)
+                .addPackage(Simple.class.getPackage())
+                .addAsWebInfResource(new StringAsset(DS_PROPERTIES_WITH_ENV_AWARE_TX_STRATEGY),
+                    "classes/META-INF/apache-deltaspike.properties");
+    }
+
+    @Inject
+    private DeltaSpikeTransactionalRepositoryInterface repository;
+
+    @Produces
+    @PersistenceContext
+    private EntityManager entityManager;
+
+    @Inject
+    private TransactionalQueryRunnerWrapper wrapper;
+
+    @Test
+    @InSequence(1)
+    public void should_run_modifying_in_transaction() throws Exception
+    {
+        // when
+        repository.deleteAll();
+
+        // then
+        assertTrue(wrapper.isRunInTx());
+    }
+
+    @Test
+    @InSequence(2)
+    public void should_save_in_transaction() throws Exception
+    {
+        // given
+        Simple simple = new Simple(NAME);
+
+        // when
+        simple = repository.save(simple);
+
+        // then
+        assertNotNull(simple.getId());
+        assertTrue(wrapper.isRunInTx());
+    }
+
+    @Test
+    @InSequence(3)
+    public void should_find_with_lockmode_in_transaction() throws Exception
+    {
+        // when
+        Simple simple = repository.findByName(NAME);
+
+        // then
+        assertNotNull(simple);
+        assertTrue(wrapper.isRunInTx());
+    }
+
+    @Test
+    @InSequence(10)
+    public void should_cleanup() throws Exception
+    {
+        repository.deleteAll();
+    }
+
+    @Before
+    public void init()
+    {
+        wrapper.reset();
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/DeltaSpikeTransactionalTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/DeltaSpikeTransactionalTest.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/DeltaSpikeTransactionalTest.java
deleted file mode 100644
index 18b0817..0000000
--- a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/DeltaSpikeTransactionalTest.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.deltaspike.data.test.ee7.tx;
-
-import static org.apache.deltaspike.data.test.ee7.util.TestDeployments.initDeployment;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import javax.enterprise.inject.Produces;
-import javax.inject.Inject;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import org.apache.deltaspike.data.test.ee7.domain.Simple;
-import org.apache.deltaspike.data.test.ee7.service.DeltaSpikeTransactionalRepositoryInterface;
-import org.apache.deltaspike.test.category.WebEE7ProfileCategory;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.arquillian.junit.InSequence;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.asset.StringAsset;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-
-@Category(WebEE7ProfileCategory.class)
-@RunWith(Arquillian.class)
-public class DeltaSpikeTransactionalTest
-{
-
-    public static String DS_PROPERTIES_WITH_ENV_AWARE_TX_STRATEGY
-            = "globalAlternatives.org.apache.deltaspike.jpa.spi.transaction.TransactionStrategy="
-            + "org.apache.deltaspike.jpa.impl.transaction.EnvironmentAwareTransactionStrategy";
-    
-    private static final String NAME = "should_run_in_transaction";
-
-    @Deployment
-    public static Archive<?> deployment()
-    {
-        return initDeployment()
-                .addClasses(DeltaSpikeTransactionalRepositoryInterface.class)
-                .addClass(TransactionalQueryRunnerWrapper.class)
-                .addPackage(Simple.class.getPackage())
-                .addAsWebInfResource(new StringAsset(DS_PROPERTIES_WITH_ENV_AWARE_TX_STRATEGY),
-                    "classes/META-INF/apache-deltaspike.properties");
-    }
-
-    @Inject
-    private DeltaSpikeTransactionalRepositoryInterface repository;
-
-    @Produces
-    @PersistenceContext
-    private EntityManager entityManager;
-
-    @Inject
-    private TransactionalQueryRunnerWrapper wrapper;
-
-    @Test
-    @InSequence(1)
-    public void should_run_modifying_in_transaction() throws Exception
-    {
-        // when
-        repository.deleteAll();
-
-        // then
-        assertTrue(wrapper.isRunInTx());
-    }
-
-    @Test
-    @InSequence(2)
-    public void should_save_in_transaction() throws Exception
-    {
-        // given
-        Simple simple = new Simple(NAME);
-
-        // when
-        simple = repository.save(simple);
-
-        // then
-        assertNotNull(simple.getId());
-        assertTrue(wrapper.isRunInTx());
-    }
-
-    @Test
-    @InSequence(3)
-    public void should_find_with_lockmode_in_transaction() throws Exception
-    {
-        // when
-        Simple simple = repository.findByName(NAME);
-
-        // then
-        assertNotNull(simple);
-        assertTrue(wrapper.isRunInTx());
-    }
-
-    @Test
-    @InSequence(4)
-    public void should_find_no_lock_without_transaction() throws Exception
-    {
-        // when
-        Simple simple = repository.findByNameNoLock(NAME);
-
-        // then
-        assertNotNull(simple);
-        assertTrue(wrapper.isRunInNonTx());
-    }
-
-    @Test
-    @InSequence(10)
-    public void should_cleanup() throws Exception
-    {
-        repository.deleteAll();
-    }
-
-    @Before
-    public void init()
-    {
-        wrapper.reset();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/JtaTransactionalRepositoryAbstractTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/JtaTransactionalRepositoryAbstractTest.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/JtaTransactionalRepositoryAbstractTest.java
new file mode 100644
index 0000000..41de5f9
--- /dev/null
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/JtaTransactionalRepositoryAbstractTest.java
@@ -0,0 +1,255 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.data.test.ee7.tx;
+
+import static org.apache.deltaspike.data.test.ee7.util.TestDeployments.initDeployment;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.apache.deltaspike.data.test.ee7.domain.Simple;
+import org.apache.deltaspike.data.test.ee7.service.JtaTransactionalRepositoryAbstract;
+import org.apache.deltaspike.data.test.ee7.service.SimpleClientApp;
+import org.apache.deltaspike.data.test.ee7.service.SimpleClientDep;
+import org.apache.deltaspike.data.test.ee7.service.SimpleClientTx;
+import org.apache.deltaspike.test.category.WebEE7ProfileCategory;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+/**
+ * Tests transactional repositories with the {@code javax.transaction.Transactional} interceptor
+ * binding and {@code javax.transaction.TransactionScoped} beans.
+ * <p>
+ * The test uses groups of beans with identical collaboration, only differing by the scope one bean
+ * per group ({@code SimpleHolderTx} vs. {@code SimpleHolderApp} vs. {@code SimpleHolderDep} ), to
+ * verify that transaction scoped beans actually do behave in a different way, compared to
+ * application scoped or dependent beans.
+ */
+@Category(WebEE7ProfileCategory.class)
+@RunWith(Arquillian.class)
+public class JtaTransactionalRepositoryAbstractTest
+{
+
+    public static String DS_PROPERTIES_WITH_CMT_STRATEGY = "globalAlternatives.org.apache.deltaspike.jpa.spi.transaction.TransactionStrategy="
+        + "org.apache.deltaspike.jpa.impl.transaction.ContainerManagedTransactionStrategy";
+
+    private static final String NAME = "should_run_in_transaction";
+
+    @Deployment
+    public static Archive<?> deployment()
+    {
+        return initDeployment()
+            .addPackage(JtaTransactionalRepositoryAbstract.class.getPackage())
+            .addClass(TransactionalQueryRunnerWrapper.class)
+            .addPackage(Simple.class.getPackage())
+            .addAsWebInfResource(new StringAsset(DS_PROPERTIES_WITH_CMT_STRATEGY),
+                "classes/META-INF/apache-deltaspike.properties");
+
+    }
+
+    @Inject
+    private JtaTransactionalRepositoryAbstract repository;
+
+    @Produces
+    @PersistenceContext
+    private EntityManager entityManager;
+
+    @Inject
+    private TransactionalQueryRunnerWrapper wrapper;
+
+    @Inject
+    private SimpleClientTx simpleClientTx;
+
+    @Inject
+    private SimpleClientApp simpleClientApp;
+
+    @Inject
+    private SimpleClientDep simpleClientDep;
+
+    @Test
+    @InSequence(1)
+    public void should_run_modifying_in_transaction() throws Exception
+    {
+        // when
+        repository.deleteAll();
+
+        // then
+        assertTrue(wrapper.isRunInTx());
+    }
+
+    @Test
+    @InSequence(2)
+    public void should_save_in_transaction() throws Exception
+    {
+        // given
+        Simple simple = new Simple(NAME);
+
+        // when
+        simple = repository.save(simple);
+
+        // then
+        assertNotNull(simple.getId());
+        assertTrue(wrapper.isRunInTx());
+    }
+
+    @Test
+    @InSequence(3)
+    public void should_find_with_lockmode_in_transaction() throws Exception
+    {
+        // when
+        Simple simple = repository.findOptionalByName(NAME);
+
+        // then
+        assertNotNull(simple);
+        assertTrue(wrapper.isRunInTx());
+    }
+
+    @Test
+    @InSequence(10)
+    public void tx_scoped_bean_should_be_empty_before_tx() throws Exception
+    {
+        // when
+        Simple simple = simpleClientTx.getSimple();
+
+        // then
+        assertNull(simple);
+    }
+
+    @Test
+    @InSequence(11)
+    public void should_save_when_tx_scoped_bean_is_found() throws Exception
+    {
+        // when
+        Simple simple = simpleClientTx.createSimple("transaction scoped");
+        Simple found = repository.findOptionalByName("transaction scoped");
+
+        // then
+        assertNotNull(simple);
+        assertNotNull(found);
+        assertEquals("transaction scoped", found.getName());
+    }
+
+    @Test
+    @InSequence(12)
+    public void tx_scoped_bean_should_be_empty_after_tx() throws Exception
+    {
+        // when
+        Simple simple = simpleClientTx.getSimple();
+
+        // then
+        assertNull(simple);
+    }
+
+    @Test
+    @InSequence(20)
+    public void app_scoped_bean_should_be_empty_before_tx() throws Exception
+    {
+        // when
+        Simple simple = simpleClientApp.getSimple();
+
+        // then
+        assertNull(simple);
+    }
+
+    @Test
+    @InSequence(21)
+    public void should_save_when_app_scoped_bean_is_found() throws Exception
+    {
+        // when
+        Simple simple = simpleClientApp.createSimple("application scoped");
+        Simple found = repository.findOptionalByName("application scoped");
+
+        // then
+        assertNotNull(simple);
+        assertNotNull(found);
+        assertEquals("application scoped", found.getName());
+    }
+
+    @Test
+    @InSequence(22)
+    public void app_scoped_bean_should_not_be_empty_after_tx() throws Exception
+    {
+        // when
+        Simple simple = simpleClientApp.getSimple();
+
+        // then
+        assertNotNull(simple);
+    }
+
+    @Test
+    @InSequence(30)
+    public void dep_scoped_bean_should_be_empty_before_tx() throws Exception
+    {
+        // when
+        Simple simple = simpleClientDep.getSimple();
+
+        // then
+        assertNull(simple);
+    }
+
+    @Test
+    @InSequence(31)
+    public void should_save_when_dep_scoped_bean_is_found() throws Exception
+    {
+        // when
+        Simple simple = simpleClientDep.createSimple("dependent");
+        Simple found = repository.findOptionalByName("dependent");
+
+        // then
+        assertNull(simple);
+        assertNull(found);
+    }
+
+    @Test
+    @InSequence(32)
+    public void dep_scoped_bean_should_be_empty_after_tx() throws Exception
+    {
+        // when
+        Simple simple = simpleClientDep.getSimple();
+
+        // then
+        assertNotNull(simple);
+    }
+
+    @Test
+    @InSequence(100)
+    public void should_cleanup() throws Exception
+    {
+        repository.deleteAll();
+    }
+
+    @Before
+    public void init()
+    {
+        wrapper.reset();
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/JtaTransactionalRepositoryInterfaceTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/JtaTransactionalRepositoryInterfaceTest.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/JtaTransactionalRepositoryInterfaceTest.java
new file mode 100644
index 0000000..caa255a
--- /dev/null
+++ b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/JtaTransactionalRepositoryInterfaceTest.java
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.data.test.ee7.tx;
+
+import static org.apache.deltaspike.data.test.ee7.util.TestDeployments.initDeployment;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.apache.deltaspike.data.test.ee7.domain.Simple;
+import org.apache.deltaspike.data.test.ee7.service.JtaTransactionalRepositoryInterface;
+import org.apache.deltaspike.test.category.WebEE7ProfileCategory;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.junit.InSequence;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+@Category(WebEE7ProfileCategory.class)
+@RunWith(Arquillian.class)
+public class JtaTransactionalRepositoryInterfaceTest
+{
+
+    public static String DS_PROPERTIES_WITH_CMT_STRATEGY
+        = "globalAlternatives.org.apache.deltaspike.jpa.spi.transaction.TransactionStrategy="
+        + "org.apache.deltaspike.jpa.impl.transaction.ContainerManagedTransactionStrategy";
+
+    private static final String NAME = "should_run_in_transaction";
+
+    @Deployment
+    public static Archive<?> deployment()
+    {
+        return initDeployment()
+                .addClass(JtaTransactionalRepositoryInterface.class)
+                .addClass(TransactionalQueryRunnerWrapper.class)
+                .addPackage(Simple.class.getPackage())
+                .addAsWebInfResource(new StringAsset(DS_PROPERTIES_WITH_CMT_STRATEGY),
+                    "classes/META-INF/apache-deltaspike.properties");
+                
+    }
+
+    @Inject
+    private JtaTransactionalRepositoryInterface repository;
+
+    @Produces
+    @PersistenceContext
+    private EntityManager entityManager;
+
+    @Inject
+    private TransactionalQueryRunnerWrapper wrapper;
+
+    @Test
+    @InSequence(1)
+    public void should_run_modifying_in_transaction() throws Exception
+    {
+        // when
+        repository.deleteAll();
+
+        // then
+        assertTrue(wrapper.isRunInTx());
+    }
+
+    @Test
+    @InSequence(2)
+    public void should_save_in_transaction() throws Exception
+    {
+        // given
+        Simple simple = new Simple(NAME);
+
+        // when
+        simple = repository.save(simple);
+
+        // then
+        assertNotNull(simple.getId());
+        assertTrue(wrapper.isRunInTx());
+    }
+
+    @Test
+    @InSequence(3)
+    public void should_find_with_lockmode_in_transaction() throws Exception
+    {
+        // when
+        Simple simple = repository.findByName(NAME);
+
+        // then
+        assertNotNull(simple);
+        assertTrue(wrapper.isRunInTx());
+    }
+
+    @Test
+    @InSequence(4)
+    public void should_find_no_lock_without_transaction() throws Exception
+    {
+        // when
+        Simple simple = repository.findByNameNoLock(NAME);
+
+        // then
+        assertNotNull(simple);
+        assertTrue(wrapper.isRunInNonTx());
+    }
+
+    @Test
+    @InSequence(10)
+    public void should_cleanup() throws Exception
+    {
+        repository.deleteAll();
+    }
+
+    @Before
+    public void init()
+    {
+        wrapper.reset();
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e55bca67/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/JtaTransactionalTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/JtaTransactionalTest.java b/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/JtaTransactionalTest.java
deleted file mode 100644
index 2dee1e6..0000000
--- a/deltaspike/modules/data/test-ee7/src/test/java/org/apache/deltaspike/data/test/ee7/tx/JtaTransactionalTest.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.deltaspike.data.test.ee7.tx;
-
-import static org.apache.deltaspike.data.test.ee7.util.TestDeployments.initDeployment;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import javax.enterprise.inject.Produces;
-import javax.inject.Inject;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import org.apache.deltaspike.data.test.ee7.domain.Simple;
-import org.apache.deltaspike.data.test.ee7.service.JtaTransactionalRepositoryInterface;
-import org.apache.deltaspike.test.category.WebEE7ProfileCategory;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.arquillian.junit.InSequence;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.asset.StringAsset;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-
-@Category(WebEE7ProfileCategory.class)
-@RunWith(Arquillian.class)
-public class JtaTransactionalTest
-{
-
-    public static String DS_PROPERTIES_WITH_CMT_STRATEGY
-        = "globalAlternatives.org.apache.deltaspike.jpa.spi.transaction.TransactionStrategy="
-        + "org.apache.deltaspike.jpa.impl.transaction.ContainerManagedTransactionStrategy";
-
-    private static final String NAME = "should_run_in_transaction";
-
-    @Deployment
-    public static Archive<?> deployment()
-    {
-        return initDeployment()
-                .addClasses(JtaTransactionalRepositoryInterface.class)
-                .addClass(TransactionalQueryRunnerWrapper.class)
-                .addPackage(Simple.class.getPackage())
-                .addAsWebInfResource(new StringAsset(DS_PROPERTIES_WITH_CMT_STRATEGY),
-                    "classes/META-INF/apache-deltaspike.properties");
-                
-    }
-
-    @Inject
-    private JtaTransactionalRepositoryInterface repository;
-
-    @Produces
-    @PersistenceContext
-    private EntityManager entityManager;
-
-    @Inject
-    private TransactionalQueryRunnerWrapper wrapper;
-
-    @Test
-    @InSequence(1)
-    public void should_run_modifying_in_transaction() throws Exception
-    {
-        // when
-        repository.deleteAll();
-
-        // then
-        assertTrue(wrapper.isRunInTx());
-    }
-
-    @Test
-    @InSequence(2)
-    public void should_save_in_transaction() throws Exception
-    {
-        // given
-        Simple simple = new Simple(NAME);
-
-        // when
-        simple = repository.save(simple);
-
-        // then
-        assertNotNull(simple.getId());
-        assertTrue(wrapper.isRunInTx());
-    }
-
-    @Test
-    @InSequence(3)
-    public void should_find_with_lockmode_in_transaction() throws Exception
-    {
-        // when
-        Simple simple = repository.findByName(NAME);
-
-        // then
-        assertNotNull(simple);
-        assertTrue(wrapper.isRunInTx());
-    }
-
-    @Test
-    @InSequence(4)
-    public void should_find_no_lock_without_transaction() throws Exception
-    {
-        // when
-        Simple simple = repository.findByNameNoLock(NAME);
-
-        // then
-        assertNotNull(simple);
-        assertTrue(wrapper.isRunInNonTx());
-    }
-
-    @Test
-    @InSequence(10)
-    public void should_cleanup() throws Exception
-    {
-        repository.deleteAll();
-    }
-
-    @Before
-    public void init()
-    {
-        wrapper.reset();
-    }
-
-}


Mime
View raw message