Search in sources :

Example 1 with SystemPropertyManager

use of net.dempsy.utils.test.SystemPropertyManager in project Dempsy by Dempsy.

the class DempsyBaseTest method runCombos.

protected void runCombos(final String testName, final ComboFilter filter, final String[][] ctxs, final String[][][] perNodeProps, final TestToRun test) throws Exception {
    if (filter != null && !filter.filter(routerId, containerId, sessionType, transportType, serializerType))
        return;
    final long comboSequence = runComboSequence.getAndIncrement();
    currentAppName = testName + "-" + comboSequence;
    LOGGER.info("=====================================================================================");
    LOGGER.info("======== Running (" + comboSequence + ") " + testName + " with " + routerId + ", " + containerId + ", " + sessionType + ", " + threadingModelDescription + ", " + transportType + "/" + serializerType);
    try (final ServiceTracker tr = new ServiceTracker()) {
        currentlyTracking = tr;
        tr.track(new SystemPropertyManager()).set("routing-strategy", ROUTER_ID_PREFIX + routerId).set("container-type", CONTAINER_ID_PREFIX + containerId).set("test-name", currentAppName).setIfAbsent("total_shards", Integer.toString(NUM_MICROSHARDS));
        // instantiate session factory
        final ClusterInfoSessionFactory sessFact = tr.track(new ClassPathXmlApplicationContext(COLLAB_CTX_PREFIX + sessionType + COLLAB_CTX_SUFFIX)).getBean(ClusterInfoSessionFactory.class);
        currentSessionFactory = sessFact;
        final List<NodeManagerWithContext> reverseCpCtxs = reverseRange(0, ctxs.length).mapToObj(i -> {
            try (final SystemPropertyManager p2 = new SystemPropertyManager()) {
                if (perNodeProps != null && perNodeProps[i] != null) {
                    for (final String[] kv : perNodeProps[i]) {
                        if (kv != null) {
                            if (kv.length != 2)
                                throw new IllegalArgumentException("Invalid KV Pair passed for per-node property");
                            p2.set(kv[0], kv[1]);
                        }
                    }
                }
                final NodeManagerWithContext ret = makeNode(ctxs[i]);
                // we can only do this level of polling when the min_nodes isn't set or is set to 1.
                final String minNodesProp = System.getProperty("min_nodes");
                if (minNodesProp != null && Integer.parseInt(minNodesProp) == 1)
                    assertTrue(qpoll(ret, o -> o.manager.isReady()));
                return ret;
            }
        }).collect(Collectors.toList());
        final List<NodeManagerWithContext> cpCtxs = reverseRange(0, reverseCpCtxs.size()).mapToObj(i -> reverseCpCtxs.get(i)).collect(Collectors.toList());
        for (final NodeManagerWithContext n : cpCtxs) assertTrue(poll(o -> n.manager.isReady()));
        test.test(new Nodes(cpCtxs, sessFact));
        currentlyTracking = null;
    } finally {
        LocalClusterSessionFactory.completeReset();
        BlockingQueueAddress.completeReset();
        ClassTracker.dumpResults();
    }
}
Also used : BlockingQueueAddress(net.dempsy.transport.blockingqueue.BlockingQueueAddress) Arrays(java.util.Arrays) Node(net.dempsy.config.Node) DefaultThreadingModel(net.dempsy.threading.DefaultThreadingModel) RunWith(org.junit.runner.RunWith) Parameters(org.junit.runners.Parameterized.Parameters) SystemPropertyManager(net.dempsy.utils.test.SystemPropertyManager) Function(java.util.function.Function) ArrayList(java.util.ArrayList) ThreadingModel(net.dempsy.threading.ThreadingModel) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) Parameterized(org.junit.runners.Parameterized) LocalClusterSessionFactory(net.dempsy.cluster.local.LocalClusterSessionFactory) Cluster(net.dempsy.config.Cluster) Logger(org.slf4j.Logger) ClassTracker(net.dempsy.serialization.util.ClassTracker) ClusterInfoSessionFactory(net.dempsy.cluster.ClusterInfoSessionFactory) Collection(java.util.Collection) Functional.uncheck(net.dempsy.util.Functional.uncheck) Assert.assertTrue(org.junit.Assert.assertTrue) Collectors(java.util.stream.Collectors) ConditionPoll.qpoll(net.dempsy.utils.test.ConditionPoll.qpoll) AtomicLong(java.util.concurrent.atomic.AtomicLong) List(java.util.List) ConditionPoll.poll(net.dempsy.utils.test.ConditionPoll.poll) Functional.reverseRange(net.dempsy.util.Functional.reverseRange) SystemPropertyManager(net.dempsy.utils.test.SystemPropertyManager) ClusterInfoSessionFactory(net.dempsy.cluster.ClusterInfoSessionFactory) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext)

