Examples of resolveBinding()


Examples of org.eclipse.jdt.core.dom.MethodDeclaration.resolveBinding()

    MethodDeclaration surroundingMeth = ASTUtil.findAncestor(node, MethodDeclaration.class);
    IMethodBinding mockMethod = null;

    if (surroundingMeth != null)
    {
      mockMethod = surroundingMeth.resolveBinding();
    }

    if( mockMethod != null && MockUtil.isMockMethod(mockMethod) )
    {
      return mockMethod;
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodDeclaration.resolveBinding()

    ASTNode node = NodeFinder.perform(astRoot, region.getOffset(), 1);

    if( node instanceof SimpleName && node.getParent() instanceof MethodDeclaration )
    {
      MethodDeclaration mdec = (MethodDeclaration) node.getParent();
      mockMethod = mdec.resolveBinding();

      paramType = MockUtil.findMockedType(mdec, mockMethod);

      wordRegion = new Region(node.getStartPosition(), node.getLength());
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodDeclaration.resolveBinding()

  @Test
  public void testOuter() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("MainClass", MAIN);
    MethodDeclaration m = EclipseTACSimpleTestDriver.getFirstMethod(cu);
    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    ClassInstanceCreation instance = (ClassInstanceCreation) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(instance);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof NewObjectInstruction);
    NewObjectInstruction newobj = (NewObjectInstruction) instr;
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodDeclaration.resolveBinding()

 
  @Test
  public void testTopLevel() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("TopLevel", TOP_LEVEL);
    MethodDeclaration m = EclipseTACSimpleTestDriver.getFirstMethod(cu);
    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    ClassInstanceCreation instance = (ClassInstanceCreation) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(instance);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof NewObjectInstruction);
    NewObjectInstruction newobj = (NewObjectInstruction) instr;
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodDeclaration.resolveBinding()

 
  @Test
  public void testInner() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("Outer", INNER);
    MethodDeclaration m = EclipseTACSimpleTestDriver.getFirstMethod(cu);
    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    ClassInstanceCreation instance = (ClassInstanceCreation) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(instance);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof NewObjectInstruction);
    NewObjectInstruction newobj = (NewObjectInstruction) instr;
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodDeclaration.resolveBinding()

 
  @Test
  public void testExplicitInner() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("OuterExplicit", EXPLICIT_INNER);
    MethodDeclaration m = EclipseTACSimpleTestDriver.getFirstMethod(cu);
    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    ClassInstanceCreation instance = (ClassInstanceCreation) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(instance);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof NewObjectInstruction);
    NewObjectInstruction newobj = (NewObjectInstruction) instr;
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodDeclaration.resolveBinding()

 
  @Test
  public void testStaticInner() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("OuterStaticInner", STATIC_INNER);
    MethodDeclaration m = EclipseTACSimpleTestDriver.getFirstMethod(cu);
    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    ClassInstanceCreation instance = (ClassInstanceCreation) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(instance);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof NewObjectInstruction);
    NewObjectInstruction newobj = (NewObjectInstruction) instr;
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodDeclaration.resolveBinding()

 
  @Test
  public void testLocal() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("OuterLocal", LOCAL);
    MethodDeclaration m = EclipseTACSimpleTestDriver.getFirstMethod(cu);
    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    ClassInstanceCreation instance = (ClassInstanceCreation) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(instance);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof NewObjectInstruction);
    NewObjectInstruction newobj = (NewObjectInstruction) instr;
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodDeclaration.resolveBinding()

 
  @Test
  public void testAnonymous() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("OuterAnon", ANON);
    MethodDeclaration m = EclipseTACSimpleTestDriver.getFirstMethod(cu);
    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    ClassInstanceCreation instance = (ClassInstanceCreation) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(instance);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof NewObjectInstruction);
    NewObjectInstruction newobj = (NewObjectInstruction) instr;
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodDeclaration.resolveBinding()

  @Test
  public void testReadField() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("FieldRead", FIELD_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);
    Assert.assertTrue(instr instanceof LoadFieldInstruction);
    LoadFieldInstruction load = (LoadFieldInstruction) instr;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.