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

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

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

      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

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

      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

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

      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.keys.AccountPK

      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.keys.AccountPK

      */
      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);
      oos.writeObject(beanHandle);
View Full Code Here

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

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