use of org.eclipse.che.ide.ext.java.client.refactoring.RefactorInfo in project che by eclipse.
the class RenamePresenterTest method renameFieldWizardShouldBeShow.
@Test
public void renameFieldWizardShouldBeShow() throws Exception {
when(session.getWizardType()).thenReturn(RenameRefactoringSession.RenameWizard.FIELD);
RefactorInfo refactorInfo = RefactorInfo.of(MoveType.REFACTOR_MENU, RefactoredItemType.COMPILATION_UNIT, new Resource[] { file });
renamePresenter.show(refactorInfo);
verifyPreparingRenameRefactoringDto();
verify(refactorService).createRenameRefactoring(createRenameRefactoringDto);
verify(renameRefactoringSessionPromise).then(renameRefactoringSessionCaptor.capture());
renameRefactoringSessionCaptor.getValue().apply(session);
verifyPreparingWizard();
verify(locale).renameFieldTitle();
verify(view).setTitle(anyString());
verify(view).setVisiblePatternsPanel(true);
verify(view).show();
}
use of org.eclipse.che.ide.ext.java.client.refactoring.RefactorInfo in project che by eclipse.
the class RenamePresenterTest method changesShouldBeAppliedWithNotErrorStatus.
@Test
public void changesShouldBeAppliedWithNotErrorStatus() throws Exception {
RefactorInfo refactorInfo = RefactorInfo.of(MoveType.REFACTOR_MENU, RefactoredItemType.COMPILATION_UNIT, new Resource[] { file });
when(changeCreationResult.isCanShowPreviewPage()).thenReturn(true);
when(refactoringStatus.getSeverity()).thenReturn(0);
renamePresenter.show(refactorInfo);
verify(refactorService).createRenameRefactoring(createRenameRefactoringDto);
verify(renameRefactoringSessionPromise).then(renameRefactoringSessionCaptor.capture());
renameRefactoringSessionCaptor.getValue().apply(session);
renamePresenter.onAcceptButtonClicked();
verify(refactoringSession).setSessionId(SESSION_ID);
verifyPreparingRenameSettingsDto();
verifyPreparingRenameChanges();
verify(changeCreationResultPromise).then(changeCreationResultCaptor.capture());
changeCreationResultCaptor.getValue().apply(changeCreationResult);
verify(refactorService).applyRefactoring(refactoringSession);
verify(refactoringStatusPromise).then(refactoringStatusCaptor.capture());
refactoringStatusCaptor.getValue().apply(refactoringStatus);
verify(view).hide();
verify(refactoringUpdater).updateAfterRefactoring(Matchers.<List<ChangeInfo>>anyObject());
}
use of org.eclipse.che.ide.ext.java.client.refactoring.RefactorInfo in project che by eclipse.
the class RenamePresenterTest method renameMethodWizardShouldBeShow.
@Test
public void renameMethodWizardShouldBeShow() throws Exception {
when(session.getWizardType()).thenReturn(RenameRefactoringSession.RenameWizard.METHOD);
RefactorInfo refactorInfo = RefactorInfo.of(MoveType.REFACTOR_MENU, RefactoredItemType.COMPILATION_UNIT, new Resource[] { file });
renamePresenter.show(refactorInfo);
verifyPreparingRenameRefactoringDto();
verify(refactorService).createRenameRefactoring(createRenameRefactoringDto);
verify(renameRefactoringSessionPromise).then(renameRefactoringSessionCaptor.capture());
renameRefactoringSessionCaptor.getValue().apply(session);
verifyPreparingWizard();
verify(locale).renameMethodTitle();
verify(view).setTitle(anyString());
verify(view).setVisibleKeepOriginalPanel(true);
verify(view).show();
}
use of org.eclipse.che.ide.ext.java.client.refactoring.RefactorInfo in project che by eclipse.
the class RenamePresenterTest method renamePackageWizardShouldBeShow.
@Test
public void renamePackageWizardShouldBeShow() throws Exception {
when(session.getWizardType()).thenReturn(RenameRefactoringSession.RenameWizard.PACKAGE);
RefactorInfo refactorInfo = RefactorInfo.of(MoveType.REFACTOR_MENU, RefactoredItemType.COMPILATION_UNIT, new Resource[] { file });
renamePresenter.show(refactorInfo);
verifyPreparingRenameRefactoringDto();
verify(refactorService).createRenameRefactoring(createRenameRefactoringDto);
verify(renameRefactoringSessionPromise).then(renameRefactoringSessionCaptor.capture());
renameRefactoringSessionCaptor.getValue().apply(session);
verifyPreparingWizard();
verify(locale).renamePackageTitle();
verify(view).setTitle(anyString());
verify(view).setVisiblePatternsPanel(true);
verify(view).setVisibleFullQualifiedNamePanel(true);
verify(view).setVisibleRenameSubpackagesPanel(true);
verify(view).show();
}
use of org.eclipse.che.ide.ext.java.client.refactoring.RefactorInfo in project che by eclipse.
the class RenamePresenterTest method renameEnumConstantWizardShouldBeShow.
@Test
public void renameEnumConstantWizardShouldBeShow() throws Exception {
when(session.getWizardType()).thenReturn(RenameRefactoringSession.RenameWizard.ENUM_CONSTANT);
RefactorInfo refactorInfo = RefactorInfo.of(MoveType.REFACTOR_MENU, RefactoredItemType.COMPILATION_UNIT, new Resource[] { file });
renamePresenter.show(refactorInfo);
verifyPreparingRenameRefactoringDto();
verify(refactorService).createRenameRefactoring(createRenameRefactoringDto);
verify(renameRefactoringSessionPromise).then(renameRefactoringSessionCaptor.capture());
renameRefactoringSessionCaptor.getValue().apply(session);
verifyPreparingWizard();
verify(locale).renameEnumTitle();
verify(view).setTitle(anyString());
verify(view).setVisiblePatternsPanel(true);
verify(view).show();
}
Aggregations