本文整理汇总了Java中org.junit.runner.Describable类的典型用法代码示例。如果您正苦于以下问题:Java Describable类的具体用法?Java Describable怎么用?Java Describable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Describable类属于org.junit.runner包,在下文中一共展示了Describable类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: makeDescription
import org.junit.runner.Describable; //导入依赖的package包/类
private static Description makeDescription(Test test) {
if (test instanceof TestCase) {
TestCase tc = (TestCase) test;
return Description.createTestDescription(tc.getClass(), tc.getName(),
getAnnotations(tc));
} else if (test instanceof TestSuite) {
TestSuite ts = (TestSuite) test;
String name = ts.getName() == null ? createSuiteDescription(ts) : ts.getName();
Description description = Description.createSuiteDescription(name);
int n = ts.testCount();
for (int i = 0; i < n; i++) {
Description made = makeDescription(ts.testAt(i));
description.addChild(made);
}
return description;
} else if (test instanceof Describable) {
Describable adapter = (Describable) test;
return adapter.getDescription();
} else if (test instanceof TestDecorator) {
TestDecorator decorator = (TestDecorator) test;
return makeDescription(decorator.getTest());
} else {
// This is the best we can do in this case
return Description.createSuiteDescription(test.getClass());
}
}
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:27,代码来源:JUnit38ClassRunner.java
示例2: makeDescription
import org.junit.runner.Describable; //导入依赖的package包/类
private static Description makeDescription(Test test) {
if (test instanceof TestCase) {
TestCase tc = (TestCase) test;
return Description.createTestDescription(tc.getClass(), tc.getName());
} else if (test instanceof TestSuite) {
TestSuite ts = (TestSuite) test;
String name = ts.getName() == null ? createSuiteDescription(ts) : ts.getName();
Description description = Description.createSuiteDescription(name);
int n = ts.testCount();
for (int i = 0; i < n; i++) {
Description made = makeDescription(ts.testAt(i));
description.addChild(made);
}
return description;
} else if (test instanceof Describable) {
Describable adapter = (Describable) test;
return adapter.getDescription();
} else if (test instanceof TestDecorator) {
TestDecorator decorator = (TestDecorator) test;
return makeDescription(decorator.getTest());
} else {
// This is the best we can do in this case
return Description.createSuiteDescription(test.getClass());
}
}
开发者ID:lcm-proj,项目名称:lcm,代码行数:26,代码来源:JUnit38ClassRunner.java
示例3: asDescription
import org.junit.runner.Describable; //导入依赖的package包/类
private Description asDescription(Test test) {
if (test instanceof Describable) {
Describable facade = (Describable) test;
return facade.getDescription();
}
return Description.createTestDescription(getEffectiveClass(test), getName(test));
}
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:8,代码来源:JUnit38ClassRunner.java
注:本文中的org.junit.runner.Describable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论