Package org.jboss.test.cmp2.audit.interfaces

Examples of org.jboss.test.cmp2.audit.interfaces.AuditSession


    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

    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)
        {
            throw new EJBException(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();
View Full Code Here

      try
      {
         beginTx();
         ALocalHome ah = AUtil.getLocalHome();
         ALocal a = ah.create(id);
         a.setIntField(1);
         commitTx();
         long lastUpdated = System.currentTimeMillis();

         checkAge(lastUpdated);
         assertValue(id, 1);

         checkAge(lastUpdated);
         jdbcUpdate(id, 2);

         checkAge(lastUpdated);
         assertValue(id, 1);

         sleepUntilEvicted();
         long lastEvicted = cacheListener.lastEvicted;
         assertValue(id, 2);

         // test ejb update
         try
         {
            Thread.sleep(1000);
         }
         catch(InterruptedException e)
         {
            e.printStackTrace();
         }

         beginTx();
         a = ah.findByPrimaryKey(id);
         a.setIntField(3);
         commitTx();

         sleepUntilEvicted();
         assertTrue(cacheListener.lastEvicted - lastEvicted >= maxAgeMs + 1000);
      }
View Full Code Here

   {
      beginTx();
      try
      {
         ALocalHome ah = AUtil.getLocalHome();
         ALocal a = ah.findByPrimaryKey(id);
         assertEquals(value, a.getIntField());
      }
      finally
      {
         commitTx();
      }
View Full Code Here

      String id = "a1";

      try
      {
         beginTx();
         ALocalHome ah = AUtil.getLocalHome();
         ALocal a = ah.create(id);
         a.setIntField(1);
         commitTx();
         long lastUpdated = System.currentTimeMillis();

         checkAge(lastUpdated);
         assertValue(id, 1);

         checkAge(lastUpdated);
         jdbcUpdate(id, 2);

         checkAge(lastUpdated);
         assertValue(id, 1);

         sleepUntilEvicted();
         long lastEvicted = cacheListener.lastEvicted;
         assertValue(id, 2);

         // test ejb update
         try
         {
            Thread.sleep(1000);
         }
         catch(InterruptedException e)
         {
            e.printStackTrace();
         }

         beginTx();
         a = ah.findByPrimaryKey(id);
         a.setIntField(3);
         commitTx();

         sleepUntilEvicted();
         assertTrue(cacheListener.lastEvicted - lastEvicted >= maxAgeMs + 1000);
View Full Code Here

TOP

Related Classes of org.jboss.test.cmp2.audit.interfaces.AuditSession

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.