package org.ntlab.trace;

import java.util.ArrayList;
import java.util.HashSet;

public class TestTrace {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Trace tracePlus = new Trace("documents\\1593375.trace");
		Trace traceMinus = new Trace("documents\\1593375-.trace");
//		HashSet<String> marked = tracePlus.getMarkedMethodSignatures(1255991806833871L, 1255991808597322L);
//		System.out.println("===== Marked Methods =====");
//		for (String method: marked) {
//			System.out.println(method);
//		}
//		HashSet<String> unmarked = tracePlus.getUnmarkedMethodSignatures(1255991806833871L, 1255991808597322L);
//		System.out.println("===== Unmarked Methods =====");
//		for (String method: unmarked) {
//			System.out.println(method);
//		}
		
/*
 * 正しい結果
 * 
===== Marked Methods =====
void worstCase.O.passL(worstCase.L)
worstCase.L worstCase.I.getL()
worstCase.L worstCase.K.getL()
worstCase.M worstCase.L.getM()
worstCase.K worstCase.J.getK()
void worstCase.N.passI(worstCase.I)
void worstCase.P.setM(worstCase.M)
===== Unmarked Methods =====
worstCase.F worstCase.C.getF()
worstCase.E worstCase.D.getE()
worstCase.A()
public worstCase.M()
worstCase.F()
void worstCase.A.m()
public static void worstCase.main.main(java.lang.String[])
worstCase.G()
worstCase.H()
worstCase.I()
worstCase.B()
worstCase.C()
worstCase.D()
worstCase.E()
worstCase.N()
worstCase.O()
worstCase.P()
worstCase.F worstCase.E.getF()
worstCase.J()
worstCase.K()
worstCase.L()
worstCase.I worstCase.F.getI()
worstCase.H worstCase.G.getH()
worstCase.I worstCase.H.getI()
worstCase.I worstCase.B.getI()
 */
		HashSet<String> allPlus = tracePlus.getAllMethodSignatures();
		HashSet<String> allMinus = traceMinus.getAllMethodSignatures();
		System.out.println("===== AllPlus Methods =====");
		for (String method: allPlus) {
			System.out.println(method);
		}
		System.out.println("===== AllMinus Methods =====");
		for (String method: allMinus) {
			System.out.println(method);
		}
		SoftwareReconnaissance sr = new SoftwareReconnaissance();
		sr.result(allPlus, allMinus);
/*
 * 正しい結果
 * 
===== All Methods =====
worstCase.F worstCase.C.getF()
worstCase.E worstCase.D.getE()
worstCase.A()
void worstCase.P.setM(worstCase.M)
public worstCase.M()
worstCase.M worstCase.L.getM()
worstCase.L worstCase.I.getL()
worstCase.L worstCase.K.getL()
void worstCase.N.passI(worstCase.I)
void worstCase.A.m()
worstCase.F()
public static void worstCase.main.main(java.lang.String[])
worstCase.G()
void worstCase.O.passL(worstCase.L)
worstCase.H()
worstCase.I()
worstCase.B()
worstCase.C()
worstCase.D()
worstCase.E()
worstCase.N()
worstCase.O()
worstCase.K worstCase.J.getK()
worstCase.F worstCase.E.getF()
worstCase.P()
worstCase.J()
worstCase.K()
worstCase.I worstCase.F.getI()
worstCase.I worstCase.H.getI()
worstCase.H worstCase.G.getH()
worstCase.L()
worstCase.I worstCase.B.getI()
 */
		
//		ArrayList<MethodExecution> specified = tracePlus.getMethodExecutions("void");
//		System.out.println("===== Specified Methods =====");
//		for (MethodExecution method: specified) {
//			System.out.println(method.getSignature());
//		}		
	}
/*
 * 正しい結果
 * 
===== Specified Methods =====
void worstCase.A.m()
void worstCase.N.passI(worstCase.I)
void worstCase.O.passL(worstCase.L)
void worstCase.P.setM(worstCase.M) * 
 */
}
