Package org.jboss.aspects.currentinvocation.test.basic

Examples of org.jboss.aspects.currentinvocation.test.basic.PojoBean


   {
      // Set TCL
      Thread.currentThread().setContextClassLoader(PojoBean.class.getClassLoader());
     
      // Ensure current invocation is accessible from within context
      TestCase.assertEquals("Current Invocation for this Thread was null", true, new PojoBean()
            .canGetCurrentInvocation());
      // Ensure context is cleansed after completion
      TestCase.assertEquals("Current Invocation was not cleansed after interception completed", null, CurrentInvocation
            .getCurrentInvocation());
   }
View Full Code Here


      // Set TCL
      Thread.currentThread().setContextClassLoader(PojoBean.class.getClassLoader());
     
      try
      {
         new PojoBean().throwException();
      }
      catch (TestException e)
      {
         TestCase.assertEquals("Current Invocation was not cleansed after exception was thrown", null,
               CurrentInvocation.getCurrentInvocation());
View Full Code Here

     
      // Initialize
      long waitForLaunch = 750L;

      // Make a new PojoBean
      PojoBean bean = new PojoBean();

      // Start a new job for Pojo to invoke and hold
      Thread otherThread = new RunPojoBeanSuspend(bean);
      otherThread.start();

      // Let the process start
      try
      {
         Thread.sleep(waitForLaunch);
      }
      catch (InterruptedException e)
      {
         throw new RuntimeException(e);
      }

      // Ensure we can't get the current invocation that's in
      // the other Thread's scope
      TestCase.assertEquals("Scoping of CurrentInvocation is not limited per Thread", null, CurrentInvocation
            .getCurrentInvocation());
     
      // Let the other Thread complete
      synchronized(bean){
         bean.notify();
      }
     
      // Wait for other thread to die
      try
      {
View Full Code Here

TOP

Related Classes of org.jboss.aspects.currentinvocation.test.basic.PojoBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.