Package org.junit.runner

Examples of org.junit.runner.RunWith


  }

  Class<? extends Runner> getRunnerClass(final Class<?> testClass) {
    if (testClass.getAnnotation(Ignore.class) != null)
      return new IgnoredClassRunner(testClass).getClass();
    RunWith annotation= testClass.getAnnotation(RunWith.class);
    if (annotation != null) {
      return annotation.value();
    } else if (hasSuiteMethod() && fCanUseSuiteMethod) {
      return AllTests.class;
    } else if (isPre4Test(testClass)) {
      return JUnit38ClassRunner.class;
    } else {
View Full Code Here


    private static Runner createRunnerFor(List<? extends Class<?>> targetClasses, final List<Filter> filters) throws InitializationError {
        RunnerBuilder runnerBuilder = new RunnerBuilder() {
            @Override
            public Runner runnerForClass(Class<?> testClass) throws Throwable {
                for (Class<?> candidate = testClass; candidate != null; candidate = candidate.getSuperclass()) {
                    RunWith runWith = candidate.getAnnotation(RunWith.class);
                    if (runWith != null && !AbstractMultiTestRunner.class.isAssignableFrom(runWith.value())) {
                        try {
                            Runner r = (Runner) runWith.value().getConstructors()[0].newInstance(testClass);
                            return filter(r);
                        } catch (InvocationTargetException e) {
                            throw e.getTargetException();
                        }
                    }
View Full Code Here

        Collections.sort(classes, byClassName());
        return classes;
    }

    private boolean normalThucydidesTest(Class<?> testClass) {
        RunWith runWith = testClass.getAnnotation(RunWith.class);
        return ((runWith != null) && (runWith.value() == ThucydidesRunner.class));
    }
View Full Code Here

        fSuiteBuilder = suiteBuilder;
    }

    @Override
    public Runner runnerForClass(Class<?> testClass) throws Exception {
        RunWith annotation = testClass.getAnnotation(RunWith.class);
        if (annotation != null) {
            return buildRunner(annotation.value(), testClass);
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.junit.runner.RunWith

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.