Example 2 with SystemPropertyManager

use of net.dempsy.utils.test.SystemPropertyManager in project Dempsy by Dempsy.

the class TestWordCount method testWordCountHomogeneousProcessing.

@Test
public void testWordCountHomogeneousProcessing() throws Throwable {
    final String[][] ctxs = { // adaptor only node
    { "classpath:/word-count/adaptor-kjv.xml" }, { "classpath:/word-count/mp-word-count.xml", "classpath:/word-count/mp-word-rank.xml" }, { "classpath:/word-count/mp-word-count.xml", "classpath:/word-count/mp-word-rank.xml" }, { "classpath:/word-count/mp-word-count.xml", "classpath:/word-count/mp-word-rank.xml" }, { "classpath:/word-count/mp-word-count.xml", "classpath:/word-count/mp-word-rank.xml" } };
    // the adaptor is the first one.
    final int NUM_WC = ctxs.length - 1;
    try (@SuppressWarnings("resource") final SystemPropertyManager props = new SystemPropertyManager().set("min_nodes", Integer.toString(NUM_WC)).set("routing-group", ":group").set("send_threads", "1").set("receive_threads", "1").set("blocking-queue-size", "500000")) {
        // need to make it wait.
        WordProducer.latch = new CountDownLatch(1);
        runCombos("testWordCountHomogeneousProcessing", (r, c, s, t, ser) -> isElasticRoutingStrategy(r), ctxs, n -> {
            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));
            assertTrue(poll(o -> managers[0].getRouter().allReachable("test-cluster2").size() == NUM_WC));
            WordProducer.latch.countDown();
            final WordProducer adaptor = nodes.get(0).ctx.getBean(WordProducer.class);
            waitForAllSent(adaptor);
            // get all of the stats collectors for the ranks.
            final List<ClusterMetricGetters> rankStats = Arrays.asList(managers).subList(1, managers.length).stream().map(nm -> nm.getClusterStatsCollector(new ClusterId(currentAppName, "test-cluster2"))).map(sc -> (ClusterMetricGetters) sc).collect(Collectors.toList());
            final int totalSent = adaptor.numDispatched;
            // now wait for the sum of all messages received by the ranking to be the number sent
            assertTrue(poll(o -> {
                final int totalRanked = rankStats.stream().map(sc -> Integer.valueOf((int) sc.getDispatchedMessageCount())).reduce(Integer.valueOf(0), (i1, i2) -> new Integer(i1.intValue() + i2.intValue())).intValue();
                return totalRanked == totalSent;
            }));
            // no nodes (except the adaptor node) should have sent any messages.
            // IOW, messages got to the Rank processor never leaving the node the Count was executed.
            final List<NodeMetricGetters> nodeStats = Arrays.asList(managers).subList(1, managers.length).stream().map(nm -> nm.getNodeStatsCollector()).map(s -> (NodeMetricGetters) s).collect(Collectors.toList());
            // if the routing id isn't a group id then there should be cross talk.
            assertEquals(NUM_WC, nodeStats.size());
            for (final NodeMetricGetters mg : nodeStats) assertEquals(0, mg.getMessagesNotSentCount());
            if (isGroupRoutingStrategy(routerId)) {
                for (final NodeMetricGetters mg : nodeStats) assertEquals(0, mg.getMessagesSentCount());
            } else {
                assertNotNull(nodeStats.stream().filter(mg -> mg.getMessagesSentCount() > 0).findFirst().orElse(null));
            }
        });
    }
}
Also used : MessageProcessor(net.dempsy.lifecycle.annotation.MessageProcessor) Arrays(java.util.Arrays) GZIPInputStream(java.util.zip.GZIPInputStream) Mp(net.dempsy.lifecycle.annotation.Mp) BufferedInputStream(java.io.BufferedInputStream) MessageType(net.dempsy.lifecycle.annotation.MessageType) Dispatcher(net.dempsy.messages.Dispatcher) LoggerFactory(org.slf4j.LoggerFactory) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) SystemPropertyManager(net.dempsy.utils.test.SystemPropertyManager) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Map(java.util.Map) ThreadingModel(net.dempsy.threading.ThreadingModel) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ClusterId(net.dempsy.config.ClusterId) Before(org.junit.Before) AfterClass(org.junit.AfterClass) MessageKey(net.dempsy.lifecycle.annotation.MessageKey) Logger(org.slf4j.Logger) Assert.assertNotNull(org.junit.Assert.assertNotNull) NodeMetricGetters(net.dempsy.container.NodeMetricGetters) MessageHandler(net.dempsy.lifecycle.annotation.MessageHandler) StringWriter(java.io.StringWriter) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) ClusterMetricGetters(net.dempsy.container.ClusterMetricGetters) Assert.assertTrue(org.junit.Assert.assertTrue) Set(java.util.Set) IOException(java.io.IOException) Test(org.junit.Test) Activation(net.dempsy.lifecycle.annotation.Activation) KeyExtractor(net.dempsy.lifecycle.annotation.utils.KeyExtractor) Collectors(java.util.stream.Collectors) 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.poll(net.dempsy.utils.test.ConditionPoll.poll) ConditionPoll.assertTrue(net.dempsy.utils.test.ConditionPoll.assertTrue) 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.utils.test.SystemPropertyManager) ClusterMetricGetters(net.dempsy.container.ClusterMetricGetters) Test(org.junit.Test)

