kernel.getNaming(),
null,
bundleContext);
configBuilder.doStart();
ConfigurationData configData = null;
DeploymentContext context = null;
ArtifactManager artifactManager = new DefaultArtifactManager();
ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, repository);
try {
File planFile = new File(BASEDIR, "src/test/resources/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);
// add the a j2ee server so the application context reference can be resolved
context.addGBean("geronimo", J2EEServerImpl.GBEAN_INFO);
// add the module validator so the connector artifacts will resolve to an instance
AbstractName abstractName = context.getNaming().createChildName(((Module)plan).getModuleName(), "ValidatorFactory", NameFactory.VALIDATOR_FACTORY);
GBeanData gbeanData = new GBeanData(abstractName, ValidatorFactoryGBean.class);
context.addGBean(gbeanData);
configData = context.getConfigurationData();
} finally {
if (context != null) {
context.close();
}
if (configData != null) {
FileUtils.recursiveDelete(configData.getConfigurationDir());
}
}