Author: scabanovich
Date: 2010-10-18 03:55:52 -0400 (Mon, 18 Oct 2010)
New Revision: 25890
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.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-18
06:33:25 UTC (rev 25889)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2010-10-18
07:55:52 UTC (rev 25890)
@@ -13,6 +13,7 @@
import java.io.IOException;
import java.io.InputStream;
+import java.util.Collection;
import java.util.Iterator;
import junit.framework.TestCase;
@@ -42,6 +43,7 @@
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamPackage;
+import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.ui.ISeamUiConstants;
import org.jboss.tools.seam.ui.SeamPerspectiveFactory;
@@ -351,7 +353,11 @@
public void testDeleteComponentInClass(){
classFile = project.getFile("JavaSource/demo/Person.java");
+ ISeamProject sp = SeamCorePlugin.getSeamProject(project, true);
+ ISeamComponent component = sp.getComponent("beatles.Pall");
+ assertNotNull(component);
+
CommonNavigator navigator = getSeamComponentsView();
navigator.getCommonViewer().expandAll();
@@ -361,7 +367,7 @@
assertTrue("Package \"beatles\" not found!",seamPackage!=null);
if(seamPackage != null){
- ISeamComponent component = findSeamComponent(seamPackage, "beatles.Pall");
+ component = findSeamComponent(seamPackage, "beatles.Pall");
assertTrue("Component \"beatles.Pall\" not
found!",component!=null);
}
@@ -378,7 +384,16 @@
}catch(Exception ex){
JUnitUtils.fail("Cannot delete file JavaSource/demo/Person.java", ex);
}
+
+ component = sp.getComponent("beatles.Pall");
+ assertNull(component);
+ Collection<ISeamPackage> ps = sp.getPackages();
+ if(ps != null) for (ISeamPackage p: ps) {
+ System.out.println(p.getName());
+ assertFalse("beatles".equals(p.getName()));
+ }
+
// refreshProject(project);
navigator.getCommonViewer().refresh(true);