Author: scabanovich
Date: 2009-06-10 06:51:37 -0400 (Wed, 10 Jun 2009)
New Revision: 15847
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/WebContent/WEB-INF/components.xml
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4393 More tests added
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/WebContent/WEB-INF/components.xml
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/WebContent/WEB-INF/components.xml 2009-06-10
10:50:22 UTC (rev 15846)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/WebContent/WEB-INF/components.xml 2009-06-10
10:51:37 UTC (rev 15847)
@@ -35,5 +35,9 @@
<component class="java.lang.Boolean" name="duplicated"/>
<component class="java.lang.Boolean" name="duplicated"/>
+
+ <component class="demo.CustomAnnotation"
name="compWithPrecedence10" precedence="10"/>
+ <component class="demo.CustomAnnotation"
name="compWithDefaultPrecedence"/>
+ <component class="demo.CustomAnnotation"
name="compWithPrecedence20" precedence="20"/>
</components>
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 2009-06-10
10:50:22 UTC (rev 15846)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2009-06-10
10:51:37 UTC (rev 15847)
@@ -180,6 +180,17 @@
if("duplicated".equals(cs[i].getName())) duplicatedCount++;
}
assertEquals("There are 2 declarations of component \"duplicated\" in
xml.", 2, duplicatedCount);
+
+ //5. components.xml has components with different precedence.
+ ISeamComponentDeclaration c10 = findDeclaration(cs, "compWithPrecedence10");
+ assertNotNull(c10);
+ assertEquals("10", ((ISeamXmlComponentDeclaration)c10).getPrecedence());
+ ISeamComponentDeclaration cDefault = findDeclaration(cs,
"compWithDefaultPrecedence");
+ assertNotNull(cDefault);
+ assertEquals("20",
((ISeamXmlComponentDeclaration)cDefault).getPrecedence());
+ ISeamComponentDeclaration c20 = findDeclaration(cs, "compWithPrecedence20");
+ assertNotNull(c20);
+ assertEquals("20", ((ISeamXmlComponentDeclaration)c20).getPrecedence());
}
private ISeamComponentDeclaration findDeclaration(ISeamComponentDeclaration[]
declarations, String name) {