Example 3 with SystemPropertyManager

use of net.dempsy.utils.test.SystemPropertyManager in project Dempsy by Dempsy.

the class TestWordCount method testWordCountNoRankMultinode.

@Test
public void testWordCountNoRankMultinode() throws Throwable {
    try (@SuppressWarnings("resource") final SystemPropertyManager props = new SystemPropertyManager().set("min_nodes", "2")) {
        final String[][] ctxs = { { "classpath:/word-count/adaptor-kjv.xml", "classpath:/word-count/mp-word-count.xml" }, { "classpath:/word-count/mp-word-count.xml" } };
        // need to make it wait.
        WordProducer.latch = new CountDownLatch(1);
        runCombos("testWordCountNoRankMultinode", (r, c, s, t, ser) -> isElasticRoutingStrategy(r), ctxs, n -> {
            final List<NodeManagerWithContext> nodes = n.nodes;
            final NodeManager[] manager = Arrays.asList(nodes.get(0).manager, nodes.get(1).manager).toArray(new NodeManager[2]);
            final ClassPathXmlApplicationContext[] ctx = Arrays.asList(nodes.get(0).ctx, nodes.get(1).ctx).toArray(new ClassPathXmlApplicationContext[2]);
            // wait until I can reach the cluster from the adaptor.
            assertTrue(poll(o -> manager[0].getRouter().allReachable("test-cluster1").size() == 2));
            assertTrue(poll(o -> manager[1].getRouter().allReachable("test-cluster1").size() == 2));
            WordProducer.latch.countDown();
            final WordProducer adaptor = ctx[0].getBean(WordProducer.class);
            final ClusterMetricGetters[] stats = Arrays.asList((ClusterMetricGetters) manager[0].getClusterStatsCollector(new ClusterId(currentAppName, "test-cluster1")), (ClusterMetricGetters) manager[1].getClusterStatsCollector(new ClusterId(currentAppName, "test-cluster1"))).toArray(new ClusterMetricGetters[2]);
            assertTrue(waitForAllSent(adaptor));
            assertTrue(poll(o -> {
                // System.out.println(stats[0].getProcessedMessageCount() + ", " + stats[1].getProcessedMessageCount());
                return adaptor.numDispatched == Arrays.stream(stats).map(c -> c.getProcessedMessageCount()).reduce((c1, c2) -> c1.longValue() + c2.longValue()).get().longValue();
            }));
        });
    }
}
Also used : MessageProcessor(net.dempsy.lifecycle.annotation.MessageProcessor) Arrays(java.util.Arrays) GZIPInputStream(java.util.zip.GZIPInputStream) Mp(net.dempsy.lifecycle.annotation.Mp) BufferedInputStream(java.io.BufferedInputStream) MessageType(net.dempsy.lifecycle.annotation.MessageType) Dispatcher(net.dempsy.messages.Dispatcher) LoggerFactory(org.slf4j.LoggerFactory) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) SystemPropertyManager(net.dempsy.utils.test.SystemPropertyManager) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Map(java.util.Map) ThreadingModel(net.dempsy.threading.ThreadingModel) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ClusterId(net.dempsy.config.ClusterId) Before(org.junit.Before) AfterClass(org.junit.AfterClass) MessageKey(net.dempsy.lifecycle.annotation.MessageKey) Logger(org.slf4j.Logger) Assert.assertNotNull(org.junit.Assert.assertNotNull) NodeMetricGetters(net.dempsy.container.NodeMetricGetters) MessageHandler(net.dempsy.lifecycle.annotation.MessageHandler) StringWriter(java.io.StringWriter) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) ClusterMetricGetters(net.dempsy.container.ClusterMetricGetters) Assert.assertTrue(org.junit.Assert.assertTrue) Set(java.util.Set) IOException(java.io.IOException) Test(org.junit.Test) Activation(net.dempsy.lifecycle.annotation.Activation) KeyExtractor(net.dempsy.lifecycle.annotation.utils.KeyExtractor) Collectors(java.util.stream.Collectors) 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.poll(net.dempsy.utils.test.ConditionPoll.poll) ConditionPoll.assertTrue(net.dempsy.utils.test.ConditionPoll.assertTrue) MessageProcessorLifecycle(net.dempsy.messages.MessageProcessorLifecycle) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) InputStream(java.io.InputStream) ClusterId(net.dempsy.config.ClusterId) CountDownLatch(java.util.concurrent.CountDownLatch) SystemPropertyManager(net.dempsy.utils.test.SystemPropertyManager) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ClusterMetricGetters(net.dempsy.container.ClusterMetricGetters) Test(org.junit.Test)

