package com.grayben.riskExtractor.helpers;

import com.grayben.riskExtractor.htmlScorer.ScoredText;
import com.grayben.riskExtractor.htmlScorer.partScorers.Scorer;
import com.grayben.tools.testOracle.SystemUnderTest;
import com.grayben.tools.testOracle.oracle.passive.PassiveOracle;
import com.grayben.tools.testOracle.testContainer.TestContainer;
import org.jsoup.nodes.Element;

import java.io.File;
import java.util.Set;
import java.util.function.Function;
import java.util.function.Supplier;

/**
 * Created by Ben Gray on 19/02/2016.
 */
public class TreeHtmlScorerReverserTestContainerSupplier implements Supplier<TestContainer<ScoredText, ScoredText>> {

    private final Supplier<Set<Scorer<Element>>> elementScorersSupplier;

    public TreeHtmlScorerReverserTestContainerSupplier(Supplier<Set<Scorer<Element>>> elementScorersSupplier) {
        this.elementScorersSupplier = elementScorersSupplier;
    }

    @Override
    public TestContainer<ScoredText, ScoredText> get() {
        return new TestContainer.Builder<ScoredText, ScoredText>()
                .begin()
                .systemUnderTest(systemUnderTest())
                .oracle(passiveOracle())
                .build();
    }

    private PassiveOracle<ScoredText, ScoredText> passiveOracle(){
        return (input, actualOutput) -> input.equals(actualOutput);
    }

    /**
     *
     * @param elementScorers the element scorers to be used in the forward function
     * @param scoredText the target scored text
     * @return a file for which a correct implementation of TreeHtmlScorer will produce the specified ScoredText
     */
    private Function<ScoredText, File> reverse(){
        throw new UnsupportedOperationException("Not implemented");
    }

    private Function<File, ScoredText> forward(){
        throw new UnsupportedOperationException("Not implemented");
    }

    private SystemUnderTest<? super ScoredText, ? extends ScoredText> systemUnderTest() {
        return scoredText -> reverse().andThen(forward()).apply(scoredText);
    }


}

@@ -391,24 +391,52 @@
 va.io.File;%0A
+import java.io.InputStream;%0A
 import java.
@@ -1670,20 +1670,27 @@
 edText, 
-File
+InputStream
 %3E revers
@@ -1790,20 +1790,27 @@
 unction%3C
-File
+InputStream
 , Scored
@@ -1933,16 +1933,8 @@
 est%3C
-? super 
 Scor
@@ -1944,18 +1944,8 @@
 ext,
- ? extends
  Sco

Make tc supplier reverse to InputReader, not File