Package com.mycila.testing.core.api

Examples of com.mycila.testing.core.api.Execution


        CONTEXTS.put(context.introspector().instance(), context);
    }

    static void unsetCurrentExecution() {
        if (LOGGER.canDebug()) {
            Execution execution = CURRENT_EXECUTION.get();
            if (execution != null) {
                LOGGER.debug("Removing Execution Context %s#%s for test %s#%s", execution.step(), execution.method().getName(), execution.context().introspector().testClass().getName(), execution.context().introspector().instance().hashCode());
            }
        }
        CURRENT_EXECUTION.remove();
    }
View Full Code Here


    /**
     * @return The current execution point
     */
    @SuppressWarnings({"unchecked"})
    public static Execution currentExecution() {
        Execution c = CURRENT_EXECUTION.get();
        if (c == null) {
            throw new IllegalStateException("No Execution context bound to local thread !");
        }
        return c;
    }
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);
        when(execution.method()).thenReturn(getClass().getDeclaredMethod("test_execution"));

        assertThrow(IllegalStateException.class).containingMessage("No Execution context bound to local thread !").whenRunning(new Code() {
            public void run() throws Throwable {
                Mycila.currentExecution();
            }
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);
        when(execution.method()).thenReturn(getClass().getDeclaredMethod("test_execution"));

        assertThrow(IllegalStateException.class).containingMessage("No Execution context bound to local thread !").whenRunning(new Code() {
            public void run() throws Throwable {
                Mycila.currentExecution();
            }
View Full Code Here

        CONTEXTS.put(context.introspector().instance(), context);
    }

    static void unsetCurrentExecution() {
        if (LOGGER.canDebug()) {
            Execution execution = CURRENT_EXECUTION.get();
            if (execution != null) {
                LOGGER.debug("Removing Execution Context {0}#{1} for test {2}#{3,number,#}", execution.step(), execution.method().getName(), execution.context().introspector().testClass().getName(), execution.context().introspector().instance().hashCode());
            }
        }
        CURRENT_EXECUTION.remove();
    }
View Full Code Here

    /**
     * @return The current execution point
     */
    @SuppressWarnings({"unchecked"})
    public static Execution currentExecution() {
        Execution c = CURRENT_EXECUTION.get();
        if (c == null) {
            throw new IllegalStateException("No Execution context bound to local thread !");
        }
        return c;
    }
View Full Code Here

TOP

Related Classes of com.mycila.testing.core.api.Execution

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.