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 2010/06/02 15:50:25 UTC

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

Author: cwiklik
Date: Wed Jun  2 13:50:24 2010
New Revision: 950564

URL: http://svn.apache.org/viewvc?rev=950564&view=rev
Log:
UIMA-1786 Added testClientProcessTimeoutWithAggregateMultiplier()

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

Modified: uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java?rev=950564&r1=950563&r2=950564&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java (original)
+++ uima/uima-as/trunk/uimaj-as-activemq/src/test/java/org/apache/uima/ee/test/TestUimaASExtended.java Wed Jun  2 13:50:24 2010
@@ -1136,6 +1136,35 @@ public class TestUimaASExtended extends 
       fail("Expected ResourceInitializationException Instead Caught:" + e.getClass().getName());
     }
   }
+  public void testClientProcessTimeoutWithAggregateMultiplier() throws Exception {
+    System.out.println("-------------- testClientProcessTimeoutWithAggregateMultiplier -------------");
+    addExceptionToignore(org.apache.uima.aae.error.UimaASProcessCasTimeout.class);
+
+    BaseUIMAAsynchronousEngine_impl uimaAsEngine = new BaseUIMAAsynchronousEngine_impl();
+    deployService(uimaAsEngine, relativePath + "/Deploy_AggregateMultiplierWithDelay.xml");
+
+    Map<String, Object> appCtx = buildContext(String.valueOf(broker.getMasterConnectorURI()),
+            "TopLevelTaeQueue");
+    appCtx.put(UimaAsynchronousEngine.Timeout, 3000);
+    appCtx.put(UimaAsynchronousEngine.CasPoolSize, 1);
+
+    // reduce the cas pool size and reply window
+    appCtx.remove(UimaAsynchronousEngine.ShadowCasPoolSize);
+    appCtx.put(UimaAsynchronousEngine.ShadowCasPoolSize, Integer.valueOf(1));
+    
+    
+    initialize(uimaAsEngine, appCtx);
+    waitUntilInitialized();
+    
+    for( int i=0; i < 2; i++ ) {
+      CAS cas = uimaAsEngine.getCAS();
+      cas.setDocumentText("Some Text");
+      uimaAsEngine.sendCAS(cas);  // will timeout after 5 secs
+      uimaAsEngine.collectionProcessingComplete();  // the CPC should not
+      // be sent to a service until the timeout occurs.
+    }
+    uimaAsEngine.stop();
+  }
 
   public void testDeployAggregateService() throws Exception {
     System.out.println("-------------- testDeployAggregateService -------------");