Search in sources :

Example 1 with FileDocument

use of org.eclipse.xtext.ui.refactoring.impl.DefaultRefactoringDocumentProvider.FileDocument in project xtext-eclipse by eclipse.

the class RefactoringDocumentProviderTest method testFileDocument.

@Test
public void testFileDocument() throws Exception {
    IRefactoringDocument document = createAndCheckDocument(testFile);
    assertTrue(document instanceof FileDocument);
    assertEquals(testFile, ((FileDocument) document).getFile());
    assertEquals(TEST_FILE_CONTENT, document.getOriginalContents());
    Change change = document.createChange(CHANGE_NAME, textEdit);
    assertTrue(change instanceof TextFileChange);
    assertEquals(CHANGE_NAME, change.getName());
    Change undoChange = checkEdit(document, textEdit);
    assertNotNull(undoChange);
}
Also used : FileDocument(org.eclipse.xtext.ui.refactoring.impl.DefaultRefactoringDocumentProvider.FileDocument) IRefactoringDocument(org.eclipse.xtext.ui.refactoring.impl.IRefactoringDocument) Change(org.eclipse.ltk.core.refactoring.Change) TextFileChange(org.eclipse.ltk.core.refactoring.TextFileChange) EditorDocumentChange(org.eclipse.xtext.ui.refactoring.impl.EditorDocumentChange) TextFileChange(org.eclipse.ltk.core.refactoring.TextFileChange) AbstractEditorTest(org.eclipse.xtext.ui.testing.AbstractEditorTest) Test(org.junit.Test)

Aggregations

Change (org.eclipse.ltk.core.refactoring.Change)1 TextFileChange (org.eclipse.ltk.core.refactoring.TextFileChange)1 FileDocument (org.eclipse.xtext.ui.refactoring.impl.DefaultRefactoringDocumentProvider.FileDocument)1 EditorDocumentChange (org.eclipse.xtext.ui.refactoring.impl.EditorDocumentChange)1 IRefactoringDocument (org.eclipse.xtext.ui.refactoring.impl.IRefactoringDocument)1 AbstractEditorTest (org.eclipse.xtext.ui.testing.AbstractEditorTest)1 Test (org.junit.Test)1