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 2014/07/15 19:07:55 UTC

svn commit: r1610754 - in /tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr: AbstractCMRTest.java OneToManyTests.java

Author: andygumbrecht
Date: Tue Jul 15 17:07:55 2014
New Revision: 1610754

URL: http://svn.apache.org/r1610754
Log:
OneToManyTests, AbstractCMRTest - try synchronization

Modified:
    tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/AbstractCMRTest.java
    tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/OneToManyTests.java

Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/AbstractCMRTest.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/AbstractCMRTest.java?rev=1610754&r1=1610753&r2=1610754&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/AbstractCMRTest.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/AbstractCMRTest.java Tue Jul 15 17:07:55 2014
@@ -48,11 +48,11 @@ public abstract class AbstractCMRTest ex
         super("Entity.CMR."+name);
     }
 
-    protected void beginTransaction() throws Exception {
+    protected synchronized void beginTransaction() throws Exception {
         transactionManager.begin();
     }
 
-    protected void completeTransaction() throws SystemException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
+    protected synchronized void completeTransaction() throws SystemException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
         int status = transactionManager.getStatus();
         if (status == Status.STATUS_ACTIVE) {
             transactionManager.commit();
@@ -67,7 +67,7 @@ public abstract class AbstractCMRTest ex
      * Sets up the fixture, for example, open a network connection.
      * This method is called before a test is executed.
      */
-    protected void setUp() throws Exception {
+    protected synchronized void setUp() throws Exception {
         super.setUp();
 
         Properties properties = TestManager.getServer().getContextEnvironment();

Modified: tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/OneToManyTests.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/OneToManyTests.java?rev=1610754&r1=1610753&r2=1610754&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/OneToManyTests.java (original)
+++ tomee/tomee/trunk/itests/openejb-itests-client/src/main/java/org/apache/openejb/test/entity/cmr/OneToManyTests.java Tue Jul 15 17:07:55 2014
@@ -36,6 +36,7 @@ import java.util.ConcurrentModificationE
 /**
  * @version $Revision$ $Date$
  */
+@SuppressWarnings("UnusedDeclaration")
 public class OneToManyTests extends AbstractCMRTest {
     private ArtistLocalHome artistLocalHome;
     private SongLocalHome songLocalHome;
@@ -316,13 +317,13 @@ public class OneToManyTests extends Abst
             try {
                 songs.add(new Object());
                 fail("expected games.add(new Object()) to throw an IllegalArgumentException");
-            } catch (IllegalArgumentException e) {
+            } catch (final IllegalArgumentException ignored) {
             }
 
             try {
                 songs.addAll(Arrays.asList(new Object()));
                 fail("expected games.addAll(Arrays.asList(new Object())) to throw an IllegalArgumentException");
-            } catch (IllegalArgumentException expected) {
+            } catch (final IllegalArgumentException ignored) {
             }
         } finally {
             completeTransaction();
@@ -360,28 +361,28 @@ public class OneToManyTests extends Abst
         try {
             songs.add(newSong);
             fail("expected songs.add(newSong) to throw an IllegalStateException");
-        } catch (IllegalStateException expected) {
+        } catch (final IllegalStateException ignored) {
         }
         try {
             songs.addAll(Arrays.asList(newSong));
             fail("expected songs.addAll(Arrays.asList(newSong)) to throw an IllegalStateException");
-        } catch (IllegalStateException expected) {
+        } catch (final IllegalStateException ignored) {
         }
         try {
             songs.remove(newSong);
             fail("expected songs.remove(newSong) to throw an IllegalStateException");
-        } catch (IllegalStateException expected) {
+        } catch (final IllegalStateException ignored) {
         }
         try {
             songs.removeAll(Arrays.asList(newSong));
             fail("expected songs.removeAll(Arrays.asList(newSong)) to throw an IllegalStateException");
-        } catch (IllegalStateException expected) {
+        } catch (final IllegalStateException ignored) {
         }
         Iterator iterator = songs.iterator();
         try {
             iterator.remove();
             fail("expected iterator.remove() to throw an ConcurrentModificationException");
-        } catch (ConcurrentModificationException expected) {
+        } catch (final ConcurrentModificationException ignored) {
         }
     }
 
@@ -418,28 +419,28 @@ public class OneToManyTests extends Abst
             try {
                 songs.add(newSong);
                 fail("expected songs.add(newSong) to throw an IllegalStateException");
-            } catch (IllegalStateException expected) {
+            } catch (final IllegalStateException ignored) {
             }
             try {
                 songs.addAll(Arrays.asList(newSong));
                 fail("expected songs.addAll(Arrays.asList(newSong)) to throw an IllegalStateException");
-            } catch (IllegalStateException expected) {
+            } catch (final IllegalStateException ignored) {
             }
             try {
                 songs.remove(newSong);
                 fail("expected songs.remove(newSong) to throw an IllegalStateException");
-            } catch (IllegalStateException expected) {
+            } catch (final IllegalStateException ignored) {
             }
             try {
                 songs.removeAll(Arrays.asList(newSong));
                 fail("expected songs.removeAll(Arrays.asList(newSong)) to throw an IllegalStateException");
-            } catch (IllegalStateException expected) {
+            } catch (final IllegalStateException ignored) {
             }
             Iterator iterator = songs.iterator();
             try {
                 iterator.remove();
                 fail("expected iterator.remove() to throw an ConcurrentModificationException");
-            } catch (ConcurrentModificationException expected) {
+            } catch (final ConcurrentModificationException ignored) {
             }
         } finally {
             completeTransaction();
@@ -464,7 +465,7 @@ public class OneToManyTests extends Abst
             try {
                 iterator.next();
                 fail("expected iterator.next() to throw an ConcurrentModificationException");
-            } catch (ConcurrentModificationException expected) {
+            } catch (final ConcurrentModificationException ignored) {
             }
         } finally {
             completeTransaction();
@@ -491,7 +492,7 @@ public class OneToManyTests extends Abst
             try {
                 iterator.next();
                 fail("expected iterator.next() to throw an ConcurrentModificationException");
-            } catch (ConcurrentModificationException expected) {
+            } catch (final ConcurrentModificationException ignored) {
             }
         } finally {
             completeTransaction();
@@ -555,7 +556,7 @@ public class OneToManyTests extends Abst
         close(c);
     }
 
-    private void resetDB() throws Exception {
+    private synchronized void resetDB() throws Exception {
         Connection connection = ds.getConnection();
         Statement statement = null;
         try {