Package org.jboss.test.ejb3.jbas6161

Examples of org.jboss.test.ejb3.jbas6161.Greeter


      return getDeploySetup(SingletonUnitTestCase.class, "ejb31singleton.jar");
   }

   public void testSingletonBeanAccess() throws Exception
   {
      AccountManager accountManager = (AccountManager) this.getInitialContext().lookup(AccountManagerBean.JNDI_NAME);

      int initialBalance = accountManager.balance();
      assertEquals("Unexpected initial balance", 0, initialBalance);

      // credit
      accountManager.credit(100);

      AccountManager anotherAccountManagerInstance = (AccountManager) this.getInitialContext().lookup(
            AccountManagerBean.JNDI_NAME);
      int balanceAfterCredit = anotherAccountManagerInstance.balance();
      assertEquals("Unexpected balance after credit", 100, balanceAfterCredit);

      // debit
      anotherAccountManagerInstance.debit(50);

      int balanceAfterDebit = accountManager.balance();
      assertEquals("Unexpected balance after debit", 50, balanceAfterDebit);

   }
View Full Code Here


      return getDeploySetup(EJB31JNDINamingSpecUnitTestCase.class, "ejb31-portable-jndi-names.jar");
   }

   public void testJNDINamesForSLSB() throws Exception
   {
      JNDI31Lookup delegateBean = (JNDI31Lookup) this.getInitialContext().lookup(JNDI31LookupBean.JNDI_NAME);
     
      delegateBean.lookupPortableSLSBJNDINames();

   }
View Full Code Here

   }

   public void testJNDINamesForSFSB() throws Exception
   {
      JNDI31Lookup delegateBean = (JNDI31Lookup) this.getInitialContext().lookup(JNDI31LookupBean.JNDI_NAME);
     
      delegateBean.lookupPortableSFSBJNDINames();

   }
View Full Code Here

   }

   public void testJNDINamesForSingleton() throws Exception
   {
      JNDI31Lookup delegateBean = (JNDI31Lookup) this.getInitialContext().lookup(JNDI31LookupBean.JNDI_NAME);
     
      delegateBean.lookupPortableSingletonBeanJNDINames();

   }
View Full Code Here

      return getDeploySetup(EJB30JNDINamingSpecUnitTestCase.class, "ejb30-portable-jndi-names.jar");
   }

   public void testJNDINamesForSLSB() throws Exception
   {
      JNDILookup delegateBean = (JNDILookup) this.getInitialContext().lookup(JNDI30LookupBean.JNDI_NAME);
     
      delegateBean.lookupPortableSLSBJNDINames();

   }
View Full Code Here

   }

   public void testJNDINamesForSFSB() throws Exception
   {
      JNDILookup delegateBean = (JNDILookup) this.getInitialContext().lookup(JNDI30LookupBean.JNDI_NAME);
     
      delegateBean.lookupPortableSFSBJNDINames();

   }
View Full Code Here

    * @throws Exception
    */
   public void testEjbDeploymentInWar() throws Exception
   {
      Context ctx = new InitialContext();
      Counter counter = (Counter) ctx.lookup("CounterDelegateBean/remote");

      int count = counter.increment();
      assertEquals("Unexpected count after increment", 1, count);

      // increment one more time
      count = counter.increment();
      assertEquals("Unexpected count after second increment", 2, count);

      // now decrement
      count = counter.decrement();
      assertEquals("Unexpected count after decrement", 1, count);

      // decrement one more time
      count = counter.decrement();
      assertEquals("Unexpected count after second decrement", 0, count);

   }
View Full Code Here

TOP

Related Classes of org.jboss.test.ejb3.jbas6161.Greeter

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.