protected void runTestMethod()

in src/main/java/org/junit/internal/runners/MethodRoadie.java [106:126]


    protected void runTestMethod() {
        try {
            testMethod.invoke(test);
            if (testMethod.expectsException()) {
                addFailure(new AssertionError("Expected exception: " + testMethod.getExpectedException().getName()));
            }
        } catch (InvocationTargetException e) {
            Throwable actual = e.getTargetException();
            if (actual instanceof AssumptionViolatedException) {
                return;
            } else if (!testMethod.expectsException()) {
                addFailure(actual);
            } else if (testMethod.isUnexpected(actual)) {
                String message = "Unexpected exception, expected<" + testMethod.getExpectedException().getName() + "> but was<"
                        + actual.getClass().getName() + ">";
                addFailure(new Exception(message, actual));
            }
        } catch (Throwable e) {
            addFailure(e);
        }
    }