Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.CompilationUnit


    "    }" +
    "}";
 
  @Test
  public void testObjectRead() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("ObjectRead", OBJECT_READ);
    MethodDeclaration m = EclipseTACSimpleTestDriver.getFirstMethod(cu);
    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    Expression read = (Expression) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(read);
    Assert.assertTrue(instr != null);
View Full Code Here


    "    }" +
    "}";
 
  @Test
  public void testFieldWrite() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("FieldWrite", FIELD_WRITE);
    MethodDeclaration m = EclipseTACSimpleTestDriver.getFirstMethod(cu);
    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    Assignment write = (Assignment) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(write);
    Assert.assertTrue(instr != null);
View Full Code Here

    "    public int getF() { return f; }" +
    "}";
 
  @Test
  public void testFieldInc() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("FieldInc", FIELD_INC);
    MethodDeclaration m = EclipseTACSimpleTestDriver.getFirstMethod(cu);
    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    PostfixExpression inc = (PostfixExpression) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(inc);
    Assert.assertTrue(instr != null);
View Full Code Here

    "    }" +
    "}";
 
  @Test
  public void testNestedFieldWrite() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("NestedFieldWrite", NESTED_FIELD_WRITE);
    MethodDeclaration m = EclipseTACSimpleTestDriver.getFirstMethod(cu);
    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    MethodInvocation inv = (MethodInvocation) ((ExpressionStatement) EclipseTACSimpleTestDriver.getLastStatement(m)).getExpression();
    TACInstruction instr = tac.instruction(inv);
    Assert.assertTrue(instr != null);
View Full Code Here

    "    public Object getO() { return o; }" +
    "}";
 
  @Test
  public void testPrivateOuterField() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("PrivateOuterField", PRIVATE_OUTER_FIELD);
    MethodDeclaration m = EclipseTACSimpleTestDriver.getFirstMethod(cu); // method in inner class
    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    Expression read = (Expression) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(read);
    Assert.assertTrue(instr != null);
View Full Code Here

    "    }" +
    "}";
 
  @Test
  public void testVisibleOuterField() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("VisibleOuterField", VISIBLE_OUTER_FIELD);
    MethodDeclaration m = EclipseTACSimpleTestDriver.getFirstMethod(cu); // method in inner class
    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    Expression read = (Expression) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(read);
    Assert.assertTrue(instr != null);
View Full Code Here

  static Map<String, MethodDeclaration> methods = new HashMap<String, MethodDeclaration>();
  static IProject project;

  @BeforeClass
  static public void setup() throws CoreException {
    CompilationUnit compUnit = CFGTestUtils.parseCode(TypeDecl.class.getName());
    methods = CFGTestUtils.createMethodNameMap(compUnit);
  }
View Full Code Here

  // Assume that we are using a class where every method has a unique name
  static Map<String, MethodDeclaration> methods = new HashMap<String, MethodDeclaration>();

  @BeforeClass
  static public void setup() throws CoreException {
    CompilationUnit compUnit = CFGTestUtils
        .parseCode(Infix.class.getName());
    methods = CFGTestUtils.createMethodNameMap(compUnit);
  }
View Full Code Here

  // Assume that we are using a class where every method has a unique name
  static Map<String, MethodDeclaration> methods = new HashMap<String, MethodDeclaration>();

  @BeforeClass
  static public void setup() throws CoreException {
    CompilationUnit compUnit = CFGTestUtils.parseCode(If.class.getName());
    methods = CFGTestUtils.createMethodNameMap(compUnit);
  }
View Full Code Here

  static Map<String, MethodDeclaration> methods = new HashMap<String, MethodDeclaration>();
  static IProject project;

  @BeforeClass
  static public void setup() throws CoreException {
    CompilationUnit compUnit = CFGTestUtils.parseCode(MethodDecl.class.getName());
    methods = CFGTestUtils.createMethodNameMap(compUnit);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.CompilationUnit

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.