@Test public void testApplyReleasePatch() throws Exception { // build a Release patch for the base installation // with 1 added module String patchID = randomString(); String layerPatchID = randomString(); File patchDir = mkdir(tempDir, patchID); String moduleName = randomString(); ContentModification moduleAdded = ContentModificationUtils.addModule(patchDir, layerPatchID, moduleName); InstalledIdentity installedIdentity = loadInstalledIdentity(); Patch patch = PatchBuilder.create() .setPatchId(patchID) .setDescription(randomString()) .upgradeIdentity(installedIdentity.getIdentity().getName(), installedIdentity.getIdentity().getVersion(), productConfig.getProductVersion() + "-Release1") .getParent() .upgradeElement(layerPatchID, BASE, false) .addContentModification(moduleAdded) .getParent() .build(); createPatchXMLFile(patchDir, patch); File zippedPatch = createZippedPatchFile(patchDir, patchID); PatchingResult result = executePatch(zippedPatch); assertPatchHasBeenApplied(result, patch); InstalledIdentity updatedInstalledIdentity = loadInstalledIdentity(); File modulePatchDirectory = updatedInstalledIdentity.getLayers().get(0).loadTargetInfo().getDirectoryStructure().getModulePatchDirectory(layerPatchID); assertDirExists(modulePatchDirectory); assertDefinedModule(modulePatchDirectory, moduleName, moduleAdded.getItem().getContentHash()); }
File zippedOneOffPatch = createZippedPatchFile(oneOffPatchDir, oneOffPatchID); PatchingResult resultOfOneOffPatch = executePatch(zippedOneOffPatch); assertPatchHasBeenApplied(resultOfOneOffPatch, oneOffPatch); File zippedReleasePatch = createZippedPatchFile(releasePatchDir, releasePatchID); PatchingResult resultOfReleasePatch = executePatch(zippedReleasePatch); assertPatchHasBeenApplied(resultOfReleasePatch, releasePatch);
File zippedReleasePatch = createZippedPatchFile(releasePatchDir, releasePatchID); PatchingResult resultOfReleasePatch = executePatch(zippedReleasePatch); assertPatchHasBeenApplied(resultOfReleasePatch, releasePatch); File zippedOneOffPatch = createZippedPatchFile(oneOffPatchDir, oneOffPatchID); PatchingResult resultOfOneOffPatch = executePatch(zippedOneOffPatch); assertPatchHasBeenApplied(resultOfOneOffPatch, oneOffPatch);
File zippedReleasePatch = createZippedPatchFile(releasePatchDir, releasePatchID); PatchingResult resultOfReleasePatch = executePatch(zippedReleasePatch); assertPatchHasBeenApplied(resultOfReleasePatch, releasePatch); File zippedOneOffPatch = createZippedPatchFile(oneOffPatchDir, oneOffPatchID); PatchingResult resultOfOneOffPatch = executePatch(zippedOneOffPatch); assertPatchHasBeenApplied(resultOfOneOffPatch, oneOffPatch);
PatchingResult result = executePatch(zippedPatch); assertPatchHasBeenApplied(result, patch);