Author: scabanovich
Date: 2009-06-09 10:15:27 -0400 (Tue, 09 Jun 2009)
New Revision: 15820
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 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-09
14:04:35 UTC (rev 15819)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/WebContent/WEB-INF/components.xml 2009-06-09
14:15:27 UTC (rev 15820)
@@ -33,4 +33,7 @@
<factory name="factory1" scope="conversation"/>
+ <component class="java.lang.Boolean" name="duplicated"/>
+ <component class="java.lang.Boolean" name="duplicated"/>
+
</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-09
14:04:35 UTC (rev 15819)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2009-06-09
14:15:27 UTC (rev 15820)
@@ -170,6 +170,16 @@
assertTrue("Declared factory 'factory1' is not found in
components.xml", factory != null);
ISeamXmlFactory af = (ISeamXmlFactory)factory;
assertTrue("Scope of 'factory1' must be 'conversation'",
af.getScope() == ScopeType.CONVERSATION);
+
+ //4. components.xml has duplicated entry
+ //<component class="java.lang.Boolean" name="duplicated"/>
+ // check that
+ // both declarations for "duplicated" are loaded
+ int duplicatedCount = 0;
+ for (int i = 0; i < cs.length; i++) {
+ if("duplicated".equals(cs[i].getName())) duplicatedCount++;
+ }
+ assertEquals("There are 2 declarations of component \"duplicated\" in
xml.", 2, duplicatedCount);
}
private ISeamComponentDeclaration findDeclaration(ISeamComponentDeclaration[]
declarations, String name) {