You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2009/11/11 18:55:59 UTC

svn commit: r834982 - /incubator/uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java

Author: cwiklik
Date: Wed Nov 11 17:55:59 2009
New Revision: 834982

URL: http://svn.apache.org/viewvc?rev=834982&view=rev
Log:
UIMA-1437 fixed hang in testQuiesceAndStop()

Modified:
    incubator/uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java

Modified: incubator/uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java
URL: http://svn.apache.org/viewvc/incubator/uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java?rev=834982&r1=834981&r2=834982&view=diff
==============================================================================
--- incubator/uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java (original)
+++ incubator/uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java Wed Nov 11 17:55:59 2009
@@ -191,6 +191,7 @@
    * the broker shutdown result in GetMeta ping and a subsequent timeout.
    * @throws Exception
    */
+  
   public void testSyncClientRecoveryFromBrokerStop() throws Exception  {
     System.out.println("-------------- testSyncClientRecoveryFromBrokerStop -------------");
      // Instantiate Uima AS Client
@@ -236,7 +237,7 @@
       if ( errorCount != 5 ) {
         fail("Expected 5 failures due to broker down, instead received:"+errorCount+" failures");
       }
-      
+      System.clearProperty("BrokerURL");
       
   }
   /**
@@ -299,6 +300,7 @@
       if ( errorCount != 5 ) {
         fail("Expected 5 failures due to broker down, instead received:"+errorCount+" failures");
       }
+      System.clearProperty("BrokerURL");
       
       synchronized(this) {
         wait(3000);   // allow broker some time to stop  
@@ -389,8 +391,8 @@
     synchronized(this) {
        wait(3000);   // allow broker some time to stop  
     }
+    System.clearProperty("BrokerURL");
 }
-
   /**
    * This test starts a broker on port 8200, starts NoOp Annotator, and
    * using asynchronous send() sends a total of 15 CASes for analysis. After processing 11th
@@ -428,6 +430,7 @@
       }
       
       uimaAsEngine.stop();
+      System.clearProperty("BrokerURL");
   }
   
   public void testAsyncClientRecoveryFromBrokerStopAndRestart() throws Exception  {
@@ -471,6 +474,7 @@
       synchronized(this) {
         wait(2000);   // allow broker some time to stop  
       }
+      System.clearProperty("BrokerURL");
   }
   public void testClientProcess() throws Exception {
     System.out.println("-------------- testClientProcess -------------");
@@ -854,26 +858,29 @@
     appCtx.put(UimaAsynchronousEngine.Timeout, 10000);
     appCtx.put(UimaAsynchronousEngine.GetMetaTimeout, 300);
     appCtx.put(UimaAsynchronousEngine.CasPoolSize, 1);
-    deployService(eeUimaEngine, relativePath + "/Deploy_NoOpAnnotator.xml");
-    String containerId = deployService(eeUimaEngine, relativePath
+    String containers[] = new String[2];
+    containers[0] = deployService(eeUimaEngine, relativePath + "/Deploy_NoOpAnnotator.xml");
+    containers[1] =  deployService(eeUimaEngine, relativePath
             + "/Deploy_AggregateAnnotatorWithInternalCM1000Docs.xml");
-    spinShutdownThread(eeUimaEngine, 2000, containerId, SpringContainerDeployer.QUIESCE_AND_STOP);
+    spinShutdownThread(eeUimaEngine, 2000, containers, SpringContainerDeployer.QUIESCE_AND_STOP);
     runTest(appCtx, eeUimaEngine, String.valueOf(broker.getMasterConnectorURI()),
-            "TopLevelTaeQueue", 2, EXCEPTION_LATCH);
+            "TopLevelTaeQueue", 3, EXCEPTION_LATCH);
   }
 
   public void testStopNow() throws Exception {
     System.out.println("-------------- testAggregateWithFailedRemoteDelegate -------------");
     BaseUIMAAsynchronousEngine_impl eeUimaEngine = new BaseUIMAAsynchronousEngine_impl();
-    deployService(eeUimaEngine, relativePath + "/Deploy_NoOpAnnotator.xml");
-    String containerId = deployService(eeUimaEngine, relativePath
+    String containers[] = new String[2];
+
+    containers[0] = deployService(eeUimaEngine, relativePath + "/Deploy_NoOpAnnotator.xml");
+    containers[1] = deployService(eeUimaEngine, relativePath
             + "/Deploy_AggregateAnnotatorWithInternalCM1000Docs.xml");
     Map<String, Object> appCtx = buildContext(String.valueOf(broker.getMasterConnectorURI()),
             "TopLevelTaeQueue");
     // Set an explicit process timeout so to test the ping on timeout
     appCtx.put(UimaAsynchronousEngine.Timeout, 4000);
     appCtx.put(UimaAsynchronousEngine.GetMetaTimeout, 300);
-    spinShutdownThread(eeUimaEngine, 3000, containerId, SpringContainerDeployer.STOP_NOW);
+    spinShutdownThread(eeUimaEngine, 3000, containers, SpringContainerDeployer.STOP_NOW);
     //  send may fail since we forcefully stop the service. Tolerate
     //  ResourceProcessException
     addExceptionToignore(ResourceProcessException.class);