@Deprecated
public abstract class CFGTestAnalysis extends AbstractCrystalMethodAnalysis {
@Override
public void analyzeMethod(MethodDeclaration method) {
IControlFlowGraph cfg = getCFG(method);
String className, methodName, testName;
Graph testGraph;
File out = null, original, projectRoot;
FileOutputStream outStream;
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
"CrystalTest");
projectRoot = new File(project.getLocationURI()); // project.getLocationURI
// will return null
// for closed
// projects.
try {
className = method.resolveBinding().getDeclaringClass().getName();
methodName = method.getName().getIdentifier();
testName = className + "_" + methodName + ".dot";
out = new File(projectRoot, "test/lastrun/" + testName);
testGraph = cfg.getDotGraph();
outStream = new FileOutputStream(out);
testGraph.printGraph(outStream);
original = new File(projectRoot, "test/" + testName);
if (original.exists()) {