@Test public void testClone() { BotsingRawControlFlowGraph rawInterProceduralGraph = new BotsingRawControlFlowGraph(BotsingTestGenerationContext.getInstance().getClassLoaderForSUT(),"testClass","testMethod",0); RawControlFlowGraph realRCFG = new BotsingRawControlFlowGraph(BotsingTestGenerationContext.getInstance().getClassLoaderForSUT(),"testClass","testMethod",0); RawControlFlowGraph rcfg = Mockito.spy(realRCFG); BytecodeInstruction stmt1 = testingUtils.mockNewStatement(className,"reverse()"); BytecodeInstruction stmt2 = testingUtils.mockNewStatement(className,"sum()"); rcfg.addVertex(stmt1); rcfg.addVertex(stmt2); BytecodeInstruction[][] edges = {{stmt1,stmt2},{stmt2,stmt1}}; testingUtils.addMockedEdge(edges,rcfg); rawInterProceduralGraph.clone(rcfg); assertEquals(2,rawInterProceduralGraph.vertexSet().size()); assertTrue(rcfg.vertexSet().equals(rawInterProceduralGraph.vertexSet())); assertEquals(2,rcfg.edgeSet().size()); assertTrue(rawInterProceduralGraph.containsEdge(stmt1,stmt2)); assertTrue(rawInterProceduralGraph.containsEdge(stmt2,stmt1)); }
public void clone(RawControlFlowGraph cfg) { Set<BytecodeInstruction> vertexes = cfg.vertexSet(); cloneVertexes(vertexes); cloneEdges(cfg); }
BotsingRawControlFlowGraph extends RawControlFlowGraph { public void clone(RawControlFlowGraph cfg) { Set<BytecodeInstruction> vertexes = cfg.vertexSet(); cloneVertexes(vertexes); cloneEdges(cfg); } }
BotsingRawControlFlowGraph extends RawControlFlowGraph { public void clone(RawControlFlowGraph cfg) { Set<BytecodeInstruction> vertexes = cfg.vertexSet(); cloneVertexes(vertexes); cloneEdges(cfg); } BotsingRawControlFlowGraph(ClassLoader classLoader, String className, String methodName, int access); }
BotsingRawControlFlowGraph extends RawControlFlowGraph { public void clone(RawControlFlowGraph cfg) { Set<BytecodeInstruction> vertexes = cfg.vertexSet(); cloneVertexes(vertexes); cloneEdges(cfg); } BotsingRawControlFlowGraph(ClassLoader classLoader, String className, String methodName, int access); void clone(RawControlFlowGraph cfg); void addInterProceduralEdge(BytecodeInstruction src, BytecodeInstruction target, Set<BytecodeInstruction> targetGraphExitPoints); void addGeneralEntryPoint(BytecodeInstruction src); @Override BasicBlock determineBasicBlockFor(BytecodeInstruction instruction); void cloneAsNewNode(BytecodeInstruction source, RawControlFlowGraph cfg); void addEdges(BytecodeInstruction src,BytecodeInstruction target, boolean isException); }
BotsingRawControlFlowGraph extends RawControlFlowGraph { public void clone(RawControlFlowGraph cfg) { Set<BytecodeInstruction> vertexes = cfg.vertexSet(); cloneVertexes(vertexes); cloneEdges(cfg); } BotsingRawControlFlowGraph(ClassLoader classLoader, String className, String methodName, int access); void clone(RawControlFlowGraph cfg); void addInterProceduralEdge(BytecodeInstruction src, BytecodeInstruction target, Set<BytecodeInstruction> targetGraphExitPoints); void addGeneralEntryPoint(BytecodeInstruction src); @Override BasicBlock determineBasicBlockFor(BytecodeInstruction instruction); void cloneAsNewNode(BytecodeInstruction source, RawControlFlowGraph cfg); void addEdges(BytecodeInstruction src,BytecodeInstruction target, boolean isException);  }