Author: scabanovich
Date: 2008-04-17 11:40:23 -0400 (Thu, 17 Apr 2008)
New Revision: 7580
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
Log:
JBIDE-2080
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2008-04-17
14:56:46 UTC (rev 7579)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2008-04-17
15:40:23 UTC (rev 7580)
@@ -34,6 +34,7 @@
import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamProperty;
+import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.ISeamXmlFactory;
import org.jboss.tools.seam.core.ScopeType;
@@ -493,6 +494,25 @@
assertNotNull("Component installWithoutPrecedence_JBIDE_2052 declared in class
annotated with @Install(false) is not found.", c);
}
+
+ public void testLocation_JBIDE_2080() {
+ String EJB = "org.jboss.seam.core.ejb";
+ ISeamProject seamProject = getSeamProject();
+ ISeamComponent c = seamProject.getComponent(EJB);
+ assertNotNull("Component " + EJB + " is not found.", c);
+ Set<ISeamComponentDeclaration> ds = c.getAllDeclarations();
+ ISeamXmlComponentDeclaration xml = null;
+ for (ISeamComponentDeclaration d: ds) {
+ if(d instanceof ISeamXmlComponentDeclaration) {
+ xml = (ISeamXmlComponentDeclaration)d;
+ break;
+ }
+ }
+ assertNotNull("XML declaration for component " + EJB + " is not found in
components.xml.", xml);
+ ISeamTextSourceReference location =
xml.getLocationFor(ISeamXmlComponentDeclaration.NAME);
+ assertNotNull("Location of declaration of component " + EJB + " in
components.xml is not found.", location);
+ assertTrue("Location should not point to 0", location.getStartPosition() >
0 && location.getLength() > 0);
+ }
@Override
protected void tearDown() throws Exception {