当前位置: 首页>>代码示例>>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;未经允许,请勿转载。