Search in sources :

Example 16 with Adaptor

use of net.dempsy.messages.Adaptor in project Dempsy by Dempsy.

the class TestWordCount method testWordCountNoRankAdaptorOnlyNode.

@Test
public void testWordCountNoRankAdaptorOnlyNode() throws Throwable {
    try (@SuppressWarnings("resource") final SystemPropertyManager props = new SystemPropertyManager().set("min_nodes", "2")) {
        final String[][] ctxs = { // adaptor only node
        { "classpath:/word-count/adaptor-kjv.xml" }, { "classpath:/word-count/mp-word-count.xml" }, { "classpath:/word-count/mp-word-count.xml" }, { "classpath:/word-count/mp-word-count.xml" }, { "classpath:/word-count/mp-word-count.xml" }, { "classpath:/word-count/mp-word-count.xml" } };
        // the adaptor is the first one.
        final int NUM_WC = ctxs.length - 1;
        WordCounter.aliveWordsToTestPassivate.clear();
        // need to make it wait.
        WordProducer.latch = new CountDownLatch(1);
        runCombos("testWordCountNoRankMultinode", (r, c, s, t, ser) -> isElasticRoutingStrategy(r) && isContainerOkay(c), ctxs, n -> {
            final ClusterId countCId = new ClusterId(currentAppName, "test-cluster1");
            final List<NodeManagerWithContext> nodes = n.nodes;
            final NodeManager[] managers = nodes.stream().map(nm -> nm.manager).toArray(NodeManager[]::new);
            // wait until I can reach the cluster from the adaptor.
            assertTrue(poll(o -> managers[0].getRouter().allReachable("test-cluster1").size() == NUM_WC));
            WordProducer.latch.countDown();
            final WordProducer adaptor = nodes.get(0).ctx.getBean(WordProducer.class);
            waitForAllSent(adaptor);
            assertTrue(poll(o -> adaptor.done.get()));
            final var statsByNode = Arrays.asList(managers).subList(1, managers.length).stream().map(nm -> Pair.with((NodeMetricGetters) nm.getNodeStatsCollector(), (ClusterMetricGetters) nm.getClusterStatsCollector(countCId))).collect(Collectors.toList());
            final NodeMetricGetters adaptorStats = (NodeMetricGetters) managers[0].getNodeStatsCollector();
            assertTrue(poll(o -> {
                final int allDiscardedMessagesCount = allDiscardedMessagesCount(adaptorStats, castToTupleList2(statsByNode));
                return adaptor.numDispatched == allDiscardedMessagesCount + statsByNode.stream().mapToInt(sc -> (int) sc.getValue1().getDispatchedMessageCount()).sum();
            }));
        });
        final int remaining = WordCounter.aliveWordsToTestPassivate.size();
        WordCounter.aliveWordsToTestPassivate.clear();
        assertEquals(0, remaining);
    }
}
Also used : Arrays(java.util.Arrays) GZIPInputStream(java.util.zip.GZIPInputStream) BufferedInputStream(java.io.BufferedInputStream) LoggerFactory(org.slf4j.LoggerFactory) ConcurrentSet(io.netty.util.internal.ConcurrentSet) Triplet(org.javatuples.Triplet) Map(java.util.Map) ThreadingModel(net.dempsy.threading.ThreadingModel) MessageKey(net.dempsy.lifecycle.annotation.MessageKey) MessageHandler(net.dempsy.lifecycle.annotation.MessageHandler) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) Activation(net.dempsy.lifecycle.annotation.Activation) KeyExtractor(net.dempsy.lifecycle.annotation.utils.KeyExtractor) Collectors(java.util.stream.Collectors) StandardCharsets(java.nio.charset.StandardCharsets) Pair(org.javatuples.Pair) Serializable(java.io.Serializable) InvocationTargetException(java.lang.reflect.InvocationTargetException) Output(net.dempsy.lifecycle.annotation.Output) CountDownLatch(java.util.concurrent.CountDownLatch) IOUtils(org.apache.commons.io.IOUtils) List(java.util.List) Adaptor(net.dempsy.messages.Adaptor) ConditionPoll.assertTrue(net.dempsy.utils.test.ConditionPoll.assertTrue) Optional(java.util.Optional) MessageProcessor(net.dempsy.lifecycle.annotation.MessageProcessor) Mp(net.dempsy.lifecycle.annotation.Mp) MessageType(net.dempsy.lifecycle.annotation.MessageType) Dispatcher(net.dempsy.messages.Dispatcher) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) Tuple(org.javatuples.Tuple) ClusterId(net.dempsy.config.ClusterId) Before(org.junit.Before) Logger(org.slf4j.Logger) Assert.assertNotNull(org.junit.Assert.assertNotNull) NodeMetricGetters(net.dempsy.container.NodeMetricGetters) StringWriter(java.io.StringWriter) ClusterMetricGetters(net.dempsy.container.ClusterMetricGetters) SystemPropertyManager(net.dempsy.util.SystemPropertyManager) Assert.assertTrue(org.junit.Assert.assertTrue) IOException(java.io.IOException) Test(org.junit.Test) Passivation(net.dempsy.lifecycle.annotation.Passivation) ConditionPoll.poll(net.dempsy.utils.test.ConditionPoll.poll) MessageProcessorLifecycle(net.dempsy.messages.MessageProcessorLifecycle) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) InputStream(java.io.InputStream) ClusterId(net.dempsy.config.ClusterId) NodeMetricGetters(net.dempsy.container.NodeMetricGetters) CountDownLatch(java.util.concurrent.CountDownLatch) SystemPropertyManager(net.dempsy.util.SystemPropertyManager) Test(org.junit.Test)

