org.junit.runner.Request.runner()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(134)

本文整理了Java中org.junit.runner.Request.runner方法的一些代码示例,展示了Request.runner的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.runner方法的具体详情如下:
包路径:org.junit.runner.Request
类名称:Request
方法名:runner

Request.runner介绍

暂无

代码示例

代码示例来源:origin: junit-team/junit4

/**
 * Creates a {@link Request} that, when processed, will report an error for the given
 * test class with the given cause.
 */
public static Request errorReport(Class<?> klass, Throwable cause) {
  return runner(new ErrorReportingRunner(klass, cause));
}

代码示例来源:origin: google/j2objc

/**
 * Not used within JUnit.  Clients should simply instantiate ErrorReportingRunner themselves
 */
@Deprecated
public static Request errorReport(Class<?> klass, Throwable cause) {
  return runner(new ErrorReportingRunner(klass, cause));
}

代码示例来源:origin: junit-team/junit4

/**
 * Create a <code>Request</code> that, when processed, will run all the tests
 * in a set of classes.
 *
 * @param computer Helps construct Runners from classes
 * @param classes the classes containing the tests
 * @return a <code>Request</code> that will cause all tests in the classes to be run
 */
public static Request classes(Computer computer, Class<?>... classes) {
  try {
    AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder();
    Runner suite = computer.getSuite(builder, classes);
    return runner(suite);
  } catch (InitializationError e) {
    return runner(new ErrorReportingRunner(e, classes));
  }
}

代码示例来源:origin: google/j2objc

/**
 * Create a <code>Request</code> that, when processed, will run all the tests
 * in a set of classes.
 *
 * @param computer Helps construct Runners from classes
 * @param classes the classes containing the tests
 * @return a <code>Request</code> that will cause all tests in the classes to be run
 */
