Package org.jboss.test.cmp2.optimisticlock.bug1006723.testentity

Examples of org.jboss.test.cmp2.optimisticlock.bug1006723.testentity.EntityALocal


      CMRBugManagerEJBHome home = (CMRBugManagerEJBHome)
         PortableRemoteObject.narrow(ref, CMRBugManagerEJBHome.class);

      getLog().debug("creating CMRBugManagerEJB");
      CMRBugManagerEJB cmrBugManager = home.create();
      getLog().debug("created CMRBugManagerEJB");

      SortedMap cmrBugs = new TreeMap();
      cmrBugs.put("1", "one");
      cmrBugs.put("1.1", "one.one");
      cmrBugs.put("1.2", "one.two");
      cmrBugs.put("1.3", "one.three");

      getLog().debug("creating " + cmrBugs.size() + " CMR bugs");
      cmrBugManager.createCMRBugs(cmrBugs);
      getLog().debug("created " + cmrBugs.size() + " CMR bugs");

      Iterator i = cmrBugs.entrySet().iterator();
      while(i.hasNext())
      {
         Map.Entry entry = (Map.Entry)i.next();

         String[] parentIdAndDescription =
            cmrBugManager.getParentFor((String)entry.getKey());
         if(!entry.getKey().equals("1"))
         {
            assertTrue("Child has not Parent! cmr post create updates NOT WRITTEN! " + entry.getKey(),
               parentIdAndDescription != null);
         } // end of if ()
View Full Code Here


    */
   public void testLoadFKState() throws Exception
   {
      Object ref = getInitialContext().lookup("CMRBugManager");
      CMRBugManagerEJBHome home = (CMRBugManagerEJBHome)PortableRemoteObject.narrow(ref, CMRBugManagerEJBHome.class);
      CMRBugManagerEJB manager = home.create();

      try
      {
         // create bugs
         manager.setupLoadFKState();

         // update
         manager.moveLastNodeBack();

         // check results
         assertTrue("The last element is the last in the chain.", !manager.lastHasNextNode());
      }
      finally
      {
         manager.tearDownLoadFKState();
      }
   }
View Full Code Here

   {
      getLog().debug("looking up CMRBugManager");
      Object ref = getInitialContext().lookup("CMRBugManager");
      getLog().debug("found CMRBugManager");

      CMRBugManagerEJBHome home = (CMRBugManagerEJBHome)
         PortableRemoteObject.narrow(ref, CMRBugManagerEJBHome.class);

      getLog().debug("creating CMRBugManagerEJB");
      CMRBugManagerEJB cmrBugManager = home.create();
      getLog().debug("created CMRBugManagerEJB");

      SortedMap cmrBugs = new TreeMap();
      cmrBugs.put("1", "one");
      cmrBugs.put("1.1", "one.one");
View Full Code Here

    * loaded is not a valid (stale) value, i.e. the relationship was already changed in the tx.
    */
   public void testLoadFKState() throws Exception
   {
      Object ref = getInitialContext().lookup("CMRBugManager");
      CMRBugManagerEJBHome home = (CMRBugManagerEJBHome)PortableRemoteObject.narrow(ref, CMRBugManagerEJBHome.class);
      CMRBugManagerEJB manager = home.create();

      try
      {
         // create bugs
         manager.setupLoadFKState();
View Full Code Here

        InitialContext ctx = getInitialContext();
        Object obj = ctx.lookup("cmrTransactionTest/TreeFacadeRemote");
        TreeFacadeHome home = (TreeFacadeHome)
                PortableRemoteObject.narrow(obj, TreeFacadeHome.class);
        TreeFacade facade = home.create();
        facade.setup();
        facade.createNodes();

        int waitTime = 0;

        CMRTransactionThread rearrange = new CMRTransactionThread(facade);
        rearrange.start();
View Full Code Here

    public void testCMRTransaction() throws Exception
    {

        InitialContext ctx = getInitialContext();
        Object obj = ctx.lookup("cmrTransactionTest/TreeFacadeRemote");
        TreeFacadeHome home = (TreeFacadeHome)
                PortableRemoteObject.narrow(obj, TreeFacadeHome.class);
        TreeFacade facade = home.create();
        facade.setup();
        facade.createNodes();

        int waitTime = 0;
View Full Code Here

    public void setup()
    {
        try
        {
            TreeLocalHome tlh = getTreeLocalHome();
            TreeLocal tl = null;
            try
            {
                tl = tlh.findByPrimaryKey("Parent");
                tl.remove();
            }
            catch (ObjectNotFoundException f) {}
            try
            {
                tl = tlh.findByPrimaryKey("Child 1");
                tl.remove();
            }
            catch (ObjectNotFoundException f) {}
            try
            {
                tl = tlh.findByPrimaryKey("Child 2");
                tl.remove();
            }
            catch (ObjectNotFoundException f) {}
        }
        catch (NamingException n)
        {
View Full Code Here

    public void createNodes()
    {
        try
        {
            TreeLocalHome tlh = getTreeLocalHome();
            TreeLocal parent = null;
            parent = tlh.create("Parent", null);
            tlh.create("Child 1", parent);
            tlh.create("Child 2", null);
        }
        catch (NamingException n)
View Full Code Here

    public void rearrangeNodes()
    {
        try
        {
            TreeLocalHome tlh = getTreeLocalHome();
            TreeLocal target = tlh.findByPrimaryKey("Child 2");
            TreeLocal sibling = null;
            sibling = tlh.findByPrimaryKey("Child 1");
            /*
            TreeLocal parent = tlh.findByPrimaryKey("Parent");
            Collection coll = parent.getMenuChildren();
            Iterator iter = coll.iterator();
            sibling = (TreeLocal) iter.next();
            */
            target.setMenuParent(sibling.getMenuParent());
            target.setPrecededBy(sibling);
        }
        catch (NamingException n)
        {
            throw new EJBException(n);
View Full Code Here

    public void setup()
    {
        try
        {
            TreeLocalHome tlh = getTreeLocalHome();
            TreeLocal tl = null;
            try
            {
                tl = tlh.findByPrimaryKey("Parent");
                tl.remove();
            }
            catch (ObjectNotFoundException f) {}
            try
            {
                tl = tlh.findByPrimaryKey("Child 1");
                tl.remove();
            }
            catch (ObjectNotFoundException f) {}
            try
            {
                tl = tlh.findByPrimaryKey("Child 2");
                tl.remove();
            }
            catch (ObjectNotFoundException f) {}
        }
        catch (NamingException n)
View Full Code Here

TOP

Related Classes of org.jboss.test.cmp2.optimisticlock.bug1006723.testentity.EntityALocal

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.