Methods Summary |
---|
protected boolean | areTestsNotRequired(boolean isModuleGivenInPartiotioningArgs)
return (frameworkContext.isPartition() &&
!isModuleGivenInPartiotioningArgs);
|
protected abstract java.lang.ClassLoader | createClassLoader()
|
protected void | createDOMObject(org.xml.sax.InputSource source, java.lang.String dd)
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
EntityResolver dh = new XMLValidationHandler(false);
builder.setEntityResolver(dh);
Document document = builder.parse(source);
if ((dd.indexOf("sun-")) < 0) { // NOI18N
if ((dd.indexOf("webservices")) < 0) { // NOI18N
context.setDocument(document);
} else {
context.setWebServiceDocument(document);
}
} else
context.setRuntimeDocument(document);
|
protected void | createDocumentObject(com.sun.enterprise.deployment.Descriptor descriptor)
InputStream is = null;
InputSource source = null;
String archBase = context.getAbstractArchive().getArchiveUri();
String uri = null;
if(descriptor instanceof Application) {
uri = archBase;
} else {
BundleDescriptor bundleDesc =
BundleDescriptor.class.cast(descriptor);
if(bundleDesc.getModuleDescriptor().isStandalone()) {
uri = archBase;
} else {
uri = archBase + File.separator + getArchiveUri();
}
}
String dd[] = getDDString();
for (int i = 0; i < dd.length; i++) {
try{
is = getInputStreamFromAbstractArchive(uri, dd[i]);
if (is != null) {
source = new InputSource(is);
createDOMObject(source, dd[i]);
is.close();
}
} finally {
try {
if(is != null) {
is.close();
}
} catch(Exception e) {}
}
}
|
private java.util.List | getAllJars(java.io.File file)
List<String> list = new ArrayList<String>();
if (file.isDirectory() || file.canRead()) {
File[] files = file.listFiles();
for (int i=0; i<files.length; i++) {
File jar = files[i];
if ( FileUtils.isJar(jar)) {
list.add( jar.getCanonicalPath() );
}
}
}
return list;
|
protected abstract java.lang.String | getArchiveUri()
|
protected java.lang.String | getClassPath(java.util.List classPath)converts list of paths to a string of paths separated by pathSeparator
StringBuilder cp = new StringBuilder("");
for (int i = 0; i < classPath.size(); i++) {
cp.append(classPath.get(i));
cp.append(File.pathSeparator);
}
return cp.toString();
|
protected abstract java.lang.String | getClassPath()
|
protected abstract java.lang.String[] | getDDString()
|
public abstract com.sun.enterprise.deployment.Descriptor | getDescriptor()
|
protected java.io.InputStream | getInputStreamFromAbstractArchive(java.lang.String uri, java.lang.String ddName)
FileArchive arch = new FileArchive();
arch.open(uri);
InputStream deploymentEntry = arch.getEntry(ddName);
return deploymentEntry;
|
protected java.lang.String | getLibdirClasspath(java.lang.String appRoot, java.lang.String libdirPath)
StringBuilder classpath=new StringBuilder();
libdirPath = libdirPath.replace('/", File.separatorChar);
List<String> jars = getAllJars(new File(appRoot, libdirPath));
for (String s : jars) {
classpath.append(s);
classpath.append(File.pathSeparator);
}
return classpath.toString();
|
protected void | preVerification()
logger.log(Level.INFO, "Verifying: [ " + getArchiveUri() + " ]");
ClassLoader loader = createClassLoader();
context = new Context(loader);
context.setAppserverMode(!frameworkContext.isPortabilityMode());
context.setAbstractArchive(frameworkContext.getAbstractArchive());
context.setClassPath(getClassPath());
logger.log(Level.FINE, "Using CLASSPATH: " + getClassPath());
|
public abstract void | verify()
|
protected void | verify(com.sun.enterprise.deployment.Descriptor descriptor, CheckMgr checkMgrImpl)
//hs for creating DOM object for runtime tests
createDocumentObject(descriptor);
// now start calling each individual test, as per spec
checkMgrImpl.setVerifierContext(context);
checkMgrImpl.check(descriptor);
logger.log(Level.FINE,
getClass().getName() + ".debug.endStaticVerification"); // NOI18N
|