[jboss-cvs] JBossAS SVN: r81980 - trunk/testsuite/src/main/org/jboss/test/jca/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 2 15:06:36 EST 2008


Author: jesper.pedersen
Date: 2008-12-02 15:06:35 -0500 (Tue, 02 Dec 2008)
New Revision: 81980

Modified:
   trunk/testsuite/src/main/org/jboss/test/jca/test/BaseConnectionManagerUnitTestCase.java
Log:
[JBAS-6272] jrockit - org.jboss.test.jca.test.BaseConnectionManagerUnitTestCase.testAllocationRetryMultiThread

Modified: trunk/testsuite/src/main/org/jboss/test/jca/test/BaseConnectionManagerUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jca/test/BaseConnectionManagerUnitTestCase.java	2008-12-02 20:01:49 UTC (rev 81979)
+++ trunk/testsuite/src/main/org/jboss/test/jca/test/BaseConnectionManagerUnitTestCase.java	2008-12-02 20:06:35 UTC (rev 81980)
@@ -65,6 +65,9 @@
    ConnectionRequestInfo cri = new TestConnectionRequestInfo();
    CachedConnectionManager ccm = new CachedConnectionManager();
 
+   private boolean failed;
+   private String failedDescription;
+   private Exception failedException;
 
    /**
     * Creates a new <code>BaseConnectionManagerUnitTestCase</code> instance.
@@ -435,6 +438,10 @@
       final CountDownLatch firstPart = new CountDownLatch(numOfThreads);
       final CountDownLatch done = new CountDownLatch(numOfThreads);
 
+      failed = false;
+      failedDescription = null;
+      failedException = null;
+
       try
       {
          for (int i = 0; i < numOfThreads; i++)
@@ -459,7 +466,9 @@
                         }
                         catch (ResourceException re)
                         {
-                           fail("ResourceException: " + re);
+                           failed = true;
+                           failedDescription = "Failed to get a connection";
+                           failedException = re;
                         }
                      }
 
@@ -471,8 +480,11 @@
 
                      try
                      {
-                        cm.getManagedConnection(null, null);
-                        fail("Got a connection");
+                        ConnectionListener cl = cm.getManagedConnection(null, null);
+                        cs.add(cl);
+
+                        failedDescription = "Got a connection";
+                        failed = true;
                      }
                      catch (ResourceException ignore)
                      {
@@ -502,6 +514,18 @@
          done.await();
 
          assertTrue("3: Wrong number of connections counted: " + cm.getConnectionCount(), cm.getConnectionCount() == 0);
+
+         if (failed)
+         {
+            if (failedDescription == null)
+            {
+               fail("Failed criteria: " + failedException);
+            }
+            else
+            {
+               fail(failedDescription + ": " + failedException);
+            }
+         }
       }
       finally
       {




More information about the jboss-cvs-commits mailing list