org.distributeme.test.concurrencycontrol.TestRun Maven / Gradle / Ivy
package org.distributeme.test.concurrencycontrol;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
import org.distributeme.core.ServiceLocator;
import org.distributeme.core.exception.DistributemeRuntimeException;
public class TestRun {
public static final int THREADS = 10;
private static final CountDownLatch ready = new CountDownLatch(THREADS);
private static final CountDownLatch start = new CountDownLatch(1);
private static final CountDownLatch finish = new CountDownLatch(THREADS);
static long tsuccesses, ttotals;
public static void test(final int limit, final Method method) throws Exception{
tsuccesses = ttotals = 0;
System.out.println("STARTING ");
final TestService service = ServiceLocator.getRemote(TestService.class);
for (int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy