Package com.mycila.testing.core.introspect

Examples of com.mycila.testing.core.introspect.Introspector


    @Test
    public void test_do_not_override_non_annotated_mockery() throws Exception {
        mockery.checking(new Expectations() {{
            allowing(ctx).introspector();
            will(returnValue(new Introspector(JMock2TestPluginTest.this)));
            one(ctx).attributes().set(with(JMock2TestPlugin.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).introspector();
            will(returnValue(new Introspector(test)));
            one(ctx).attributes().set(with(JMock2TestPlugin.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).introspector();
            will(returnValue(new Introspector(test)));
            one(ctx).attributes().set(with(JMock2TestPlugin.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).introspector();
            will(returnValue(new Introspector(test)));
            one(ctx).attributes().set(with(JMock2TestPlugin.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).introspector();
            will(returnValue(new Introspector(test)));
            one(ctx).attributes().set(with(JMock2TestPlugin.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).introspector();
            will(returnValue(new Introspector(test)));
            one(ctx).attributes().set(with(JMock2TestPlugin.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).introspector();
            will(returnValue(new Introspector(test)));
        }});
        assertNull(test.get());
        plugin.prepareTestInstance(ctx);
    }
View Full Code Here

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

                return new Mockery();
            }
        };
        mockery.checking(new Expectations() {{
            allowing(ctx).introspector();
            will(returnValue(new Introspector(test)));
            one(ctx).attributes().set(with(JMock2TestPlugin.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).introspector();
            will(returnValue(new Introspector(test)));
        }});
        assertNull(test.get());
        plugin.prepareTestInstance(ctx);
    }
View Full Code Here

TOP

Related Classes of com.mycila.testing.core.introspect.Introspector

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.