Methods Summary |
---|
public com.sun.enterprise.tools.verifier.Result | check(com.sun.enterprise.deployment.Descriptor descriptor)
run an individual test against the deployment descriptor for the
archive the verifier is performing compliance tests against.
return check((WebBundleDescriptor) descriptor);
|
public abstract com.sun.enterprise.tools.verifier.Result | check(com.sun.enterprise.deployment.WebBundleDescriptor descriptor)
all connector tests should implement this method. it run an individual
test against the resource adapter deployment descriptor.
|
protected void | deleteDirectory(java.lang.String oneDir)Method for recursively deleting all temporary directories
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();
|
protected java.lang.String | getAbstractArchiveUri(com.sun.enterprise.deployment.WebBundleDescriptor desc)
String archBase = getVerifierContext().getAbstractArchive().
getArchiveUri();
final ModuleDescriptor moduleDescriptor = desc.getModuleDescriptor();
if (moduleDescriptor.isStandalone()) {
return archBase; // it must be a stand-alone module; no such physical dir exists
} else {
return archBase + File.separator +
FileUtils.makeFriendlyFileName(moduleDescriptor.getArchiveUri());
}
|
public java.lang.Class | loadClass(com.sun.enterprise.tools.verifier.Result result, java.lang.String className)
load a class from the web bundle archive file
try {
WebTestsUtil webTestsUtil = WebTestsUtil.getUtil(context.getClassLoader());
//webTestsUtil.appendCLWithWebInfContents();
return webTestsUtil.loadClass(className);
} catch (Throwable e) {
// @see preVerify Method of Verifier.java
try {
ClassLoader cl = getVerifierContext().getAlternateClassLoader();
if (cl == null) {
throw e;
}
Class c = cl.loadClass(className);
return c;
}catch(Throwable ex) {
/*
result.addErrorDetails(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.web.WebTest.Exception",
"Error: Unexpected exception occurred [ {0} ]",
new Object[] {ex.toString()}));
*/
}
}
return null;
|
public com.sun.enterprise.tools.verifier.Result | loadWarFile(com.sun.enterprise.deployment.WebBundleDescriptor descriptor)load the war file
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
context = getVerifierContext();
try {
// TODO : check whether this method is required?
WebTestsUtil webTestsUtil = WebTestsUtil.getUtil(context.getClassLoader());
// File f = Verifier.getArchiveFile(descriptor.getModuleDescriptor().
// getArchiveUri());
// if (f != null) {
// webTestsUtil.extractJarFile(f);
// }
// else {
// // dont bother about extracting JarFile
// }
//Sheetal: 09/30/02
//dont need to call Verifier's appendCLWithWebInfContents() since J2EEClassLoader takes care of it
//webTestsUtil.appendCLWithWebInfContents();
} catch (Throwable e) {
// e.printStackTrace();
Verifier.debug(e);
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addErrorDetails(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.web.WebTest" + ".Exception",
"Error: Unexpected exception occurred [ {0} ]",
new Object[] {e.toString()}));
}
return result;
|