本文整理匯總了Java中org.junit.runner.Description.getDisplayName方法的典型用法代碼示例。如果您正苦於以下問題:Java Description.getDisplayName方法的具體用法?Java Description.getDisplayName怎麽用?Java Description.getDisplayName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.junit.runner.Description
的用法示例。
在下文中一共展示了Description.getDisplayName方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getTestName
import org.junit.runner.Description; //導入方法依賴的package包/類
/***/
public static String getTestName(Description description) {
String text = null;
if (description.isTest()) {
String s = description.getDisplayName();
if (s.startsWith(TEST_FILE_INIT_ERROR_MSG)) {
return TEST_FILE_INIT_ERROR_MSG;
}
// seems like malformed xt file - no XPECT comment ?
if (s.indexOf("#") < 0 || s.indexOf("~") < 0) {
return s;
}
int posXT = s.indexOf("#");
int posTM = s.indexOf("~", posXT);
text = s.substring(posXT + 1, posTM);
}
return text;
}
示例2: apply
import org.junit.runner.Description; //導入方法依賴的package包/類
public Statement apply(final Statement base, Description description) {
Class<?> testClass = description.getTestClass();
init(description.getMethodName(), testClass.getSimpleName());
suppressCleanupErrors = testClass.getAnnotation(LeaksFileHandles.class) != null
|| description.getAnnotation(LeaksFileHandles.class) != null;
return new TestDirectoryCleaningStatement(base, description.getDisplayName());
}
示例3: getSuiteName
import org.junit.runner.Description; //導入方法依賴的package包/類
/***/
public static String getSuiteName(Description description) {
String text = null;
if (description.isSuite()) {
String s = description.getDisplayName();
int posSemi = s.indexOf(":");
text = s.substring(0, posSemi);
}
return text;
}
示例4: constructWorkingDirectoryByDescription
import org.junit.runner.Description; //導入方法依賴的package包/類
private synchronized File constructWorkingDirectoryByDescription(final Description description) {
final File class_name = new File(RESULTS_HOME, getTestClass().getJavaClass().getSimpleName());
final File display_name = new File(class_name, description.getDisplayName());
final File repetitions = new File(display_name, REPETITIONS_HOME_NAME);
final File working_directory = new File(repetitions, DATE_FORMAT.format(new Date()));
return working_directory.exists() ? constructWorkingDirectoryByDescription(description) : working_directory;
}
示例5: apply
import org.junit.runner.Description; //導入方法依賴的package包/類
@Override
public Statement apply(Statement statement, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
List<Fetch> annotations = annotationCollector.getAnnotations(description);
if (!annotations.isEmpty()) {
testName = description.getDisplayName();
}
fetchFromAnnotation(annotations, testName);
statement.evaluate();
}
};
}
示例6: setTestName
import org.junit.runner.Description; //導入方法依賴的package包/類
/**
* To be called in the {@link #apply(Statement, Description)}.
*/
protected void setTestName(Description description) {
testName = description.getDisplayName();
}
示例7: getTestDescription
import org.junit.runner.Description; //導入方法依賴的package包/類
private String getTestDescription( Description description ) {
String tcDescription = description.getDisplayName();
// TODO: TestHarness' @Description annotation - in TestNG package currently
return tcDescription;
}