private void executeTestBuildModule(InstallAction action) throws Exception {
// String j2eeDomainName = "geronimo.server";
// String j2eeServerName = "TestGeronimoServer";
// String j2eeModuleName = "org/apache/geronimo/j2ee/deployment/test";
// String j2eeApplicationName = "null";
J2eeContext j2eeContext = new J2eeContextImpl("test.domain", "testServer", "null", "org/apache/geronimo/j2ee/deployment/test", null, null);
ObjectName connectionTrackerName = new ObjectName("geronimo.connector:service=ConnectionTracker");
Kernel kernel = new Kernel("testServer");
ConnectorModuleBuilder moduleBuilder = new ConnectorModuleBuilder(defaultParentId, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, kernel);
File rarFile = action.getRARFile();
ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
ClassLoader cl = new URLClassLoader(new URL[]{rarFile.toURL()}, oldCl);
Thread.currentThread().setContextClassLoader(cl);
JarFile rarJarFile = DeploymentUtil.createJarFile(rarFile);
Module module = moduleBuilder.createModule(action.getVendorDD(), rarJarFile, j2eeContext.getJ2eeModuleName(), action.getSpecDD(), null);
if (module == null) {
throw new DeploymentException("Was not a connector module");
}
File tempDir = null;
try {
tempDir = DeploymentUtil.createTempDir();
EARContext earContext = new EARContext(tempDir,
module.getConfigId(),
module.getType(),
module.getParentId(),
null,
j2eeContext.getJ2eeDomainName(),
j2eeContext.getJ2eeServerName(),
j2eeContext.getJ2eeApplicationName(),
null,
connectionTrackerName,
null,
null,
new RefContext(null, moduleBuilder));