Example 4 with SystemPropertyManager

use of net.dempsy.utils.test.SystemPropertyManager in project Dempsy by Dempsy.

the class TestWordCount method testWordCountNoRank.

@Test
public void testWordCountNoRank() 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" } };
        // need to make it wait.
        WordProducer.latch = new CountDownLatch(1);
        runCombos("testWordCountNoRank", ctxs, n -> {
            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;
            final ClusterMetricGetters stats;
            WordProducer.latch.countDown();
            adaptor = ctx.getBean(WordProducer.class);
            stats = (ClusterMetricGetters) manager.getClusterStatsCollector(new ClusterId(currentAppName, "test-cluster1"));
            assertTrue(poll(o -> adaptor.done.get()));
            assertTrue(poll(o -> {
                // System.out.println("" + adaptor.numDispatched + " == " + stats.getProcessedMessageCount());
                return adaptor.numDispatched == stats.getProcessedMessageCount();
            }));
        });
    }
}
Also used : MessageProcessor(net.dempsy.lifecycle.annotation.MessageProcessor) Arrays(java.util.Arrays) GZIPInputStream(java.util.zip.GZIPInputStream) Mp(net.dempsy.lifecycle.annotation.Mp) BufferedInputStream(java.io.BufferedInputStream) MessageType(net.dempsy.lifecycle.annotation.MessageType) Dispatcher(net.dempsy.messages.Dispatcher) LoggerFactory(org.slf4j.LoggerFactory) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) SystemPropertyManager(net.dempsy.utils.test.SystemPropertyManager) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Map(java.util.Map) ThreadingModel(net.dempsy.threading.ThreadingModel) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ClusterId(net.dempsy.config.ClusterId) Before(org.junit.Before) AfterClass(org.junit.AfterClass) MessageKey(net.dempsy.lifecycle.annotation.MessageKey) Logger(org.slf4j.Logger) Assert.assertNotNull(org.junit.Assert.assertNotNull) NodeMetricGetters(net.dempsy.container.NodeMetricGetters) MessageHandler(net.dempsy.lifecycle.annotation.MessageHandler) StringWriter(java.io.StringWriter) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) ClusterMetricGetters(net.dempsy.container.ClusterMetricGetters) Assert.assertTrue(org.junit.Assert.assertTrue) Set(java.util.Set) IOException(java.io.IOException) Test(org.junit.Test) Activation(net.dempsy.lifecycle.annotation.Activation) KeyExtractor(net.dempsy.lifecycle.annotation.utils.KeyExtractor) Collectors(java.util.stream.Collectors) 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.poll(net.dempsy.utils.test.ConditionPoll.poll) ConditionPoll.assertTrue(net.dempsy.utils.test.ConditionPoll.assertTrue) MessageProcessorLifecycle(net.dempsy.messages.MessageProcessorLifecycle) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) InputStream(java.io.InputStream) SystemPropertyManager(net.dempsy.utils.test.SystemPropertyManager) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ClusterMetricGetters(net.dempsy.container.ClusterMetricGetters) ClusterId(net.dempsy.config.ClusterId) CountDownLatch(java.util.concurrent.CountDownLatch) Test(org.junit.Test)

