[hornetq-commits] JBoss hornetq SVN: r10368 - branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Mar 25 17:15:32 EDT 2011


Author: clebert.suconic at jboss.com
Date: 2011-03-25 17:15:31 -0400 (Fri, 25 Mar 2011)
New Revision: 10368

Modified:
   branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
Log:
cleanup code

Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java	2011-03-25 21:13:53 UTC (rev 10367)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java	2011-03-25 21:15:31 UTC (rev 10368)
@@ -875,26 +875,8 @@
    @Override
    protected void tearDown() throws Exception
    {
-      OperationContextImpl.clearContext();
+      cleanupPools();
 
-      deleteDirectory(new File(getTestDir()));
-
-      int invmSize = InVMRegistry.instance.size();
-      if (invmSize > 0)
-      {
-         InVMRegistry.instance.clear();
-         fail("invm registry still had acceptors registered");
-      }
-
-      if (AsynchronousFileImpl.getTotalMaxIO() != 0)
-      {
-         AsynchronousFileImpl.resetMaxAIO();
-         Assert.fail("test did not close all its files " + AsynchronousFileImpl.getTotalMaxIO());
-      }
-      
-      // We shutdown the global pools to give a better isolation between tests
-      ServerLocatorImpl.clearThreadPools();
-
       Map<Thread, StackTraceElement[]> threadMap = Thread.getAllStackTraces();
       for (Thread thread : threadMap.keySet())
       {
@@ -967,6 +949,32 @@
       super.tearDown();
    }
 
+   /**
+    * 
+    */
+   protected void cleanupPools()
+   {
+      OperationContextImpl.clearContext();
+
+      deleteDirectory(new File(getTestDir()));
+
+      int invmSize = InVMRegistry.instance.size();
+      if (invmSize > 0)
+      {
+         InVMRegistry.instance.clear();
+         fail("invm registry still had acceptors registered");
+      }
+
+      if (AsynchronousFileImpl.getTotalMaxIO() != 0)
+      {
+         AsynchronousFileImpl.resetMaxAIO();
+         Assert.fail("test did not close all its files " + AsynchronousFileImpl.getTotalMaxIO());
+      }
+      
+      // We shutdown the global pools to give a better isolation between tests
+      ServerLocatorImpl.clearThreadPools();
+   }
+
    protected byte[] autoEncode(final Object... args)
    {
 



More information about the hornetq-commits mailing list