artifact2 = new Artifact("test", "2", "2.2", "bar");
artifact3 = new Artifact("test", "3", "3.3", "bar");
// As if it was deployed with no version, now its version is a timestamp
artifact3NoVersion = new Artifact(artifact3.getGroupId(), artifact3.getArtifactId(), new Version(Long.toString(System.currentTimeMillis())), artifact3.getType());
Environment e1 = new Environment();
e1.setConfigId(artifact1);
ConfigurationData configurationData1 = new ConfigurationData(e1, kernel.getNaming());
configurationData1.setConfigurationStore(configStore);
gbean1 = configurationData1.addGBean("gbean1", TestBean.getGBeanInfo()).getAbstractName();
configurations.put(artifact1, configurationData1);
Environment e2 = new Environment();
e2.setConfigId(artifact2);
e2.addDependency(new Artifact("test", "1", (Version) null, "bar"), ImportType.ALL);
ConfigurationData configurationData2 = new ConfigurationData(e2, kernel.getNaming());
gbean2 = configurationData2.addGBean("gbean2", TestBean.getGBeanInfo()).getAbstractName();
configurationData2.setConfigurationStore(configStore);
configurations.put(artifact2, configurationData2);
{ // Make it obvious if these temp variables are reused
Environment e3 = new Environment();
e3.setConfigId(artifact3);
e3.addDependency(new Artifact("test", "2", (Version) null, "bar"), ImportType.ALL);
ConfigurationData configurationData3 = new ConfigurationData(e3, kernel.getNaming());
gbean3 = configurationData3.addGBean("gbean3", TestBean.getGBeanInfo()).getAbstractName();
configurationData3.setConfigurationStore(configStore);
configurations.put(artifact3, configurationData3);
}
{
Environment e3newer = new Environment();
e3newer.setConfigId(artifact3NoVersion);
e3newer.addDependency(new Artifact("test", "2", (Version) null, "bar"), ImportType.ALL);
ConfigurationData configurationData3newer = new ConfigurationData(e3newer, kernel.getNaming());
gbean3newer = configurationData3newer.addGBean("gbean3", TestBean.getGBeanInfo()).getAbstractName();
configurationData3newer.setConfigurationStore(configStore);
configurations.put(artifact3NoVersion, configurationData3newer);
}