本文整理汇总了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;
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例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());
}
示例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());
}
示例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());
}
示例10: describeChild
import org.junit.runner.Runner; //导入方法依赖的package包/类
@Override
protected Description describeChild(final Runner child) {
return child.getDescription();
}
示例11: describeChild
import org.junit.runner.Runner; //导入方法依赖的package包/类
@Override
protected Description describeChild(Runner child) {
return child.getDescription();
}
示例12: describeChild
import org.junit.runner.Runner; //导入方法依赖的package包/类
protected Description describeChild(Runner child) {
return child.getDescription();
}
示例13: describeChild
import org.junit.runner.Runner; //导入方法依赖的package包/类
@Override
protected Description describeChild(Runner child) {
return child.getDescription();
}
示例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());
}
示例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();
}