public static void createApplications() throws Exception {
if (createdApplications) {
return;
}
ZipFixture testEba = ArchiveFixture.newZip()
.jar("sample.jar")
.manifest().symbolicName("org.apache.aries.isolated.sample")
.attribute("Bundle-Version", "1.0.0")
.end()
.binary("org/apache/aries/isolated/sample/HelloWorld.class",
IsolatedRuntimeTest.class.getClassLoader().getResourceAsStream("org/apache/aries/isolated/sample/HelloWorld.class"))
.binary("org/apache/aries/isolated/sample/HelloWorldImpl.class",
IsolatedRuntimeTest.class.getClassLoader().getResourceAsStream("org/apache/aries/isolated/sample/HelloWorldImpl.class"))
.binary("OSGI-INF/blueprint/sample-blueprint.xml",
IsolatedRuntimeTest.class.getClassLoader().getResourceAsStream("isolated/sample-blueprint.xml"))
.end();
FileOutputStream fout = new FileOutputStream("test.eba");
testEba.writeOut(fout);
fout.close();
ZipFixture testEba2 = testEba.binary("META-INF/APPLICATION.MF",
IsolatedRuntimeTest.class.getClassLoader().getResourceAsStream("isolated/APPLICATION.MF"))
.end();
fout = new FileOutputStream("test2.eba");
testEba2.writeOut(fout);
fout.close();
ZipFixture sampleJar2 = ArchiveFixture.newJar()
.manifest().symbolicName("org.apache.aries.isolated.sample")
.attribute("Bundle-Version", "2.0.0")
.end()
.binary("org/apache/aries/isolated/sample/HelloWorld.class",
IsolatedRuntimeTest.class.getClassLoader().getResourceAsStream("org/apache/aries/isolated/sample/HelloWorld.class"))
.binary("org/apache/aries/isolated/sample/HelloWorldImpl.class",
IsolatedRuntimeTest.class.getClassLoader().getResourceAsStream("org/apache/aries/isolated/sample/HelloWorldImpl.class"))
.binary("OSGI-INF/blueprint/aries.xml",
IsolatedRuntimeTest.class.getClassLoader().getResourceAsStream("isolated/sample2-blueprint.xml"))
.end();
fout = new FileOutputStream("sample_2.0.0.jar");
sampleJar2.writeOut(fout);
fout.close();
ZipFixture ebaWithFragment = ArchiveFixture.newZip()
.jar("sample.jar")
.manifest().symbolicName("org.apache.aries.isolated.sample")
.attribute("Bundle-Version", "1.0.0")
.end()
.end()
.jar("fragment.jar")
.manifest().symbolicName("org.apache.aries.isolated.fragment")
.attribute("Bundle-Version", "1.0.0")
.attribute("Fragment-Host", "org.apache.aries.isolated.sample")
.end()
.binary("org/apache/aries/isolated/sample/HelloWorld.class",
IsolatedRuntimeTest.class.getClassLoader().getResourceAsStream("org/apache/aries/isolated/sample/HelloWorld.class"))
.binary("org/apache/aries/isolated/sample/HelloWorldImpl.class",
IsolatedRuntimeTest.class.getClassLoader().getResourceAsStream("org/apache/aries/isolated/sample/HelloWorldImpl.class"))
.binary("OSGI-INF/blueprint/sample-blueprint.xml",
IsolatedRuntimeTest.class.getClassLoader().getResourceAsStream("isolated/sample-blueprint.xml"))
.end();
fout = new FileOutputStream("withFragment.eba");
ebaWithFragment.writeOut(fout);
fout.close();
createdApplications = true;
}