本文整理汇总了Java中org.junit.runners.parameterized.ParametersRunnerFactory类的典型用法代码示例。如果您正苦于以下问题:Java ParametersRunnerFactory类的具体用法?Java ParametersRunnerFactory怎么用?Java ParametersRunnerFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParametersRunnerFactory类属于org.junit.runners.parameterized包,在下文中一共展示了ParametersRunnerFactory类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createRunnersForParameters
import org.junit.runners.parameterized.ParametersRunnerFactory; //导入依赖的package包/类
private List<Runner> createRunnersForParameters(
Iterable<Object> allParameters, String namePattern,
ParametersRunnerFactory runnerFactory) throws Exception {
try {
List<TestWithParameters> tests = createTestsForParameters(
allParameters, namePattern);
List<Runner> runners = new ArrayList<Runner>();
for (TestWithParameters test : tests) {
runners.add(runnerFactory
.createRunnerForTestWithParameters(test));
}
return runners;
} catch (ClassCastException e) {
throw parametersMethodReturnedWrongType();
}
}
开发者ID:hortonworks,项目名称:registry,代码行数:17,代码来源:CustomParameterizedRunner.java
示例2: createRunnersForParameters
import org.junit.runners.parameterized.ParametersRunnerFactory; //导入依赖的package包/类
private List<Runner> createRunnersForParameters(
Iterable<Object> allParameters, String namePattern,
ParametersRunnerFactory runnerFactory)
throws InitializationError,
Exception {
try {
List<TestWithParameters> tests = createTestsForParameters(
allParameters, namePattern);
List<Runner> runners = new ArrayList<Runner>();
for (TestWithParameters test : tests) {
runners.add(runnerFactory
.createRunnerForTestWithParameters(test));
}
return runners;
} catch (ClassCastException e) {
throw parametersMethodReturnedWrongType();
}
}
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:19,代码来源:Parameterized.java
示例3: getParametersRunnerFactory
import org.junit.runners.parameterized.ParametersRunnerFactory; //导入依赖的package包/类
private ParametersRunnerFactory getParametersRunnerFactory()
throws InstantiationException, IllegalAccessException {
UseParametersRunnerFactory annotation = testClass
.getAnnotation(UseParametersRunnerFactory.class);
if (annotation == null) {
return DEFAULT_FACTORY;
} else {
Class<? extends ParametersRunnerFactory> factoryClass = annotation
.value();
return factoryClass.newInstance();
}
}
开发者ID:hortonworks,项目名称:registry,代码行数:13,代码来源:CustomParameterizedRunner.java
示例4: Parameterized
import org.junit.runners.parameterized.ParametersRunnerFactory; //导入依赖的package包/类
public Parameterized(Class<?> klass) throws Throwable {
super(klass);
FrameworkMethod parametersMethod = getParametersMethod();
if (parametersMethod != null) {
Parameters parameters = parametersMethod.getAnnotation(Parameters.class);
Method declaredMethod =
org.junit.runners.Parameterized.class.getDeclaredMethod("createRunnersForParameters", Iterable.class, String.class, ParametersRunnerFactory.class);
declaredMethod.setAccessible(true);
l = (List<Runner>)declaredMethod.invoke(this, allParameters(klass, parametersMethod), parameters.name(), BlockJUnit4ClassRunnerWithParametersFactory.class.newInstance());
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:Parameterized.java
示例5: Parameterized
import org.junit.runners.parameterized.ParametersRunnerFactory; //导入依赖的package包/类
/**
* Only called reflectively. Do not use programmatically.
*/
public Parameterized(Class<?> klass) throws Throwable {
super(klass, NO_RUNNERS);
ParametersRunnerFactory runnerFactory = getParametersRunnerFactory(
klass);
Parameters parameters = getParametersMethod().getAnnotation(
Parameters.class);
fRunners = Collections.unmodifiableList(createRunnersForParameters(
allParameters(), parameters.name(), runnerFactory));
}
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:13,代码来源:Parameterized.java
示例6: getParametersRunnerFactory
import org.junit.runners.parameterized.ParametersRunnerFactory; //导入依赖的package包/类
private ParametersRunnerFactory getParametersRunnerFactory(Class<?> klass)
throws InstantiationException, IllegalAccessException {
UseParametersRunnerFactory annotation = klass
.getAnnotation(UseParametersRunnerFactory.class);
if (annotation == null) {
return DEFAULT_FACTORY;
} else {
Class<? extends ParametersRunnerFactory> factoryClass = annotation
.value();
return factoryClass.newInstance();
}
}
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:13,代码来源:Parameterized.java
注:本文中的org.junit.runners.parameterized.ParametersRunnerFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论