• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ClassRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.junit.internal.requests.ClassRequest的典型用法代码示例。如果您正苦于以下问题:Java ClassRequest类的具体用法?Java ClassRequest怎么用?Java ClassRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ClassRequest类属于org.junit.internal.requests包,在下文中一共展示了ClassRequest类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getSuiteMethodDescription

import org.junit.internal.requests.ClassRequest; //导入依赖的package包/类
private static Description getSuiteMethodDescription(Request request, Description description) throws NoSuchFieldException, IllegalAccessException {
  Field field;
  try {
    field = ClassRequest.class.getDeclaredField("fTestClass");
  }
  catch (NoSuchFieldException e) {
    field = ClassRequest.class.getDeclaredField("testClass");
  }
  field.setAccessible(true);
  final Description methodDescription = Description.createSuiteDescription((Class)field.get(request));
  for (Iterator iterator = description.getChildren().iterator(); iterator.hasNext();) {
    methodDescription.addChild((Description)iterator.next());
  }
  description = methodDescription;
  return description;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:JUnit4IdeaTestRunner.java


示例2: getTestToStart

import org.junit.internal.requests.ClassRequest; //导入依赖的package包/类
public Object getTestToStart(String[] args) {
  final Request request = JUnit4TestRunnerUtil.buildRequest(args, false);
  if (request == null) return null;
  final Runner testRunner = request.getRunner();
  Description description = null;
  try {
    description = testRunner.getDescription();
    if (request instanceof ClassRequest) {
      description = getSuiteMethodDescription(request, description);
    }
    else if (request instanceof FilterRequest) {
      description = getFilteredDescription(request, description);
    }
  }
  catch (Exception e) {
    //noinspection HardCodedStringLiteral
    System.err.println("Internal Error occured.");
    e.printStackTrace(System.err);
  }
  return description;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:JUnit4IdeaTestRunner.java


示例3: getDescription

import org.junit.internal.requests.ClassRequest; //导入依赖的package包/类
private static Description getDescription(Request request, Runner testRunner) throws NoSuchFieldException, IllegalAccessException {
  Description description = testRunner.getDescription();
  if (description == null) {
    System.err.println("Nothing found to run. Runner " + testRunner.getClass().getName() + " provides no description.");
    return null;
  }
  if (request instanceof ClassRequest) {
    description = getSuiteMethodDescription(request, description);
  }
  else if (request instanceof FilterRequest) {
    description = getFilteredDescription(request, description);
  }
  return description;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:JUnit4IdeaTestRunner.java


示例4: createIgnoreIgnoredClassRequest

import org.junit.internal.requests.ClassRequest; //导入依赖的package包/类
private static Request createIgnoreIgnoredClassRequest(final Class clazz, final boolean recursively) throws ClassNotFoundException {
  Class.forName("org.junit.runners.BlockJUnit4ClassRunner"); //ignore IgnoreIgnored for junit4.4 and <
  return new ClassRequest(clazz) {
    public Runner getRunner() {
      try {
        return new IgnoreIgnoredTestJUnit4ClassRunner(clazz, recursively);
      }
      catch (Exception ignored) {
        //return super runner
      }
      return super.getRunner();
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:JUnit4TestRunnerUtil.java


示例5: getSuiteMethodDescription

import org.junit.internal.requests.ClassRequest; //导入依赖的package包/类
private static Description getSuiteMethodDescription(Request request, Description description) throws NoSuchFieldException, IllegalAccessException {
  final Field field = ClassRequest.class.getDeclaredField("fTestClass");
  field.setAccessible(true);
  final Description methodDescription = Description.createSuiteDescription((Class)field.get(request));
  for (Iterator iterator = description.getChildren().iterator(); iterator.hasNext();) {
    methodDescription.addChild((Description)iterator.next());
  }
  description = methodDescription;
  return description;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:JUnit4IdeaTestRunner.java


示例6: aClass

import org.junit.internal.requests.ClassRequest; //导入依赖的package包/类
/**
 * Create a <code>Request</code> that, when processed, will run all the tests
 * in a class. The odd name is necessary because <code>class</code> is a reserved word.
 *
 * @param clazz the class containing the tests
 * @return a <code>Request</code> that will cause all tests in the class to be run
 */
public static Request aClass(Class<?> clazz) {
    return new ClassRequest(clazz);
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:11,代码来源:Request.java


示例7: classWithoutSuiteMethod

import org.junit.internal.requests.ClassRequest; //导入依赖的package包/类
/**
 * Create a <code>Request</code> that, when processed, will run all the tests
 * in a class. If the class has a suite() method, it will be ignored.
 *
 * @param clazz the class containing the tests
 * @return a <code>Request</code> that will cause all tests in the class to be run
 */
public static Request classWithoutSuiteMethod(Class<?> clazz) {
    return new ClassRequest(clazz, false);
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:11,代码来源:Request.java



注:本文中的org.junit.internal.requests.ClassRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DarculaUIUtil类代码示例发布时间:2022-05-22
下一篇:
Java LicenseResolver类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap