use of org.eclipse.che.ide.ext.java.shared.dto.refactoring.ReorgDestination in project che by eclipse.
the class MoveRefactoringSessionTest method testGetMoveChanges.
@Test
public void testGetMoveChanges() throws Exception {
IType type = fProject.findType("p.A");
ICompilationUnit unit = type.getCompilationUnit();
String sessionId = manager.createMoveRefactoringSession(new IJavaElement[] { unit });
ReorgDestination destination = new DtoServerImpls.ReorgDestinationImpl();
destination.setSessionId(sessionId);
destination.setProjectPath(RefactoringTestSetup.getProject().getPath().toOSString());
destination.setDestination(p1.getPath().toOSString());
destination.setType(ReorgDestination.DestinationType.PACKAGE);
manager.setRefactoringDestination(destination);
MoveSettings settings = new DtoServerImpls.MoveSettingsImpl();
settings.setUpdateReferences(true);
settings.setSessionId(sessionId);
manager.setMoveSettings(settings);
manager.createChange(sessionId);
RefactoringPreview change = manager.getRefactoringPreview(sessionId);
assertThat(change).isNotNull();
assertThat(change.getText()).isEqualTo("Move");
assertThat(change.getChildrens()).isNotNull().hasSize(2);
}
Aggregations