Methods Summary |
---|
public void | check(Descriptor descriptor)Check Ejb for spec. conformance
// run persistence tests first.
checkPersistenceUnits(EjbBundleDescriptor.class.cast(descriptor));
// an EjbBundleDescriptor can have an WebServicesDescriptor
checkWebServices(descriptor);
// an EjbBundleDescriptor can have WebService References
checkWebServicesClient(descriptor);
if (frameworkContext.isPartition() &&
!frameworkContext.isEjb())
return;
EjbBundleDescriptor bundleDescriptor = (EjbBundleDescriptor) descriptor;
setDescClassLoader(bundleDescriptor);
// DOL (jerome): is asking us to call this in some cases, like when
// an ejb-ref is unresolved etc.
try {
EjbBundleValidator validator = new EjbBundleValidator();
validator.accept(bundleDescriptor);
} catch (Exception e) {
} // nothing can be done
// initialize JDOC if bundle has CMP's
if (bundleDescriptor.containsCMPEntity()) {
try {
// See bug #6274161. We now pass an additional boolean
// to indicate whether we are in portable or AS mode.
jdc.init(bundleDescriptor, context.getClassLoader(),
getAbstractArchiveUri(bundleDescriptor),
frameworkContext.isPortabilityMode());
} catch (Throwable ex) {
context.setJDOException(ex);
}
}
// set the JDO Codegenerator into the context
context.setJDOCodeGenerator(jdc);
// run the ParseDD test
if (bundleDescriptor.getSpecVersion().compareTo("2.1") < 0) { // NOI18N
EjbDeploymentDescriptorFile ddf = new EjbDeploymentDescriptorFile();
File file = new File(getAbstractArchiveUri(bundleDescriptor),
ddf.getDeploymentDescriptorPath());
FileInputStream is = new FileInputStream(file);
try {
if (is != null) {
Result result = new ParseDD().validateEJBDescriptor(is);
result.setComponentName(new File(bundleDescriptor.getModuleDescriptor().
getArchiveUri()).getName());
setModuleName(result);
frameworkContext.getResultManager().add(result);
}
} finally {
try {
if(is != null) {
is.close();
}
} catch (Exception e) {}
}
}
for (Iterator itr = bundleDescriptor.getEjbs().iterator();
itr.hasNext();) {
EjbDescriptor ejbDescriptor = (EjbDescriptor) itr.next();
super.check(ejbDescriptor);
}
if (bundleDescriptor.containsCMPEntity() &&
context.getJDOException() == null) {
try {
jdc.cleanup();
} catch (GeneratorException ge) {
} // eat up the exception
context.setJDOCodeGenerator(null);
}
|
protected void | checkWebServicesClient(Descriptor descriptor)
if (frameworkContext.isPartition() &&
!frameworkContext.isWebServicesClient())
return;
EjbBundleDescriptor desc = (EjbBundleDescriptor) descriptor;
WebServiceClientCheckMgrImpl webServiceClientCheckMgr = new WebServiceClientCheckMgrImpl(
frameworkContext);
if (desc.hasWebServiceClients()) {
Set ejbdescs = desc.getEjbs();
Iterator ejbIt = ejbdescs.iterator();
while (ejbIt.hasNext()) {
EjbDescriptor ejbDesc = (EjbDescriptor) ejbIt.next();
context.setEjbDescriptorForServiceRef(ejbDesc);
Set serviceRefDescriptors = ejbDesc.getServiceReferenceDescriptors();
Iterator it = serviceRefDescriptors.iterator();
while (it.hasNext()) {
webServiceClientCheckMgr.setVerifierContext(context);
webServiceClientCheckMgr.check(
(ServiceReferenceDescriptor) it.next());
}
}
context.setEjbDescriptorForServiceRef(null);
}
|
private java.lang.String | getAbstractArchiveUri(EjbBundleDescriptor desc)
String archBase = context.getAbstractArchive().getArchiveUri();
ModuleDescriptor mdesc = desc.getModuleDescriptor();
if(mdesc.isStandalone()) {
return archBase;
} else {
return archBase + File.separator +
FileUtils.makeFriendlyFileName(mdesc.getArchiveUri());
}
|
protected EjbBundleDescriptor | getBundleDescriptor(Descriptor descriptor)
return ((EjbDescriptor) descriptor).getEjbBundleDescriptor();
|
protected com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor | getComponentNameConstructor(Descriptor descriptor)
return new ComponentNameConstructor((EjbDescriptor)descriptor);
|
protected java.lang.String | getSchemaVersion(Descriptor descriptor)
return getBundleDescriptor(descriptor).getSpecVersion();
|
protected java.lang.String | getSunONETestsListFileName()
return sunONETestsListFileName;
|
protected java.lang.String | getTestsListFileName()return the configuration file name for the list of tests pertinent to the
connector architecture
return testsListFileName;
|
protected boolean | isApplicable(TestInformation test, Descriptor descriptor)entity and mdb assertions should not be run for session descriptors and
similarly the other way round.
String testName = test.getClassName();
if(descriptor instanceof EjbSessionDescriptor &&
(testName.indexOf("tests.ejb.entity")>=0 || // NOI18N
testName.indexOf("tests.ejb.messagebean")>=0)) // NOI18N
return false;
if(descriptor instanceof EjbEntityDescriptor &&
(testName.indexOf("tests.ejb.session")>=0 || // NOI18N
testName.indexOf("tests.ejb.messagebean")>=0)) // NOI18N
return false;
if(descriptor instanceof EjbMessageBeanDescriptor &&
(testName.indexOf("tests.ejb.session")>=0 || // NOI18N
testName.indexOf("tests.ejb.entity")>=0)) // NOI18N
return false;
return true;
|
private void | setDescClassLoader(EjbBundleDescriptor bundleDescriptor)
Iterator bundleItr = bundleDescriptor.getEjbs().iterator();
while (bundleItr.hasNext()) {
EjbDescriptor descriptor = (EjbDescriptor) bundleItr.next();
if (descriptor instanceof IASEjbCMPEntityDescriptor) {
((IASEjbCMPEntityDescriptor) (descriptor)).setClassLoader(
context.getClassLoader());
}
}
|
protected void | setModuleName(Result r)
r.setModuleName(Result.EJB);
|