1. put every class in certain packages, including those test classes, not like to use Default package
2. generate .Jar file including thoes packages.
3. write script files (*.sh) to run certain test java classes in .Jar
in same folder as my .Jar file and set CLASSPATH in my script files
ex:
export CLASSPATH=$CLASSPATH:com.mycompany.util-1.0.0.jar
java com.mycompany.util.TestClass
4. then run the script file...
or, we can use command line like this: java -classpath *.jar ..TestClass
Note: be sure to use complete path for testing classes, otherwise famours NoClassDefFound error will be thrown out.