Search in sources :

Example 6 with SystemContext

use of com.codingchili.core.context.SystemContext in project chili-core by codingchili.

the class BusRouterTest method setUp.

@Before
public void setUp() {
    core = new SystemContext();
    system().setClusterTimeout(500);
    router = new BusRouter() {

        @Override
        public void onNodeTimeout(Request request) {
            nodeTimeout.set(true);
            super.onNodeTimeout(request);
        }

        @Override
        public void onNodeNotReachable(Request request) {
            nodeUnreachable.set(true);
            super.onNodeNotReachable(request);
        }

        @Override
        public void onRecipientFailure(Request request) {
            recipientFailure.set(true);
            super.onRecipientFailure(request);
        }
    };
    router.init(core);
}
Also used : SystemContext(com.codingchili.core.context.SystemContext)

Example 7 with SystemContext

use of com.codingchili.core.context.SystemContext in project chili-core by codingchili.

the class ClusteredSessionTest method setUp.

@Before
public void setUp(TestContext test) {
    Async async = test.async();
    core = new SystemContext();
    sessionFactory = new SessionFactoryMock(core);
    sessionFactory.create(home, connectionId).onComplete(created -> {
        session = created.result();
        async.complete();
    });
}
Also used : SystemContext(com.codingchili.core.context.SystemContext) Async(io.vertx.ext.unit.Async)

Example 8 with SystemContext

use of com.codingchili.core.context.SystemContext in project chili-core by codingchili.

the class HashFactoryTest method setUp.

@Before
public void setUp() {
    context = new SystemContext();
    hasher = new HashFactory(context);
    executor = context.vertx().createSharedWorkerExecutor("worker_pool_name", 8);
}
Also used : SystemContext(com.codingchili.core.context.SystemContext)

Example 9 with SystemContext

use of com.codingchili.core.context.SystemContext in project chili-core by codingchili.

the class ByteComparatorTest method setUp.

@Before
public void setUp() {
    context = new SystemContext();
    hasher = new HashFactory(context);
}
Also used : SystemContext(com.codingchili.core.context.SystemContext)

Example 10 with SystemContext

use of com.codingchili.core.context.SystemContext in project chili-core by codingchili.

the class TokenFactoryTest method setUp.

@BeforeClass
public static void setUp() {
    context = new SystemContext();
    tokenFactory = new TokenFactory(context, secret);
    tokenFactory2 = new TokenFactory(context, secret2);
}
Also used : SystemContext(com.codingchili.core.context.SystemContext)

Aggregations

SystemContext (com.codingchili.core.context.SystemContext)16 Before (org.junit.Before)4 RealmContext (com.codingchili.realm.configuration.RealmContext)2 RealmSettings (com.codingchili.realm.configuration.RealmSettings)2 ListeningPerson (com.codingchili.realm.instance.model.npc.ListeningPerson)2 Async (io.vertx.ext.unit.Async)2 FileSystemMock (com.codingchili.core.testing.FileSystemMock)1 LogContext (com.codingchili.logging.configuration.LogContext)1 PatchContext (com.codingchili.patching.configuration.PatchContext)1 PatchHandler (com.codingchili.patching.controller.PatchHandler)1 SpellTarget (com.codingchili.realm.instance.model.spells.SpellTarget)1 RouterContext (com.codingchili.router.configuration.RouterContext)1 RouterSettings (com.codingchili.router.configuration.RouterSettings)1 JsonObject (io.vertx.core.json.JsonObject)1 BeforeClass (org.junit.BeforeClass)1