protected void setUp() throws Exception {
super.setUp();
kernel = KernelFactory.newInstance().createKernel("test");
kernel.boot();
ConfigurationData bootstrap = new ConfigurationData(bootId, naming);
// GBeanData artifactManagerData = bootstrap.addGBean("ArtifactManager", DefaultArtifactManager.GBEAN_INFO);
//
// GBeanData artifactResolverData = bootstrap.addGBean("ArtifactResolver", DefaultArtifactResolver.GBEAN_INFO);
// artifactResolverData.setReferencePattern("ArtifactManager", artifactManagerData.getAbstractName());
//
// GBeanData configurationManagerData = bootstrap.addGBean("ConfigurationManager", EditableKernelConfigurationManager.GBEAN_INFO);
// configurationManagerData.setReferencePattern("ArtifactManager", artifactManagerData.getAbstractName());
// configurationManagerData.setReferencePattern("ArtifactResolver", artifactResolverData.getAbstractName());
// bootstrap.addGBean(configurationManagerData);
bootstrap.addGBean("ServerInfo", BasicServerInfo.GBEAN_INFO).setAttribute("baseDirectory", ".");
AbstractName repositoryName = bootstrap.addGBean("Repository", MockRepository.GBEAN_INFO).getAbstractName();
AbstractName configStoreName = bootstrap.addGBean("MockConfigurationStore", MockConfigStore.GBEAN_INFO).getAbstractName();
GBeanData artifactManagerData = bootstrap.addGBean("ArtifactManager", DefaultArtifactManager.GBEAN_INFO);
GBeanData artifactResolverData = bootstrap.addGBean("ArtifactResolver", DefaultArtifactResolver.GBEAN_INFO);
artifactResolverData.setReferencePattern("ArtifactManager", artifactManagerData.getAbstractName());
GBeanData configurationManagerData = bootstrap.addGBean("ConfigurationManager", EditableKernelConfigurationManager.GBEAN_INFO);
configurationManagerData.setReferencePattern("ArtifactManager", artifactManagerData.getAbstractName());
configurationManagerData.setReferencePattern("ArtifactResolver", artifactResolverData.getAbstractName());
configurationManagerData.setReferencePattern("Stores", configStoreName);
configurationManagerData.setReferencePattern("Repositories", repositoryName);
bootstrap.addGBean(configurationManagerData);
GBeanData serverData = bootstrap.addGBean("geronimo", J2EEServerImpl.GBEAN_INFO);
serverName = serverData.getAbstractName();
bootstrap.addGBean(serverData);
// add fake TransactionManager so refs will resolve
GBeanData tm = bootstrap.addGBean("TransactionManager", GeronimoTransactionManagerGBean.GBEAN_INFO);
tm.setAttribute("defaultTransactionTimeoutSeconds", 10);
ConfigurationUtil.loadBootstrapConfiguration(kernel, bootstrap, getClass().getClassLoader());
repository = (MockRepository) kernel.getGBean(repositoryName);
Set<Artifact> repo = repository.getRepo();
repo.add(Artifact.create("org.apache.geronimo.tests/test/1/car"));
repo.add(bootId);
configurationManager = ConfigurationUtil.getEditableConfigurationManager(kernel);
// configurationManager.getConfiguration(bootstrap.getId());
ConfigurationStore configStore = (ConfigurationStore) kernel.getGBean(configStoreName);
configStore.install(bootstrap);
defaultEnvironment = new Environment();
defaultEnvironment.addDependency(bootstrap.getId(), ImportType.ALL);
}