add junit test case, fix some mistake