Package org.jmock.lib.concurrent

Examples of org.jmock.lib.concurrent.Synchroniser


    public static JUnitRuleMockery2 createFor(final Mode mode) {
        final JUnitRuleMockery2 jUnitRuleMockery2 = new JUnitRuleMockery2();
        if (mode == Mode.INTERFACES_AND_CLASSES) {
            jUnitRuleMockery2.setImposteriser(JavassistImposteriser.INSTANCE);
        }
        jUnitRuleMockery2.setThreadingPolicy(new Synchroniser());
        return jUnitRuleMockery2;
    }
View Full Code Here


    @Test (expected = RuntimeException.class)
    public void expectedExceptionFailsInMainTestThreadWithoutJUnitFrameworkIntervention() throws Throwable {
        Mockery context = new JUnit4Mockery() {{
            setImposteriser(ClassImposteriser.INSTANCE);
            setThreadingPolicy(new Synchroniser());
        }};
        FrameworkMethod method = createMethodWithExpectations(context);
        Statement statement = createStatementWithExpectations(context);
        new RunConcurrently(method, statement).evaluate();
        context.assertIsSatisfied();
View Full Code Here

    public static JUnitRuleMockery2 createFor(final Mode mode) {
        final JUnitRuleMockery2 jUnitRuleMockery2 = new JUnitRuleMockery2();
        if (mode == Mode.INTERFACES_AND_CLASSES) {
            jUnitRuleMockery2.setImposteriser(ClassImposteriser.INSTANCE);
        }
        jUnitRuleMockery2.setThreadingPolicy(new Synchroniser());
        return jUnitRuleMockery2;
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Before
    public void setUp() {
        this.mockCtx = new JUnit4Mockery();
        this.mockCtx.setImposteriser(ClassImposteriser.INSTANCE);
        this.mockCtx.setThreadingPolicy(new Synchroniser());
        this.pool = this.mockCtx.mock(Pool.class);
        this.jedis = this.mockCtx.mock(Jedis.class);
        this.qInfoDAO = new QueueInfoDAORedisImpl(new ConfigBuilder().build(), this.pool);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Before
    public void setUp() {
        this.mockCtx = new JUnit4Mockery();
        this.mockCtx.setImposteriser(ClassImposteriser.INSTANCE);
        this.mockCtx.setThreadingPolicy(new Synchroniser());
        this.pool = this.mockCtx.mock(Pool.class);
        this.jedis = this.mockCtx.mock(Jedis.class);
        this.failureDAO = new FailureDAORedisImpl(new ConfigBuilder().build(), this.pool);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Before
    public void setUp() {
        this.mockCtx = new JUnit4Mockery();
        this.mockCtx.setImposteriser(ClassImposteriser.INSTANCE);
        this.mockCtx.setThreadingPolicy(new Synchroniser());
        this.pool = this.mockCtx.mock(Pool.class);
        this.jedis = this.mockCtx.mock(Jedis.class);
        this.workerInfoDAO = new WorkerInfoDAORedisImpl(new ConfigBuilder().build(), this.pool);
    }
View Full Code Here

   
    @SuppressWarnings("unchecked")
    @Before
    public void setUp() throws Exception {
        this.mockCtx = new JUnit4Mockery();
        this.mockCtx.setThreadingPolicy(new Synchroniser());
        this.workerFactory = this.mockCtx.mock(Callable.class);
        this.workers.add(this.mockCtx.mock(Worker.class, "Worker1"));
        this.workers.add(this.mockCtx.mock(Worker.class, "Worker2"));
        this.eventEmitters.add(this.mockCtx.mock(WorkerEventEmitter.class, "WorkerEventEmitter1"));
        this.eventEmitters.add(this.mockCtx.mock(WorkerEventEmitter.class, "WorkerEventEmitter2"));
View Full Code Here

    @SuppressWarnings("unchecked")
    @Before
    public void setUp() {
        this.mockCtx = new JUnit4Mockery();
        this.mockCtx.setImposteriser(ClassImposteriser.INSTANCE);
        this.mockCtx.setThreadingPolicy(new Synchroniser());
        this.pool = this.mockCtx.mock(Pool.class);
        this.jedis = this.mockCtx.mock(Jedis.class);
        this.keysDAO = new KeysDAORedisImpl(new ConfigBuilder().build(), this.pool);
    }
View Full Code Here

TOP

Related Classes of org.jmock.lib.concurrent.Synchroniser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.