Java 类org.junit.runners.parameterized.TestWithParameters 实例源码
项目:registry
文件:CustomParameterizedRunner.java
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();
}
}
项目:FreeBuilder
文件:ParameterizedBehaviorTestFactory.java
ParameterizedBehaviorTestRunner(TestWithParameters test) throws InitializationError {
super(test);
FeatureSet features = FluentIterable
.from(test.getParameters())
.filter(FeatureSet.class)
.first()
.orNull();
checkState(features != null, "No FeatureSet parameter found");
// JDK-8 bug: Cannot use `super::` if the superclass method is protected; see
// https://bugs.openjdk.java.net/browse/JDK-8139836
testing = new SharedBehaviorTesting(
notifier -> super.childrenInvoker(notifier),
(method, notifier) -> super.runChild(method, notifier),
super::createTest,
super::getDescription,
super::getTestClass,
(cls, name) -> Description.createTestDescription(cls, name + test.getParameters()),
features);
}
项目:sosiefier
文件:Parameterized.java
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();
}
}
项目:OHMS
文件:RunnerFactory.java
@Override
public org.junit.runner.Runner createRunnerForTestWithParameters( TestWithParameters test )
throws InitializationError
{
Class<?> klass = test.getTestClass().getJavaClass();
return new RetryRunner( klass, test );
}
项目:registry
文件:CustomParameterizedRunner.java
private TestWithParameters createTestWithNotNormalizedParameters(
String pattern, int index, Object parametersOrSingleParameter) {
Object[] parameters = (parametersOrSingleParameter instanceof Object[]) ? (Object[]) parametersOrSingleParameter
: new Object[] { parametersOrSingleParameter };
return createTestWithParameters(testClass, pattern, index,
parameters);
}
项目:registry
文件:CustomParameterizedRunner.java
private List<TestWithParameters> createTestsForParameters(
Iterable<Object> allParameters, String namePattern)
throws Exception {
int i = 0;
List<TestWithParameters> children = new ArrayList<TestWithParameters>();
for (Object parametersOfSingleTest : allParameters) {
children.add(createTestWithNotNormalizedParameters(namePattern,
i++, parametersOfSingleTest));
}
return children;
}
项目:registry
文件:CustomParameterizedRunner.java
private TestWithParameters createTestWithParameters(
TestClass testClass, String pattern, int index,
Object[] parameters) {
String finalPattern = pattern.replaceAll("\\{index\\}",
Integer.toString(index));
String name = MessageFormat.format(finalPattern, parameters);
return new TestWithParameters("[" + name + "]", testClass,
Arrays.asList(parameters));
}
项目:registry
文件:CustomParameterizedBlockJUnit4Runner.java
public CustomParameterizedBlockJUnit4Runner(TestWithParameters test)
throws InitializationError {
super(test.getTestClass().getJavaClass());
parameters = test.getParameters().toArray(
new Object[test.getParameters().size()]);
name = test.getName();
}
项目:sosiefier
文件:Parameterized.java
private TestWithParameters createTestWithNotNormalizedParameters(
String pattern, int index, Object parametersOrSingleParameter) {
Object[] parameters= (parametersOrSingleParameter instanceof Object[]) ? (Object[]) parametersOrSingleParameter
: new Object[] { parametersOrSingleParameter };
return createTestWithParameters(getTestClass(), pattern, index,
parameters);
}
项目:sosiefier
文件:Parameterized.java
private List<TestWithParameters> createTestsForParameters(
Iterable<Object> allParameters, String namePattern)
throws Exception {
int i = 0;
List<TestWithParameters> children = new ArrayList<TestWithParameters>();
for (Object parametersOfSingleTest : allParameters) {
children.add(createTestWithNotNormalizedParameters(namePattern,
i++, parametersOfSingleTest));
}
return children;
}
项目:sosiefier
文件:Parameterized.java
private static TestWithParameters createTestWithParameters(
TestClass testClass, String pattern, int index, Object[] parameters) {
String finalPattern = pattern.replaceAll("\\{index\\}",
Integer.toString(index));
String name = MessageFormat.format(finalPattern, parameters);
return new TestWithParameters("[" + name + "]", testClass,
Arrays.asList(parameters));
}
项目:denominator
文件:Live.java
protected List<Runner> createRunners(Class<?> klass) throws InitializationError {
List<Runner> result = new ArrayList<Runner>();
TestWithParameters test = new TestWithParameters(graph.manager().toString(), getTestClass(),
Arrays.<Object>asList(graph.manager()));
result.add(new BlockJUnit4ClassRunnerWithParameters(test));
return Collections.unmodifiableList(result);
}
项目:https-github.com-apache-zookeeper
文件:ZKParameterized.java
@Override
public org.junit.runner.Runner createRunnerForTestWithParameters(TestWithParameters test) throws InitializationError {
return new ZKParameterized.Runner(test);
}
项目:https-github.com-apache-zookeeper
文件:ZKParameterized.java
public Runner(TestWithParameters test) throws InitializationError {
super(test);
}
项目:monarch
文件:CategoryWithParameterizedRunnerFactory.java
@Override
public Runner createRunnerForTestWithParameters(TestWithParameters test)
throws InitializationError {
return new CategoryWithParameterizedRunner(test);
}
项目:monarch
文件:CategoryWithParameterizedRunner.java
public CategoryWithParameterizedRunner(TestWithParameters test) throws InitializationError {
super(test);
}
项目:monarch
文件:CategoryWithParameterizedRunnerFactoryTest.java
public ExposedBlockJUnit4ClassRunnerWithParameters(TestWithParameters test)
throws InitializationError {
super(test);
}
项目:monarch
文件:CategoryWithParameterizedRunnerFactoryTest.java
public Runner createRunnerForTestWithParameters(TestWithParameters test)
throws InitializationError {
return new ExposedBlockJUnit4ClassRunnerWithParameters(test);
}
项目:QD
文件:TraceRunnerWithParameters.java
public TraceRunnerWithParameters(TestWithParameters test) throws InitializationError {
super(test);
}
项目:QD
文件:TraceRunnerWithParametersFactory.java
@Override
public Runner createRunnerForTestWithParameters(TestWithParameters test) throws InitializationError {
return new TraceRunnerWithParameters(test);
}
项目:OHMS
文件:RetryRunner.java
public RetryRunner( Class<?> klass, TestWithParameters test )
throws InitializationError
{
super( test );
this.parameters = test.getParameters().toArray( new Object[test.getParameters().size()] );
}
项目:registry
文件:CustomParameterizedBlockJUnit4RunnerFactory.java
public Runner createRunnerForTestWithParameters(TestWithParameters test)
throws InitializationError {
return new CustomParameterizedBlockJUnit4Runner(test);
}
项目:SecureKeeper
文件:ZKParameterized.java
@Override
public org.junit.runner.Runner createRunnerForTestWithParameters(TestWithParameters test) throws InitializationError {
return new ZKParameterized.Runner(test);
}
项目:SecureKeeper
文件:ZKParameterized.java
public Runner(TestWithParameters test) throws InitializationError {
super(test);
}
项目:SecureKeeper
文件:ZKParameterized.java
@Override
public org.junit.runner.Runner createRunnerForTestWithParameters(TestWithParameters test) throws InitializationError {
return new ZKParameterized.Runner(test);
}
项目:SecureKeeper
文件:ZKParameterized.java
public Runner(TestWithParameters test) throws InitializationError {
super(test);
}
项目:FreeBuilder
文件:ParameterizedBehaviorTestFactory.java
@Override
public Runner createRunnerForTestWithParameters(TestWithParameters test)
throws InitializationError {
return new ParameterizedBehaviorTestRunner(test);
}
项目:vertx-unit
文件:VertxUnitRunnerWithParametersFactory.java
@Override
public Runner createRunnerForTestWithParameters(TestWithParameters test) throws InitializationError {
return new VertxUnitRunnerWithParameters(test);
}
项目:vertx-unit
文件:VertxUnitRunnerWithParameters.java
protected VertxUnitRunnerWithParameters(TestWithParameters test) throws InitializationError {
super(test.getTestClass().getJavaClass());
parameters = test.getParameters().toArray(
new Object[test.getParameters().size()]);
name = test.getName();
}
项目:hifive-pitalium
文件:PtlBlockJUnit4ClassRunnerWithParametersFactory.java
@Override
public Runner createRunnerForTestWithParameters(TestWithParameters test) throws InitializationError {
return new PtlBlockJUnit4ClassRunnerWithParameters(test);
}
项目:sosiefier
文件:ParameterizedTestTest.java
public Runner createRunnerForTestWithParameters(TestWithParameters test)
throws InitializationError {
throw new InitializationError(
"Called ExceptionThrowingRunnerFactory.");
}
项目:orcas
文件:OrcasParameterizedParallel.java
public Runner createRunnerForTestWithParameters( TestWithParameters pTest ) throws InitializationError
{
return new OrcasBlockJUnit4ClassRunnerWithParameters( pTest );
}
项目:orcas
文件:OrcasParameterizedParallel.java
public OrcasBlockJUnit4ClassRunnerWithParameters( TestWithParameters pTest ) throws InitializationError
{
super( pTest );
testName = (String)pTest.getParameters().get( 0 );
}
项目:kurento-java
文件:KurentoBlockJUnit4ClassRunnerWithParameters.java
public KurentoBlockJUnit4ClassRunnerWithParameters(TestWithParameters test)
throws InitializationError {
super(test);
}
项目:kurento-java
文件:KurentoBlockJUnit4ClassRunnerWithParametersFactory.java
@Override
public Runner createRunnerForTestWithParameters(TestWithParameters test)
throws InitializationError {
return new KurentoBlockJUnit4ClassRunnerWithParameters(test);
}
项目:es6draft
文件:ParameterizedRunner.java
public ParameterizedRunner(TestWithParameters test) throws InitializationError {
super(test);
}
项目:es6draft
文件:ParameterizedRunnerFactory.java
@Override
public Runner createRunnerForTestWithParameters(TestWithParameters test) throws InitializationError {
return new ParameterizedRunner(test);
}
项目:hifive-pitalium
文件:PtlBlockJUnit4ClassRunnerWithParameters.java
/**
* コンストラクタ
*
* @param test パラメータ付きテストクラス
* @throws InitializationError 初期化に失敗した場合
*/
public PtlBlockJUnit4ClassRunnerWithParameters(TestWithParameters test) throws InitializationError {
super(test);
parameters = test.getParameters().toArray(new Object[test.getParameters().size()]);
}