Package ai.test.TestProject

Examples of ai.test.TestProject.ProjectFile


    performTest(pf.getCFG("Assignments", "assignment06"));
  }

  @Test
  public void testMethodInvocation() throws CoreException {
    ProjectFile pf = project.openFile("domain.expressions", "MethodInvocation.java");
    performTest(pf.getCFG("MethodInvocation", "methodInvocation01"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocation02"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocation03"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocation04"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocation05"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocation06"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocation07"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocation08"));
   
    performTest(pf.getCFG("MethodInvocation", "methodInvocationWithResult01"));
   
    performTest(pf.getCFG("MethodInvocation", "methodInvocationSuper01"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocationSuper02"));
   
    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocation01"));
    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocation02"));
    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocation03"));
    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocation04"));
    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocation05"));

    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocationWithResult01"));

    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocationSuper01"));
    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocationSuper02"));
    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocationSuper03"));   
  }
View Full Code Here


    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocationSuper03"));   
  }

  @Test
  public void testFieldAccess() throws CoreException {
    ProjectFile pf = project.openFile("domain.expressions", "FieldAccess.java");
    performTest(pf.getCFG("FieldAccess", "numericFieldAccess01"));
    performTest(pf.getCFG("FieldAccess", "numericFieldAccess02"));
    performTest(pf.getCFG("FieldAccess", "numericFieldAccess03"));
    performTest(pf.getCFG("FieldAccess", "numericFieldAccess04"));
    performTest(pf.getCFG("FieldAccess", "numericFieldAccess05"));

    performTest(pf.getCFG("FieldAccess", "numericSuperFieldAccess01"));
    performTest(pf.getCFG("FieldAccess", "numericSuperFieldAccess02"));
    performTest(pf.getCFG("FieldAccess", "numericSuperFieldAccess03"));

    performTest(pf.getCFG("FieldAccess", "booleanFieldAccess01"));
    performTest(pf.getCFG("FieldAccess", "booleanFieldAccess02"));
    performTest(pf.getCFG("FieldAccess", "booleanFieldAccess03"));
    performTest(pf.getCFG("FieldAccess", "booleanFieldAccess04"));
    performTest(pf.getCFG("FieldAccess", "booleanFieldAccess05"));

    performTest(pf.getCFG("FieldAccess", "booleanSuperFieldAccess01"));
    performTest(pf.getCFG("FieldAccess", "booleanSuperFieldAccess02"));
    performTest(pf.getCFG("FieldAccess", "booleanSuperFieldAccess03"));
  }
View Full Code Here

    performTest(pf.getCFG("FieldAccess", "booleanSuperFieldAccess03"));
  }

  @Test
  public void testClassInstanceCreation() throws CoreException {
    ProjectFile pf = project.openFile("domain.expressions", "ClassInstanceCreation.java");
    performTest(pf.getCFG("ClassInstanceCreation", "classInstance01"));
    performTest(pf.getCFG("ClassInstanceCreation", "classInstance02"));
    performTest(pf.getCFG("ClassInstanceCreation", "classInstance03"));
    performTest(pf.getCFG("ClassInstanceCreation", "classInstance04"));
    performTest(pf.getCFG("ClassInstanceCreation", "classInstance05"));
    performTest(pf.getCFG("ClassInstanceCreation", "classInstance06"));
  }
View Full Code Here

  @Test
  public void testArrays() throws CoreException {
//    Logger logger = Logger.getRootLogger();
//    logger.setLevel(Level.DEBUG);
    ProjectFile pf = project.openFile("domain.expressions", "Arrays.java");
    performTest(pf.getCFG("Arrays", "arrayCreation01"));
    performTest(pf.getCFG("Arrays", "arrayCreation02"));
    performTest(pf.getCFG("Arrays", "arrayCreation03"));
    performTest(pf.getCFG("Arrays", "arrayCreation04"));
    performTest(pf.getCFG("Arrays", "arrayCreation05"));
    performTest(pf.getCFG("Arrays", "arrayCreation06"));
    performTest(pf.getCFG("Arrays", "arrayAccess01"));
    performTest(pf.getCFG("Arrays", "arrayAccess02"));
    performTest(pf.getCFG("Arrays", "arrayAccess03"));
  }
View Full Code Here

  private TestProject project;

  @Test
  public void testGettingCompilationUnit() throws CoreException{
    //get file
    ProjectFile pf = project.openFile("", "CFGTests.java");
    IJavaElement icu = pf.getIcu();
    org.junit.Assert.assertEquals(icu.getElementName(), "CFGTests.java");
    org.junit.Assert.assertEquals(icu.getAncestor(ICompilationUnit.PACKAGE_FRAGMENT).getElementName(), "");
   
    pf = project.openFile("cfg", "MethodNames.java");
    icu = pf.getIcu();
    org.junit.Assert.assertEquals(icu.getElementName(), "MethodNames.java");
    org.junit.Assert.assertEquals(icu.getAncestor(ICompilationUnit.PACKAGE_FRAGMENT).getElementName(), "cfg");
  }
View Full Code Here

    org.junit.Assert.assertEquals(icu.getAncestor(ICompilationUnit.PACKAGE_FRAGMENT).getElementName(), "cfg");
  }

  @Test
  public void testEmptyMethod() throws CoreException{
    ProjectFile pf = project.openFile("cfg", "MethodNames.java");
    //top level methods
    MethodControlFlowGraph cfg = pf.getCFG("MethodNames", "topLevelMethod");
    org.junit.Assert.assertEquals(cfg.getCodeFragment().getUniqueName(), "cfg.MethodNames:topLevelMethod()");

    cfg = pf.getCFG("MethodNames", "anotherTopLevelMethod");
    org.junit.Assert.assertEquals(cfg.getCodeFragment().getUniqueName(), "cfg.MethodNames:anotherTopLevelMethod()");

    //inner class methods
    cfg = pf.getCFG("MethodNames$InnerClass", "innerClassMethod");
    org.junit.Assert.assertEquals(cfg.getCodeFragment().getUniqueName(), "cfg.MethodNames$InnerClass:innerClassMethod()");
   
    cfg = pf.getCFG("MethodNames$InnerClass", "anotherInnerClassMethod");
    org.junit.Assert.assertEquals(cfg.getCodeFragment().getUniqueName(), "cfg.MethodNames$InnerClass:anotherInnerClassMethod()");

    //top level anonymous methods
    cfg = pf.getCFG("MethodNames$1", "compareTo");
    org.junit.Assert.assertEquals(cfg.getCodeFragment().getUniqueName(), "cfg.MethodNames$1:compareTo(String)");
   
    //inner class anonymous
    cfg = pf.getCFG("MethodNames$InnerClass$1", "compareTo");
    org.junit.Assert.assertEquals(cfg.getCodeFragment().getUniqueName(), "cfg.MethodNames$InnerClass$1:compareTo(String)");
  }
View Full Code Here

    testBooleans(cfg);
  }

  @Test
  public void testInfixAnd() throws CoreException {
    ProjectFile pf = project.openFile("domain.booleans.expressions", "InfixExpressions.java");
    performTest(pf.getCFG("InfixExpressions", "and01"));
    performTest(pf.getCFG("InfixExpressions", "and02"));
    performTest(pf.getCFG("InfixExpressions", "and03"));
    performTest(pf.getCFG("InfixExpressions", "and04"));

    performTest(pf.getCFG("InfixExpressions", "lazyAnd01"));
    performTest(pf.getCFG("InfixExpressions", "lazyAnd02"));
    performTest(pf.getCFG("InfixExpressions", "lazyAnd03"));
  }
