项目:intellij-ce-playground
文件:JUnit4IdeaTestRunner.java
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;
}
项目:tools-idea
文件:JUnit4IdeaTestRunner.java
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;
}
项目:intellij-ce-playground
文件:JUnit4IdeaTestRunner.java
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;
}
项目:intellij-ce-playground
文件:JUnit4TestRunnerUtil.java
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();
}
};
}
项目:tools-idea
文件:JUnit4IdeaTestRunner.java
private static Description getSuiteMethodDescription(Request request,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;
}
项目:tools-idea
文件:JUnit4TestRunnerUtil.java
项目:sosiefier
文件:Request.java
/**
* 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);
}
项目:sosiefier
文件:Request.java
/**
* Create a <code>Request</code> that,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);
}
项目:lcm
文件:Request.java
/**
* Create a <code>Request</code> that,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);
}
项目:lcm
文件:Request.java
/**
* Create a <code>Request</code> that,false);
}
项目:junit
文件:Request.java
/**
* Create a <code>Request</code> that,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);
}
项目:junit
文件:Request.java
/**
* Create a <code>Request</code> that,false);
}
项目:org.openntf.domino
文件:Request.java
/**
* Create a <code>Request</code> that,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);
}
项目:org.openntf.domino
文件:Request.java
/**
* Create a <code>Request</code> that,false);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。