protected PatchingResult apply(final PatchMetadataResolver patchResolver, final PatchContentProvider contentProvider, final ContentVerificationPolicy contentPolicy) throws PatchingException { // Apply the patch final org.jboss.as.patching.metadata.Identity identity = patchResolver.resolvePatch(null, null).getIdentity(); final InstallationManager.InstallationModification modification = ((InstallationManagerImpl)manager). getInstalledIdentity(identity.getName(), identity.getVersion()).modifyInstallation(callback); try { return runner.applyPatch(patchResolver, contentProvider, contentPolicy, modification); } catch (Exception e) { modification.cancel(); throw rethrowException(e); } }
protected PatchingResult apply(final PatchMetadataResolver patchResolver, final PatchContentProvider contentProvider, final ContentVerificationPolicy contentPolicy) throws PatchingException { // Apply the patch final org.jboss.as.patching.metadata.Identity identity = patchResolver.resolvePatch(null, null).getIdentity(); final InstallationManager.InstallationModification modification = ((InstallationManagerImpl)manager). getInstalledIdentity(identity.getName(), identity.getVersion()).modifyInstallation(callback); try { return runner.applyPatch(patchResolver, contentProvider, contentPolicy, modification); } catch (Exception e) { modification.cancel(); throw rethrowException(e); } }
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; }