com.jparams.junit4.statement.ParameterizedTestStatement Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jparams-junit4 Show documentation
Show all versions of jparams-junit4 Show documentation
Parameterized JUnit4 Tests
package com.jparams.junit4.statement;
import com.jparams.junit4.ParameterizedMethod;
import com.jparams.junit4.data.converter.BigDecimalConverter;
import com.jparams.junit4.data.converter.BooleanConverter;
import com.jparams.junit4.data.converter.ClassConverter;
import com.jparams.junit4.data.converter.Convert;
import com.jparams.junit4.data.converter.Converter;
import com.jparams.junit4.data.converter.DateConverter;
import com.jparams.junit4.data.converter.DoubleConverter;
import com.jparams.junit4.data.converter.EnumConverter;
import com.jparams.junit4.data.converter.FloatConverter;
import com.jparams.junit4.data.converter.IntegerConverter;
import com.jparams.junit4.data.converter.LongConverter;
import com.jparams.junit4.data.converter.StringConverter;
import com.jparams.junit4.reflection.MethodParameter;
import com.jparams.junit4.reflection.Reflection;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.Statement;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ParameterizedTestStatement extends Statement {
private static final Map, Converter> converters = getConverters();
private final ParameterizedMethod parameterizedMethod;
private final Object test;
public ParameterizedTestStatement(ParameterizedMethod parameterizedMethod, Object test) {
this.parameterizedMethod = parameterizedMethod;
this.test = test;
}
@Override
public void evaluate() throws Throwable {
FrameworkMethod method = parameterizedMethod.getMethod();
Object[] parameters = parameterizedMethod.getParameters();
MethodParameter[] methodParameters = Reflection.getMethodParameters(method.getMethod());
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy