Methods Summary |
---|
public void | allTestsFinished(java.util.EventObject e)
Notification that all tests pertinent to a verifier check manager have
been completed
// remove tmp files
if ((warFile != null) && (warFile.exists())) {
deleteDirectory(warFile.getAbsolutePath());
}
warFile=null;
util=null;
cl=null;
WebCheckMgrImpl.removeVerifierEventsListener(this);
|
public void | appendCLWithWebInfContents()method that appends the class loader's class path
try {
File warclasses = new File(warFile, listenerClassPath);
File libraries = new File(warFile, libraryClassPath);
Vector<File> v = new Vector<File>();
if (libraries.exists()) {
File[] libs = libraries.listFiles();
for (int i=0;i<libs.length;i++) {
if (libs[i].getName().endsWith(".jar")) {
v.add(libs[i]);
}
}
}
URL[] repositories = new URL[v.size() + 1];
try {
repositories[0] = warclasses.toURI().toURL();
for (int i = 1;i <= v.size(); i++) {
repositories[i] = ((File) v.elementAt(i-1)).toURI().toURL();
}
}catch(MalformedURLException ex) {
throw ex;
}
for (int i = 0; i < repositories.length; i++) {
((JarClassLoader)cl).appendURL(repositories[i]);
}
}catch (Exception e) {
throw e;
}
|
private void | deleteDirectory(java.lang.String oneDir)
File[] listOfFiles;
File cleanDir;
cleanDir = new File(oneDir);
if (!cleanDir.exists()) // Nothing to do. Return;
return;
listOfFiles = cleanDir.listFiles();
if(listOfFiles != null) {
for(int countFiles = 0; countFiles < listOfFiles.length; countFiles++) {
if (listOfFiles[countFiles].isFile()) {
listOfFiles[countFiles].delete();
} else { // It is a directory
String nextCleanDir = cleanDir + separator + listOfFiles[countFiles].getName();
File newCleanDir = new File(nextCleanDir);
deleteDirectory(newCleanDir.getAbsolutePath());
}
}// End for loop
} // End if statement
cleanDir.delete();
|
public java.io.File | extractJarFile(java.io.File warFilePath)
Extract if necessary the war file and return the path to the extracted
archive file
//if (!warFile.exists())
try {
warFile = new File(System.getProperty("java.io.tmpdir"), "listenertmp");
if (!warFile.exists()) {
warFile.mkdirs();
}
VerifierUtils.copyArchiveToDir(warFilePath, warFile);
return warFile;
}catch (Exception e) {
throw new IOException (e.getMessage());
}
|
private java.lang.ClassLoader | getClassLoader()
return cl;
|
public static com.sun.enterprise.tools.verifier.tests.web.WebTestsUtil | getUtil(java.lang.ClassLoader cLoader)
Get the unique instance for this class
if (util==null) {
util = new WebTestsUtil();
WebCheckMgrImpl.addVerifierEventsListener(util);
cl = cLoader;
}
return util;
|
public java.lang.Class | loadClass(java.lang.String className)
load a class from the war archive file
if ((warFile==null || !warFile.exists())
&& (getClassLoader() == null)) {
throw new ClassNotFoundException();
}
Class c = getClassLoader().loadClass(className);
return c;
|
public void | testFinished(java.util.EventObject e)
Individual test completion notification event
// do nothing, we don't care
|