Examples of StubNewObjectInstruction


Examples of edu.cmu.cs.fusion.test.constraint.operations.StubNewObjectInstruction

    RelationshipContext rels = new RelationshipContext(false);

    List<StubVariable> vars = new LinkedList<StubVariable>();
    vars.add(new StubVariable("p0", "Bar"));
   
    StubNewObjectInstruction instr = new StubNewObjectInstruction(vars,
         new StubMethodBinding(new NamedTypeBinding("Foo"), new NamedTypeBinding[]{new NamedTypeBinding("Bar")}), new StubVariable("tVar", "Foo"));
   
    TestAliasContext aliases = new TestAliasContext();
    aliases.addAlias(instr.getTarget(), labels[3]);
    aliases.addAlias(instr.getArgOperands().get(0), labels[5]);
   
    AliasDelta expected = new AliasDelta();
    expected.addChange(instr.getTarget(), labels[3]);
    expected.addChange(instr.getArgOperands().get(0), labels[5])
   
    Operation op = new ConstructorOp("Foo", new SpecVar[] {utils.getVar(0)}, new String[] {"Bar"});
    List<Effect> effects = new LinkedList<Effect>();
    effects.add(RelEffect.createRemoveEffect(utils.getRelation(1), new SpecVar[] {utils.getVar(0), utils.getVar(0)}));
    effects.add(RelEffect.createAddEffect(utils.getRelation(0), new SpecVar[] {Constraint.RESULT, utils.getVar(0)}));
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.