Author: ritchiem
Date: Tue Jan 19 20:38:07 2010
New Revision: 900945

URL: http://svn.apache.org/viewvc?rev=900945&view=rev
Log:
QPID-2262 : merged change from trunk r900943 updated catch statements to ensure 
that if we get a null cause that it does not fail test as these failures are 
due to QPID-2345.

Modified:
    qpid/branches/0.5.x-dev/qpid/java/   (props changed)
    
qpid/branches/0.5.x-dev/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java

Propchange: qpid/branches/0.5.x-dev/qpid/java/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 19 20:38:07 2010
@@ -1,2 +1,2 @@
 /qpid/branches/java-broker-0-10/qpid/java:829414,829575
-/qpid/trunk/qpid/java:835115,884634-884635,884838,885765,887948,887950-887952,887994,888246,888248,888250,888345,888348,889645,891323-891332,892228,896674,896692-896693,900919
+/qpid/trunk/qpid/java:835115,884634-884635,884838,885765,887948,887950-887952,887994,888246,888248,888250,888345,888348,889645,891323-891332,892228,896674,896692-896693,900919,900943

Modified: 
qpid/branches/0.5.x-dev/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
URL: 
http://svn.apache.org/viewvc/qpid/branches/0.5.x-dev/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java?rev=900945&r1=900944&r2=900945&view=diff
==============================================================================
--- 
qpid/branches/0.5.x-dev/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
 (original)
+++ 
qpid/branches/0.5.x-dev/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
 Tue Jan 19 20:38:07 2010
@@ -438,17 +438,34 @@
         catch (JMSException e)
         {
             Throwable cause = e.getLinkedException();
-            if (!(cause instanceof AMQAuthenticationException))
+
+            if (cause == null)
             {
-                e.printStackTrace();
+                e.printStackTrace(System.out);
+                if (e instanceof IllegalStateException)
+                {
+                    System.out.println("QPID-2345: Session became closed and 
we got that error rather than the authentication error.");
+                }
+                else
+                {
+                    fail("JMS Exception of did not have cause.:" + 
e.getMessage());
+                }
             }
-            assertEquals("Incorrect exception", 
AMQAuthenticationException.class, cause.getClass());
-            assertEquals("Incorrect error code thrown", 403, 
((AMQAuthenticationException) cause).getErrorCode().getCode());
-            
-            //use the latch to ensure the control thread waits long enough for 
the exception thread 
-            //to have done enough to mark the connection closed before 
teardown commences
-            assertTrue("Timed out waiting for conneciton to report close",
-                       exceptionReceived.await(2, TimeUnit.SECONDS));
+            else
+            {
+                if (!(cause instanceof AMQAuthenticationException))
+                {
+                    e.printStackTrace();
+                }
+                assertEquals("Incorrect exception", 
AMQAuthenticationException.class, cause.getClass());
+                assertEquals("Incorrect error code thrown", 403, 
((AMQAuthenticationException) cause).getErrorCode().getCode());
+
+                //use the latch to ensure the control thread waits long enough 
for the exception thread
+                //to have done enough to mark the connection closed before 
teardown commences
+                assertTrue("Timed out waiting for connection to report close",
+                           exceptionReceived.await(2, TimeUnit.SECONDS));
+            }
+
         }
     }
 
@@ -865,9 +882,21 @@
 
             if (!(cause instanceof AMQAuthenticationException))
             {
+                e.printStackTrace(System.out);
+                if (e instanceof IllegalStateException)
+                {
+                    System.out.println("QPID-2345: Session became closed and 
we got that error rather than the authentication error.");
+                }
+                else
+                {
+                    fail("JMS Exception of did not have cause.:" + 
e.getMessage());
+                }
+            }
+            else if (!(cause instanceof AMQAuthenticationException))
+            {
                 cause.printStackTrace(System.out);
                 assertEquals("Incorrect exception", 
IllegalStateException.class, cause.getClass());
-                System.out.println("QPID-1204 : Session became closed and we 
got that error rather than the authentication error.");
+                System.out.println("QPID-2345: Session became closed and we 
got that error rather than the authentication error.");
             }
             else
             {



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to