Package org.junit.runner

Examples of org.junit.runner.RunWith


        return newAnnotatedEmbedderRunner(runnerClass, annotatedClassName, classLoader);
    }

    private static Class<?> runnerClass(String annotatedClassName, EmbedderClassLoader classLoader) {
        Class<?> annotatedClass = loadClass(annotatedClassName, classLoader);
        RunWith annotation = annotatedClass.getAnnotation(RunWith.class);
        if (annotation != null) {
            return annotation.value();
        }
        throw new MissingAnnotatedEmbedderRunner(annotatedClass);
    }
View Full Code Here


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

        return null;
    }
View Full Code Here

      return Request.errorReport(fTestClass, e).getRunner();
    }
  }

  Class getRunnerClass(Class<?> testClass) {
    RunWith annotation= testClass.getAnnotation(RunWith.class);
    if (annotation != null) {
      return annotation.value();
    } else if (isPre4Test(testClass)) {
      return OldTestClassRunner.class;
    } else {
      return TestClassRunner.class;
    }
View Full Code Here

    public void run(RunNotifier notifier) {
        graph.run(this, notifier);
    }

    public void validate() throws JExampleError {
        RunWith run = (RunWith) jclass.getAnnotation(RunWith.class);
        if (run == null || run.value() != JExample.class) {
            errors.add(Kind.MISSING_RUNWITH_ANNOTATION,
                    "Class %s is not a JExample test class, annotation @RunWith(JExample.class) missing.", this);
        }
        try {
            Util.getConstructor(jclass);
View Full Code Here

      return Request.errorReport(fTestClass, e).getRunner();
    }
  }

  Class<? extends Runner> getRunnerClass(Class<?> testClass) {
    RunWith annotation= testClass.getAnnotation(RunWith.class);
    if (annotation != null) {
      return annotation.value();
    } else if (isPre4Test(testClass)) {
      return OldTestClassRunner.class;
    } else {
      return TestClassRunner.class;
    }
View Full Code Here

        final Map<String, Collection<URL>> featureUrls = Features.createFeatureMap(
                configuration.get().getTempDir(), configuration.get().getFeatureHome(), javaClass, loader);

        if (featureUrls.isEmpty()
                || !LibraryContainer.class.isInstance(applicationArchive)) {
            final RunWith runWith = testClass.getAnnotation(RunWith.class);
            if (runWith == null || (!ArquillianCucumber.class.equals(runWith.value()) && !CukeSpace.class.equals(runWith.value()))) {
                // not a cucumber test so skip enrichment
                return;
            } else {
                // else let enrich it to avoid type not found error
                Logger.getLogger(CucumberArchiveProcessor.class.getName()).info("No feature found for " + javaClass.getName());
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

      for(Annotation a : clazz.getDeclaredAnnotations()) {
        if(a.annotationType().equals(RunWith.class)) return false;
      }
      return true;
    } else {
      RunWith rw = clazz.getAnnotation(RunWith.class);
      if(rw != null) return !settings.ignoreRunner(rw.value().getName());
      else return true;
    }
  }
View Full Code Here

  }

  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 OldTestClassRunner.class;
    } else {
View Full Code Here

    DEBUG.P(this,"getRunnerClass(1)");
    DEBUG.P("testClass="+testClass);

    if (testClass.getAnnotation(Ignore.class) != null)
      return new IgnoredClassRunner(testClass).getClass();
    RunWith annotation= testClass.getAnnotation(RunWith.class);
    if (annotation != null) {
      DEBUG.P("annotation.value()="+annotation.value());
      return annotation.value();
    } else if (hasSuiteMethod() && fCanUseSuiteMethod) {
      return AllTests.class;
    } else if (isPre4Test(testClass)) {
      return JUnit38ClassRunner.class;
    } else {
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.