1.
|
In the Package Explorer view, select the MyTestCase.java
file and drag it into the junit.framework
package. The file is moved, and its package declaration changes to reflect
the new location.
![]() |
2.
|
Select the MyTestCase.java
file and drag it into the root directory of the JUnit project. A default
package is created to contain the class, and the package declaration is
removed to reflect its new location.
![]() |
3.
|
Using the context menu is an alternative to drag and
drop:
Select the MyTestCase.java file and from its context menu, select Refactor > Move. In the Move dialog, expand the hierarchy to browse the possible new locations for the resource. Select the junit.framework package, then click OK. The class is moved, and its package declaration is updated to the new location. ![]() Note: This example did not result in compile errors.
However, moving a compilation unit can lead to compile errors because import
statements are not updated when a compilation unit is moved.
|