Migrate testjob into new java api

The testjob has been tested on cluster.