james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r681650 - /james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/AbstractRemoteDeliveryTest.java
Date Fri, 01 Aug 2008 11:13:24 GMT
Author: bago
Date: Fri Aug  1 04:13:23 2008
New Revision: 681650

URL: http://svn.apache.org/viewvc?rev=681650&view=rev
Log:
Try some more debug for AbstractRemoteDeliveryTest

Modified:
    james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/AbstractRemoteDeliveryTest.java

Modified: james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/AbstractRemoteDeliveryTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/AbstractRemoteDeliveryTest.java?rev=681650&r1=681649&r2=681650&view=diff
==============================================================================
--- james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/AbstractRemoteDeliveryTest.java
(original)
+++ james/server/trunk/mailets-function/src/test/java/org/apache/james/transport/remotedeliverytester/AbstractRemoteDeliveryTest.java
Fri Aug  1 04:13:23 2008
@@ -29,11 +29,14 @@
 import javax.mail.SendFailedException;
 
 import java.io.IOException;
+import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.Map;
 import java.util.Properties;
 import java.util.Random;
+import java.util.Set;
 
 import junit.framework.AssertionFailedError;
 import junit.framework.TestCase;
@@ -396,7 +399,22 @@
             // TEMPORARILY add a dump stack on failure to 
             // see if we have a deadlock (unlikely) or simply the
             // notification is not working properly. (see JAMES-850)
-            Thread.dumpStack();
+            
+            // Use reflection to invoke java 1.5 stack functions.
+            try {
+                Method m = Thread.class.getMethod("getAllStackTraces", null);
+                Map stackDump = (Map) m.invoke(null, null);
+                Set threads = stackDump.keySet();
+                for (Iterator i = threads.iterator(); i.hasNext(); ) {
+                    Thread th = (Thread) i.next();
+                    System.out.println("Thread "+th);
+                    StackTraceElement[] stack = (StackTraceElement[]) stackDump.get(th);
+                    for (int k = 0; k < stack.length; k++) {
+                        System.out.println("STE: "+stack[k]);
+                    }
+                }
+            } catch (Exception reflectException) {
+            }
             throw e;
         }
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message