Examples of MethodInvocationOp


Examples of edu.cmu.cs.fusion.constraint.operations.MethodInvocationOp

  }

  @Test
  public void testFreeVars() {
    SpecVar[] vars = new SpecVar[] {utils.getVar(0), utils.getVar(1)};
    MethodInvocationOp invoke = new MethodInvocationOp("mName", "Foo", vars, new String[] {"Foo", "Bar"}, "Bar", false);
    FreeVars fv = invoke.getFreeVariables();
   
    assertEquals("Foo", fv.getType(Constraint.RECEIVER));
    assertEquals("Bar", fv.getType(Constraint.RESULT));
    assertEquals("Foo", fv.getType(utils.getVar(0)));
    assertEquals("Bar", fv.getType(utils.getVar(1)));
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.operations.MethodInvocationOp

    params.add(new StubVariable());
   
    NewObjectInstruction instr = new StubNewObjectInstruction(params, new StubMethodBinding(new NamedTypeBinding("Foo"), vBindings), new StubVariable())
    SpecVar[] vars = new SpecVar[] {utils.getVar(0), utils.getVar(1)};
    String[] vTypes = new String[] {"Bar", "Baz"};
    MethodInvocationOp op = new MethodInvocationOp("testtesttest", "Foo", vars, vTypes, "void", false);
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);

    assertTrue(map == null);
  }
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.operations.MethodInvocationOp

    params.add(new StubVariable());

    MethodCallInstruction instr = getMCI(new StubVariable(), params, new StubVariable());
    SpecVar[] vars = new SpecVar[] {utils.getVar(0), utils.getVar(1)};
    String[] vTypes = new String[] {"Bar", "Baz"};
    MethodInvocationOp op = new MethodInvocationOp("testtesttest", "Foo", vars, vTypes, "Bazaz", false);
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(map == null);
  }
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.operations.MethodInvocationOp

    params.add(new StubVariable());

    MethodCallInstruction instr = getMCI(new StubVariable(), params, new StubVariable());
    SpecVar[] vars = new SpecVar[] {utils.getVar(0), utils.getVar(1)};
    String[] vTypes = new String[] {"Bar", "Baz"};
    MethodInvocationOp op = new MethodInvocationOp("mName", "Foo2", vars, vTypes, "Bazaz", false);
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(map == null);
  }
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.operations.MethodInvocationOp

    params.add(new StubVariable());

    MethodCallInstruction instr = getMCI(new StubVariable(), params, new StubVariable());
    SpecVar[] vars = new SpecVar[] {utils.getVar(0), utils.getVar(1)};
    String[] vTypes = new String[] {"Bar", "Baz2"};
    MethodInvocationOp op = new MethodInvocationOp("mName", "Foo", vars, vTypes, "Bazaz", false);
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(map == null)
  }
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.operations.MethodInvocationOp

    params.add(new StubVariable());

    MethodCallInstruction instr = getMCI(new StubVariable(), params, new StubVariable());
    SpecVar[] vars = new SpecVar[] {utils.getVar(0), utils.getVar(1)};
    String[] vTypes = new String[] {"Bar", "Baz", "blah"};
    MethodInvocationOp op = new MethodInvocationOp("mName", "Foo", vars, vTypes, "Bazaz", false);
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(map == null);
   
  }
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.operations.MethodInvocationOp

    params.add(p2);

    MethodCallInstruction instr = getMCI(rVar, params, tVar);
    SpecVar[] vars = new SpecVar[] {utils.getVar(0), utils.getVar(1)};
    String[] vTypes = new String[] {"Bar", "Baz"};
    MethodInvocationOp op = new MethodInvocationOp("mName", "Foo", vars, vTypes, "Bazaz", false);
   
    ConsList<Binding> list = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(list != null);
    assertTrue(list.contains(new Binding(Constraint.RESULT, tVar)));
    assertTrue(list.contains(new Binding(Constraint.RECEIVER, rVar)));
    assertTrue(list.contains(new Binding(utils.getVar(0), p1)));
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.operations.MethodInvocationOp

    NamedTypeBinding[] vBindings = new NamedTypeBinding[] {new NamedTypeBinding("Foo"), new NamedTypeBinding("Bar")};
    StubMethodCallInstruction instr = new StubMethodCallInstruction("mName", rVar, params, new StubMethodBinding(rBinding, vBindings), tVar)
   
    SpecVar[] vars = new SpecVar[] {utils.getVar(0), utils.getVar(1)};
    String[] vTypes = new String[] {"Foo", "Bar"};
    MethodInvocationOp op = new MethodInvocationOp("mName", "Foo", vars, vTypes, "Bar", false);
   
    ConsList<Binding> list = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(list != null);
    assertTrue(list.contains(new Binding(Constraint.RESULT, tVar)));
    assertTrue(list.contains(new Binding(Constraint.RECEIVER, rVar)));
    assertTrue(list.contains(new Binding(utils.getVar(0), rVar)));
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.operations.MethodInvocationOp

     
      for (int ndx = 0; ndx < paramTypes.length; ndx++) {
        paramTypes[ndx] = Utilities.resolveType(contextType, Signature.toString(method.getParameterTypes()[ndx]));
        opParams[ndx] = new SpecVar(method.getParameterNames()[ndx]);
      }
      op = new MethodInvocationOp(methodName, receiverType, opParams, paramTypes, returnType, isStatic);
    }
    String owner = method.getDeclaringType().getFullyQualifiedName();
    constraints.add(new Constraint(owner, op, new TruePredicate(), new TruePredicate(), new TruePredicate(), effects));
  }
View Full Code Here

Examples of edu.cmu.cs.fusion.constraint.operations.MethodInvocationOp

   
    Operation op;
    Predicate trigger;
    Predicate rst;
   
    op = new MethodInvocationOp("methodName", "Foo", new SpecVar[] {utils.getVar(0), utils.getVar(1)}, new String[] {"Foo", "Bar"}, "Bar", false);
    trigger = new RelationshipPredicate(utils.getRelation(0), new SpecVar[] {utils.getVar(0), utils.getVar(1)});
    rst = new RelationshipPredicate(utils.getRelation(1), new SpecVar[] {utils.getVar(1), utils.getVar(2)});
    cons = new Constraint("", op, trigger, rst, new TruePredicate(), new LinkedList<Effect>());
   
   
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.