package com.google.jam.unit.solvers;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.function.Function;
import java.util.function.Supplier;

import com.google.jam.solvers.MultiThreadRoundResolver;
import com.google.jam.solvers.RoundResolver;

import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

//@RunWith(Parameterized.class)
public class MultiThreadRoundResolversTest/*
        extends AbstractRoundResolversTest */ {

    @Parameters
    public static Collection<Object[]> dataSubClass() {
        return new DataProvider().provide(
                new AlgorithmSupplier(),
                new RoundLetterSupplier(),
                new TestDataLocationSupplier(),
                new NumberOfThreadFunctionSupplier()
        );
    }

    private final Supplier<Integer> numberOfThreadFunction;

    public MultiThreadRoundResolversTest(
            final Function<String, Integer> algorithm,
            final char roundLetter,
            final String location,
            final String complexity,
            final String roundType,
            final Supplier<Integer> numberOfThreadFunction) {
//        super(algorithm, roundLetter, location, complexity, roundType);
        this.numberOfThreadFunction = numberOfThreadFunction;
    }

    //    @Override
    protected RoundResolver createRoundResolver() {
        return new MultiThreadRoundResolver(numberOfThreadFunction);
    }

    private static class DataProvider {

        public Collection<Object[]> provide(
                final Supplier<Iterator<Function<String, String>>> algorithmSupplier,
                final Supplier<Iterator<Character>> roundLetterSupplier,
                final Supplier<Iterator<String[]>> testDataLocationSupplier,
                final Supplier<Iterator<Supplier<Integer>>> numberOfThreadFunctionSupplier) {
            final Collection<Object[]> collection = new ArrayList<>();
            final Iterator<Character> roundLetterIterator = roundLetterSupplier.get();
            final Iterator<Function<String, String>> algorithmIterator = algorithmSupplier.get();
            while (roundLetterIterator.hasNext()) {
                final Character roundLetter = roundLetterIterator.next();
                final Function<String, String> algorithm = algorithmIterator.next();
                final Iterator<String[]> testDataLocationIterator = testDataLocationSupplier.get();
                while (testDataLocationIterator.hasNext()) {
                    final String[] testDataLocation = testDataLocationIterator.next();
                    final Iterator<Supplier<Integer>> numberOfThreadFunctionIterator =
                            numberOfThreadFunctionSupplier.get();
                    while (numberOfThreadFunctionIterator.hasNext()) {
                        final Supplier<Integer> numberOfThreadFunction = numberOfThreadFunctionIterator.next();
                        collection.add(
                                new Object[] {
                                        algorithm,
                                        roundLetter,
                                        testDataLocation[0],
                                        testDataLocation[1],
                                        testDataLocation[2],
                                        numberOfThreadFunction
                                }
                        );
                    }
                }
            }
            return collection;
        }
    }
}

@@ -415,18 +415,16 @@
 eters;%0A%0A
-//
 @RunWith
@@ -491,10 +491,8 @@
 Test
-/*
 %0A   
@@ -534,11 +534,8 @@
 Test
- */
  %7B%0A%0A
@@ -990,23 +990,22 @@
 String, 
-Integer
+String
 %3E algori
@@ -1215,18 +1215,16 @@
 tion) %7B%0A
-//
         
@@ -1287,16 +1287,16 @@
 dType);%0A
+
         
@@ -1360,14 +1360,8 @@
  %7D%0A%0A
-    //
     

switch on multithread resolver test