Thread: [Exmmt-commit] SF.net SVN: exmmt: [36] net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/b
Status: Inactive
Brought to you by:
lgrammel
|
From: <lgr...@us...> - 2006-06-05 23:33:44
|
Revision: 36 Author: lgrammel Date: 2006-06-05 01:40:32 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/exmmt/?rev=36&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:40:25 UTC (rev 35) +++ net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/TreeBuilderTest.java 2006-06-05 08:40:32 UTC (rev 36) @@ -44,8 +44,33 @@ assertEquals(element, composite.getModel()); assertNotNull(composite.getChildren()); assertEquals(1, composite.getChildren().size()); + + Composite childComposite = composite.getChildren().get(0); + + assertEquals(element.getAttribute("item"), childComposite.getModel()); + assertNotNull(childComposite.getChildren()); + assertEquals(0, childComposite.getChildren().size()); } + + @Test public void buildElementWithChildElement() { + TreeBuilder builder = new TreeBuilder(); + Element listElement = new Element("list"); + Element entryElement = new Element("entry"); + listElement.addContent(entryElement); + + Composite composite = builder.build(listElement); + + assertEquals(listElement, composite.getModel()); + assertNotNull(composite.getChildren()); + assertEquals(1, composite.getChildren().size()); + + Composite childComposite = composite.getChildren().get(0); + assertEquals(entryElement, childComposite.getModel()); + assertNotNull(childComposite.getChildren()); + assertEquals(0, childComposite.getChildren().size()); + } + // Junit 3.8.1 backward compability public static junit.framework.Test suite() { return new JUnit4TestAdapter(TreeBuilderTest.class); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <lgr...@us...> - 2006-06-06 00:53:53
|
Revision: 34 Author: lgrammel Date: 2006-06-05 01:34:49 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/exmmt/?rev=34&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:34:40 UTC (rev 33) +++ net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/TreeBuilderTest.java 2006-06-05 08:34:49 UTC (rev 34) @@ -13,6 +13,7 @@ package net.sourceforge.exmmt.builder; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import junit.framework.JUnit4TestAdapter; import org.jdom.Element; @@ -20,16 +21,31 @@ public class TreeBuilderTest { - @Test public void build() { + @Test public void buildOneElement() { + TreeBuilder builder = new TreeBuilder(); + Element element = new Element("entry"); + Composite composite = builder.build(element); + + assertEquals(element, composite.getModel()); + assertNotNull(composite.getChildren()); + assertEquals(0, composite.getChildren().size()); + } + + @Test public void buildOneElementWithAttribute() { TreeBuilder builder = new TreeBuilder(); + + Element element = new Element("entry"); + element.setAttribute("item", "testItem"); Composite composite = builder.build(element); assertEquals(element, composite.getModel()); + assertNotNull(composite.getChildren()); + assertEquals(1, composite.getChildren().size()); } - + // Junit 3.8.1 backward compability public static junit.framework.Test suite() { return new JUnit4TestAdapter(TreeBuilderTest.class); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <lgr...@us...> - 2006-06-06 00:54:56
|
Revision: 38 Author: lgrammel Date: 2006-06-05 01:46:44 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/exmmt/?rev=38&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:35 UTC (rev 37) +++ net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/TreeBuilderTest.java 2006-06-05 08:46:44 UTC (rev 38) @@ -14,6 +14,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import junit.framework.JUnit4TestAdapter; import org.jdom.Element; @@ -31,6 +32,7 @@ assertEquals(element, composite.getModel()); assertNotNull(composite.getChildren()); assertEquals(0, composite.getChildren().size()); + assertNull(composite.getParent()); } @Test public void buildOneElementWithAttribute() { @@ -44,12 +46,14 @@ assertEquals(element, composite.getModel()); assertNotNull(composite.getChildren()); assertEquals(1, composite.getChildren().size()); + assertNull(composite.getParent()); Composite childComposite = composite.getChildren().get(0); assertEquals(element.getAttribute("item"), childComposite.getModel()); assertNotNull(childComposite.getChildren()); assertEquals(0, childComposite.getChildren().size()); + assertEquals(composite, childComposite.getParent()); } @Test public void buildElementWithChildElement() { @@ -64,11 +68,14 @@ assertEquals(listElement, composite.getModel()); assertNotNull(composite.getChildren()); assertEquals(1, composite.getChildren().size()); + assertNull(composite.getParent()); Composite childComposite = composite.getChildren().get(0); + assertEquals(entryElement, childComposite.getModel()); assertNotNull(childComposite.getChildren()); assertEquals(0, childComposite.getChildren().size()); + assertEquals(composite, childComposite.getParent()); } // Junit 3.8.1 backward compability This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
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. |