Package com.mycila.testing.core

Examples of com.mycila.testing.core.TestInstance


    @Test
    public void test_do_not_override_non_annotated_mockery() throws Exception {
        mockery.checking(new Expectations() {{
            allowing(ctx).getTest();
            will(returnValue(new TestInstance(JMock2TestPluginTest.this)));
            one(ctx).setAttribute(with("org.jmock.Mockery"), with(any(Mockery.class)));
        }});
        Mockery current = mockery;
        plugin.prepareTestInstance(ctx);
        assertEquals(mockery, current);
View Full Code Here


    @Test
    public void test_inject_mockery() throws Exception {
        final Test5 test = new Test5();
        mockery.checking(new Expectations() {{
            allowing(ctx).getTest();
            will(returnValue(new TestInstance(test)));
            one(ctx).setAttribute(with("org.jmock.Mockery"), with(any(Mockery.class)));
        }});
        assertNotNull(test.mockery1);
        assertNull(test.mockery2);
        Mockery current = test.mockery1;
View Full Code Here

    @Test
    public void test_mock_interface() throws Exception {
        final Test1 test = new Test1();
        mockery.checking(new Expectations() {{
            allowing(ctx).getTest();
            will(returnValue(new TestInstance(test)));
            one(ctx).setAttribute(with("org.jmock.Mockery"), with(any(Mockery.class)));
        }});
        assertNull(test.ctx);
        plugin.prepareTestInstance(ctx);
        assertNotNull(test.ctx);
View Full Code Here

    @Test
    public void test_mock_class() throws Exception {
        final Test2 test = new Test2();
        mockery.checking(new Expectations() {{
            allowing(ctx).getTest();
            will(returnValue(new TestInstance(test)));
            one(ctx).setAttribute(with("org.jmock.Mockery"), with(any(Mockery.class)));
        }});
        assertNull(test.ti);
        plugin.prepareTestInstance(ctx);
        assertNotNull(test.ti);
View Full Code Here

    @Test
    public void test_enhance_superclasses() throws Exception {
        final Test4 test = new Test4();
        mockery.checking(new Expectations() {{
            allowing(ctx).getTest();
            will(returnValue(new TestInstance(test)));
            one(ctx).setAttribute(with("org.jmock.Mockery"), with(any(Mockery.class)));
        }});
        assertNull(test.getTi3());
        assertNull(test.getTi4());
        plugin.prepareTestInstance(ctx);
View Full Code Here

            @MockContextProvider
            private Mockery m = new Mockery();
        };
        mockery.checking(new Expectations() {{
            allowing(ctx).getTest();
            will(returnValue(new TestInstance(test)));
            one(ctx).setAttribute(with("org.jmock.Mockery"), with(any(Mockery.class)));
        }});
        assertNull(test.get());
        plugin.prepareTestInstance(ctx);
        assertNotNull(test.get());
View Full Code Here

            @MockContextProvider
            private Mockery m;
        };
        mockery.checking(new Expectations() {{
            allowing(ctx).getTest();
            will(returnValue(new TestInstance(test)));
        }});
        assertNull(test.get());
        plugin.prepareTestInstance(ctx);
    }
View Full Code Here

            @MockContextProvider
            private String m = "a string";
        };
        mockery.checking(new Expectations() {{
            allowing(ctx).getTest();
            will(returnValue(new TestInstance(test)));
        }});
        assertNull(test.get());
        plugin.prepareTestInstance(ctx);
    }
View Full Code Here

                return new Mockery();
            }
        };
        mockery.checking(new Expectations() {{
            allowing(ctx).getTest();
            will(returnValue(new TestInstance(test)));
            one(ctx).setAttribute(with("org.jmock.Mockery"), with(any(Mockery.class)));
        }});
        assertNull(test.get());
        plugin.prepareTestInstance(ctx);
        assertNotNull(test.get());
View Full Code Here

                return null;
            }
        };
        mockery.checking(new Expectations() {{
            allowing(ctx).getTest();
            will(returnValue(new TestInstance(test)));
        }});
        assertNull(test.get());
        plugin.prepareTestInstance(ctx);
    }
View Full Code Here

TOP

Related Classes of com.mycila.testing.core.TestInstance

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.