rarFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-ear-noger.ear"));
EARConfigBuilder configBuilder = new EARConfigBuilder(defaultEnvironment, transactionContextManagerName, connectionTrackerName, null, null, null, new AbstractNameQuery(serverName, J2EEServerImpl.GBEAN_INFO.getInterfaces()), null, null, ejbReferenceBuilder, null,
new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching),
resourceReferenceBuilder, null, serviceReferenceBuilder, kernel.getNaming());
ConfigurationData configData = null;
DeploymentContext context = null;
ArtifactManager artifactManager = new DefaultArtifactManager();
ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, Collections.EMPTY_SET, null);
try {
File planFile = new File(basedir, "src/test-data/data/external-application-plan.xml");
ModuleIDBuilder idBuilder = new ModuleIDBuilder();
Object plan = configBuilder.getDeploymentPlan(planFile, rarFile, idBuilder);
context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, rarFile, idBuilder), plan, rarFile, Collections.singleton(configurationStore), artifactResolver, configurationStore);
configData = context.getConfigurationData();
} finally {
if (context != null) {
context.close();
}
if (configData != null) {
DeploymentUtil.recursiveDelete(configData.getConfigurationDir());
}
}