Examples of NestedStateful


Examples of org.jboss.test.cluster.ejb3.stateful.nested.base.std.NestedStateful

      // Reset the parent to clean things up
      parent.reset();
      parentInv++;
      nestedInv++;
     
      NestedStateful nested = (NestedStateful) parent.getNested();
      parentInv++;
      runner.addRemovable(nested);
     
      NestedBeanSet beanSet = runner.getNestedBeanSet();
     
      int attempts = 0;
      while (beanSet.parent.getVMID().equals(beanSet.nested.getVMID()))
      {
         if (++attempts == 20)
         {
            System.err.println("Unable to obtain nested bean running on separate VM from parent");
            log.warn("Unable to obtain nested bean running on separate VM from parent");
            return;
         }
         beanSet = runner.getNestedBeanSet();
      }

      // Exercise the beans, trigger replication
      assertEquals("Remote counter: ", 1, parent.increment());
      parentInv++;
      nestedInv++;
      assertEquals("Remote counter: ", 2, parent.increment());
      parentInv++;
      nestedInv++;
      assertEquals("Local counter: ", 1, parent.incrementLocal());
      parentInv++;
      assertEquals("Local counter: ", 2, parent.incrementLocal());
      parentInv++;
     
      // This call activates the nested bean without triggering the @PrePassivate
      // callback at the end of the call because of the way the bean
      // implements Optimized
      nested.getPrePassivate();
     
      // Passivate. The nested bean will get the @PrePassivate callback since
      // the previous call activated it
      sleep(runner.getSleepTime());
     
View Full Code Here

Examples of org.jboss.test.cluster.ejb3.stateful.nested.base.std.NestedStateful

      getLog().debug("Running testDependentLifecycle()");
      getLog().debug("==================================");
     
      NestedBeanSet beanSet = getNestedBeanSet();
      ParentStatefulRemote parent = beanSet.parent;
      NestedStateful nested = beanSet.nested;
      NestedBeanMonitor monitor = beanSet.monitor;
     
      Assert.assertEquals("Remote counter (via parent): ", 1, parent.increment())
     
      String deepId = monitor.getDeepNestedId();
      Assert.assertNotNull("Got a deepId", deepId);
      Assert.assertFalse("Got a non-ERROR deepId", "ERROR".equals(deepId));
      String localDeepId = monitor.getLocalDeepNestedId();
      Assert.assertNotNull("Got a localDeepId", localDeepId);
      Assert.assertFalse("Got a non-ERROR localDeepId", "ERROR".equals(localDeepId));
      
      removeBean(parent);
      
      // Confirm parent is dead
      Assert.assertEquals("Remote counter (via dead parent): ", -1, monitor.incrementParent());
      Assert.assertFalse("parent.remove() fails", monitor.removeParent());
     
      // Confirm nested beans still work following parent remove
      Assert.assertEquals("Remote counter (direct):", 2 ,nested.increment());     
      Assert.assertEquals("Local counter (monitor):", 1 , monitor.incrementLocalNested());
      Assert.assertEquals("Deep nested id", deepId, monitor.getDeepNestedId());
      Assert.assertEquals("Local deep nested id", localDeepId, monitor.getLocalDeepNestedId());
     
      // Remove the bottom tier
      Assert.assertTrue("Local deep nested removed", monitor.removeLocalDeepNested());
     
      // Confirm it is dead
      Assert.assertEquals("Local deep nested removed", "ERROR", monitor.getLocalDeepNestedId());
      Assert.assertFalse("localDeepNested.remove() fails", monitor.removeLocalDeepNested());
     
      // Confirm other beans still work following parent remove
      Assert.assertEquals("Remote counter (direct):", 3 ,nested.increment());     
      Assert.assertEquals("Local counter (monitor):", 2 , monitor.incrementLocalNested());
      Assert.assertEquals("Deep nested id", deepId, monitor.getDeepNestedId());
     
      // Remove the nested bean
      removeBean(nested);
View Full Code Here

Examples of org.jboss.test.cluster.ejb3.stateful.nested.base.std.NestedStateful

      getLog().debug("==================================");
     
      NestedBeanSet beanSet = getNestedBeanSet();
      NestedBeanMonitor monitor = beanSet.monitor;
      ParentStatefulRemote parent = beanSet.parent;
      NestedStateful nested = beanSet.nested;
     
      int parentInv = beanSet.parentInvocations; // 2
      int nestedInv = beanSet.nestedInvocations; // 1

//    Assert.assertEquals("Remote counter: ", 1, parent.increment());
View Full Code Here

Examples of org.jboss.test.cluster.ejb3.stateful.nested.base.std.NestedStateful

      // Reset the parent to clean things up
      parent.reset();
      parentInv++;
      nestedInv++;
     
      NestedStateful nested = (NestedStateful) parent.getNested();
      parentInv++;
      addRemovable(nested);
     
      NestedBeanSet result = new NestedBeanSet();
      result.monitor = monitor;
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.