Source:
<code>public void testUncontrolElementCausesEmptyFragment() throws IOException, CoreException, URISyntaxException { IComparisonScope scope = <START> initComparison("emptyfragmentaftermerge"); <END> Comparison comparison = EMFCompare.builder().build().compare(scope); BatchMerger batchMerger = new BatchMerger(EMFCompareRCPPlugin.getDefault().getMergerRegistry()); ResourceSet leftResourceSet = (ResourceSet)scope.getLeft(); ResourceSet rightResourceSet = (ResourceSet)scope.getRight(); ResourceSet originResourceSet = (ResourceSet)scope.getOrigin(); EcoreUtil.resolveAll(leftResourceSet); EcoreUtil.resolveAll(rightResourceSet); EcoreUtil.resolveAll(originResourceSet); assertEquals(1, leftResourceSet.getResources().size()); assertEquals(2, rightResourceSet.getResources().size()); assertEquals(rightResourceSet.getResources().get(0).getURI().lastSegment(), "right.nodes"); assertEquals(rightResourceSet.getResources().get(1).getURI().lastSegment(), "fragment.nodes"); assertEquals(2, originResourceSet.getResources().size()); batchMerger.copyAllLeftToRight(comparison.getDifferences(), null); ResourceUtil.saveAllResources(leftResourceSet, Collections.emptyMap()); ResourceUtil.saveAllResources(rightResourceSet, Collections.emptyMap()); ResourceUtil.saveAllResources(originResourceSet, Collections.emptyMap()); assertEquals(1, leftResourceSet.getResources().size()); assertEquals(1, rightResourceSet.getResources().size()); assertEquals(rightResourceSet.getResources().get(0).getURI().lastSegment(), "right.nodes"); assertEquals(2, originResourceSet.getResources().size()); IResource fragmentFile = ResourcesPlugin.getWorkspace().getRoot() .findMember("Project-1/right/fragment.nodes"); assertNull(fragmentFile); }</code><technical_language>want put test models a folder name relates this test instead of emptyfragmentaftermerge. E.g. _497566/emptyfragmentaftermerge</technical_language>

Target:
public void testUncontrolElementCausesEmptyFragment() throws IOException, CoreException, URISyntaxException { IComparisonScope scope = initComparison("_497566/empty"); Comparison comparison = EMFCompare.builder().build().compare(scope); BatchMerger batchMerger = new BatchMerger(EMFCompareRCPPlugin.getDefault().getMergerRegistry()); ResourceSet leftResourceSet = (ResourceSet)scope.getLeft(); ResourceSet rightResourceSet = (ResourceSet)scope.getRight(); ResourceSet originResourceSet = (ResourceSet)scope.getOrigin(); EcoreUtil.resolveAll(leftResourceSet); EcoreUtil.resolveAll(rightResourceSet); EcoreUtil.resolveAll(originResourceSet); assertEquals(1, leftResourceSet.getResources().size()); assertEquals(2, rightResourceSet.getResources().size()); assertEquals(rightResourceSet.getResources().get(0).getURI().lastSegment(), "right.nodes"); assertEquals(rightResourceSet.getResources().get(1).getURI().lastSegment(), "fragment.nodes"); assertEquals(2, originResourceSet.getResources().size()); batchMerger.copyAllLeftToRight(comparison.getDifferences(), null); ResourceUtil.saveAllResources(leftResourceSet, Collections.emptyMap()); ResourceUtil.saveAllResources(rightResourceSet, Collections.emptyMap()); ResourceUtil.saveAllResources(originResourceSet, Collections.emptyMap()); assertEquals(1, leftResourceSet.getResources().size()); assertEquals(1, rightResourceSet.getResources().size()); assertEquals(rightResourceSet.getResources().get(0).getURI().lastSegment(), "right.nodes"); assertEquals(2, originResourceSet.getResources().size()); IResource fragmentFile = ResourcesPlugin.getWorkspace().getRoot() .findMember("Project-1/right/fragment.nodes"); assertNull(fragmentFile); }