Package edu.cmu.cs.crystal.cfg

Examples of edu.cmu.cs.crystal.cfg.IControlFlowGraph


  static public boolean testAndCompareCFG(MethodDeclaration method)
      throws Exception {
    IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
        PROJECT);
    IControlFlowGraph cfg = new EclipseNodeFirstCFG(method);
    String className, methodName, testName;
    Graph testGraph;
    File out = null, original, projectRoot;
    FileOutputStream outStream;
    projectRoot = new File(project.getLocationURI());

    className = method.resolveBinding().getDeclaringClass().getName();
    methodName = method.getName().getIdentifier();
    testName = className + "_" + methodName + ".dot";

    out = new File(projectRoot, "test/dotFiles/cfg/last/" + testName);
    testGraph = cfg.getDotGraph();
    outStream = new FileOutputStream(out);

    try {
      testGraph.printGraph(outStream);
      original = new File(projectRoot, "test/dotFiles/cfg/saved/"
View Full Code Here


@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()) {
View Full Code Here

    Assert.assertEquals(0, node.getProblems().length);
    List<MethodDeclaration> methods = WorkspaceUtilities
        .scanForMethodDeclarationsFromAST(node);
    Assert.assertEquals(1, methods.size());
    IControlFlowGraph cfg = new EclipseNodeFirstCFG(methods.get(0));

    testGraph = cfg.getDotGraph();
    if (store) {
      out = new FileOutputStream("test/" + subFolder + "_" + file);
    } else {
      out = new FileOutputStream("test/lastrun/" + subFolder + "_" + file);
    }
View Full Code Here

TOP

Related Classes of edu.cmu.cs.crystal.cfg.IControlFlowGraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.