sync in home.

1) Add endRun() method which closes all opened positions before stop test.
2) add tests.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>