View Full Code Here

    performTest(pf.getCFG("InfixExpressions", "lazyAnd03"));
  }

  @Test
  public void testInfixOr() throws CoreException {
    ProjectFile pf = project.openFile("domain.booleans.expressions", "InfixExpressions.java");
    performTest(pf.getCFG("InfixExpressions", "or01"));
    performTest(pf.getCFG("InfixExpressions", "or02"));
    performTest(pf.getCFG("InfixExpressions", "or03"));
    performTest(pf.getCFG("InfixExpressions", "or04"));
    performTest(pf.getCFG("InfixExpressions", "or05"));

    performTest(pf.getCFG("InfixExpressions", "lazyOr01"));
    performTest(pf.getCFG("InfixExpressions", "lazyOr02"));
    performTest(pf.getCFG("InfixExpressions", "lazyOr03"));
  }
View Full Code Here

    performTest(pf.getCFG("InfixExpressions", "lazyOr03"));
  }

  @Test
  public void testInfixXor() throws CoreException {
    ProjectFile pf = project.openFile("domain.booleans.expressions", "InfixExpressions.java");
    performTest(pf.getCFG("InfixExpressions", "xor01"));
    performTest(pf.getCFG("InfixExpressions", "xor02"));
    performTest(pf.getCFG("InfixExpressions", "xor03"));
    performTest(pf.getCFG("InfixExpressions", "xor04"));

    performTest(pf.getCFG("InfixExpressions", "notLazyXor01"));
    performTest(pf.getCFG("InfixExpressions", "notLazyXor02"));
  }
View Full Code Here

    performTest(pf.getCFG("InfixExpressions", "notLazyXor02"));
  }

  @Test
  public void testMethodInvocation() throws CoreException {
    ProjectFile pf = project.openFile("domain.expressions", "MethodInvocation.java");
    performTest(pf.getCFG("MethodInvocation", "methodInvocation01"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocation02"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocation03"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocation04"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocation05"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocation06"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocation07"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocation08"));
   
    performTest(pf.getCFG("MethodInvocation", "methodInvocationWithResult01"));
   
    performTest(pf.getCFG("MethodInvocation", "methodInvocationSuper01"));
    performTest(pf.getCFG("MethodInvocation", "methodInvocationSuper02"));
   
    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocation01"));
    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocation02"));
    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocation03"));
    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocation04"));
    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocation05"));

    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocationWithResult01"));

    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocationSuper01"));
    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocationSuper02"));
    performTest(pf.getCFG("MethodInvocation", "booleanMethodInvocationSuper03"));   
  }
View Full Code Here

TOP

Related Classes of ai.test.TestProject.ProjectFile

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.