use of io.fabric8.patch.management.Patch in project fabric8 by jboss-fuse.
the class AbstractPatchIntegrationTest method rollback.
// Rollback a patch and wait for rollback to complete
protected void rollback(String name) throws Exception {
Patch patch = service.getPatch(name);
service.rollback(patch, false, false);
long start = System.currentTimeMillis();
while (patch.isInstalled() && System.currentTimeMillis() - start < TIMEOUT) {
Thread.sleep(100);
}
if (patch.isInstalled()) {
fail(String.format("Patch '%s' did not roll back within %s ms", name, TIMEOUT));
}
}
use of io.fabric8.patch.management.Patch in project fabric8 by jboss-fuse.
the class AbstractPatchIntegrationTest method install.
// Install a patch and wait for installation to complete
protected void install(String name) throws Exception {
Patch patch = service.getPatch(name);
service.install(patch, false, false);
long start = System.currentTimeMillis();
while (!patch.isInstalled() && System.currentTimeMillis() - start < TIMEOUT) {
Thread.sleep(100);
}
if (!patch.isInstalled()) {
fail(String.format("Patch '%s' did not installed within %s ms", name, TIMEOUT));
}
}
use of io.fabric8.patch.management.Patch in project fabric8 by jboss-fuse.
the class PatchBundlesIntegrationTest method createdeployment.
@Deployment
public static JavaArchive createdeployment() {
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "test.jar");
archive.addClass(ServiceLocator.class);
archive.addClass(IOHelpers.class);
archive.addPackage(ServiceTracker.class.getPackage());
archive.addPackages(true, OSGiManifestBuilder.class.getPackage());
archive.setManifest(new Asset() {
public InputStream openStream() {
OSGiManifestBuilder builder = OSGiManifestBuilder.newInstance();
builder.addBundleSymbolicName(archive.getName());
builder.addBundleManifestVersion(2);
builder.addImportPackages(Bundle.class, Service.class, PatchManagement.class, Validatable.class);
return builder.openStream();
}
});
// add the original bundle as well as the patch zip files as resources
archive.add(createPatchableBundle("1.0.0"), "/bundles", ZipExporter.class);
archive.add(createPatchZipFile("patch-01"), "/patches", ZipExporter.class);
archive.add(createPatchZipFile("patch-02"), "/patches", ZipExporter.class);
archive.add(createPatchZipFile("patch-02-without-range"), "/patches", ZipExporter.class);
return archive;
}
use of io.fabric8.patch.management.Patch in project fabric8 by jboss-fuse.
the class PatchFilesIntegrationTest method createdeployment.
@Deployment
public static JavaArchive createdeployment() {
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "test.jar");
archive.addClass(ServiceLocator.class);
archive.addClass(IOHelpers.class);
archive.addPackage(ServiceTracker.class.getPackage());
archive.addPackages(true, OSGiManifestBuilder.class.getPackage());
archive.setManifest(new Asset() {
public InputStream openStream() {
OSGiManifestBuilder builder = OSGiManifestBuilder.newInstance();
builder.addBundleSymbolicName(archive.getName());
builder.addBundleManifestVersion(2);
builder.addImportPackages(Bundle.class, Service.class, PatchManagement.class, Validatable.class);
return builder.openStream();
}
});
// add the patch zip files as resources
archive.add(createPatchZipFile("file-01"), "/patches", ZipExporter.class);
archive.add(createPatchZipFile("file-02"), "/patches", ZipExporter.class);
return archive;
}
use of io.fabric8.patch.management.Patch in project fabric8 by jboss-fuse.
the class PatchMigratorTest method createdeployment.
@Deployment
public static JavaArchive createdeployment() {
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "test.jar");
archive.setManifest(new Asset() {
public InputStream openStream() {
OSGiManifestBuilder builder = OSGiManifestBuilder.newInstance();
builder.addBundleSymbolicName(archive.getName());
builder.addBundleManifestVersion(2);
builder.addImportPackages(Bundle.class, Service.class, PatchManagement.class, Validatable.class);
return builder.openStream();
}
});
archive.addClass(ServiceLocator.class);
archive.addClass(IOHelpers.class);
archive.addPackage(ServiceTracker.class.getPackage());
archive.addPackages(true, OSGiManifestBuilder.class.getPackage());
// add the original bundle as well as the patch zip files as resources
archive.add(createPatchZipFile("migrator-patch-01"), "/patches", ZipExporter.class);
return archive;
}
Aggregations