extrac code from scala upload file
fix test code to cope with new architecture
fix test code to cope with new architecture
Merge pull request #1170 from XuefengWu/extrac-doccode-scala-upload

extrac code from scala upload file