public static Request classes(Computer computer, Class<?>... classes) {
  try {
    AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder(true);
    Runner suite = computer.getSuite(builder, classes);
    return runner(suite);
  } catch (InitializationError e) {
    throw new RuntimeException(
        "Bug in saff's brain: Suite constructor, called as above, should always complete");
  }
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Not used within JUnit.  Clients should simply instantiate ErrorReportingRunner themselves
 */
@Deprecated
public static Request errorReport(Class<?> klass, Throwable cause) {
  return runner(new ErrorReportingRunner(klass, cause));
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Create a <code>Request</code> that, when processed, will run all the tests
 * in a set of classes.
 *
 * @param computer Helps construct Runners from classes
 * @param classes the classes containing the tests
 * @return a <code>Request</code> that will cause all tests in the classes to be run
 */
public static Request classes(Computer computer, Class<?>... classes) {
  try {
    AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder(true);
    Runner suite = computer.getSuite(builder, classes);
    return runner(suite);
  } catch (InitializationError e) {
    throw new RuntimeException(
        "Bug in saff's brain: Suite constructor, called as above, should always complete");
  }
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Creates a {@link Request} that, when processed, will report an error for the given
 * test class with the given cause.
 */
public static Request errorReport(Class<?> klass, Throwable cause) {
  return runner(new ErrorReportingRunner(klass, cause));
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.junit

/**
 * Creates a {@link Request} that, when processed, will report an error for the given
 * test class with the given cause.
 */
public static Request errorReport(Class<?> klass, Throwable cause) {
  return runner(new ErrorReportingRunner(klass, cause));
}

代码示例来源:origin: org.junit/com.springsource.org.junit

/**
 * Not used within JUnit.  Clients should simply instantiate ErrorReportingRunner themselves
 */
@Deprecated
public static Request errorReport(Class<?> klass, Throwable cause) {
  return runner(new ErrorReportingRunner(klass, cause));
}

代码示例来源:origin: com.oracle/truffle-tck

/**
 * Not used within JUnit.  Clients should simply instantiate ErrorReportingRunner themselves
 */
@Deprecated
public static Request errorReport(Class<?> klass, Throwable cause) {
  return runner(new ErrorReportingRunner(klass, cause));
}

代码示例来源:origin: org.junit/com.springsource.org.junit

/**
 * Create a <code>Request</code> that, when processed, will run all the tests
 * in a set of classes.
 *
 * @param computer Helps construct Runners from classes
 * @param classes the classes containing the tests
 * @return a <code>Request</code> that will cause all tests in the classes to be run
 */
public static Request classes(Computer computer, Class<?>... classes) {
  try {
    AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder(true);
    Runner suite = computer.getSuite(builder, classes);
    return runner(suite);
  } catch (InitializationError e) {
    throw new RuntimeException(
        "Bug in saff's brain: Suite constructor, called as above, should always complete");
  }
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Create a <code>Request</code> that, when processed, will run all the tests
 * in a set of classes.
 *
 * @param computer Helps construct Runners from classes
 * @param classes the classes containing the tests
 * @return a <code>Request</code> that will cause all tests in the classes to be run
 */
public static Request classes(Computer computer, Class<?>... classes) {
  try {
    AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder(true);
    Runner suite = computer.getSuite(builder, classes);
    return runner(suite);
  } catch (InitializationError e) {
    throw new RuntimeException(
        "Bug in saff's brain: Suite constructor, called as above, should always complete");
  }
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.junit

/**
 * Create a <code>Request</code> that, when processed, will run all the tests
 * in a set of classes.
 *
 * @param computer Helps construct Runners from classes
 * @param classes the classes containing the tests
 * @return a <code>Request</code> that will cause all tests in the classes to be run
 */
public static Request classes(Computer computer, Class<?>... classes) {
  try {
    AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder(true);
    Runner suite = computer.getSuite(builder, classes);
    return runner(suite);
  } catch (InitializationError e) {
    throw new RuntimeException(
        "Bug in saff's brain: Suite constructor, called as above, should always complete");
  }
}

代码示例来源:origin: com.oracle/truffle-tck

/**
 * Create a <code>Request</code> that, when processed, will run all the tests
 * in a set of classes.
 *
 * @param computer Helps construct Runners from classes
 * @param classes the classes containing the tests
 * @return a <code>Request</code> that will cause all tests in the classes to be run
 */
public static Request classes(Computer computer, Class<?>... classes) {
  try {
    AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder(true);
    Runner suite = computer.getSuite(builder, classes);
    return runner(suite);
  } catch (InitializationError e) {
    throw new RuntimeException(
        "Bug in saff's brain: Suite constructor, called as above, should always complete");
  }
}

代码示例来源:origin: esmasui/AndroidJUnit4

/**
 * Create a <code>Request</code> that, when processed, will run all the tests
 * in a set of classes.
 * @param computer Helps construct Runners from classes
 * @param classes the classes containing the tests
 * @return a <code>Request</code> that will cause all tests in the classes to be run
 */
public Request classes(Computer computer,
            Class<?>... classes) {
  try {
    //For Android
    AllDefaultPossibilitiesBuilder builder = new AndroidAllDefaultPossibilitiesBuilder(true);
    Runner suite = computer.getSuite(builder,
                     classes);
    return Request.runner(suite);
  } catch (InitializationError e) {
    throw new RuntimeException("Bug in saff's brain: Suite constructor, called as above, should always complete");
  }
}

代码示例来源:origin: com.uphyca/android-junit4

/**
 * Create a <code>Request</code> that, when processed, will run all the tests
 * in a set of classes.
 * @param computer Helps construct Runners from classes
 * @param classes the classes containing the tests
 * @return a <code>Request</code> that will cause all tests in the classes to be run
 */
public Request classes(Computer computer,
            Class<?>... classes) {
  try {
    //For Android
    AllDefaultPossibilitiesBuilder builder = new AndroidAllDefaultPossibilitiesBuilder(true);
    Runner suite = computer.getSuite(builder,
                     classes);
    return Request.runner(suite);
  } catch (InitializationError e) {
    throw new RuntimeException("Bug in saff's brain: Suite constructor, called as above, should always complete");
  }
}

代码示例来源:origin: greghaskins/spectrum

private static Result runWithJUnit(final Runner runner) {
  return new JUnitCore().run(Request.runner(runner));
 }
}

代码示例来源:origin: greghaskins/spectrum

private static Result runWithJUnit(final Runner runner) {
 return new JUnitCore().run(Request.runner(runner));
}

代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-osgi-testrunner-bundle

try {
  ClassLoaderStack.push(testClass.getClassLoader());
  testResult = c.run(Request.runner(runner));
} finally {
  ClassLoaderStack.pop();

代码示例来源:origin: effektif/effektif

public static void run(Configuration configuration, Class<?> clazz, String methodName) {
 try {
  Request request = null;
  if (clazz!=null && methodName!=null) {
   request = Request.method(clazz, methodName);
  } else {
   Suite suite = new Suite(new JUnit4Builder(), API_TEST_CLASSES);
   request = Request.runner(suite);
  }
  
  Configuration originalConfiguration = WorkflowTest.cachedConfiguration;
  WorkflowTest.cachedConfiguration = configuration;
  JUnitCore junitCore = new JUnitCore();
  Result result = junitCore.run(request);
  WorkflowTest.cachedConfiguration = originalConfiguration;
  
  checkResult(result);
 } catch (Exception e) {
  throw new RuntimeException(e);
 }
}

相关文章