Examples of AccountPK


Examples of org.jboss.test.cts.keys.AccountPK

      CtsBmp bean = null;

      try {
         CtsBmpHome home = getHome();
         AccountPK pk = new AccountPK(BEAN_PK_007);

         mbx.clearMessages();

         getLog().debug("Create a bean...");
         bean = doEjbCreate(pk, BEAN_NAME);
View Full Code Here

Examples of org.jboss.test.cts.keys.AccountPK

   public void testOptionD() throws Exception
   {
      InitialContext ctx = new InitialContext();
      CtsCmpHome home = (CtsCmpHome) ctx.lookup("ejbcts/CMPBeanOptionD");
      AccountPK pk = new AccountPK("testOptionD-1");
      home.create(pk, "name1");
      pk = new AccountPK("testOptionD-2");
      home.create(pk, "name2");
     
      ObjectName cache = new ObjectName("jboss.j2ee:service=EJB,jndiName=ejbcts/CMPBeanOptionD,plugin=cache");
      Long cacheSize = (Long) getServer().getAttribute(cache, "CacheSize");
      assertEquals(2, cacheSize.longValue());
View Full Code Here

Examples of org.jboss.test.cts.keys.AccountPK

      UserTransaction ut = (UserTransaction) ctx.lookup("UserTransaction");
      ut.getStatus();

      ut.begin();
      CtsCmpHome home = (CtsCmpHome) ctx.lookup("ejbcts/CMPBean");
      AccountPK pk = new AccountPK("testWithInvalidDefaultJndiContext");
      CtsCmp bean = home.create(pk, "Scott");
      bean.setPersonsAge(40);
      ut.commit();

      assertTrue("age == 40", bean.getPersonsAge() == 40);
View Full Code Here

Examples of org.jboss.test.cts.keys.AccountPK

      UserTransaction ut = (UserTransaction) ctx.lookup("UserTransaction");
      ut.getStatus();

      ut.begin();
      CtsCmpHome home = (CtsCmpHome) ctx.lookup("ejbcts/CMPBean");
      AccountPK pk = new AccountPK("testWithDefaultJndiContext");
      CtsCmp bean = home.create(pk, "Scott");
      bean.setPersonsAge(40);
      ut.commit();

      assertTrue("age == 40", bean.getPersonsAge() == 40);
View Full Code Here

Examples of org.jboss.test.cts.keys.AccountPK

      if (!testBeginSetrollbackonlyCommit())
         return false;

      // Create first instance
      try {
         bean1 = home.create(new AccountPK("UT_TestBean1"), "Ole1");
      } catch (Exception ex) {
         log.debug("failed", ex);
         return false;
      }

      // Single resource tests
      if (!testSingleRollback())
         return false;
      if (!testSingleCommit())
         return false;
      if (!testSingleSetrollbackonlyCommit())
         return false;

      // Can second instance be created in a tx that is rolled back?
      try {
         ut.begin();
         bean2 = home.create(new AccountPK("UT_TestBean2"), "Ole2");
         ut.rollback();
        
         // Should no longer exist
         boolean gotException = false;
         try {
            bean2.setPersonsName("Ole");
         } catch (Exception e) {
     log.info("IGNORE PREVIOUS NoSuchEntityException - it is intentional");
            gotException = true;
         }
         if (!gotException)
            throw new RuntimeException("Rollback didn't rollback create.");
      } catch (Exception ex) {
         log.debug("failed", ex);
         return false;
      }

      // Create second instance
      try {
         bean2 = home.create(new AccountPK("UT_TestBean2"), "Ole2");
      } catch (Exception ex) {
         log.debug("failed", ex);
         return false;
      }
View Full Code Here

Examples of org.jboss.test.cts.keys.AccountPK

      getLog().debug("+++ testLocalInterfacePassivation");
      StatefulSessionHome sessionHome = ( StatefulSessionHome ) ctx.lookup("ejbcts/StatefulSessionBean");
      StatefulSession sessionBean = sessionHome.create("testLocalInterfacePassivation");   

    getLog().debug("Creating local home");
      AccountPK pk = new AccountPK("123456789");
      sessionBean.createLocalEntity(pk, "jduke");

      getLog().debug("Creating a second session bean, forcing the first one to be passivated?");
      // The pool size has been set to 1 in the container
      // config, so creating another ASession here should
View Full Code Here

Examples of org.jboss.test.cts.keys.AccountPK

      StatefulSession bean = home.create("testRemoveSessionObject");   
      getLog().debug("OK, bean="+bean);
      getLog().debug("Call remove using a primary key");
      try
      {
         home.remove(new AccountPK("pk"));
         fail("[EJB 1.1, p42, section 5.3.2] Expected 'RemoveException' when remove-ing a session object, got NO exception");
      }
      catch(RemoveException e)
      {
         getLog().debug("Remove using a primary key failed as expected");
View Full Code Here

Examples of org.jboss.test.cts.keys.AccountPK

    */
   public void testBasicCmp()
         throws Exception
   {
      getLog().debug("+++ testBasicCmp()");
      AccountPK pk = new AccountPK("testBasicCmp");
      CtsCmp bean = home.create(pk, "testBasicCmp unitTest");
      String result = bean.getPersonsName();
      // Test response
      assertTrue(result.equals("testBasicCmp unitTest"));
      bean.remove();
View Full Code Here

Examples of org.jboss.test.cts.keys.AccountPK

      {
         InitialContext ctx = new InitialContext(env);
         Object ref = ctx.lookup("ejbcts/CMPBean");
         CtsCmpHome home = (CtsCmpHome)
               PortableRemoteObject.narrow(ref, CtsCmpHome.class);
         AccountPK pk1 = new AccountPK("bean1");
         CtsCmp bean1 = home.create(pk1, "testHomeFromRemoteNoDefaultJNDI");
         CtsCmpHome home2 = (CtsCmpHome) bean1.getEJBHome();
         AccountPK pk2 = new AccountPK("bean2");
         CtsCmp bean2 = home2.create(pk2, "testHomeFromRemoteNoDefaultJNDI");
         bean2.remove();
      }
      finally
      {
View Full Code Here

Examples of org.jboss.test.cts.keys.AccountPK

            try
            {
               ResultSet rs = ps.executeQuery();

               while (rs.next())
                  result.add(new AccountPK(rs.getString(1)));

               return result;
            }
            finally
            {
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.