@Test public void testVarGenericsReferenceAssignation() { ClassFile cf = bci.readClassFile("src/test/classes/testclasses/assignation/ReferenceAssignation.class"); MethodInstruction mi = cd.constructTree(cf.getMethods()[5]); assertNotNull(mi); assertTrue(mi.getInstructionsMap().firstEntry().getValue() instanceof AssignationInstruction); AssignationInstruction ai = (AssignationInstruction) mi.getInstructionsMap().firstEntry().getValue(); assertTrue(ai.getValue() instanceof SimpleVariable); SimpleVariable c = (SimpleVariable) ai.getValue(); }
@Test public void testConstantReferenceAssignation() { ClassFile cf = bci.readClassFile("src/test/classes/testclasses/assignation/ReferenceAssignation.class"); MethodInstruction mi = cd.constructTree(cf.getMethods()[1]); assertNotNull(mi); assertTrue(mi.getInstructionsMap().firstEntry().getValue() instanceof AssignationInstruction); AssignationInstruction ai = (AssignationInstruction) mi.getInstructionsMap().firstEntry().getValue(); assertTrue(ai.getValue() instanceof Constant); Constant c = (Constant) ai.getValue(); }