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


Java Runner.getDescription方法代碼示例

本文整理匯總了Java中org.junit.runner.Runner.getDescription方法的典型用法代碼示例。如果您正苦於以下問題:Java Runner.getDescription方法的具體用法?Java Runner.getDescription怎麽用?Java Runner.getDescription使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.junit.runner.Runner的用法示例。


在下文中一共展示了Runner.getDescription方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initExecutions

import org.junit.runner.Runner; //導入方法依賴的package包/類
private void initExecutions() {
    if (!executionsInitialized) {
        try {
            Runner descriptionProvider = createRunnerFor(Arrays.asList(target), Collections.<Filter>emptyList());
            templateDescription = descriptionProvider.getDescription();
        } catch (InitializationError initializationError) {
            throw UncheckedException.throwAsUncheckedException(initializationError);
        }
        createExecutions();
        for (Execution execution : executions) {
            execution.init(target, templateDescription);
        }
        executionsInitialized = true;
    }
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:16,代碼來源:AbstractMultiTestRunner.java

示例2: getAllDescriptions

import org.junit.runner.Runner; //導入方法依賴的package包/類
List<Description> getAllDescriptions(Description description, String className) {
    final AllExceptIgnoredTestRunnerBuilder allExceptIgnoredTestRunnerBuilder = new AllExceptIgnoredTestRunnerBuilder();
    try {
        final Class<?> testClass = description.getClass().getClassLoader().loadClass(className);
        Runner runner = allExceptIgnoredTestRunnerBuilder.runnerForClass(testClass);
        if (runner == null) {
            //fall back to default runner
            runner = Request.aClass(testClass).getRunner();
        }
        final Description runnerDescription = runner.getDescription();
        return runnerDescription.getChildren();
    } catch (Throwable throwable) {
        throw new TestSuiteExecutionException(String.format("Unable to process Ignored class %s.", className), throwable);
    }
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:16,代碼來源:IgnoredTestDescriptorProvider.java

示例3: getRootDescription

import org.junit.runner.Runner; //導入方法依賴的package包/類
private Description getRootDescription(Runner runner, DescriptionMatcher matcher) {
	Description current= runner.getDescription();
	while (true) {
		List<Description> children= current.getChildren();
		if (children.size() != 1 || matcher.matches(current))
			return current;
		current= children.get(0);
	}
}
 
開發者ID:SAP,項目名稱:hybris-commerce-eclipse-plugin,代碼行數:10,代碼來源:HybrisJUnitIntegrationTestLoader.java

示例4: createUnfilteredTest

import org.junit.runner.Runner; //導入方法依賴的package包/類
private ITestReference createUnfilteredTest(Class<?> clazz, String[] failureNames) {
	Request request= sortByFailures(Request.aClass(clazz), failureNames);
	Runner runner= request.getRunner();
	Description description= runner.getDescription();
	//I324747: modified to Hybris implementation
	return new HybrisJUnitTestReference(runner, description);
}
 
開發者ID:SAP,項目名稱:hybris-commerce-eclipse-plugin,代碼行數:8,代碼來源:HybrisJUnitIntegrationTestLoader.java

示例5: checkDescription

import org.junit.runner.Runner; //導入方法依賴的package包/類
@Test
public void checkDescription() throws InitializationError {
	Runner runner = new ZohhakRunner(BasicAnnotationsUsage.class);
	Description description = runner.getDescription();
	
	assertThat(description.getChildren()).hasSize(5);
}
 
開發者ID:piotrturski,項目名稱:zohhak,代碼行數:8,代碼來源:EclipseIntegration.java

示例6: initExecutions

import org.junit.runner.Runner; //導入方法依賴的package包/類
private void initExecutions() {
    if (executions.isEmpty()) {
        try {
            Runner descriptionProvider = createRunnerFor(Arrays.asList(target), Collections.<Filter>emptyList());
            templateDescription = descriptionProvider.getDescription();
        } catch (InitializationError initializationError) {
            throw UncheckedException.throwAsUncheckedException(initializationError);
        }
        createExecutions();
        for (Execution execution : executions) {
            execution.init(target, templateDescription);
        }
    }
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:15,代碼來源:AbstractMultiTestRunner.java

示例7: plansNamedCorrectly

import org.junit.runner.Runner; //導入方法依賴的package包/類
@Test
public void plansNamedCorrectly() throws Exception {
    Runner runner = Request.aClass(FibonacciTest.class).getRunner();
    Description description = runner.getDescription();
    assertEquals("[0: fib(0)=0]", description.getChildren().get(0)
            .getDisplayName());
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:8,代碼來源:ParameterizedTestTest.java

示例8: usesIndexAsTestName

import org.junit.runner.Runner; //導入方法依賴的package包/類
@Test
public void usesIndexAsTestName() {
    Runner runner = Request
            .aClass(ParameterizedWithoutSpecialTestname.class).getRunner();
    Description description = runner.getDescription();
    assertEquals("[1]", description.getChildren().get(1).getDisplayName());
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:8,代碼來源:ParameterizedTestTest.java

示例9: eliminateUnnecessaryTreeBranches

import org.junit.runner.Runner; //導入方法依賴的package包/類
@Test
public void eliminateUnnecessaryTreeBranches() throws Exception {
    Runner runner = Request.aClass(OneTwoSuite.class).filterWith(
            Description.createTestDescription(TestOne.class, "a"))
            .getRunner();
    Description description = runner.getDescription();
    assertEquals(1, description.getChildren().size());
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:9,代碼來源:SingleMethodTest.java

示例10: describeChild

import org.junit.runner.Runner; //導入方法依賴的package包/類
@Override
protected Description describeChild(final Runner child) {
	return child.getDescription();
}
 
開發者ID:xtf-cz,項目名稱:xtf,代碼行數:5,代碼來源:XTFTestSuite.java

示例11: describeChild

import org.junit.runner.Runner; //導入方法依賴的package包/類
@Override
protected Description describeChild(Runner child) {
    return child.getDescription();
}
 
開發者ID:easymall,項目名稱:easy-test,代碼行數:5,代碼來源:EasySuite.java

示例12: describeChild

import org.junit.runner.Runner; //導入方法依賴的package包/類
protected Description describeChild(Runner child) {
    return child.getDescription();
}
 
開發者ID:PeterWippermann,項目名稱:parameterized-suite,代碼行數:4,代碼來源:ParameterizedSuite.java

示例13: describeChild

import org.junit.runner.Runner; //導入方法依賴的package包/類
@Override
protected Description describeChild(Runner child) {
	return child.getDescription();
}
 
開發者ID:eclipse,項目名稱:xtext-core,代碼行數:5,代碼來源:AllScenariosRunner.java

示例14: plansNamedCorrectlyWithParameterizedField

import org.junit.runner.Runner; //導入方法依賴的package包/類
@Test
public void plansNamedCorrectlyWithParameterizedField() throws Exception {
    Runner runner = Request.aClass(FibonacciWithParameterizedFieldTest.class).getRunner();
    Description description = runner.getDescription();
    assertEquals("[0]", description.getChildren().get(0).getDisplayName());
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:7,代碼來源:ParameterizedTestTest.java

示例15: I_describe_the_tests

import org.junit.runner.Runner; //導入方法依賴的package包/類
@When("^I describe the tests in the class$")
public void I_describe_the_tests() throws Exception {
  Runner runner = new JavaSpecRunner(testClass);
  this.description = runner.getDescription();
}
 
開發者ID:kkrull,項目名稱:javaspec,代碼行數:6,代碼來源:JavaSpecRunnerSteps.java


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