Package org.jboss.test.ejb3.ejbthree1597

Examples of org.jboss.test.ejb3.ejbthree1597.PersistenceUnitSettingsBean


      // Yes, it's a weird method name for testing that the deployment
      // did not throw errors during deployment :)
      serverFound();
     
      // Now just do a simple test of the EJBs - lookup and invoke a method
      Echo bean = (Echo) this.getInitialContext().lookup("JBAS-7231-BeanJNDINameFromJBossXml");
      String msg = "JBAS-7231 is now fixed!!";
      String returnedMessage = bean.echo(msg);
     
      assertEquals("Bean returned unexpected value", msg, returnedMessage);
     
   }
View Full Code Here


    * @throws Exception
    */
   public void testNoInterfaceViewAccess() throws Exception
   {
      Context ctx = new InitialContext();
      AccountManager accountMgr = (AccountManager) ctx.lookup(AccountManagerBean.JNDI_NAME);
     
      long dummyAccountNumber = 123;
      // credit 50 dollars (Note that the current balance is hard coded in the bean to 100)
      // so after crediting, the current balance is going to be 150
      int currentBalance = accountMgr.credit(dummyAccountNumber, 50);
     
      assertEquals("Unexpected account balance after credit", 150, currentBalance);
     
      // now let's debit 10 dollars (Note that the current balance is again hard coded in the bean to 100).
      // So after debiting, the current balance is going to be 90
      currentBalance = accountMgr.debit(dummyAccountNumber, 10);
     
      assertEquals("Unexpected account balance after debit", 90, currentBalance);
   }
View Full Code Here

        
         TestObject o = new TestObject();
         remote.access(o);
         o = remote.createTestObject();
        
         Session30BusinessLocal local = (Session30BusinessLocal)ctx.lookup("ejb/Session30Local");
         o = new TestObject();
         local.access(o);
         o = local.createTestObject();
        
         // FIXME: this makes the servlet hang sometimes in Class.defineClass1()
         //WarTestObject warObject = (WarTestObject)local.getWarTestObject();
        
         Session30Home home = (Session30Home)ctx.lookup("ejb/Session30Home");
View Full Code Here

         injectedStateful.hello();
         injectedStateful.goodbye();
          
         InitialContext ctx = new InitialContext();
       
         Session30BusinessRemote remote = (Session30BusinessRemote)ctx.lookup("ejb/Session30");
        
         remote.hello();
         remote.goodbye();
        
         TestObject o = new TestObject();
         remote.access(o);
         o = remote.createTestObject();
        
         Session30BusinessLocal local = (Session30BusinessLocal)ctx.lookup("ejb/Session30Local");
         o = new TestObject();
         local.access(o);
         o = local.createTestObject();
View Full Code Here

         o = local.createTestObject();
        
         // FIXME: this makes the servlet hang sometimes in Class.defineClass1()
         //WarTestObject warObject = (WarTestObject)local.getWarTestObject();
        
         Session30Home home = (Session30Home)ctx.lookup("ejb/Session30Home");
         Session30Remote remote21 = home.create();
         remote21.access(o);
        
         Session30LocalHome localHome = (Session30LocalHome)ctx.lookup("ejb/Session30LocalHome");
         Session30Local local21 = localHome.create();
         local21.access(o);
        
         home = (Session30Home)ctx.lookup("java:comp/env/ejb/remote/Session30");
         remote21 = home.create();
         remote21.access(o);
        
         localHome = (Session30LocalHome)ctx.lookup("java:comp/env/ejb/local/Session30");
         local21 = localHome.create();
         local21.access(o);
View Full Code Here

         Session30Home home = (Session30Home)ctx.lookup("ejb/Session30Home");
         Session30Remote remote21 = home.create();
         remote21.access(o);
        
         Session30LocalHome localHome = (Session30LocalHome)ctx.lookup("ejb/Session30LocalHome");
         Session30Local local21 = localHome.create();
         local21.access(o);
        
         home = (Session30Home)ctx.lookup("java:comp/env/ejb/remote/Session30");
         remote21 = home.create();
         remote21.access(o);
        
         localHome = (Session30LocalHome)ctx.lookup("java:comp/env/ejb/local/Session30");
         local21 = localHome.create();
         local21.access(o);
      }
      catch (Exception e)
      {
         e.printStackTrace();
       
View Full Code Here

        
         Session30Home home = (Session30Home)ctx.lookup("ejb/Session30Home");
         Session30Remote remote21 = home.create();
         remote21.access(o);
        
         Session30LocalHome localHome = (Session30LocalHome)ctx.lookup("ejb/Session30LocalHome");
         Session30Local local21 = localHome.create();
         local21.access(o);
        
         home = (Session30Home)ctx.lookup("java:comp/env/ejb/remote/Session30");
         remote21 = home.create();
         remote21.access(o);
        
         localHome = (Session30LocalHome)ctx.lookup("java:comp/env/ejb/local/Session30");
         local21 = localHome.create();
         local21.access(o);
      }
      catch (Exception e)
      {
         e.printStackTrace();
View Full Code Here

        
         // FIXME: this makes the servlet hang sometimes in Class.defineClass1()
         //WarTestObject warObject = (WarTestObject)local.getWarTestObject();
        
         Session30Home home = (Session30Home)ctx.lookup("ejb/Session30Home");
         Session30Remote remote21 = home.create();
         remote21.access(o);
        
         Session30LocalHome localHome = (Session30LocalHome)ctx.lookup("ejb/Session30LocalHome");
         Session30Local local21 = localHome.create();
         local21.access(o);
        
         home = (Session30Home)ctx.lookup("java:comp/env/ejb/remote/Session30");
         remote21 = home.create();
         remote21.access(o);
        
         localHome = (Session30LocalHome)ctx.lookup("java:comp/env/ejb/local/Session30");
         local21 = localHome.create();
         local21.access(o);
      }
View Full Code Here

         Session30BusinessRemote remote = (Session30BusinessRemote)ctx.lookup("ejb/Session30");
        
         remote.hello();
         remote.goodbye();
        
         TestObject o = new TestObject();
         remote.access(o);
         o = remote.createTestObject();
        
         Session30BusinessLocal local = (Session30BusinessLocal)ctx.lookup("ejb/Session30Local");
         o = new TestObject();
         local.access(o);
         o = local.createTestObject();
        
         // FIXME: this makes the servlet hang sometimes in Class.defineClass1()
         //WarTestObject warObject = (WarTestObject)local.getWarTestObject();
View Full Code Here

      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

TOP

Related Classes of org.jboss.test.ejb3.ejbthree1597.PersistenceUnitSettingsBean

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.