public class ClassLoaderTestHelper
extends java.lang.Object
| Constructor and Description |
|---|
ClassLoaderTestHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addJarFilesToJar(java.io.File targetJar,
java.lang.String libPrefix,
java.io.File... srcJars)
Add a list of jar files to another jar file under a specific folder.
|
static java.io.File |
buildJar(java.lang.String testDir,
java.lang.String className,
java.lang.String code)
Create a test jar for testing purpose for a given class
name with specified code string: save the class to a file,
compile it, and jar it up.
|
static java.io.File |
buildJar(java.lang.String testDir,
java.lang.String className,
java.lang.String code,
java.lang.String folder)
Create a test jar for testing purpose for a given class
name with specified code string.
|
public static java.io.File buildJar(java.lang.String testDir,
java.lang.String className,
java.lang.String code)
throws java.lang.Exception
testDir - the folder under which to store the test class and jarclassName - the test class namecode - the optional test class code, which can be null.
If null, a bare empty class will be usedjava.lang.Exceptionpublic static java.io.File buildJar(java.lang.String testDir,
java.lang.String className,
java.lang.String code,
java.lang.String folder)
throws java.lang.Exception
testDir - the folder under which to store the test classclassName - the test class namecode - the optional test class code, which can be null.
If null, an empty class will be usedfolder - the folder under which to store the generated jarjava.lang.Exceptionpublic static void addJarFilesToJar(java.io.File targetJar,
java.lang.String libPrefix,
java.io.File... srcJars)
throws java.lang.Exception
targetJar - the target jar filelibPrefix - the folder where to put inner jar filessrcJars - the source inner jar files to be addedjava.lang.Exception - if anything doesn't work as expected