Author: scabanovich
Date: 2010-10-15 11:57:55 -0400 (Fri, 15 Oct 2010)
New Revision: 25874
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java
Log:
JBIDE-7348
https://jira.jboss.org/browse/JBIDE-7348
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2010-10-15
15:56:08 UTC (rev 25873)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2010-10-15
15:57:55 UTC (rev 25874)
@@ -366,12 +366,21 @@
}
try{
+ boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
+ JobUtils.waitForIdle();
classFile.delete(true, new NullProgressMonitor());
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ JobUtils.waitForIdle();
+ project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new
NullProgressMonitor());
+ JobUtils.waitForIdle();
+ ResourcesUtils.setBuildAutomatically(saveAutoBuild);
+ JobUtils.waitForIdle();
}catch(Exception ex){
JUnitUtils.fail("Cannot delete file JavaSource/demo/Person.java", ex);
}
- refreshProject(project);
+// refreshProject(project);
+
navigator.getCommonViewer().refresh(true);
navigator.getCommonViewer().expandAll();
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java 2010-10-15
15:56:08 UTC (rev 25873)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java 2010-10-15
15:57:55 UTC (rev 25874)
@@ -18,6 +18,7 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.ui.wizard.OpenSeamComponentDialog;
import org.jboss.tools.seam.ui.wizard.OpenSeamComponentDialog.SeamComponentWrapper;
import org.jboss.tools.test.util.JobUtils;
@@ -67,7 +68,7 @@
}
public void testOpenSeamComponentDialogSearch() {
- find("m", "mockSecureEntity", true);
+ find("mock", "mockSecureEntity", true);
find("o", "org.jboss.seam.captcha.captcha", false);
find("p", "org.jboss.seam.core.pageContext", false);
}
@@ -98,13 +99,22 @@
assertTrue("Component "+componentName+" not found", objects.length
!= 0);
- SeamComponentWrapper wrapper = (SeamComponentWrapper)objects[0];
- assertNotNull(wrapper.getComponent());
+ ISeamComponent component = findComponent(objects, componentName);
- assertEquals("Component "+componentName+" not found with " +
pattern, componentName, wrapper.getComponentName());
+ assertNotNull("Component "+componentName+" not found with " +
pattern, component);
} finally {
dialog.okPressed();
}
}
+ private ISeamComponent findComponent(Object[] objects, String componentName) {
+ for (Object o: objects) {
+ SeamComponentWrapper wrapper = (SeamComponentWrapper)o;
+ assertNotNull(wrapper.getComponent());
+ if(componentName.equals(wrapper.getComponentName())) {
+ return wrapper.getComponent();
+ }
+ }
+ return null;
+ }
}