public static ContentModification modifyModule(File patchDir, String patchElementID, File existingModule, String newContent) throws IOException { byte[] existingHash = hashFile(existingModule); return modifyModule(patchDir, patchElementID, existingModule.getName(), existingHash, newContent); }
public T updateModule(final String moduleName, byte[] existingHash, byte[] resultingHash, final TestUtils.ContentTask task) throws IOException { final ContentModification modification = ContentModificationUtils.modifyModule(getPatchDir(), getPatchId(), moduleName, existingHash, task); return addContentModification(modification, resultingHash); }
public T updateModuleWithRandomContent(final String moduleName, byte[] existingHash, byte[] resultingHash) throws IOException { final ContentModification modification = ContentModificationUtils.modifyModule(getPatchDir(), getPatchId(), moduleName, existingHash, randomString()); return addContentModification(modification, resultingHash); }
File moduleDir = createModule0(baseModuleDir, moduleName); ContentModification moduleModified = ContentModificationUtils.modifyModule(patchDir, patchElementId, moduleDir, "new resource in the module");
private void prepareCP3(final InstalledIdentity installedIdentity) throws IOException, Exception { final String cp3ID = "CP3"; final File cp3Dir = mkdir(tempDir, cp3ID); cp3StandaloneModified = ContentModificationUtils.modifyMisc(cp3Dir, cp3ID, "updated by cp3", standaloneSh, "bin", standaloneSh.getName()); cp3BaseModuleModified = ContentModificationUtils.modifyModule(cp3Dir, baseCP3ID, moduleName, cp2BaseModuleModified.getItem().getContentHash(), "cp3 content"); // cp3BaseModule2Added = ContentModificationUtils.addModule(cp3Dir, baseCP3ID, moduleName + "2"); the patchgen tool // would generate an update instead final File absentModuleXml = IoUtils.newFile(installedIdentity.getLayer("base").loadTargetInfo() .getDirectoryStructure().getModulePatchDirectory(baseCP2ID), "org", "jboss", "test2", "main", "module.xml"); cp3BaseModule2Added = ContentModificationUtils.modifyModule(cp3Dir, baseCP3ID, moduleName + "2", HashUtils.hashFile(absentModuleXml), "cp3 content"); final ContentModification cp3AddedByCP1RemovedByCP3Removed = ContentModificationUtils.removeMisc(addedByCP1RemovedByCP3, "bin", addedByCP1RemovedByCP3.getName()); cp3 = PatchBuilder.create() .setPatchId(cp3ID) .setDescription(randomString()) .upgradeIdentity(installedIdentity.getIdentity().getName(), productConfig.getProductVersion() + "_CP2", productConfig.getProductVersion() + "_CP3") .getParent() .upgradeElement(baseCP3ID, BASE, false) .addContentModification(cp3BaseModuleModified) .addContentModification(cp3BaseModule2Added) .getParent() .addContentModification(cp3StandaloneModified) .addContentModification(cp3AddedByCP1RemovedByCP3Removed) .build(); createPatchXMLFile(cp3Dir, cp3); cp3Zip = createZippedPatchFile(cp3Dir, cp3ID); }
File moduleDir = createModule0(baseModuleDir, moduleName); ContentModification moduleModified = ContentModificationUtils.modifyModule(patchDir, patchElementId, moduleDir, "new resource in the module"); ContentModification moduleModified2 = ContentModificationUtils.modifyModule(patchDir, patchElementId2, patchedModule, "another module update");
File moduleConflictDir = createModule0(baseModuleDir, moduleConflictName); ContentModification moduleConflictModified = ContentModificationUtils.modifyModule(patchDir, patchID, moduleConflictDir, "new resource in the module"); File moduleNoConflictDir = createModule0(baseModuleDir, moduleNoConflictName); ContentModification moduleNoConflictModified = ContentModificationUtils.modifyModule(patchDir, patchID, moduleNoConflictDir, "new resource in the module");
File moduleDir = createModule0(baseModuleDir, moduleName); ContentModification moduleModified = ContentModificationUtils.modifyModule(patchDir, patchElementId, moduleDir, "new resource in the module"); ContentModification moduleModified2 = ContentModificationUtils.modifyModule(patchDir, patchElementId2, patchedModule, "another module update");
File moduleConflictDir = createModule0(baseModuleDir, moduleConflictName); ContentModification moduleConflictModified = ContentModificationUtils.modifyModule(patchDir, patchElementId, moduleConflictDir, "new resource in the module"); File moduleNoConflictDir = createModule0(baseModuleDir, moduleNoConflictName); ContentModification moduleNoConflictModified = ContentModificationUtils.modifyModule(patchDir, patchElementId, moduleNoConflictDir, "new resource in the module");
final File cp2Dir = mkdir(tempDir, cp2ID); cp2BaseModuleModified = ContentModificationUtils.modifyModule(cp2Dir, baseCP2ID, moduleName, cp1BaseModuleAdded.getItem().getContentHash(), "cp2 content"); final File baseModule2Dir = IoUtils.newFile( installedIdentity.getLayer("base").loadTargetInfo().getDirectoryStructure().getModulePatchDirectory(baseCP1ID),
ContentModification moduleModified = ContentModificationUtils.modifyModule(patchDir, baseLayerPatchID, moduleDir, "new resource in the module");
File oneOffPatchDir = mkdir(tempDir, oneOffPatchID); ContentModification moduleModified = ContentModificationUtils.modifyModule(oneOffPatchDir, oneOffLayerPatchID, newFile(modulePatchDirectory, moduleName), "new resource in the module");
File oneOffPatchDir = mkdir(tempDir, oneOffPatchID); ContentModification moduleModified = ContentModificationUtils.modifyModule(oneOffPatchDir, oneOffLayerPatchID, newFile(modulePatchDirectory, moduleName), "new resource in the module");