[weld-commits] Weld SVN: r5638 - in core/trunk: tests/src/test/java/org/jboss/weld/tests/unit/bootstrap/xml and 1 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Wed Jan 27 08:19:33 EST 2010


Author: pete.muir at jboss.org
Date: 2010-01-27 08:19:32 -0500 (Wed, 27 Jan 2010)
New Revision: 5638

Added:
   core/trunk/tests/src/test/resources/org/jboss/weld/tests/unit/bootstrap/xml/nonPrettyPrinted.xml
Modified:
   core/trunk/impl/src/main/java/org/jboss/weld/util/dom/NodeListIterator.java
   core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/bootstrap/xml/BeansXmlTest.java
Log:
WELD-362

Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/dom/NodeListIterator.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/dom/NodeListIterator.java	2010-01-27 06:18:35 UTC (rev 5637)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/dom/NodeListIterator.java	2010-01-27 13:19:32 UTC (rev 5638)
@@ -38,13 +38,12 @@
 
    public boolean hasNext()
    {
-      return index < nodeList.getLength() - 1;
+      return index < nodeList.getLength();
    }
 
    public Node next()
    {
-      index++;
-      return nodeList.item(index);
+      return nodeList.item(index++);
    }
 
    public void remove()

Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/bootstrap/xml/BeansXmlTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/bootstrap/xml/BeansXmlTest.java	2010-01-27 06:18:35 UTC (rev 5637)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/bootstrap/xml/BeansXmlTest.java	2010-01-27 13:19:32 UTC (rev 5638)
@@ -162,6 +162,19 @@
    public void testCannotGetDocumentBuilder()
    {
    }
+   /*
+    * https://jira.jboss.org/jira/browse/WELD-362
+    */
+   @Test
+   public void testNonPrettyPrintedXML()
+   {
+      List<Class<?>> beans = Arrays.asList(Alt.class, Dec.class, Int.class, IntBind.class, Plain.class);
+      List<URL> beansXmls = Arrays.asList(getClass().getResource("nonPrettyPrinted.xml"));
+      TestContainer container = new TestContainer(new MockEELifecycle(), beans, beansXmls).startContainer().ensureRequestActive();
+      assert container.getBeanManager().getEnabledAlternativeClasses().size() == 1;
+      assert container.getBeanManager().getEnabledAlternativeClasses().iterator().next() == Alt.class;
+      container.stopContainer();
+   }
 
    @Test
    public void testCannotLoadFile() throws MalformedURLException

Added: core/trunk/tests/src/test/resources/org/jboss/weld/tests/unit/bootstrap/xml/nonPrettyPrinted.xml
===================================================================
--- core/trunk/tests/src/test/resources/org/jboss/weld/tests/unit/bootstrap/xml/nonPrettyPrinted.xml	                        (rev 0)
+++ core/trunk/tests/src/test/resources/org/jboss/weld/tests/unit/bootstrap/xml/nonPrettyPrinted.xml	2010-01-27 13:19:32 UTC (rev 5638)
@@ -0,0 +1 @@
+<beans><alternatives><class>org.jboss.weld.tests.unit.bootstrap.xml.Alt</class></alternatives></beans>
\ No newline at end of file



More information about the weld-commits mailing list