[Exmmt-commit] SF.net SVN: exmmt: [39] net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/b
Status: Inactive
Brought to you by:
lgrammel
|
From: <lgr...@us...> - 2006-06-06 01:27:31
|
Revision: 39 Author: lgrammel Date: 2006-06-05 01:48:30 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/exmmt/?rev=39&view=rev Log Message: ----------- #1500774 scenario "shopping list" Modified Paths: -------------- net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/TreeBuilderTest.java Modified: net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/TreeBuilderTest.java =================================================================== --- net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/TreeBuilderTest.java 2006-06-05 08:46:44 UTC (rev 38) +++ net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/TreeBuilderTest.java 2006-06-05 08:48:30 UTC (rev 39) @@ -35,25 +35,36 @@ assertNull(composite.getParent()); } - @Test public void buildOneElementWithAttribute() { + @Test public void buildOneElementWithAttributes() { + String nameOfAttribute1 = "item"; + String nameOfAttribute2 = "count"; + TreeBuilder builder = new TreeBuilder(); Element element = new Element("entry"); - element.setAttribute("item", "testItem"); + element.setAttribute(nameOfAttribute1, "testItem"); + element.setAttribute(nameOfAttribute2, "2"); Composite composite = builder.build(element); assertEquals(element, composite.getModel()); assertNotNull(composite.getChildren()); - assertEquals(1, composite.getChildren().size()); + assertEquals(2, composite.getChildren().size()); assertNull(composite.getParent()); - Composite childComposite = composite.getChildren().get(0); + Composite childComposite1 = composite.getChildren().get(0); - assertEquals(element.getAttribute("item"), childComposite.getModel()); - assertNotNull(childComposite.getChildren()); - assertEquals(0, childComposite.getChildren().size()); - assertEquals(composite, childComposite.getParent()); + assertEquals(element.getAttribute(nameOfAttribute1), childComposite1.getModel()); + assertNotNull(childComposite1.getChildren()); + assertEquals(0, childComposite1.getChildren().size()); + assertEquals(composite, childComposite1.getParent()); + + Composite childComposite2 = composite.getChildren().get(1); + + assertEquals(element.getAttribute(nameOfAttribute2), childComposite2.getModel()); + assertNotNull(childComposite2.getChildren()); + assertEquals(0, childComposite2.getChildren().size()); + assertEquals(composite, childComposite2.getParent()); } @Test public void buildElementWithChildElement() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |