FileDocCategorySizeDatePackage
AsynchTestCase.javaAPI DocJBoss 4.2.12784Fri Jul 13 21:02:24 BST 2007org.jboss.test.asynch

AsynchTestCase

public class AsynchTestCase extends org.jboss.test.JBossTestCase
Comment
author
Bill Burke
version
$Revision: 57186 $

Fields Summary
Category
log
static boolean
deployed
static int
test
Constructors Summary
public AsynchTestCase(String name)


     
   

      super(name);

   
Methods Summary
public static junit.framework.Testsuite()

      TestSuite suite = new TestSuite();
      suite.addTest(new TestSuite(AsynchTestCase.class));

      AOPTestSetup setup = new AOPTestSetup(suite, "asynch-test.sar");
      return setup;
   
public voidtestCollocated()

      POJO pojo = (POJO) getInitialContext().lookup("pojo");

      pojo.testCollocated();
   
public voidtestLocal()

      POJO pojo = (POJO) getInitialContext().lookup("pojo");

      pojo.test();
   
public voidtestRemote()

      try
      {
         POJO pojo = (POJO) getInitialContext().lookup("pojo");

         AsynchProvider asynch = (AsynchProvider) pojo;
         pojo.testMethod(5);

         Future future = asynch.getFuture();
         int rtn = ((Integer) future.get()).intValue();
         assertEquals(rtn, 5);

         pojo.testMethod("hello");

         future = asynch.getFuture();
         String srtn = (String) future.get();
         assertEquals("hello", srtn);
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }