Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [imp-dev] Writing a function to call move method refactoring

Hi there,

Generally, refactorings are implemented in two layers: the lower "engine" layer, and the upper UI layer. The lower layer is typically what gets tested by the regression suite.

This is the approach taken by the JDT, for example. See the plugin org.eclipse.jdt.ui.refactoring.tests (on eclipse.org CVS). Yes, that plugin has "ui" in the name, but that's because it does actually spin up a runtime workbench. All the same, the refactoring tests all have the same basic flow: (1) populate workspace with resources, i.e. projects and source files, (2) instantiate an instance of the Refactoring-derived class and set any parameters, (3) apply the refactoring, and (4) check results. The dialogs/wizards/etc are not involved in the tests.

For your second question, passing around an IJavaProject from the JUnit test method to the various workspace-manipulating helper methods is entirely reasonable.

Hope that helps!

On Feb 20, 2010, at 10:55 PM, lehmia kiran wrote:
Hi all

I am using org.eclipse.core.refactoring jar for refactoring purpose, but i want to write my own function in which i can call and test the functionality of "move method" refactoring. I am not getting how can i do it;because the move functionality is initiated by refactoring menu given in eclipse IDE.
And one more thing that i am thinking to pass the project as parameter to above function so that refactoring can be applied on that project.The first issue is how can i pass the whole project as parameter and second - is to pass the whole project as parameter right approach??


Hoping for the quick response.Thanks all

--
Cheers,
  - Bob
-------------------------------------------------
Robert M. Fuhrer
Research Staff Member
Programming Technologies Dept.
IBM T.J. Watson Research Center

IMP Project Lead (http://www.eclipse.org/imp)
X10: Productivity for High-Performance Parallel Programming (http://x10-lang.org)


Back to the top