Source:
<code>public void testMigrationWithReadOnlyFilePressCancel() { assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration.ecore"); assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration.aird"); assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p1.ecore"); assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p1.aird"); assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p2.ecore"); assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p2.aird"); assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p1_p1_1.ecore"); assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p1_p1_1.aird"); IFile p1Fragment = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p1.ecore")); IFile p2Fragment = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p2.ecore")); IFile p1P1Fragment = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p1_p1_1.ecore")); EclipseTestsSupportHelper.INSTANCE.setReadOnlyStatus(true, p1Fragment, p2Fragment, p1P1Fragment); <START> <END> IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(TEMPORARY_PROJECT_NAME); assertEquals("It should be no backup file before migration.", 0, getNumberOfBackupFiles(project)); TransactionalEditingDomain editingDomain = EditingDomainFactoryService.INSTANCE.getEditingDomainFactory().createEditingDomain(new ResourceSetImpl()); ResourceSet rs = editingDomain.getResourceSet(); URI parentUri = URI.createPlatformResourceURI(TEMPORARY_PROJECT_NAME + "/fragmentedMigration.ecore", true); checkParentSemanticModel(parentUri, rs, "root"); EclipseTestsSupportHelper.INSTANCE.setReadOnlyStatus(false, p1Fragment, p2Fragment, p1P1Fragment); }</code><technical_language>add a "try {"</technical_language>

Target:
public void testMigrationWithReadOnlyFilePressCancel() { assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration.ecore"); assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration.aird"); assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p1.ecore"); assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p1.aird"); assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p2.ecore"); assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p2.aird"); assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p1_p1_1.ecore"); assertFileExists(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p1_p1_1.aird"); IFile p1Fragment = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p1.ecore")); IFile p2Fragment = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p2.ecore")); IFile p1P1Fragment = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(TEMPORARY_PROJECT_NAME + "/fragmentedMigration_p1_p1_1.ecore")); EclipseTestsSupportHelper.INSTANCE.setReadOnlyStatus(true, p1Fragment, p2Fragment, p1P1Fragment); try { IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(TEMPORARY_PROJECT_NAME); assertEquals("It should be no backup file before migration.", 0, getNumberOfBackupFiles(project)); TransactionalEditingDomain editingDomain = EditingDomainFactoryService.INSTANCE.getEditingDomainFactory().createEditingDomain(new ResourceSetImpl()); ResourceSet rs = editingDomain.getResourceSet(); URI parentUri = URI.createPlatformResourceURI(TEMPORARY_PROJECT_NAME + "/fragmentedMigration.ecore", true); checkParentSemanticModel(parentUri, rs, "root"); } finally { EclipseTestsSupportHelper.INSTANCE.setReadOnlyStatus(false, p1Fragment, p2Fragment, p1P1Fragment); } }