Package org.jboss.ejb3.core.test.txsync

Examples of org.jboss.ejb3.core.test.txsync.TxSync.sayHi()


      Class<?> interfaces[] = { MyInterface.class };
      MyInterface proxy = container.constructProxy(interfaces);
     
      assertEquals("ProxiedInterceptor postConstruct must have been called once", 1, ProxiedInterceptor.postConstructs);
     
      String result = proxy.sayHi("Me");
      assertEquals("Hi Me", result);
     
      assertEquals("sayHi didn't invoke ProxiedInterceptor.aroundInvoke once", 1, ProxiedInterceptor.aroundInvokes);
      assertEquals("sayHi didn't invoke ProxiedBean.aroundInvoke once", 1, ProxiedBean.aroundInvokes);
      log.info("======= Done");
View Full Code Here


      Class<?> interfaces[] = { MyInterface.class };
      MyInterface proxy = container.constructProxy(interfaces);
     
     
      reset(true);
      String result = proxy.sayHi("Me");
      assertEquals("Hi Me", result);
      ProxiedBean bean1hi = Interceptions.getProxiedBean();
      PerInstanceInterceptor pi1hi = Interceptions.getPerInstanceInterceptor();
      PerJoinpointInterceptor pj1hi = Interceptions.getPerJoinpointInterceptor();
      assertEquals(1, Interceptions.getProxiedBeanCalls());
View Full Code Here

      assertSame(bean1hi, bean1bye);
      assertSame(pi1hi, pi1bye);
      assertNotSame(pj1hi, pj1bye);

      reset(true);
      result = proxy.sayHi("Me");
      assertEquals("Hi Me", result);
      ProxiedBean bean2hi = Interceptions.getProxiedBean();
      PerInstanceInterceptor pi2hi = Interceptions.getPerInstanceInterceptor();
      PerJoinpointInterceptor pj2hi = Interceptions.getPerJoinpointInterceptor();
      assertNotSame(bean1hi, bean2hi);
View Full Code Here

      String name = "ejbthree1886";
      String expectedMessage = "Hi " + name;
      MyStatelessLocal localBean = (MyStatelessLocal) obj;

      String message = localBean.sayHi(name);
      Assert.assertEquals("Unexpected greeting message: " + message + " from local stateless bean", message,
            expectedMessage);

      // now lookup remote and invoke on it
      String remoteJNDIName = smd.getJndiName();
View Full Code Here

      Object bean = RemoteAccessTestCase.getContext().lookup(JNDI_NAME_SLSB_REMOTE);
      assertTrue("Bean was not of expected type " + MyStatelessRemote.class.getName() + " but was instead " + bean,
            bean instanceof MyStatelessRemote);

      MyStatelessRemote slsb = ((MyStatelessRemote) bean);
      String result = slsb.sayHi("testRemote");
      String expected = "Hi testRemote";
      assertEquals("Result was not expected", expected, result);
      result = slsb.sayHi("testRemote");
      expected = "Hi testRemote";
      assertEquals("Result was not expected", expected, result);
View Full Code Here

      MyStatelessRemote slsb = ((MyStatelessRemote) bean);
      String result = slsb.sayHi("testRemote");
      String expected = "Hi testRemote";
      assertEquals("Result was not expected", expected, result);
      result = slsb.sayHi("testRemote");
      expected = "Hi testRemote";
      assertEquals("Result was not expected", expected, result);
   }

   /**
 
View Full Code Here

      Assert.assertTrue("Remote jndi name lookup at " + remoteJNDIName + " returned unexpected object " + remote,
            remote instanceof MyStatelessRemote);

      MyStatelessRemote remoteBean = (MyStatelessRemote) remote;

      String remoteMessage = remoteBean.sayHi(name);
      Assert.assertEquals("Unexpected greeting message: " + message + " from remote stateless bean", remoteMessage,
            expectedMessage);

   }
View Full Code Here

   @Test
   public void test1() throws Throwable
   {
      Greeter bean = container.constructProxy(Greeter.class);
     
      bean.sayHi("me");
     
      assertEquals("disallowed", AfterCompletionTestBean.result);
   }
}
View Full Code Here

   {
      SessionSyncTest bean = container.constructProxy(SessionSyncTest.class);
     
      try
      {
         bean.sayHi("me");
         fail("Should have thrown an EJBTransactionRolledbackException");
      }
      catch(EJBTransactionRolledbackException e)
      {
         // whoopie
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.