Example 17 with Adaptor

use of net.dempsy.messages.Adaptor in project Dempsy by Dempsy.

the class TestWordCount method testWordCountWithRank.

@Test
public void testWordCountWithRank() throws Throwable {
    try (@SuppressWarnings("resource") final SystemPropertyManager props = new SystemPropertyManager().set("min_nodes", "1")) {
        final String[][] ctxs = { { "classpath:/word-count/adaptor-kjv.xml", "classpath:/word-count/mp-word-count.xml", "classpath:/word-count/mp-word-rank.xml" } };
        WordCounter.aliveWordsToTestPassivate.clear();
        // need to make it wait.
        WordProducer.latch = new CountDownLatch(1);
        runCombos("testWordCountWithRank", (r, c, s, t, ser) -> isContainerOkay(c), ctxs, n -> {
            final ClusterId countCId = new ClusterId(currentAppName, "test-cluster1");
            final ClusterId rankCId = new ClusterId(currentAppName, "test-cluster2");
            final List<NodeManagerWithContext> nodes = n.nodes;
            final NodeManager manager = nodes.get(0).manager;
            // wait until I can reach the cluster from the adaptor.
            assertTrue(poll(o -> manager.getRouter().allReachable("test-cluster1").size() == 1));
            final ClassPathXmlApplicationContext ctx = nodes.get(0).ctx;
            final WordProducer adaptor;
            WordProducer.latch.countDown();
            adaptor = ctx.getBean(WordProducer.class);
            assertTrue(poll(o -> adaptor.done.get()));
            final var statsByNode = Triplet.with((NodeMetricGetters) manager.getNodeStatsCollector(), (ClusterMetricGetters) manager.getClusterStatsCollector(countCId), (ClusterMetricGetters) manager.getClusterStatsCollector(rankCId));
            // wait until all of the counts are also passed to WordRank
            assertTrue(poll(o -> {
                final int allDiscardedMessagesCount = allDiscardedMessagesCount(null, castToTupleList3(List.of(statsByNode)));
                final ClusterMetricGetters rstat = statsByNode.getValue2();
                return adaptor.numDispatched == allDiscardedMessagesCount + rstat.getDispatchedMessageCount();
            }));
            stopSystem();
            // pull the Rank mp from the manager
            final MessageProcessorLifecycle<?> mp = AccessUtil.getMp(manager, "test-cluster2");
            @SuppressWarnings("unchecked") final WordRank prototype = ((MessageProcessor<WordRank>) mp).getPrototype();
            final List<Rank> ranks = prototype.getPairs();
            Collections.sort(ranks, (o1, o2) -> o2.rank.compareTo(o1.rank));
            final int top10OrSo = (ranks.size() < 10) ? ranks.size() : 10;
            final List<Rank> top10 = ranks.subList(0, top10OrSo);
            final String errStr = "expected the top 10 results: " + top10 + " to all be in:" + finalResults;
            top10.stream().forEach(r -> assertTrue(errStr, finalResults.contains(r.word)));
        });
        final int remaining = WordCounter.aliveWordsToTestPassivate.size();
        WordCounter.aliveWordsToTestPassivate.clear();
        assertEquals(0, remaining);
    }
}
Also used : Arrays(java.util.Arrays) GZIPInputStream(java.util.zip.GZIPInputStream) BufferedInputStream(java.io.BufferedInputStream) LoggerFactory(org.slf4j.LoggerFactory) ConcurrentSet(io.netty.util.internal.ConcurrentSet) Triplet(org.javatuples.Triplet) Map(java.util.Map) ThreadingModel(net.dempsy.threading.ThreadingModel) MessageKey(net.dempsy.lifecycle.annotation.MessageKey) MessageHandler(net.dempsy.lifecycle.annotation.MessageHandler) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) Activation(net.dempsy.lifecycle.annotation.Activation) KeyExtractor(net.dempsy.lifecycle.annotation.utils.KeyExtractor) Collectors(java.util.stream.Collectors) StandardCharsets(java.nio.charset.StandardCharsets) Pair(org.javatuples.Pair) Serializable(java.io.Serializable) InvocationTargetException(java.lang.reflect.InvocationTargetException) Output(net.dempsy.lifecycle.annotation.Output) CountDownLatch(java.util.concurrent.CountDownLatch) IOUtils(org.apache.commons.io.IOUtils) List(java.util.List) Adaptor(net.dempsy.messages.Adaptor) ConditionPoll.assertTrue(net.dempsy.utils.test.ConditionPoll.assertTrue) Optional(java.util.Optional) MessageProcessor(net.dempsy.lifecycle.annotation.MessageProcessor) Mp(net.dempsy.lifecycle.annotation.Mp) MessageType(net.dempsy.lifecycle.annotation.MessageType) Dispatcher(net.dempsy.messages.Dispatcher) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) Tuple(org.javatuples.Tuple) ClusterId(net.dempsy.config.ClusterId) Before(org.junit.Before) Logger(org.slf4j.Logger) Assert.assertNotNull(org.junit.Assert.assertNotNull) NodeMetricGetters(net.dempsy.container.NodeMetricGetters) StringWriter(java.io.StringWriter) ClusterMetricGetters(net.dempsy.container.ClusterMetricGetters) SystemPropertyManager(net.dempsy.util.SystemPropertyManager) Assert.assertTrue(org.junit.Assert.assertTrue) IOException(java.io.IOException) Test(org.junit.Test) Passivation(net.dempsy.lifecycle.annotation.Passivation) ConditionPoll.poll(net.dempsy.utils.test.ConditionPoll.poll) MessageProcessorLifecycle(net.dempsy.messages.MessageProcessorLifecycle) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) InputStream(java.io.InputStream) ClusterId(net.dempsy.config.ClusterId) MessageProcessor(net.dempsy.lifecycle.annotation.MessageProcessor) CountDownLatch(java.util.concurrent.CountDownLatch) SystemPropertyManager(net.dempsy.util.SystemPropertyManager) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ClusterMetricGetters(net.dempsy.container.ClusterMetricGetters) Test(org.junit.Test)

