@Override public TargetInfo loadTargetInfo() throws IOException { return identity.loadTargetInfo(); }
@Override public TargetInfo loadTargetInfo() throws IOException { return identity.loadTargetInfo(); }
protected void putPatchableTarget(final String name, final PatchableTarget target, Map<String, MutableTargetImpl> map) throws IOException { final PatchableTarget.TargetInfo info = target.loadTargetInfo(); map.put(name, new MutableTargetImpl(info)); }
protected void putPatchableTarget(final String name, final PatchableTarget target, Map<String, MutableTargetImpl> map) throws IOException { final PatchableTarget.TargetInfo info = target.loadTargetInfo(); map.put(name, new MutableTargetImpl(info)); }
public static File[] getModuleRoot(final PatchableTarget target) { try { return PatchUtils.getModulePath(target.getDirectoryStructure(), target.loadTargetInfo()); } catch (IOException e) { throw new RuntimeException(e); } }
static void writeTargetInfo(final XMLExtendedStreamWriter writer, final Element element, final PatchableTarget target) throws XMLStreamException { try { final PatchableTarget.TargetInfo info = target.loadTargetInfo(); // writer.writeEmptyElement(element.name); writer.writeAttribute(Attribute.NAME.name, target.getName()); writer.writeAttribute(Attribute.RELEASE_ID.name, info.getCumulativePatchID()); if (! info.getPatchIDs().isEmpty()) { writer.writeAttribute(Attribute.PATCHES.name, PatchUtils.asString(info.getPatchIDs())); } } catch (IOException e) { throw new XMLStreamException(e); } }
static void writeTargetInfo(final XMLExtendedStreamWriter writer, final Element element, final PatchableTarget target) throws XMLStreamException { try { final PatchableTarget.TargetInfo info = target.loadTargetInfo(); // writer.writeEmptyElement(element.name); writer.writeAttribute(Attribute.NAME.name, target.getName()); writer.writeAttribute(Attribute.RELEASE_ID.name, info.getCumulativePatchID()); if (! info.getPatchIDs().isEmpty()) { writer.writeAttribute(Attribute.PATCHES.name, PatchUtils.asString(info.getPatchIDs())); } } catch (IOException e) { throw new XMLStreamException(e); } }
File getModuleResource(final String layer, final String patchID, final String moduleName) throws IOException { final PatchableTarget.TargetInfo info = getLayer(layer).loadTargetInfo(); final File root = info.getDirectoryStructure().getModulePatchDirectory(patchID); final File moduleRoot = TestUtils.getModuleRoot(root, moduleName); return new File(moduleRoot, RESOURCE); }
File getModuleResource(final String layer, final String patchID, final String moduleName) throws IOException { final PatchableTarget.TargetInfo info = getLayer(layer).loadTargetInfo(); final File root = info.getDirectoryStructure().getModulePatchDirectory(patchID); final File moduleRoot = TestUtils.getModuleRoot(root, moduleName); return new File(moduleRoot, RESOURCE); }
static void assertApplied(final Patch patch, InstallationManager manager) throws IOException { final String patchID = patch.getPatchId(); InstalledIdentity installedIdentity = null; try { installedIdentity = manager.getInstalledIdentity(patch.getIdentity().getName(), null); } catch (PatchingException e) { Assert.fail(e.getLocalizedMessage()); } final PatchableTarget target = installedIdentity.getIdentity(); final PatchableTarget.TargetInfo identity = target.loadTargetInfo(); assertIsApplied(patch.getIdentity().getPatchType(), patchID, identity); assertExists(identity.getDirectoryStructure().getInstalledImage().getPatchHistoryDir(patchID)); assertContentItems(patchID, target, patch.getModifications()); for (final PatchElement element : patch.getElements()) { final PatchElementProvider provider = element.getProvider(); final PatchableTarget targetElement = provider.isAddOn() ? installedIdentity.getAddOn(provider.getName()) : installedIdentity.getLayer(provider.getName()); assertIsApplied(provider.getPatchType(), element.getId(), targetElement.loadTargetInfo()); assertContentItems(element.getId(), targetElement, element.getModifications()); } }
static void assertNotApplied(final Patch patch, InstallationManager manager) throws IOException { InstalledIdentity installedIdentity = null; try { installedIdentity = manager.getInstalledIdentity(patch.getIdentity().getName(), patch.getIdentity().getVersion()); } catch (PatchingException e) { Assert.fail(e.getLocalizedMessage()); } final PatchableTarget.TargetInfo identity = installedIdentity.getIdentity().loadTargetInfo(); assertNotApplied(patch.getIdentity().getPatchType(), patch.getPatchId(), identity); assertDoesNotExists(identity.getDirectoryStructure().getInstalledImage().getPatchHistoryDir(patch.getPatchId())); for (final PatchElement element : patch.getElements()) { final PatchElementProvider provider = element.getProvider(); final PatchableTarget target = provider.isAddOn() ? installedIdentity.getAddOn(provider.getName()) : installedIdentity.getLayer(provider.getName()); Assert.assertNotNull(target); assertNotApplied(provider.getPatchType(), element.getId(), target.loadTargetInfo()); } }