@Test public void testUpdateWithBasicValues2() throws Exception { File root = getIncMergeRoot("basicValues2"); File fakeRoot = getMergedBlobFolder(root); ResourceMerger resourceMerger = new ResourceMerger(0); assertTrue(resourceMerger.loadFromBlob(fakeRoot, true )); checkSourceFolders(resourceMerger); List<ResourceSet> sets = resourceMerger.getDataSets(); assertEquals(2, sets.size()); RecordingLogger logger = new RecordingLogger(); ResourceSet overlaySet = sets.get(1); File overlayBase = new File(root, "overlay"); File overlayValues = new File(overlayBase, "values"); File overlayValuesNew = new File(overlayValues, "values.xml"); overlaySet.updateWith(overlayBase, overlayValuesNew, FileStatus.REMOVED, logger); checkLogger(logger); resourceMerger.validateDataSets(); ListMultimap<String, ResourceItem> mergedMap = resourceMerger.getDataMap(); List<ResourceItem> valuesUntouched = mergedMap.get("string/untouched"); assertEquals(1, valuesUntouched.size()); assertTrue(valuesUntouched.get(0).isWritten()); assertFalse(valuesUntouched.get(0).isTouched()); assertFalse(valuesUntouched.get(0).isRemoved()); List<ResourceItem> valuesRemovedOverlay = mergedMap.get("string/removed_overlay"); assertEquals(2, valuesRemovedOverlay.size()); assertFalse(valuesRemovedOverlay.get(0).isWritten()); assertFalse(valuesRemovedOverlay.get(0).isTouched()); assertFalse(valuesRemovedOverlay.get(0).isRemoved()); assertTrue(valuesRemovedOverlay.get(1).isWritten()); assertFalse(valuesRemovedOverlay.get(1).isTouched()); assertTrue(valuesRemovedOverlay.get(1).isRemoved()); File resFolder = getFolderCopy(new File(root, "resOut")); MergedResourceWriter writer = getConsumer(resFolder); resourceMerger.mergeData(writer, false ); Map<String, String> map = quickStringOnlyValueFileParser( new File(resFolder, "values" + File.separator + "values.xml")); assertEquals("untouched", map.get("untouched")); assertEquals("untouched", map.get("removed_overlay")); }
@Override public void mergeData(@NonNull MergeConsumer<ResourceItem> consumer, boolean doCleanUp) throws MergingException { clearFilterCache(); super.mergeData(consumer, doCleanUp); }
ResourceMerger extends DataMerger<ResourceItem, ResourceFile, ResourceSet> { @Override public void mergeData(@NonNull MergeConsumer<ResourceItem> consumer, boolean doCleanUp) throws MergingException { clearFilterCache(); super.mergeData(consumer, doCleanUp); } }
ResourceMerger extends DataMerger<ResourceItem, ResourceFile, ResourceSet> { @Override public void mergeData(@NonNull MergeConsumer<ResourceItem> consumer, boolean doCleanUp) throws MergingException { clearFilterCache(); super.mergeData(consumer, doCleanUp); } ResourceMerger(int minSdk); }
ResourceMerger extends DataMerger<ResourceItem, ResourceFile, ResourceSet> { @Override public void mergeData(@NonNull MergeConsumer<ResourceItem> consumer, boolean doCleanUp) throws MergingException { clearFilterCache(); super.mergeData(consumer, doCleanUp); } ResourceMerger(int minSdk); @Override void addDataSet(ResourceSet resourceSet); @Override void mergeData(@NonNull MergeConsumer<ResourceItem> consumer, boolean doCleanUp); }
ResourceMerger extends DataMerger<ResourceItem, ResourceFile, ResourceSet> { @Override public void mergeData(@NonNull MergeConsumer<ResourceItem> consumer, boolean doCleanUp) throws MergingException { clearFilterCache(); super.mergeData(consumer, doCleanUp); } ResourceMerger(int minSdk); @Override void addDataSet(ResourceSet resourceSet); @Override void mergeData(@NonNull MergeConsumer<ResourceItem> consumer, boolean doCleanUp);  }