Home | History | Annotate | Download | only in combined
      1 package junitparams.custom.combined;
      2 
      3 import java.util.ArrayList;
      4 import java.util.List;
      5 
      6 import junitparams.custom.ParametersProvider;
      7 import junitparams.internal.Utils;
      8 
      9 public class CombinedParametersProvider implements ParametersProvider<CombinedParameters> {
     10 
     11     private CombinedParameters combinedParameters;
     12 
     13     @Override
     14     public void initialize(CombinedParameters parametersAnnotation) {
     15         this.combinedParameters = parametersAnnotation;
     16     }
     17 
     18     @Override
     19     public Object[] getParameters() {
     20         List<Object[]> list = new ArrayList<Object[]>();
     21         for(String parameterArray : combinedParameters.value()) {
     22             list.add(Utils.splitAtCommaOrPipe(parameterArray));
     23         }
     24 
     25         return Cartesian.getCartesianProductOf(list);
     26     }
     27 }
     28