Examples of CtsBmpHome


Examples of org.jboss.test.cts.interfaces.CtsBmpHome

      getLog().debug("     testEjbFinder()");

      CtsBmp bean = null;

      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");
         assertTrue(!clct.isEmpty());
         getLog().debug("OK");
         getLog().debug("Bean result set:");
         for(Iterator itr=clct.iterator(); itr.hasNext();)
View Full Code Here

Examples of org.jboss.test.cts.interfaces.CtsBmpHome

      getLog().debug("     testEjbRemove()");

      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");

         getLog().debug("Delete with bean.remove()...");
         bean.remove();
         getLog().debug("OK");

         getLog().debug("Recreate the bean...");
         bean = doEjbCreate(pk, BEAN_NAME);
         getLog().debug("OK");

         getLog().debug("Remove the bean using primary key...");
         home.remove(pk);
         getLog().debug("OK");

         getLog().debug("Reconstitute the bean...");
         bean = doEjbCreate(pk, BEAN_NAME);
         getLog().debug("OK");

         getLog().debug("Get Handle object...");
         Handle hn = bean.getHandle( );
         getLog().debug("OK");

         getLog().debug("Remove the bean using the handle...");
         home.remove(hn);
         getLog().debug("OK");

         getLog().debug("Bean remove, try to use.. " +
                          "Should get 'java.rmi.NoSuchObjectException'..." );
         try {
View Full Code Here

Examples of org.jboss.test.cts.interfaces.CtsBmpHome

      getLog().debug("     testEjbLifeCycle()");

      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");

         getLog().debug("Use a finder method to retrieve the bean...");
         bean = home.findByPrimaryKey( pk );
         getLog().debug("OK");

         getLog().debug("Assert it is the same bean as passed to a method..." );
         // Send to a method as a reference, make sure it is usable by the method
         assertTrue( this.gotRefOkay(bean, BEAN_NAME) );
View Full Code Here

Examples of org.jboss.test.cts.interfaces.CtsBmpHome

      CtsBmp bean = null;
      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");
View Full Code Here

Examples of org.jboss.test.cts.interfaces.CtsBmpHome

     getLog().debug("     testEjbRemoteIF ()");

      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

Examples of org.jboss.test.cts.interfaces.CtsBmpHome

     getLog().debug("     testEntityHandle()");

      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

Examples of org.jboss.test.cts.interfaces.CtsBmpHome

      during the home lookup and session creation.
      */
      Properties homeProps = new Properties();
      homeProps.setProperty("java.naming.factory.initial", "org.jboss.naming.NamingContextFactory");
      InitialContext ic = new InitialContext(homeProps);
      CtsBmpHome home = (CtsBmpHome) ic.lookup("ejbcts/BMPBean");
      AccountPK pk = new AccountPK(BEAN_PK_007);
      CtsBmp bean = doEjbCreate(pk, BEAN_NAME);
      Handle beanHandle = bean.getHandle();
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(out);
View Full Code Here

Examples of org.jboss.test.cts.interfaces.CtsBmpHome

      getLog().debug("     testProbeContainerCallbacks()");

      CtsBmp bean = null;

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

         mbx.clearMessages();

         getLog().debug("Create a bean...");
View Full Code Here

Examples of org.jboss.test.cts.interfaces.CtsBmpHome

      getLog().debug("     testContainerObjects()");

      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);
         getLog().debug("OK");

         getLog().debug("Get HomeHandle..." );
         HomeHandle homeHan = home.getHomeHandle();
         assertTrue(homeHan != null);  
         getLog().debug("OK");

         getLog().debug("Get another home from the HomeHandle...");
         CtsBmpHome anotherHome = (CtsBmpHome)homeHan.getEJBHome();
         assertTrue(anotherHome != null);
         getLog().debug("OK");

         getLog().debug("Get the Meta-data object...");
         EJBMetaData md = anotherHome.getEJBMetaData();
         assertTrue(md != null);
         getLog().debug("OK");

         getLog().debug("Probe the Meta-data object:");
         String homeInterface = md.getHomeInterfaceClass().getName();
         String primaryKey = md.getPrimaryKeyClass().getName();
         String remoteInterface = md.getRemoteInterfaceClass().getName();
         getLog().debug("  Home Interface  : " + homeInterface);
         getLog().debug("  PrimaryKey      : " + primaryKey);
         getLog().debug("  Remote Interface: " + remoteInterface);
         assertTrue(homeInterface.equals("org.jboss.test.cts.interfaces.CtsBmpHome"));
         assertTrue(primaryKey.equals("org.jboss.test.cts.keys.AccountPK"));
         assertTrue(remoteInterface.equals("org.jboss.test.cts.interfaces.CtsBmp"));
         getLog().debug("Meta-data OK");

         getLog().debug("Check isSession()==false ...");
         assertTrue(!md.isSession());
         getLog().debug("OK");

         getLog().debug("Check isStatelessSession()==false ...");
         assertTrue(!md.isStatelessSession());
         getLog().debug("OK");

         getLog().debug("Test EJBHome.remove(PrimaryKey)");
         anotherHome.remove(pk);
         getLog().debug("OK");

      } catch (Exception ex) {
         getLog().error("Error in bmptest", ex);
         fail("testEjbCreate has failed!");
View Full Code Here

Examples of org.jboss.test.cts.interfaces.CtsBmpHome

   {
      getLog().debug(
         "**************************************************************");
      getLog().debug("     testUserTransaction()");
      CtsBmpHome home = getHome();
      UserTransaction ut;
      getLog().debug("Obtain UserTransaction...");
      Object o = new InitialContext().lookup("UserTransaction");
      ut = (UserTransaction)PortableRemoteObject.narrow(o, UserTransaction.class);
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.