Package org.jboss.test.ejb3.vfs.impl.vfs3

Examples of org.jboss.test.ejb3.vfs.impl.vfs3.UnifiedVirtualFileFactoryImplUnitTest


   public void testJPA() throws Exception
   {
     getLog().info("testJPA start");
     InitialContext ctx = this.getInitialContext();
     SoccerFacade stats = (SoccerFacade) ctx.lookup("ejb3/ejbthree7376/SoccerFacade");
     getLog().info("testJPA about to add player");
     stats.addPlayer(0,"Heather Mitts","Boston Breakers", 0); // 2009 season
     getLog().info("testJPA player added.  About to look up player");
     Player p = stats.getPlayer(0);
     assertNotNull("player is null" , p);
     assertEquals(p.getName(), "Heather Mitts");
     assertEquals(p.getTeam(), "Boston Breakers");
     getLog().info("testJPA end");
   }
View Full Code Here


   public void testJPABeanValidation() throws Exception
   {
     getLog().info("testJPABeanValidation start");
     InitialContext ctx = this.getInitialContext();
     SoccerFacade stats = (SoccerFacade) ctx.lookup("ejb3/ejbthree7376/SoccerFacade");
     try {
       stats.addPlayer(1, "Christine Lily","Boston Breakers", 9999); // should be invalid number of goals
       fail("failed to throw ConstraintViolationException");
     }
     catch(ConstraintViolationException expected)
     {
       // expected path
View Full Code Here

  public void testJPAReadLock() throws Exception
  {
     getLog().info("testJPA start");
     InitialContext ctx = this.getInitialContext();
     SoccerFacade stats = (SoccerFacade) ctx.lookup("ejb3/ejbthree7376/SoccerFacade");
     getLog().info("testJPA about to add player");
     stats.addPlayer(2,"Fabiana","Boston Breakers", 5); // 2009 season
     assertNotNull("player is null", stats.getPlayer(2));
     getLog().info("testJPA player added.  About to look up player");
     Player p = stats.getPlayerReadLock(2);
     assertNotNull("player is null" , p);
     assertEquals(p.getName(), "Fabiana");
     assertEquals(p.getTeam(), "Boston Breakers");
     getLog().info("testJPA end");
  }
View Full Code Here

  public void testJPAOptimisticLock() throws Exception
  {
     getLog().info("testJPA start");
     InitialContext ctx = this.getInitialContext();
     SoccerFacade stats = (SoccerFacade) ctx.lookup("ejb3/ejbthree7376/SoccerFacade");
     getLog().info("testJPA about to add player");
     stats.addPlayer(3,"Kelly Smith","Boston Breakers", 10); // 2009 season
     assertNotNull("player is null", stats.getPlayer(3));
     getLog().info("testJPA player added.  About to look up player");
     Player p = stats.getPlayerOptimisticLock(3);
     assertNotNull("player is null" , p);
     assertEquals(p.getName(), "Kelly Smith");
     assertEquals(p.getTeam(), "Boston Breakers");
     getLog().info("testJPA end");
View Full Code Here

   public void testBeanCalls() throws Exception
   {
      String earNames[] = { "jbas6161-A", "jbas6161-B" };
      for(String earName : earNames)
      {
         Greeter bean = lookup(earName + "/SimpleSessionBean/remote", Greeter.class);
         String name = new Date().toString();
         String actual = bean.sayHiTo(name);
         assertEquals("Hi " + name, actual);
      }
   }
View Full Code Here

   public void testBeanCalls() throws Exception
   {
      String earNames[] = { "jbas6161-A", "jbas6161-B" };
      for(String earName : earNames)
      {
         Greeter bean = lookup(earName + "/SimpleSessionBean/remote", Greeter.class);
         String name = new Date().toString();
         String actual = bean.sayHiTo(name);
         assertEquals("Hi " + name, actual);
      }
   }
View Full Code Here

   /**
    * EE.5.15
    */
   public void testModuleName() throws Exception
   {
      QueryNameSpaceRemote bean = (QueryNameSpaceRemote) getInitialContext().lookup("QueryNameSpaceBean/remote");
      String result = bean.query("java:module/ModuleName");
      assertEquals("jbas7556", result);
   }
View Full Code Here

      // 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

TOP

Related Classes of org.jboss.test.ejb3.vfs.impl.vfs3.UnifiedVirtualFileFactoryImplUnitTest

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.