Skip to content

Commit

Permalink
WELD-362
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuir committed Jan 27, 2010
1 parent ef08291 commit 880e115
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Expand Up @@ -38,13 +38,12 @@ public NodeListIterator(NodeList nodeList)

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()
Expand Down
Expand Up @@ -162,6 +162,19 @@ public void testBeansXmlDoesntExist()
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
Expand Down
@@ -0,0 +1 @@
<beans><alternatives><class>org.jboss.weld.tests.unit.bootstrap.xml.Alt</class></alternatives></beans>

0 comments on commit 880e115

Please sign in to comment.