Package com.mycila.testing.core.introspect

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


                return "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 JMock2TestPluginTest.this.mockery3;
            }
        };
        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

     * @param testInstance The object having configure methods
     * @return this
     */
    public MycilaTesting configure(Object testInstance) {
        notNull("Test instance", testInstance);
        final Introspector introspector = new Introspector(testInstance);
        final List<Method> methods = introspector.selectMethods(excludeOverridenMethods(and(methodsAnnotatedBy(ConfigureMycilaPlugins.class), new Filter<Method>() {
            @Override
            protected boolean accept(Method method) {
                final Class<?>[] types = method.getParameterTypes();
                return types.length == 1 && types[0].equals(PluginManager.class);
            }
View Full Code Here

    private final Attributes attributes = new AttributesImpl();

    TestContextImpl(PluginManager<TestPlugin> pluginManager, Object testInstance) {
        notNull("Plugin manager", pluginManager);
        notNull("Test instance", testInstance);
        this.introspector = new Introspector(testInstance);
        this.pluginManager = pluginManager;
        LOGGER.debug("Creating new Test Context for test %s#%s", this.introspector.testClass().getName(), this.introspector.instance().hashCode());
        Mycila.registerContext(this);
    }
View Full Code Here

     * @param testInstance The object having configure methods
     * @return this
     */
    public MycilaTesting configure(Object testInstance) {
        notNull("Test instance", testInstance);
        final Introspector introspector = new Introspector(testInstance);
        final List<Method> methods = introspector.selectMethods(excludeOverridenMethods(and(methodsAnnotatedBy(ConfigureMycilaPlugins.class), new Filter<Method>() {
            @Override
            protected boolean accept(Method method) {
                final Class<?>[] types = method.getParameterTypes();
                return types.length == 1 && types[0].equals(PluginManager.class);
            }
View Full Code Here

    private final Attributes attributes = new AttributesImpl();

    TestContextImpl(PluginManager<TestPlugin> pluginManager, Object testInstance) {
        notNull("Plugin manager", pluginManager);
        notNull("Test instance", testInstance);
        this.introspector = new Introspector(testInstance);
        this.pluginManager = pluginManager;
        LOGGER.debug("Creating new Test Context for test {0}#{1,number,#}", this.introspector.testClass().getName(), this.introspector.instance().hashCode());
        Mycila.registerContext(this);
    }
View Full Code Here

        JDKLogging.init();
    }

    @Test
    public void test_context() throws Exception {
        Introspector introspector = new Introspector(this);
        TestContext context = mock(TestContext.class);
        when(context.introspector()).thenReturn(introspector);

        assertThrow(IllegalStateException.class).containingMessage("No Global Test Context available for test com.mycila.testing.core.MycilaTest#").whenRunning(new Code() {
            public void run() throws Throwable {
View Full Code Here

        });
    }

    @Test
    public void test_execution() throws Exception {
        Introspector introspector = new Introspector(this);
        TestContext context = mock(TestContext.class);
        final Execution execution = mock(Execution.class);
        when(context.introspector()).thenReturn(introspector);
        when(execution.context()).thenReturn(context);
        when(execution.step()).thenReturn(Step.BEFORE);
View Full Code Here

        JDKLogging.init();
    }

    @Test
    public void test_context() throws Exception {
        Introspector introspector = new Introspector(this);
        TestContext context = mock(TestContext.class);
        when(context.introspector()).thenReturn(introspector);

        assertThrow(MycilaTestingException.class).containingMessage("No Global Test Context available for test com.mycila.testing.core.MycilaTest#").whenRunning(new Code() {
            public void run() throws Throwable {
View Full Code Here

        });
    }

    @Test
    public void test_execution() throws Exception {
        Introspector introspector = new Introspector(this);
        TestContext context = mock(TestContext.class);
        final Execution execution = mock(Execution.class);
        when(context.introspector()).thenReturn(introspector);
        when(execution.context()).thenReturn(context);
        when(execution.step()).thenReturn(Step.BEFORE);
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.