Package edu.cmu.cs.fusion.constraint.operations

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


    FPLParser parser = new FPLParser(string, null, new StubIType());
    Operation op = parser.operation();
   
    Assert.assertTrue("Parsed predicate should be a BOM, but is " + op.getClass().getCanonicalName(), op instanceof BeginOfMethodOp);
   
    BeginOfMethodOp invoke = (BeginOfMethodOp)op;
       
    FreeVars vars = invoke.getFreeVariables();
    Assert.assertEquals("Wrong number of free vars", 0, vars.size());     
  }
View Full Code Here


    FPLParser parser = new FPLParser(string, null, new StubIType());
    Operation op = parser.operation();
   
    Assert.assertTrue("Parsed predicate should be a BOM, but is " + op.getClass().getCanonicalName(), op instanceof BeginOfMethodOp);
   
    BeginOfMethodOp invoke = (BeginOfMethodOp)op;
       
    FreeVars vars = invoke.getFreeVariables();
    Assert.assertEquals("Wrong number of free vars", 1, vars.size());   
    Assert.assertEquals("Wrong type", "Foo", vars.getType(Constraint.RECEIVER));   
  }
View Full Code Here

    FPLParser parser = new FPLParser(string, null, new StubIType());
    Operation op = parser.operation();
   
    Assert.assertTrue("Parsed predicate should be a BOM, but is " + op.getClass().getCanonicalName(), op instanceof BeginOfMethodOp);
   
    BeginOfMethodOp invoke = (BeginOfMethodOp)op;
       
    FreeVars vars = invoke.getFreeVariables();
    Assert.assertEquals("Wrong number of free vars", 1, vars.size());   
    Assert.assertEquals("Wrong type", "Foo", vars.getType(Constraint.RECEIVER));   
  }
View Full Code Here

    FPLParser parser = new FPLParser(string, null, new StubIType());
    Operation op = parser.operation();
   
    Assert.assertTrue("Parsed predicate should be a BOM, but is " + op.getClass().getCanonicalName(), op instanceof BeginOfMethodOp);
   
    BeginOfMethodOp invoke = (BeginOfMethodOp)op;
       
    FreeVars vars = invoke.getFreeVariables();
    Assert.assertEquals("Wrong number of free vars", 3, vars.size());
    Assert.assertEquals("Wrong type", "java.lang.Object", vars.getType(Constraint.RECEIVER));   
    Assert.assertEquals("Wrong type", "Baz", vars.getType(new SpecVar("baz")));   
    Assert.assertEquals("Wrong type", "Bar", vars.getType(new SpecVar("bar")));   
  }
View Full Code Here

    FPLParser parser = new FPLParser(string, null, new StubIType());
    Operation op = parser.operation();
   
    Assert.assertTrue("Parsed predicate should be a BOM, but is " + op.getClass().getCanonicalName(), op instanceof BeginOfMethodOp);
   
    BeginOfMethodOp invoke = (BeginOfMethodOp)op;
       
    FreeVars vars = invoke.getFreeVariables();
    Assert.assertEquals("Wrong number of free vars", 2, vars.size());   
    Assert.assertEquals("Wrong type", "Baz", vars.getType(new SpecVar("baz")));   
    Assert.assertEquals("Wrong type", "Bar", vars.getType(new SpecVar("bar")));   
  }
View Full Code Here

    utils = new TestUtils();
  }

  @Test
  public void testFreeVarsWild() {
    BeginOfMethodOp begin = new BeginOfMethodOp(null, null, null, null, false);
    FreeVars fv = begin.getFreeVariables();
   
    assertEquals("java.lang.Object", fv.getType(Constraint.RECEIVER));   
    assertEquals(1, fv.size());
  }
View Full Code Here

    assertEquals(1, fv.size());
  }
 
  @Test
  public void testFreeVarsBoundedReceiver() {
    BeginOfMethodOp begin = new BeginOfMethodOp("Foo", null, null, null, false);
    FreeVars fv = begin.getFreeVariables();
   
    assertEquals("Foo", fv.getType(Constraint.RECEIVER));   
    assertEquals(1, fv.size());
  }
View Full Code Here

  }
 
  @Test
  public void testFreeVarsBoundedParams() {
    SpecVar[] vars = new SpecVar[] {utils.getVar(0), utils.getVar(1)};
    BeginOfMethodOp begin = new BeginOfMethodOp(null, null, vars, new String[] {"Bar", "Baz"}, false);
    FreeVars fv = begin.getFreeVariables();
   
    assertEquals("java.lang.Object", fv.getType(Constraint.RECEIVER));   
    assertEquals("Bar", fv.getType(utils.getVar(0)));   
    assertEquals("Baz", fv.getType(utils.getVar(1)));   
    assertEquals(3, fv.size());
View Full Code Here

   
    StubMethodBinding binding = new StubMethodBinding(new NamedTypeBinding("Foo"), vBindings);
    Method method = new Method(new Variable[] {v1, v2}, null, binding);
   
    NewObjectInstruction instr = new StubNewObjectInstruction(params, binding, new StubVariable())
    BeginOfMethodOp op = new BeginOfMethodOp(null, null, null, null, false);
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), method, instr);

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

    List<Variable> params = new ArrayList<Variable>();
    params.add(new StubVariable());
    params.add(new StubVariable());

    Pair<EntryInstruction, Method> pair = getEntryAndMethod(new StubVariable(), params);
    BeginOfMethodOp op = new BeginOfMethodOp(null, "OtherName", null, null, false);
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), pair.snd(), pair.fst());
   
    assertTrue(map == null);
  }
View Full Code Here

TOP

Related Classes of edu.cmu.cs.fusion.constraint.operations.BeginOfMethodOp

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.