Package com.mycila.testing.core.api

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


        return new Statement() {
            @SuppressWarnings({"ThrowableResultOfMethodCallIgnored"})
            @Override
            public void evaluate() throws Throwable {
                testNotifier.fireBeforeTest(method.getMethod());
                TestExecution testExecution = (TestExecution) Mycila.currentExecution();
                if (!testExecution.mustSkip()) {
                    try {
                        LOGGER.debug("Calling test method %s.%s", testExecution.method().getDeclaringClass().getName(), testExecution.method().getName());
                        MycilaJunitRunner.super.methodInvoker(method, test).evaluate();
                    } catch (Throwable t) {
                        testExecution.setThrowable(t);
                    }
                }
                testNotifier.fireAfterTest();
                if (testExecution.throwable() != null) {
                    throw testExecution.throwable();
                }
            }
        };
    }
View Full Code Here


        testNotifier.prepare();
    }

    public final void run(IHookCallBack callBack, ITestResult testResult) {
        testNotifier.fireBeforeTest(testResult.getMethod().getMethod());
        TestExecution testExecution = (TestExecution) Mycila.currentExecution();
        if (testExecution.mustSkip()) {
            testResult.setStatus(ITestResult.SKIP);
        } else {
            LOGGER.debug("Calling test method %s.%s", testExecution.method().getDeclaringClass().getName(), testExecution.method().getName());
            try {
                Field field = callBack.getClass().getDeclaredField("val$instance");
                field.setAccessible(true);
                MethodHelper.invokeMethod(testResult.getMethod().getMethod(), field.get(callBack), testResult.getParameters());
            } catch (Throwable e) {
                testExecution.setThrowable(e);
            }
        }
        try {
            testNotifier.fireAfterTest();
        } catch (TestPluginException e) {
            testExecution.setThrowable(e);
        }
        //noinspection ThrowableResultOfMethodCallIgnored
        testResult.setThrowable(testExecution.throwable());
    }
View Full Code Here

        });
        testNotifier.prepare();
        try {
            setUp();
            testNotifier.fireBeforeTest(getTestMethod());
            TestExecution testExecution = (TestExecution) Mycila.currentExecution();
            if (!testExecution.mustSkip()) {
                try {
                    LOGGER.debug("Calling test method %s.%s", testExecution.method().getDeclaringClass().getName(), testExecution.method().getName());
                    super.runTest();
                } catch (Throwable t) {
                    testExecution.setThrowable(t);
                }
            }
            testNotifier.fireAfterTest();
            tearDown();
            if (testExecution.hasFailed()) {
                throw testExecution.throwable().fillInStackTrace();
            }
        } finally {
            testNotifier.fireAfterClass();
        }
    }
View Full Code Here

        return new Statement() {
            @SuppressWarnings({"ThrowableResultOfMethodCallIgnored"})
            @Override
            public void evaluate() throws Throwable {
                testNotifier.fireBeforeTest(method.getMethod());
                TestExecution testExecution = (TestExecution) Mycila.currentExecution();
                if (!testExecution.mustSkip()) {
                    try {
                        LOGGER.debug("Calling test method %s.%s", testExecution.method().getDeclaringClass().getName(), testExecution.method().getName());
                        MycilaJunitRunner.super.methodInvoker(method, test).evaluate();
                    } catch (Throwable t) {
                        testExecution.setThrowable(t);
                    }
                }
                testNotifier.fireAfterTest();
                if (testExecution.throwable() != null) {
                    throw testExecution.throwable();
                }
            }
        };
    }
View Full Code Here

        testNotifier.prepare();
    }

    public final void run(IHookCallBack callBack, ITestResult testResult) {
        testNotifier.fireBeforeTest(testResult.getMethod().getMethod());
        TestExecution testExecution = (TestExecution) Mycila.currentExecution();
        if (testExecution.mustSkip()) {
            testResult.setStatus(ITestResult.SKIP);
        } else {
            LOGGER.debug("Calling test method %s.%s", testExecution.method().getDeclaringClass().getName(), testExecution.method().getName());
            try {
                Field field = callBack.getClass().getDeclaredField("val$instance");
                field.setAccessible(true);
                MethodHelper.invokeMethod(testResult.getMethod().getMethod(), field.get(callBack), testResult.getParameters());
            } catch (Throwable e) {
                testExecution.setThrowable(e);
            }
        }
        try {
            testNotifier.fireAfterTest();
        } catch (TestPluginException e) {
            testExecution.setThrowable(e);
        }
        //noinspection ThrowableResultOfMethodCallIgnored
        testResult.setThrowable(testExecution.throwable());
    }
View Full Code Here

        return new Statement() {
            @SuppressWarnings({"ThrowableResultOfMethodCallIgnored"})
            @Override
            public void evaluate() throws Throwable {
                testNotifier.fireBeforeTest(method.getMethod());
                TestExecution testExecution = (TestExecution) Mycila.currentExecution();
                if (!testExecution.mustSkip()) {
                    try {
                        LOGGER.debug("Calling test method {0}.{1}", testExecution.method().getDeclaringClass().getName(), testExecution.method().getName());
                        MycilaJunitRunner.super.methodInvoker(method, test).evaluate();
                    } catch (Throwable t) {
                        testExecution.setThrowable(t);
                    }
                }
                testNotifier.fireAfterTest();
                if (testExecution.throwable() != null) {
                    throw testExecution.throwable();
                }
            }
        };
    }
View Full Code Here

        testNotifier.prepare();
    }

    public final void run(IHookCallBack callBack, ITestResult testResult) {
        testNotifier.fireBeforeTest(testResult.getMethod().getMethod());
        TestExecution testExecution = (TestExecution) Mycila.currentExecution();
        if (testExecution.mustSkip()) {
            testResult.setStatus(ITestResult.SKIP);
        } else {
            LOGGER.debug("Calling test method {0}.{1}", testExecution.method().getDeclaringClass().getName(), testExecution.method().getName());
            try {
                Field field = callBack.getClass().getDeclaredField("val$instance");
                field.setAccessible(true);
                MethodHelper.invokeMethod(testResult.getMethod().getMethod(), field.get(callBack), testResult.getParameters());
            } catch (Throwable e) {
                testExecution.setThrowable(e);
            }
        }
        try {
            testNotifier.fireAfterTest();
        } catch (TestPluginException e) {
            testExecution.setThrowable(e);
        }
        //noinspection ThrowableResultOfMethodCallIgnored
        testResult.setThrowable(testExecution.throwable());
    }
View Full Code Here

        });
        testNotifier.prepare();
        try {
            setUp();
            testNotifier.fireBeforeTest(getTestMethod());
            TestExecution testExecution = (TestExecution) Mycila.currentExecution();
            if (!testExecution.mustSkip()) {
                try {
                    LOGGER.debug("Calling test method {0}.{1}", testExecution.method().getDeclaringClass().getName(), testExecution.method().getName());
                    super.runTest();
                } catch (Throwable t) {
                    testExecution.setThrowable(t);
                }
            }
            testNotifier.fireAfterTest();
            tearDown();
            if (testExecution.hasFailed()) {
                throw testExecution.throwable().fillInStackTrace();
            }
        } finally {
            testNotifier.fireAfterClass();
        }
    }
View Full Code Here

TOP

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

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.