refine test cases and add invoke