From 8a3a6ed4f91adb7c0735bf2804876446a68da39e Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Wed, 21 Apr 2010 11:21:56 +0000 Subject: [PATCH] Try to improve information on if/when the context won't cleanly shutdown, by making the close more explicit, which will hopefully help with ALF-2485 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19929 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../repo/workflow/WorkflowTestSuite.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/source/java/org/alfresco/repo/workflow/WorkflowTestSuite.java b/source/java/org/alfresco/repo/workflow/WorkflowTestSuite.java index 2569acf184..5e21e62294 100644 --- a/source/java/org/alfresco/repo/workflow/WorkflowTestSuite.java +++ b/source/java/org/alfresco/repo/workflow/WorkflowTestSuite.java @@ -27,6 +27,7 @@ import org.alfresco.repo.workflow.jbpm.ReviewAndApproveTest; import org.alfresco.util.ApplicationContextHelper; import junit.framework.Test; +import junit.framework.TestCase; import junit.framework.TestSuite; /** @@ -58,7 +59,26 @@ public class WorkflowTestSuite extends TestSuite // This should go last, as its uses a different // context to the other tests suite.addTestSuite( JBPMEngineUnitTest.class ); + + // This one will force the suite to shut down the context + // properly, which avoids periodic wierd build failures + suite.addTestSuite( WorkflowSuiteContextShutdownTest.class ); return suite; } + + public static class WorkflowSuiteContextShutdownTest extends TestCase { + public void testDummy() {} + + protected void tearDown() throws Exception { + System.err.println("Workflow test suite has completed, shutting down the ApplicationContext..."); + ApplicationContextHelper.closeApplicationContext(); + + Thread.yield(); + Thread.sleep(25); + Thread.yield(); + + System.err.println("Workflow test suite shutdown has finished"); + } + } }