Example 18 with Adaptor

use of net.dempsy.messages.Adaptor in project Dempsy by Dempsy.

the class TestContainer method testMessageDispatch.

@Test
public void testMessageDispatch() throws Exception {
    cache = new ConcurrentHashMap<>();
    final TestAdaptor adaptor = context.getBean(TestAdaptor.class);
    assertNotNull(adaptor.dispatcher);
    adaptor.dispatcher.dispatchAnnotated(new ContainerTestMessage("foo"));
    assertTrue(poll(o -> container.getProcessorCount() > 0));
    Thread.sleep(100);
    assertEquals("did not create MP", 1, container.getProcessorCount());
    assertTrue(poll(cache, c -> c.get("foo") != null));
    final TestProcessor mp = cache.get("foo");
    assertNotNull("MP not associated with expected key", mp);
    assertEquals("activation count, 1st message", 1, mp.activationCount);
    assertEquals("invocation count, 1st message", 1, mp.invocationCount);
    adaptor.dispatcher.dispatchAnnotated(new ContainerTestMessage("foo"));
    assertTrue(poll(mp, o -> o.invocationCount > 1));
    Thread.sleep(100);
    assertEquals("activation count, 2nd message", 1, mp.activationCount);
    assertEquals("invocation count, 2nd message", 2, mp.invocationCount);
}
Also used : Arrays(java.util.Arrays) Node(net.dempsy.config.Node) NodeManager(net.dempsy.NodeManager) ContainerTestMessage(net.dempsy.container.mocks.ContainerTestMessage) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) After(org.junit.After) Parameterized(org.junit.runners.Parameterized) MessageKey(net.dempsy.lifecycle.annotation.MessageKey) MessageHandler(net.dempsy.lifecycle.annotation.MessageHandler) Collection(java.util.Collection) Operation(net.dempsy.container.Container.Operation) Functional.uncheck(net.dempsy.util.Functional.uncheck) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) Activation(net.dempsy.lifecycle.annotation.Activation) KeyExtractor(net.dempsy.lifecycle.annotation.utils.KeyExtractor) LockingContainer(net.dempsy.container.locking.LockingContainer) OutputMessage(net.dempsy.container.mocks.OutputMessage) Output(net.dempsy.lifecycle.annotation.Output) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Adaptor(net.dempsy.messages.Adaptor) AccessUtil.canReach(net.dempsy.AccessUtil.canReach) Start(net.dempsy.lifecycle.annotation.Start) Assert.assertFalse(org.junit.Assert.assertFalse) Evictable(net.dempsy.lifecycle.annotation.Evictable) MessageProcessor(net.dempsy.lifecycle.annotation.MessageProcessor) AccessUtil.getRouter(net.dempsy.AccessUtil.getRouter) Mp(net.dempsy.lifecycle.annotation.Mp) BlockingQueueReceiver(net.dempsy.transport.blockingqueue.BlockingQueueReceiver) NonLockingAltContainer(net.dempsy.container.altnonlocking.NonLockingAltContainer) MessageType(net.dempsy.lifecycle.annotation.MessageType) Dispatcher(net.dempsy.messages.Dispatcher) KeyedMessageWithType(net.dempsy.messages.KeyedMessageWithType) RunWith(org.junit.runner.RunWith) Parameters(org.junit.runners.Parameterized.Parameters) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) DempsyException(net.dempsy.DempsyException) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) BasicNodeStatsCollector(net.dempsy.monitoring.basic.BasicNodeStatsCollector) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ClusterId(net.dempsy.config.ClusterId) Before(org.junit.Before) LocalClusterSessionFactory(net.dempsy.cluster.local.LocalClusterSessionFactory) Functional.recheck(net.dempsy.util.Functional.recheck) Iterator(java.util.Iterator) Assert.assertNotNull(org.junit.Assert.assertNotNull) KeyedMessage(net.dempsy.messages.KeyedMessage) SystemPropertyManager(net.dempsy.util.SystemPropertyManager) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Passivation(net.dempsy.lifecycle.annotation.Passivation) AtomicLong(java.util.concurrent.atomic.AtomicLong) ClusterStatsCollector(net.dempsy.monitoring.ClusterStatsCollector) ConditionPoll.poll(net.dempsy.utils.test.ConditionPoll.poll) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) ContainerTestMessage(net.dempsy.container.mocks.ContainerTestMessage) Test(org.junit.Test)