Example 5 with SystemPropertyManager

use of net.dempsy.utils.test.SystemPropertyManager 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;
        // need to make it wait.
        WordProducer.latch = new CountDownLatch(1);
        runCombos("testWordCountNoRankMultinode", (r, c, s, t, ser) -> isElasticRoutingStrategy(r), ctxs, n -> {
            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);
            final List<ClusterMetricGetters> stats = Arrays.asList(managers).subList(1, managers.length).stream().map(nm -> nm.getClusterStatsCollector(new ClusterId(currentAppName, "test-cluster1"))).map(sc -> (ClusterMetricGetters) sc).collect(Collectors.toList());
            waitForAllSent(adaptor);
            assertTrue(poll(o -> adaptor.done.get()));
            assertTrue(poll(o -> {
                return adaptor.numDispatched == stats.stream().map(c -> c.getProcessedMessageCount()).reduce((c1, c2) -> c1.longValue() + c2.longValue()).get().longValue();
            }));
        });
    }
}
Also used : MessageProcessor(net.dempsy.lifecycle.annotation.MessageProcessor) Arrays(java.util.Arrays) GZIPInputStream(java.util.zip.GZIPInputStream) Mp(net.dempsy.lifecycle.annotation.Mp) BufferedInputStream(java.io.BufferedInputStream) MessageType(net.dempsy.lifecycle.annotation.MessageType) Dispatcher(net.dempsy.messages.Dispatcher) LoggerFactory(org.slf4j.LoggerFactory) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) SystemPropertyManager(net.dempsy.utils.test.SystemPropertyManager) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Map(java.util.Map) ThreadingModel(net.dempsy.threading.ThreadingModel) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ClusterId(net.dempsy.config.ClusterId) Before(org.junit.Before) AfterClass(org.junit.AfterClass) MessageKey(net.dempsy.lifecycle.annotation.MessageKey) Logger(org.slf4j.Logger) Assert.assertNotNull(org.junit.Assert.assertNotNull) NodeMetricGetters(net.dempsy.container.NodeMetricGetters) MessageHandler(net.dempsy.lifecycle.annotation.MessageHandler) StringWriter(java.io.StringWriter) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) ClusterMetricGetters(net.dempsy.container.ClusterMetricGetters) Assert.assertTrue(org.junit.Assert.assertTrue) Set(java.util.Set) IOException(java.io.IOException) Test(org.junit.Test) Activation(net.dempsy.lifecycle.annotation.Activation) KeyExtractor(net.dempsy.lifecycle.annotation.utils.KeyExtractor) Collectors(java.util.stream.Collectors) 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.poll(net.dempsy.utils.test.ConditionPoll.poll) ConditionPoll.assertTrue(net.dempsy.utils.test.ConditionPoll.assertTrue) MessageProcessorLifecycle(net.dempsy.messages.MessageProcessorLifecycle) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) InputStream(java.io.InputStream) ClusterId(net.dempsy.config.ClusterId) CountDownLatch(java.util.concurrent.CountDownLatch) SystemPropertyManager(net.dempsy.utils.test.SystemPropertyManager) ClusterMetricGetters(net.dempsy.container.ClusterMetricGetters) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)8 Arrays (java.util.Arrays)8 List (java.util.List)8 ConditionPoll.poll (net.dempsy.utils.test.ConditionPoll.poll)8 SystemPropertyManager (net.dempsy.utils.test.SystemPropertyManager)8 Assert.assertTrue (org.junit.Assert.assertTrue)8 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)8 Collections (java.util.Collections)7 HashSet (java.util.HashSet)7 Map (java.util.Map)7 Set (java.util.Set)7 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)7 CountDownLatch (java.util.concurrent.CountDownLatch)7 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)7 Function (java.util.function.Function)7 Collectors (java.util.stream.Collectors)7 ClusterId (net.dempsy.config.ClusterId)7 Activation (net.dempsy.lifecycle.annotation.Activation)7 MessageHandler (net.dempsy.lifecycle.annotation.MessageHandler)7 MessageKey (net.dempsy.lifecycle.annotation.MessageKey)7