Search in sources :

Example 1 with LocalClusterSessionFactory

use of net.dempsy.cluster.local.LocalClusterSessionFactory in project Dempsy by Dempsy.

the class TestSimpleRoutingStrategy method setup.

@Before
public void setup() {
    sessFact = new LocalClusterSessionFactory();
    session = sessFact.createSession();
    sched = new AutoDisposeSingleThreadScheduler("test");
    infra = makeInfra(session, sched);
}
Also used : AutoDisposeSingleThreadScheduler(net.dempsy.util.executor.AutoDisposeSingleThreadScheduler) LocalClusterSessionFactory(net.dempsy.cluster.local.LocalClusterSessionFactory) Before(org.junit.Before)

Example 2 with LocalClusterSessionFactory

use of net.dempsy.cluster.local.LocalClusterSessionFactory in project Dempsy by Dempsy.

the class TestContainer method setUp.

@Before
public void setUp() throws Exception {
    justThrowMe = null;
    throwMeInActivation = null;
    track(new SystemPropertyManager()).set("container-type", containerId);
    context = track(new ClassPathXmlApplicationContext(ctx));
    sessionFactory = new LocalClusterSessionFactory();
    final Node node = context.getBean(Node.class);
    manager = track(new NodeManager()).node(node).collaborator(track(sessionFactory.createSession())).start();
    statsCollector = manager.getClusterStatsCollector(new ClusterId("test-app", "test-cluster"));
    container = manager.getContainers().get(0);
    assertTrue(poll(manager, m -> m.isReady()));
}
Also used : Arrays(java.util.Arrays) Node(net.dempsy.config.Node) NodeManager(net.dempsy.NodeManager) SystemPropertyManager(net.dempsy.utils.test.SystemPropertyManager) 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) 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) NonLockingContainer(net.dempsy.container.nonlocking.NonLockingContainer) 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) 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) SystemPropertyManager(net.dempsy.utils.test.SystemPropertyManager) NodeManager(net.dempsy.NodeManager) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ClusterId(net.dempsy.config.ClusterId) Node(net.dempsy.config.Node) LocalClusterSessionFactory(net.dempsy.cluster.local.LocalClusterSessionFactory) Before(org.junit.Before)

Aggregations

LocalClusterSessionFactory (net.dempsy.cluster.local.LocalClusterSessionFactory)2 Before (org.junit.Before)2 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 ArrayBlockingQueue (java.util.concurrent.ArrayBlockingQueue)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 AccessUtil.canReach (net.dempsy.AccessUtil.canReach)1 AccessUtil.getRouter (net.dempsy.AccessUtil.getRouter)1