package SBST2015; import java.util.*; import Sequenic.T3.Config; import Sequenic.T3.T3groovyAPI; import Sequenic.T3.Sequence.Datatype.SUITE; import Sequenic.T3.Sequence.Datatype.SUITE_RT_info; /** * Provide function that will load trace files, and function to replay a suite. * To be loaded from JUnit test class. * * We eventually don't use this utility class... because Pitest will drop the entire * test class if just one of the test method fails :( */ public class Replayer { public T3groovyAPI t3 ; public List suites ; public List minOrcSuites ; public List inner_suites ; public List inner_minOrcSuites ; public Replayer(String CUT, String tracesDir) throws Exception { this(Class.forName(CUT),tracesDir) ; } public Replayer(Class CUT, String tracesDir) throws Exception { Common.setCUT(CUT) ; if (tracesDir != null) Common.setTraceDir(tracesDir) ; Config config = Common.replayConfig() ; t3 = new T3groovyAPI(config) ; suites = Common.load("suite_") ; minOrcSuites = Common.load("minOrcSuite_") ; inner_suites = Common.load("inner_suite_") ; inner_minOrcSuites = Common.load("inner_minOrcSuite_") ; } public boolean test(SUITE S) { SUITE_RT_info info = t3.replay(S); return info.violating.isEmpty() ; } }