make using thrift more easy. add test mode.