當前位置: 首頁>>代碼示例>>Java>>正文


Java Description.getDisplayName方法代碼示例

本文整理匯總了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;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:22,代碼來源:N4IDEXpectFileNameUtil.java

示例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());
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:10,代碼來源:AbstractTestDirectoryProvider.java

示例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;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:11,代碼來源:N4IDEXpectFileNameUtil.java

示例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;
    }
 
開發者ID:stacs-srg,項目名稱:shabdiz,代碼行數:9,代碼來源:ExperimentRunner.java

示例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();
        }
    };
}
 
開發者ID:christian-draeger,項目名稱:page-content-tester,代碼行數:16,代碼來源:FetcherRule.java

示例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();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:7,代碼來源:TestRealmConfigurationFactory.java

示例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;
    }
 
開發者ID:Axway,項目名稱:ats-framework,代碼行數:8,代碼來源:AtsJunitTestListener.java


注:本文中的org.junit.runner.Description.getDisplayName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。