added some log in test case
change return and output parameter order and fix issues in it