@Test public void testCheckIfMethodIsInvoked_whenItIsInvoked() throws Exception { target.addMethod(CtNewMethod.make("public void bar() { }", target)); CtMethod withinMethod = CtNewMethod.make("public void foo() { bar(); }", target); target.addMethod(withinMethod); boolean isInvoked = afterBurner.checkIfMethodIsInvoked(withinMethod, "bar"); assertTrue(isInvoked); }
public boolean checkIfMethodIsInvoked(CtMethod withinMethod, String invokedMethod) throws CannotCompileException { return new DetectMethodCallEditor(withinMethod, invokedMethod).checkIfisCallingMethod(); }
AfterBurner { public boolean checkIfMethodIsInvoked(CtMethod withinMethod, String invokedMethod) throws CannotCompileException { return new DetectMethodCallEditor(withinMethod, invokedMethod).checkIfisCallingMethod(); } }
AfterBurner { public boolean checkIfMethodIsInvoked(CtMethod withinMethod, String invokedMethod) throws CannotCompileException { return new DetectMethodCallEditor(withinMethod, invokedMethod).checkIfisCallingMethod(); } AfterBurner(); }
AfterBurner { public boolean checkIfMethodIsInvoked(CtMethod withinMethod, String invokedMethod) throws CannotCompileException { return new DetectMethodCallEditor(withinMethod, invokedMethod).checkIfisCallingMethod(); } AfterBurner(); void addOrInsertMethod(InsertableMethod insertableMethod); void beforeOverrideMethod(CtClass targetClass, String targetMethodName, String body); void afterOverrideMethod(CtClass targetClass, String targetMethodName, String body); void insertConstructor(InsertableConstructor insertableConstructor); CtMethod extractExistingMethod(final CtClass classToTransform,
            String methodName); boolean checkIfMethodIsInvoked(CtMethod withinMethod,
        String invokedMethod); }
AfterBurner { public boolean checkIfMethodIsInvoked(CtMethod withinMethod, String invokedMethod) throws CannotCompileException { return new DetectMethodCallEditor(withinMethod, invokedMethod).checkIfisCallingMethod(); } AfterBurner(); void addOrInsertMethod(InsertableMethod insertableMethod); void beforeOverrideMethod(CtClass targetClass, String targetMethodName, String body); void afterOverrideMethod(CtClass targetClass, String targetMethodName, String body); void insertConstructor(InsertableConstructor insertableConstructor); CtMethod extractExistingMethod(final CtClass classToTransform,
            String methodName); boolean checkIfMethodIsInvoked(CtMethod withinMethod,
        String invokedMethod);  }