Author: akazakov
Date: 2009-05-29 10:46:28 -0400 (Fri, 29 May 2009)
New Revision: 15603
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4351
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-05-29
14:20:29 UTC (rev 15602)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-05-29
14:46:28 UTC (rev 15603)
@@ -10,7 +10,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater;
-import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.TextFileChange;
import org.eclipse.text.edits.MultiTextEdit;
@@ -121,10 +120,11 @@
}
private void renameComponent(ISeamProject seamProject, String componentName, String
newName, List<TestChangeStructure> changeList) throws CoreException{
+ JobUtils.waitForIdle();
// Test before renaming
ISeamComponent component = seamProject.getComponent(componentName);
- assertNotNull(component);
- assertNull(seamProject.getComponent(newName));
+ assertNotNull("Can't load component " + componentName, component);
+ assertNull("There is unexisted component in seam project: " + newName,
seamProject.getComponent(newName));
for(TestChangeStructure changeStructure : changeList){
IFile file = changeStructure.getProject().getFile(changeStructure.getFileName());
String content = null;
@@ -140,28 +140,28 @@
RenameComponentProcessor processor = new RenameComponentProcessor(component);
processor.setNewComponentName(newName);
CompositeChange rootChange = (CompositeChange)processor.createChange(new
NullProgressMonitor());
-
+
for(int i = 0; i < rootChange.getChildren().length;i++){
TextFileChange fileChange = (TextFileChange)rootChange.getChildren()[i];
-
+
MultiTextEdit edit = (MultiTextEdit)fileChange.getEdit();
TestChangeStructure change = findChange(changeList, fileChange.getFile());
if(change != null){
- if(change.size() != edit.getChildrenSize()){
- System.out.println("File - "+fileChange.getFile().getName());
- System.out.println("Edit size - "+edit.getChildrenSize());
- }
+// if(change.size() != edit.getChildrenSize()){
+// System.out.println("File - "+fileChange.getFile().getName());
+// System.out.println("Edit size - "+edit.getChildrenSize());
+// }
assertEquals(change.size(), edit.getChildrenSize());
}
}
-
+
rootChange.perform(new NullProgressMonitor());
JobUtils.waitForIdle();
// Test results
- assertNull(seamProject.getComponent(componentName));
- assertNotNull(seamProject.getComponent(newName));
+ assertNull("There is unexisted component in seam project: " + componentName,
seamProject.getComponent(componentName));
+ assertNotNull("Can't load component " + newName,
seamProject.getComponent(newName));
for(TestChangeStructure changeStructure : changeList){
IFile file = changeStructure.getProject().getFile(changeStructure.getFileName());
String content = null;