Author: scabanovich
Date: 2008-02-12 10:31:13 -0500 (Tue, 12 Feb 2008)
New Revision: 6264
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/.settings/org.jboss.tools.seam.core.prefs
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java
Log:
JBIDE-1758
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF 2008-02-12
15:27:41 UTC (rev 6263)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF 2008-02-12
15:31:13 UTC (rev 6264)
@@ -24,5 +24,11 @@
org.eclipse.jface,
org.jboss.tools.jst.firstrun,
org.eclipse.wst.server.core,
- org.eclipse.datatools.connectivity
+ org.eclipse.datatools.connectivity,
+ org.eclipse.ltk.core.refactoring,
+ org.eclipse.ltk.ui.refactoring,
+ org.eclipse.jdt.core,
+ org.eclipse.jdt.ui,
+ org.eclipse.ui.ide,
+ org.eclipse.jface
Provide-Package: org.jboss.tools.seam.core.test
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/.settings/org.jboss.tools.seam.core.prefs
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/.settings/org.jboss.tools.seam.core.prefs
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/.settings/org.jboss.tools.seam.core.prefs 2008-02-12
15:31:13 UTC (rev 6264)
@@ -0,0 +1,3 @@
+#Tue Feb 12 16:24:00 MSK 2008
+eclipse.preferences.version=1
+seam.parent.project=Test1
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java 2008-02-12
15:27:41 UTC (rev 6263)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java 2008-02-12
15:31:13 UTC (rev 6264)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.seam.core.test;
+import java.lang.reflect.InvocationTargetException;
+
import junit.framework.TestCase;
import org.eclipse.core.resources.IProject;
@@ -17,11 +19,16 @@
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.ui.refactoring.RenameSupport;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.WorkbenchUtils;
import org.jboss.tools.test.util.xpl.EditorTestHelper;
/**
@@ -33,7 +40,7 @@
IProject projectWAR = null;
IProject projectEJB = null;
- boolean makeCopy = false;
+ boolean makeCopy = true;
public SeamEARTest() {}
@@ -80,4 +87,27 @@
assertNotNull("War project must see component 'authenticator' declared in
ejb project", c);
}
+
+ public void testRenameProject() throws CoreException {
+ getSeamProject(projectWAR);
+ ISeamProject seamProjectEJB = getSeamProject(projectEJB);
+
+ String parentName = seamProjectEJB.getParentProjectName();
+
+ RenameSupport support = RenameSupport.create(JavaCore.create(projectWAR),
"newName", RenameSupport.UPDATE_REFERENCES);
+
+ Shell parent = WorkbenchUtils.getActiveShell();
+ IWorkbenchWindow context = WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow();
+ try {
+ support.perform(parent, context);
+ } catch (InterruptedException e) {
+ JUnitUtils.fail("Rename failed", e);
+ } catch (InvocationTargetException e) {
+ JUnitUtils.fail("Rename failed", e);
+ }
+ String newParentName = seamProjectEJB.getParentProjectName();
+ System.out.println(parentName);
+ System.out.println(newParentName);
+ assertTrue("", "newName".equals(newParentName));
+ }
}
\ No newline at end of file
Show replies by date