use of org.jboss.as.patching.installation.InstallationManagerImpl in project wildfly-core by wildfly.
the class AbstractPatchingTest method apply.
protected PatchingResult apply(final PatchingTestStepBuilder builder, final ContentVerificationPolicy verificationPolicy, final PatchStepAssertions assertions) throws PatchingException {
final Patch patch = builder.build();
final File installation = new File(tempDir, JBOSS_INSTALLATION);
try {
assertions.before(installation, patch, installationManager);
} catch (IOException e) {
throw new PatchingException(e);
}
// Write patch
writePatch(builder.getPatchDir(), patch);
// Create the patch tool and apply the patch
final PatchTool patchTool = PatchTool.Factory.create(installationManager);
final PatchingResult result = patchTool.applyPatch(builder.getPatchDir(), verificationPolicy);
result.commit();
final InstalledIdentity identity = ((InstallationManagerImpl) installationManager).getInstalledIdentity(patch.getIdentity().getName(), null);
Assert.assertTrue(identity.getAllInstalledPatches().contains(patch.getPatchId()));
try {
assertions.after(installation, patch, installationManager);
} catch (IOException e) {
throw new PatchingException(e);
}
return result;
}
Aggregations