Example 19 with Adaptor

use of net.dempsy.messages.Adaptor in project Dempsy by Dempsy.

the class TestContainer method testEvictable.

@Test
public void testEvictable() throws Exception {
    final TestProcessor mp = createAndGet("foo");
    final TestProcessor prototype = context.getBean(TestProcessor.class);
    final int tmpCloneCount = prototype.cloneCount.intValue();
    mp.evict.set(true);
    container.evict();
    final TestAdaptor adaptor = context.getBean(TestAdaptor.class);
    adaptor.dispatcher.dispatchAnnotated(new ContainerTestMessage("foo"));
    assertTrue(poll(o -> prototype.cloneCount.intValue() > tmpCloneCount));
    Thread.sleep(1000);
    assertEquals("Clone count, 2nd message", tmpCloneCount + 1, prototype.cloneCount.intValue());
}
Also used : Arrays(java.util.Arrays) Node(net.dempsy.config.Node) NodeManager(net.dempsy.NodeManager) ContainerTestMessage(net.dempsy.container.mocks.ContainerTestMessage) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) After(org.junit.After) Parameterized(org.junit.runners.Parameterized) MessageKey(net.dempsy.lifecycle.annotation.MessageKey) MessageHandler(net.dempsy.lifecycle.annotation.MessageHandler) Collection(java.util.Collection) Operation(net.dempsy.container.Container.Operation) Functional.uncheck(net.dempsy.util.Functional.uncheck) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) Activation(net.dempsy.lifecycle.annotation.Activation) KeyExtractor(net.dempsy.lifecycle.annotation.utils.KeyExtractor) LockingContainer(net.dempsy.container.locking.LockingContainer) OutputMessage(net.dempsy.container.mocks.OutputMessage) Output(net.dempsy.lifecycle.annotation.Output) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Adaptor(net.dempsy.messages.Adaptor) AccessUtil.canReach(net.dempsy.AccessUtil.canReach) Start(net.dempsy.lifecycle.annotation.Start) Assert.assertFalse(org.junit.Assert.assertFalse) Evictable(net.dempsy.lifecycle.annotation.Evictable) MessageProcessor(net.dempsy.lifecycle.annotation.MessageProcessor) AccessUtil.getRouter(net.dempsy.AccessUtil.getRouter) Mp(net.dempsy.lifecycle.annotation.Mp) BlockingQueueReceiver(net.dempsy.transport.blockingqueue.BlockingQueueReceiver) NonLockingAltContainer(net.dempsy.container.altnonlocking.NonLockingAltContainer) MessageType(net.dempsy.lifecycle.annotation.MessageType) Dispatcher(net.dempsy.messages.Dispatcher) KeyedMessageWithType(net.dempsy.messages.KeyedMessageWithType) RunWith(org.junit.runner.RunWith) Parameters(org.junit.runners.Parameterized.Parameters) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) DempsyException(net.dempsy.DempsyException) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) BasicNodeStatsCollector(net.dempsy.monitoring.basic.BasicNodeStatsCollector) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ClusterId(net.dempsy.config.ClusterId) Before(org.junit.Before) LocalClusterSessionFactory(net.dempsy.cluster.local.LocalClusterSessionFactory) Functional.recheck(net.dempsy.util.Functional.recheck) Iterator(java.util.Iterator) Assert.assertNotNull(org.junit.Assert.assertNotNull) KeyedMessage(net.dempsy.messages.KeyedMessage) SystemPropertyManager(net.dempsy.util.SystemPropertyManager) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Passivation(net.dempsy.lifecycle.annotation.Passivation) AtomicLong(java.util.concurrent.atomic.AtomicLong) ClusterStatsCollector(net.dempsy.monitoring.ClusterStatsCollector) ConditionPoll.poll(net.dempsy.utils.test.ConditionPoll.poll) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) ContainerTestMessage(net.dempsy.container.mocks.ContainerTestMessage) Test(org.junit.Test)

