@Test public void testBothClean_2() throws Exception { try { refactoringPreferences.setSaveAllBeforeRefactoring(true); renameFooToFooBar(fooEditor); assertFalse(fooEditor.isDirty()); assertFalse(barEditor.isDirty()); } finally { refactoringPreferences.setSaveAllBeforeRefactoring(false); } }
@Test public void testCleanDirty_1() throws Exception { assertFalse(refactoringPreferences.isSaveAllBeforeRefactoring()); renameFooToFooBar(barEditor); assertFalse(fooEditor.isDirty()); assertFalse(barEditor.isDirty()); }
@Test public void testReferrerDirty_0() throws Exception { assertFalse(refactoringPreferences.isSaveAllBeforeRefactoring()); smudge(barEditor); renameFooToFooBar(fooEditor); assertFalse(fooEditor.isDirty()); assertTrue(barEditor.isDirty()); }
@Override public void setUp() throws Exception { super.setUp(); IJavaProject project = JavaProjectSetupUtil.createJavaProject(TEST_PROJECT); addNature(project.getProject(), XtextProjectHelper.NATURE_ID); Injector injector = Activator.getInstance().getInjector(getEditorId()); injector.injectMembers(this); IFile fooFile = IResourcesSetupUtil.createFile(TEST_PROJECT + "/foo.refactoringtestlanguage", "foo"); IFile barFile = IResourcesSetupUtil.createFile( TEST_PROJECT + "/bar.refactoringtestlanguage", "bar { ref foo }"); waitForAutoBuild(); fooEditor = openEditor(fooFile); barEditor = openEditor(barFile); assertTrue(refactoringPreferences.useInlineRefactoring()); }