Examples of increment()


Examples of org.jboss.as.test.clustering.cluster.ejb3.deployment.ClusteredBean.increment()

    public void testAnnotationBasedClusteredBeanDeployment() throws Exception {
        final Context ctx = new InitialContext();
        final ClusteredBean clusteredBean = (ClusteredBean) ctx.lookup("java:module/" + ClusteredBean.class.getSimpleName() + "!" + ClusteredBean.class.getName());
        final int NUM_TIMES = 5;
        for (int i = 0; i < NUM_TIMES; i++) {
            clusteredBean.increment();
        }
        Assert.assertEquals("Unexpected count on stateful bean", clusteredBean.getCount(), NUM_TIMES);
    }

}
View Full Code Here

Examples of org.jboss.as.test.clustering.cluster.ejb3.deployment.DDBasedClusteredBean.increment()

    public void testDDBasedClusteredBeanDeployment() throws Exception {
        final Context ctx = new InitialContext();
        final DDBasedClusteredBean ddBasedClusteredBean = (DDBasedClusteredBean) ctx.lookup("java:module/" + DDBasedClusteredBean.class.getSimpleName() + "!" + DDBasedClusteredBean.class.getName());
        final int NUM_TIMES = 5;
        for (int i = 0; i < NUM_TIMES; i++) {
            ddBasedClusteredBean.increment();
        }
        Assert.assertEquals("Unexpected count on stateful bean", ddBasedClusteredBean.getCount(), NUM_TIMES);
    }

    /**
 
View Full Code Here

Examples of org.jboss.as.test.clustering.cluster.ejb3.stateful.remote.failover.RemoteCounter.increment()

        try {
            final RemoteCounter remoteCounter = context.lookupStateful(DDBasedClusteredSFSB.class, RemoteCounter.class);
            // invoke on the bean a few times
            final int NUM_TIMES = 25;
            for (int i = 0; i < NUM_TIMES; i++) {
                final CounterResult result = remoteCounter.increment();
                logger.info("Counter incremented to " + result.getCount() + " on node " + result.getNodeName());
            }
            final CounterResult result = remoteCounter.getCount();
            Assert.assertNotNull("Result from remote stateful counter was null", result);
            Assert.assertEquals("Unexpected count from remote counter", NUM_TIMES, result.getCount());
View Full Code Here

Examples of org.jboss.cache.optimistic.DefaultDataVersion.increment()

   }

   public void testPropagationOfDefaultVersions() throws Exception
   {
      DefaultDataVersion expected = new DefaultDataVersion();
      expected = (DefaultDataVersion) expected.increment();

      cache[0].put(fqn, key, "value");

      assertEquals("value", cache[0].get(fqn, key));
      assertEquals("value", cache[1].get(fqn, key));
View Full Code Here

Examples of org.jboss.messaging.core.impl.DeliveringCounter.increment()

      assertEquals(DeliveringCounter.LEVEL_NONE, counter.getLevel());
      Message[] mids = new Message[1000];
      for (int i = 0; i < 1000; i++)
      {
         Message m = CoreMessageFactory.createCoreMessage(i);
         counter.increment(m);
         mids[i] = m;
      }
      assertEquals(0, counter.get());
      for (int i = 0; i < 49; i++) {
         counter.decrement(mids[i]);
View Full Code Here

Examples of org.jboss.test.cluster.ejb3.clusteredsession.StatefulRemote.increment()

     
      stateful.setName("The Code");
      NodeAnswer node1 = stateful.getNodeState();
      getLog ().debug ("Node 1 ID: " +node1);

      assertEquals("Counter: ", 1, stateful.increment());
      assertEquals("Counter: ", 2, stateful.increment());
     
      sleep_(10100);

      // Now we switch to the other node, simulating a failure on node 1
View Full Code Here

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

      // 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
View Full Code Here

Examples of org.jboss.test.cluster.ejb3.stateful.nested.base.std.ParentStatefulRemote.increment()

      ParentStatefulRemote stateful = beanSet.parent;
      VMID node1 = stateful.getVMID();
      assertNotNull("State node: ", node1);
      getLog ().debug ("Node 1 ID: " +node1);

      assertEquals("Counter: ", 1, stateful.increment());
      assertEquals("Counter: ", 2, stateful.increment());
      sleep(300);

      // Now we switch to the other node, simulating a failure on node 1
      stateful.setUpFailover("once");
View Full Code Here

Examples of org.jboss.test.ejb3.war.deployment.Counter.increment()

   public void testEjbDeploymentInWar() throws Exception
   {
      Context ctx = new InitialContext();
      Counter counter = (Counter) ctx.lookup("CounterDelegateBean/remote");

      int count = counter.increment();
      assertEquals("Unexpected count after increment", 1, count);

      // increment one more time
      count = counter.increment();
      assertEquals("Unexpected count after second increment", 2, count);
View Full Code Here

Examples of org.jdk8.backport.LongAdder.increment()

                @Override public Object call() throws Exception {
                    for (int i = 0; i < loops; i++) {
                        exec.submit(new Callable<Void>() {
                            @Override
                            public Void call() throws Exception {
                                sum.increment();

                                return null;
                            }
                        });
                    }
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.