import Sequenic.T2.TrFile; import Sequenic.T2ext.Analyzer.T2TraceFileCoverageAnalyzer; import Sequenic.T2ext.Analyzer.T2TraceFileCoverageResult; import java_1_4.util.* ; import junit.framework.TestCase ; public class ArrayList_mutationTest extends TestCase { String trfile1 ; String trfile2 ; Experiment_ArrayList_1 expr1 ; Experiment_ArrayList_2 expr2 ; public ArrayList_mutationTest() { expr1 = new Experiment_ArrayList_1() ; expr2 = new Experiment_ArrayList_2() ; trfile1 = expr1.trfiles[9][5] ; trfile2 = expr2.trfiles[3][5] ; } void coba() { T2TraceFileCoverageAnalyzer analz = new T2TraceFileCoverageAnalyzer( trfile1, expr1.CUTpath + expr1.CUTsimplename + ".cfgs"); TrFile base_trf = analz.tracefile ; analz = new T2TraceFileCoverageAnalyzer( trfile2, expr2.CUTpath + expr2.CUTsimplename + ".cfgs"); ArrayList_test1.markIrrelevant(analz) ; analz.tracefile = base_trf.merge(analz.tracefile) ; System.out.println("** Analyzing ... ") ; T2TraceFileCoverageResult res = analz.calculateCoverage(); int numOfPath = res.totNumberOfTargetPaths() ; int Di = res.totNumberOfDirectlyCoveredPaths() ; System.out.println("** Direct path coverage = " + T2TraceFileCoverageResult.calcPercentage(Di,numOfPath)) ; } public void test1() { // Forcing assertion to be anabled: MyArrayList.class.getClassLoader().setClassAssertionStatus(MyArrayList.class.getName(),true) ; try { System.out.println("** Replaying " + trfile1 + " ...") ; Sequenic.T2.Main.Junit("-R " + trfile1 // + " --tmax=100" + " --silent" + " --violmax=1" ) ; System.out.println("** Replaying " + trfile2 + " ...") ; Sequenic.T2.Main.Junit("-R " + trfile2 + " --silent" + " --violmax=1" ) ; } catch (Sequenic.T2.Msg.Violation v) { System.out.println("** FAIL!") ; assertTrue(false) ; } System.out.println("** PASS.") ; } static public void main(String[] args) { ArrayList_mutationTest T = new ArrayList_mutationTest() ; T.test1() ; //T.coba() ; } }