Codota Logo
Runner
Code IndexAdd Codota to your IDE (free)

How to use
Runner
in
org.junit.runner

Best Java code snippets using org.junit.runner.Runner (Showing top 20 results out of 693)

Refine searchRefine arrow

  • Description
  • Common ways to obtain Runner
private void myMethod () {
Runner r =
  • Codota IconRequest request;request.getRunner()
  • Codota Iconnew Suite((Class<?>)null, new Class<?>[0])
  • Codota IconRunnerBuilder each;Class testClass;each.safeRunnerForClass(testClass)
  • Smart code suggestions by Codota
}
origin: pmd/pmd

private Description createChildrenDescriptions(Runner runner, String suiteName) {
  Description suite = Description.createSuiteDescription(suiteName);
  for (Description child : runner.getDescription().getChildren()) {
    suite.addChild(child);
  }
  return suite;
}
origin: junit-team/junit4

  @Override
  protected void runChild(Runner runner, final RunNotifier notifier) {
    runner.run(notifier);
  }
}
origin: junit-team/junit4

public int countTestCases() {
  return fRunner.testCount();
}
origin: junit-team/junit4

/**
 * Do not use. Testing purposes only.
 */
public Result run(Runner runner) {
  Result result = new Result();
  RunListener listener = result.createListener();
  notifier.addFirstListener(listener);
  try {
    notifier.fireTestRunStarted(runner.getDescription());
    runner.run(notifier);
    notifier.fireTestRunFinished(result);
  } finally {
    removeListener(listener);
  }
  return result;
}
origin: cinchapi/concourse

@Override
public Description getDescription() {
  Description description = Description
      .createSuiteDescription(super.getDescription().getTestClass());
  for (Runner runner : runners) {
    description.addChild(runner.getDescription());
  }
  return description;
}
origin: net.sf.jexample/jexample

@Override
public Description getDescription() {
    Description spec= Description.createSuiteDescription(ExampleGraph.class);
    for (Runner runner : fRunners)
        spec.addChild(runner.getDescription());
    return spec;
}
origin: hcoles/pitest

private boolean isAJUnitThreeErrorOrWarning(final Runner runner) {
 return !runner.getDescription().getChildren().isEmpty()
   && runner.getDescription().getChildren().get(0).getClassName()
     .startsWith("junit.framework.TestSuite");
}
origin: junit-team/junit4

@Override
protected Description describeChild(Runner child) {
  return child.getDescription();
}
origin: apache/tinkerpop

@Override
protected void runChild(final Runner runner, final RunNotifier notifier) {
  if (beforeTestExecution((Class<? extends AbstractGremlinTest>) runner.getDescription().getTestClass()))
    super.runChild(runner, notifier);
  afterTestExecution((Class<? extends AbstractGremlinTest>) runner.getDescription().getTestClass());
}
origin: hcoles/pitest

private boolean isJUnitThreeSuiteMethodNotForOwnClass(final Runner runner,
  final String className) {
 // use strings in case this hack blows up due to internal junit change
 return runner.getClass().getName()
   .equals("org.junit.internal.runners.SuiteMethod")
   && !runner.getDescription().getClassName().equals(className);
}
origin: junit-team/junit4

private void configureRunner(Runner runner) throws InvalidOrderingException {
  Description description = runner.getDescription();
  OrderWith orderWith = description.getAnnotation(OrderWith.class);
  if (orderWith != null) {
    Ordering ordering = Ordering.definedBy(orderWith.value(), description);
    ordering.apply(runner);
  }
}
origin: junit-team/junit4

  /**
   * @return the number of tests to be run by the receiver
   */
  public int testCount() {
    return getDescription().testCount();
  }
}
origin: babyfish-ct/babyfish

@Override
public Description getDescription() {
  if (this.accept) {
    return this.secondaryRunner.getDescription();
  }
  return Description.createSuiteDescription(this.klass);
}

origin: net.avh4.test/junit-nested

@Override
public Description getDescription() {
  Description suiteDescription = classRunner.getDescription();
  for (Runner childRunner : childRunners) {
    suiteDescription.addChild(childRunner.getDescription());
  }
  return suiteDescription;
}
origin: org.junit.vintage/junit-vintage-engine

@Override
public void prune() {
  if (wasFiltered) {
    // filtering the runner may render intermediate Descriptions obsolete
    // (e.g. test classes without any remaining children in a suite)
    pruneDescriptorsForObsoleteDescriptions(singletonList(runner.getDescription()));
  }
  if (rejectedExclusions.isEmpty()) {
    super.prune();
  }
  else if (rejectedExclusions.containsAll(getDescription().getChildren())) {
    // since the Runner was asked to remove all of its direct children,
    // it's safe to remove it entirely
    removeFromHierarchy();
  }
  else {
    logIncompleteFiltering();
  }
}
origin: org.seasar.container/s2-tiger

@Override
public Description getDescription() {
  final Description spec = Description.createSuiteDescription(fName);
  for (final Runner runner : fRunners)
    spec.addChild(runner.getDescription());
  return spec;
}
origin: org.pitest/pitest

private boolean isAJUnitThreeErrorOrWarning(final Runner runner) {
 return !runner.getDescription().getChildren().isEmpty()
   && runner.getDescription().getChildren().get(0).getClassName()
     .startsWith("junit.framework.TestSuite");
}
origin: google/j2objc

@Override
protected Description describeChild(Runner child) {
  return child.getDescription();
}
origin: org.apache.tinkerpop/gremlin-test

@Override
protected void runChild(final Runner runner, final RunNotifier notifier) {
  if (beforeTestExecution((Class<? extends AbstractGremlinTest>) runner.getDescription().getTestClass()))
    super.runChild(runner, notifier);
  afterTestExecution((Class<? extends AbstractGremlinTest>) runner.getDescription().getTestClass());
}
origin: org.pitest/pitest

private boolean isJUnitThreeSuiteMethodNotForOwnClass(final Runner runner,
  final String className) {
 // use strings in case this hack blows up due to internal junit change
 return runner.getClass().getName()
   .equals("org.junit.internal.runners.SuiteMethod")
   && !runner.getDescription().getClassName().equals(className);
}
org.junit.runnerRunner

Javadoc

A Runner runs tests and notifies a org.junit.runner.notification.RunNotifierof significant events as it does so. You will need to subclass Runner when using org.junit.runner.RunWith to invoke a custom runner. When creating a custom runner, in addition to implementing the abstract methods here you must also provide a constructor that takes as an argument the Class containing the tests.

The default runner implementation guarantees that the instances of the test case class will be constructed immediately before running the test and that the runner will retain no reference to the test case instances, generally making them available for garbage collection.

Most used methods

  • getDescription
  • run
    Run the tests for this runner.
  • testCount

Popular in Java

  • Running tasks concurrently on multiple threads
  • getContentResolver (Context)
  • getApplicationContext (Context)
  • orElseThrow (Optional)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now