Example 20 with Adaptor

use of net.dempsy.messages.Adaptor in project Dempsy by Dempsy.

the class TestContainer method testEvictableWithBusyMp.

@Test
public void testEvictableWithBusyMp() throws Throwable {
    final TestProcessor mp = createAndGet("foo");
    // now we're going to cause the processing to be held up.
    mp.latch = new CountDownLatch(1);
    // allow eviction
    mp.evict.set(true);
    // sending it a message will now cause it to hang up while processing
    final TestAdaptor adaptor = context.getBean(TestAdaptor.class);
    adaptor.dispatcher.dispatchAnnotated(new ContainerTestMessage("foo"));
    final TestProcessor prototype = context.getBean(TestProcessor.class);
    // keep track of the cloneCount for later checking
    final int tmpCloneCount = prototype.cloneCount.intValue();
    // invocation count should go to 2
    assertTrue(poll(mp, o -> o.invocationCount == 2));
    // now kick off the evict in a separate thread since we expect it to hang
    // until the mp becomes unstuck.
    // this will allow us to see the evict pass complete
    final AtomicBoolean evictIsComplete = new AtomicBoolean(false);
    final Thread thread = new Thread(new Runnable() {

        @Override
        public void run() {
            container.evict();
            evictIsComplete.set(true);
        }
    });
    thread.start();
    // now check to make sure eviction doesn't complete.
    // just a little to give any mistakes a change to work themselves through
    Thread.sleep(100);
    // make sure eviction didn't finish
    assertFalse(evictIsComplete.get());
    // this lets it go
    mp.latch.countDown();
    // wait until the eviction completes
    assertTrue(poll(evictIsComplete, o -> o.get()));
    Thread.sleep(100);
    assertEquals("activation count, 2nd message", 1, mp.activationCount);
    assertEquals("invocation count, 2nd message", 2, mp.invocationCount);
    adaptor.dispatcher.dispatchAnnotated(new ContainerTestMessage("foo"));
    assertTrue(poll(o -> prototype.cloneCount.intValue() > tmpCloneCount));
    Thread.sleep(1000);
    assertEquals("Clone count, 2nd message", tmpCloneCount + 1, prototype.cloneCount.intValue());
}
Also used : Arrays(java.util.Arrays) Node(net.dempsy.config.Node) NodeManager(net.dempsy.NodeManager) ContainerTestMessage(net.dempsy.container.mocks.ContainerTestMessage) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) After(org.junit.After) Parameterized(org.junit.runners.Parameterized) MessageKey(net.dempsy.lifecycle.annotation.MessageKey) MessageHandler(net.dempsy.lifecycle.annotation.MessageHandler) Collection(java.util.Collection) Operation(net.dempsy.container.Container.Operation) Functional.uncheck(net.dempsy.util.Functional.uncheck) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) Activation(net.dempsy.lifecycle.annotation.Activation) KeyExtractor(net.dempsy.lifecycle.annotation.utils.KeyExtractor) LockingContainer(net.dempsy.container.locking.LockingContainer) OutputMessage(net.dempsy.container.mocks.OutputMessage) Output(net.dempsy.lifecycle.annotation.Output) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Adaptor(net.dempsy.messages.Adaptor) AccessUtil.canReach(net.dempsy.AccessUtil.canReach) Start(net.dempsy.lifecycle.annotation.Start) Assert.assertFalse(org.junit.Assert.assertFalse) Evictable(net.dempsy.lifecycle.annotation.Evictable) MessageProcessor(net.dempsy.lifecycle.annotation.MessageProcessor) AccessUtil.getRouter(net.dempsy.AccessUtil.getRouter) Mp(net.dempsy.lifecycle.annotation.Mp) BlockingQueueReceiver(net.dempsy.transport.blockingqueue.BlockingQueueReceiver) NonLockingAltContainer(net.dempsy.container.altnonlocking.NonLockingAltContainer) MessageType(net.dempsy.lifecycle.annotation.MessageType) Dispatcher(net.dempsy.messages.Dispatcher) KeyedMessageWithType(net.dempsy.messages.KeyedMessageWithType) RunWith(org.junit.runner.RunWith) Parameters(org.junit.runners.Parameterized.Parameters) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) DempsyException(net.dempsy.DempsyException) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) BasicNodeStatsCollector(net.dempsy.monitoring.basic.BasicNodeStatsCollector) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ClusterId(net.dempsy.config.ClusterId) Before(org.junit.Before) LocalClusterSessionFactory(net.dempsy.cluster.local.LocalClusterSessionFactory) Functional.recheck(net.dempsy.util.Functional.recheck) Iterator(java.util.Iterator) Assert.assertNotNull(org.junit.Assert.assertNotNull) KeyedMessage(net.dempsy.messages.KeyedMessage) SystemPropertyManager(net.dempsy.util.SystemPropertyManager) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Passivation(net.dempsy.lifecycle.annotation.Passivation) AtomicLong(java.util.concurrent.atomic.AtomicLong) ClusterStatsCollector(net.dempsy.monitoring.ClusterStatsCollector) ConditionPoll.poll(net.dempsy.utils.test.ConditionPoll.poll) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) ContainerTestMessage(net.dempsy.container.mocks.ContainerTestMessage) CountDownLatch(java.util.concurrent.CountDownLatch) Test(org.junit.Test)

Aggregations

Adaptor (net.dempsy.messages.Adaptor)23 Dispatcher (net.dempsy.messages.Dispatcher)22 Test (org.junit.Test)22 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)21 Assert.assertTrue (org.junit.Assert.assertTrue)21 List (java.util.List)20 MessageHandler (net.dempsy.lifecycle.annotation.MessageHandler)20 MessageKey (net.dempsy.lifecycle.annotation.MessageKey)20 MessageType (net.dempsy.lifecycle.annotation.MessageType)20 Mp (net.dempsy.lifecycle.annotation.Mp)20 Assert.assertEquals (org.junit.Assert.assertEquals)20 ArrayList (java.util.ArrayList)19 Set (java.util.Set)19 ClusterId (net.dempsy.config.ClusterId)19 Activation (net.dempsy.lifecycle.annotation.Activation)19 ConditionPoll.poll (net.dempsy.utils.test.ConditionPoll.poll)19 Collections (java.util.Collections)18 Map (java.util.Map)18 MessageProcessor (net.dempsy.lifecycle.annotation.MessageProcessor)18 KeyExtractor (net.dempsy.lifecycle.annotation.utils.KeyExtractor)18