Package org.jboss.test.cts.keys

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


      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

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

      {
         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

      CtsBmp bean = null;

      try {
         getLog().debug("create bean, name=" + BEAN_NAME);

         bean = doEjbCreate(new AccountPK(BEAN_PK_007), BEAN_NAME);
      } catch (Exception ex) {
         getLog().error("Error in bmptest", ex);
         fail("testEjbCreate has failed!");
      }
View Full Code Here

      try {
         CtsBmpHome home = getHome();

         // First create a bean instance to find
         getLog().debug("Create bean, name=" + BEAN_NAME);
         doEjbCreate(new AccountPK(BEAN_PK_007), BEAN_NAME);

         getLog().debug("Find bean, name=" + BEAN_NAME);

         Collection clct = home.findByPersonsName(BEAN_NAME);
         getLog().debug("Verify result set not empty");
View Full Code Here

      CtsBmp bean = null;

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

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

      CtsBmp bean = null;

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

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

      CtsBmp anotherBean = null;
      CtsBmp differentBean = null;

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

         getLog().debug("Create a bean...");
         bean = doEjbCreate(pk, BEAN_NAME);
         getLog().debug("OK");

         getLog().debug("Now query based on the 'PersonsName': " +
                          BEAN_NAME + "...");
         Collection clct = home.findByPersonsName(BEAN_NAME);
         getLog().debug("OK");

         getLog().debug("Verify result set not empty...");
         assertTrue(!clct.isEmpty());
         getLog().debug("OK");

         getLog().debug("Bean result set:");
         for (Iterator itr=clct.iterator(); itr.hasNext();)
         {
            anotherBean = (CtsBmp)itr.next();
            getLog().debug("Use 'isIdentical()' to compare beans");
            assertTrue(anotherBean.isIdentical(bean));
            getLog().debug( "beans match..OK" );
         }

         getLog().debug("Make a bean that doesn't match..");
         AccountPK anotherPK = new AccountPK("123");
         differentBean = doEjbCreate(anotherPK, "SomeOtherGuy");
         getLog().debug("OK");

         getLog().debug("Use 'isIdentical()' to verify different beans...");
         assertTrue(!differentBean.isIdentical(bean));
         getLog().debug("OK...beans are different!");

         getLog().debug("Test the Primary Keys...");
         AccountPK beansPK = (AccountPK)bean.getPrimaryKey();
         AccountPK anotherBeansPK = (AccountPK)anotherBean.getPrimaryKey();
         assertTrue(beansPK.equals(anotherBeansPK));
         getLog().debug("OK...they're the same");

         getLog().debug("Compare different keys...");
         assertTrue(!beansPK.equals(anotherPK));
View Full Code Here

      CtsBmp bean = null;

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

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

TOP

Related Classes of org.jboss.test.cts.keys.AccountPK

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.