Package org.eclipse.ltk.core.refactoring

Examples of org.eclipse.ltk.core.refactoring.Change.perform()


    fixture.addClassToProject("org.superbiz.ProductBean", fixture.getStreamContent(getClass().getResourceAsStream("Ejb21ProductBean.txt"))); //$NON-NLS-1$ //$NON-NLS-2$
    JDTFacade facade = new JDTFacade(fixture.getProject());
    facade.convertMethodToConstructor("org.superbiz.ProductBean", "ejbCreate", new String[] { "java.lang.Integer", "java.lang.String", "java.lang.String", "java.lang.String"}); //$NON-NLS-1$
   
    Change change = facade.getChange();
    change.perform(new NullProgressMonitor());

    assertEquals(fixture.getStreamContent(getClass().getResourceAsStream("Expected30ProductBean.txt")), fixture.getClassContents("org.superbiz.ProductBean")); //$NON-NLS-1$ //$NON-NLS-2$
  }
 
  public void testShouldChangeUsesOfEjbCreateToUseConstructor() throws Exception {
View Full Code Here


    JDTFacade facade = new JDTFacade(fixture.getProject());
    String[] signature = new String[] { "java.lang.Integer", "java.lang.String", "java.lang.String", "java.lang.String" };
    facade.changeInvocationsToConstructor("org.superbiz.ProductHome", "create", signature, "org.superbiz.ProductBean");

    Change change = facade.getChange();
    change.perform(new NullProgressMonitor());

    assertEquals(fixture.getStreamContent(getClass().getResourceAsStream("ExpectedSessionBean.txt")), fixture.getClassContents("org.superbiz.SessionBean")); //$NON-NLS-1$ //$NON-NLS-2$
  }
}
View Full Code Here

        assertTrue("Refactoring is not ok: " + result.getMessageMatchingSeverity(RefactoringStatus.WARNING),
                result.isOK());

        Change change = refactoring.createChange(monitor);
        change.perform(monitor);

        assertEquals(data.result, document.get());

        FileUtilsFileBuffer.IN_TESTS = false;
    }
View Full Code Here

        assertTrue("Refactoring is not ok: " + result.getMessageMatchingSeverity(RefactoringStatus.WARNING),
                result.isOK());

        Change change = refactoring.createChange(monitor);
        change.perform(monitor);

        assertContentsEqual(data.result, document.get());

        FileUtilsFileBuffer.IN_TESTS = false;
    }
View Full Code Here

        checkStatus(processor.checkInitialConditions(nullProgressMonitor), expectError);
        checkStatus(processor.checkFinalConditions(nullProgressMonitor, null), expectError);
        Change change = processor.createChange(nullProgressMonitor);
        if (!expectError) {
            //otherwise, if there is an error, the change may be null
            change.perform(nullProgressMonitor);
        }
    }

    protected void checkStatus(RefactoringStatus status, boolean expectError) {
        RefactoringStatusEntry err = status.getEntryMatchingSeverity(RefactoringStatus.ERROR);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.