Thread: [Exmmt-commit] SF.net SVN: exmmt: [70] net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/b
Status: Inactive
Brought to you by:
lgrammel
|
From: <lgr...@us...> - 2006-06-05 23:35:59
|
Revision: 70 Author: lgrammel Date: 2006-06-05 04:04:00 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/exmmt/?rev=70&view=rev Log Message: ----------- #1500774 scenario "shopping list" Modified Paths: -------------- net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/TreeBuilderTest.java net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/navigation/FocusTest.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 10:36:03 UTC (rev 69) +++ net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/TreeBuilderTest.java 2006-06-05 11:04:00 UTC (rev 70) @@ -27,7 +27,7 @@ Element element = new Element("entry"); - Composite composite = builder.build(element); + Controller composite = builder.build(element); assertEquals(element, composite.getModel()); assertNotNull(composite.getChildren()); @@ -45,21 +45,21 @@ element.setAttribute(nameOfAttribute1, "testItem"); element.setAttribute(nameOfAttribute2, "2"); - Composite composite = builder.build(element); + Controller composite = builder.build(element); assertEquals(element, composite.getModel()); assertNotNull(composite.getChildren()); assertEquals(2, composite.getChildren().size()); assertNull(composite.getParent()); - Composite childComposite1 = composite.getChildren().get(0); + Controller childComposite1 = composite.getChildren().get(0); assertEquals(element.getAttribute(nameOfAttribute1), childComposite1.getModel()); assertNotNull(childComposite1.getChildren()); assertEquals(0, childComposite1.getChildren().size()); assertEquals(composite, childComposite1.getParent()); - Composite childComposite2 = composite.getChildren().get(1); + Controller childComposite2 = composite.getChildren().get(1); assertEquals(element.getAttribute(nameOfAttribute2), childComposite2.getModel()); assertNotNull(childComposite2.getChildren()); @@ -74,14 +74,14 @@ Element entryElement = new Element("entry"); listElement.addContent(entryElement); - Composite composite = builder.build(listElement); + Controller composite = builder.build(listElement); assertEquals(listElement, composite.getModel()); assertNotNull(composite.getChildren()); assertEquals(1, composite.getChildren().size()); assertNull(composite.getParent()); - Composite childComposite = composite.getChildren().get(0); + Controller childComposite = composite.getChildren().get(0); assertEquals(entryElement, childComposite.getModel()); assertNotNull(childComposite.getChildren()); Modified: net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/navigation/FocusTest.java =================================================================== --- net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/navigation/FocusTest.java 2006-06-05 10:36:03 UTC (rev 69) +++ net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/navigation/FocusTest.java 2006-06-05 11:04:00 UTC (rev 70) @@ -14,7 +14,7 @@ import static org.junit.Assert.assertEquals; import junit.framework.JUnit4TestAdapter; -import net.sourceforge.exmmt.builder.Composite; +import net.sourceforge.exmmt.builder.Controller; import org.jdom.Element; import org.junit.Before; @@ -22,15 +22,15 @@ public class FocusTest { - private Composite composite; + private Controller composite; private Focus focus; - private Composite childComposite1; + private Controller childComposite1; - private Composite childComposite2; + private Controller childComposite2; - private Composite childComposite3; + private Controller childComposite3; @Test public void getInitialFocus() { @@ -118,12 +118,12 @@ @Before public void setUp() { - composite = new Composite(new Element("test")); - childComposite1 = new Composite(new Element("child1")); + composite = new Controller(new Element("test")); + childComposite1 = new Controller(new Element("child1")); composite.addChild(childComposite1); - childComposite2 = new Composite(new Element("child2")); + childComposite2 = new Controller(new Element("child2")); composite.addChild(childComposite2); - childComposite3 = new Composite(new Element("child3")); + childComposite3 = new Controller(new Element("child3")); composite.addChild(childComposite3); focus = new Focus(composite); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <lgr...@us...> - 2006-06-05 23:44:07
|
Revision: 78 Author: lgrammel Date: 2006-06-05 04:28:42 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/exmmt/?rev=78&view=rev Log Message: ----------- #1500774 scenario "shopping list" Modified Paths: -------------- net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/ControllerTreeBuilderTest.java Added Paths: ----------- net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/ControllerTest.java Added: net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/ControllerTest.java =================================================================== --- net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/ControllerTest.java (rev 0) +++ net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/ControllerTest.java 2006-06-05 11:28:42 UTC (rev 78) @@ -0,0 +1,38 @@ +/* $HeadURL$ + * ----------------------------------------------------------------------------- + * + * Copyright (C) Lars Grammel and others. + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Common Public License v1.0 which accompanies + * this distribution, and is available at + * + * http://www.eclipse.org/legal/cpl-v10.html + * + */ +package net.sourceforge.exmmt.builder; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import junit.framework.JUnit4TestAdapter; +import net.sourceforge.exmmt.renderer.NullRenderer; + +import org.jdom.Element; +import org.junit.Test; + +public class ControllerTest { + + @Test + public void getDefaultRenderer() { + Controller controller = new Controller(new Element("test")); + + assertNotNull(controller.getRenderer()); + assertTrue(controller.getRenderer() instanceof NullRenderer); + } + + // Junit 3.8.1 backward compability + public static junit.framework.Test suite() { + return new JUnit4TestAdapter(ControllerTest.class); + } + +} Property changes on: net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/ControllerTest.java ___________________________________________________________________ Name: svn:keywords + HeadURL Id LastChangedBy LastChangedDate LastChangedRevision Modified: net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/ControllerTreeBuilderTest.java =================================================================== --- net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/ControllerTreeBuilderTest.java 2006-06-05 11:14:35 UTC (rev 77) +++ net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/ControllerTreeBuilderTest.java 2006-06-05 11:28:42 UTC (rev 78) @@ -22,67 +22,72 @@ public class ControllerTreeBuilderTest { - @Test public void buildOneElement() { + @Test + public void buildOneElement() { ControllerTreeBuilder builder = new ControllerTreeBuilder(); Element element = new Element("entry"); - + Controller composite = builder.build(element); - + assertEquals(element, composite.getModel()); assertNotNull(composite.getChildren()); assertEquals(0, composite.getChildren().size()); assertNull(composite.getParent()); } - - @Test public void buildOneElementWithAttributes() { + + @Test + public void buildOneElementWithAttributes() { String nameOfAttribute1 = "item"; String nameOfAttribute2 = "count"; - + ControllerTreeBuilder builder = new ControllerTreeBuilder(); Element element = new Element("entry"); element.setAttribute(nameOfAttribute1, "testItem"); element.setAttribute(nameOfAttribute2, "2"); - + Controller composite = builder.build(element); - + assertEquals(element, composite.getModel()); assertNotNull(composite.getChildren()); assertEquals(2, composite.getChildren().size()); assertNull(composite.getParent()); - + Controller childComposite1 = composite.getChildren().get(0); - - assertEquals(element.getAttribute(nameOfAttribute1), childComposite1.getModel()); + + assertEquals(element.getAttribute(nameOfAttribute1), childComposite1 + .getModel()); assertNotNull(childComposite1.getChildren()); assertEquals(0, childComposite1.getChildren().size()); assertEquals(composite, childComposite1.getParent()); Controller childComposite2 = composite.getChildren().get(1); - - assertEquals(element.getAttribute(nameOfAttribute2), childComposite2.getModel()); + + assertEquals(element.getAttribute(nameOfAttribute2), childComposite2 + .getModel()); assertNotNull(childComposite2.getChildren()); assertEquals(0, childComposite2.getChildren().size()); assertEquals(composite, childComposite2.getParent()); } - - @Test public void buildElementWithChildElement() { + + @Test + public void buildElementWithChildElement() { ControllerTreeBuilder builder = new ControllerTreeBuilder(); Element listElement = new Element("list"); Element entryElement = new Element("entry"); listElement.addContent(entryElement); - + Controller composite = builder.build(listElement); - + assertEquals(listElement, composite.getModel()); assertNotNull(composite.getChildren()); assertEquals(1, composite.getChildren().size()); assertNull(composite.getParent()); - + Controller childComposite = composite.getChildren().get(0); - + assertEquals(entryElement, childComposite.getModel()); assertNotNull(childComposite.getChildren()); assertEquals(0, childComposite.getChildren().size()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <lgr...@us...> - 2006-06-05 23:44:12
|
Revision: 72 Author: lgrammel Date: 2006-06-05 04:06:10 -0700 (Mon, 05 Jun 2006) ViewCVS: http://svn.sourceforge.net/exmmt/?rev=72&view=rev Log Message: ----------- #1500774 scenario "shopping list" Added Paths: ----------- net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/ControllerTreeBuilderTest.java Removed Paths: ------------- net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/TreeBuilderTest.java Copied: net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/ControllerTreeBuilderTest.java (from rev 70, net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/TreeBuilderTest.java) =================================================================== --- net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/ControllerTreeBuilderTest.java (rev 0) +++ net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/ControllerTreeBuilderTest.java 2006-06-05 11:06:10 UTC (rev 72) @@ -0,0 +1,97 @@ +/* $HeadURL$ + * ----------------------------------------------------------------------------- + * + * Copyright (C) Lars Grammel and others. + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Common Public License v1.0 which accompanies + * this distribution, and is available at + * + * http://www.eclipse.org/legal/cpl-v10.html + * + */ +package net.sourceforge.exmmt.builder; + +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; +import org.junit.Test; + +public class ControllerTreeBuilderTest { + + @Test public void buildOneElement() { + ControllerTreeBuilder builder = new ControllerTreeBuilder(); + + Element element = new Element("entry"); + + Controller composite = builder.build(element); + + assertEquals(element, composite.getModel()); + assertNotNull(composite.getChildren()); + assertEquals(0, composite.getChildren().size()); + assertNull(composite.getParent()); + } + + @Test public void buildOneElementWithAttributes() { + String nameOfAttribute1 = "item"; + String nameOfAttribute2 = "count"; + + ControllerTreeBuilder builder = new ControllerTreeBuilder(); + + Element element = new Element("entry"); + element.setAttribute(nameOfAttribute1, "testItem"); + element.setAttribute(nameOfAttribute2, "2"); + + Controller composite = builder.build(element); + + assertEquals(element, composite.getModel()); + assertNotNull(composite.getChildren()); + assertEquals(2, composite.getChildren().size()); + assertNull(composite.getParent()); + + Controller childComposite1 = composite.getChildren().get(0); + + assertEquals(element.getAttribute(nameOfAttribute1), childComposite1.getModel()); + assertNotNull(childComposite1.getChildren()); + assertEquals(0, childComposite1.getChildren().size()); + assertEquals(composite, childComposite1.getParent()); + + Controller 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() { + ControllerTreeBuilder builder = new ControllerTreeBuilder(); + + Element listElement = new Element("list"); + Element entryElement = new Element("entry"); + listElement.addContent(entryElement); + + Controller composite = builder.build(listElement); + + assertEquals(listElement, composite.getModel()); + assertNotNull(composite.getChildren()); + assertEquals(1, composite.getChildren().size()); + assertNull(composite.getParent()); + + Controller 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 + public static junit.framework.Test suite() { + return new JUnit4TestAdapter(ControllerTreeBuilderTest.class); + } + +} Deleted: 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 11:04:09 UTC (rev 71) +++ net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/builder/TreeBuilderTest.java 2006-06-05 11:06:10 UTC (rev 72) @@ -1,97 +0,0 @@ -/* $HeadURL$ - * ----------------------------------------------------------------------------- - * - * Copyright (C) Lars Grammel and others. - * - * All rights reserved. This program and the accompanying materials are made - * available under the terms of the Common Public License v1.0 which accompanies - * this distribution, and is available at - * - * http://www.eclipse.org/legal/cpl-v10.html - * - */ -package net.sourceforge.exmmt.builder; - -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; -import org.junit.Test; - -public class TreeBuilderTest { - - @Test public void buildOneElement() { - TreeBuilder builder = new TreeBuilder(); - - Element element = new Element("entry"); - - Controller composite = builder.build(element); - - assertEquals(element, composite.getModel()); - assertNotNull(composite.getChildren()); - assertEquals(0, composite.getChildren().size()); - assertNull(composite.getParent()); - } - - @Test public void buildOneElementWithAttributes() { - String nameOfAttribute1 = "item"; - String nameOfAttribute2 = "count"; - - TreeBuilder builder = new TreeBuilder(); - - Element element = new Element("entry"); - element.setAttribute(nameOfAttribute1, "testItem"); - element.setAttribute(nameOfAttribute2, "2"); - - Controller composite = builder.build(element); - - assertEquals(element, composite.getModel()); - assertNotNull(composite.getChildren()); - assertEquals(2, composite.getChildren().size()); - assertNull(composite.getParent()); - - Controller childComposite1 = composite.getChildren().get(0); - - assertEquals(element.getAttribute(nameOfAttribute1), childComposite1.getModel()); - assertNotNull(childComposite1.getChildren()); - assertEquals(0, childComposite1.getChildren().size()); - assertEquals(composite, childComposite1.getParent()); - - Controller 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() { - TreeBuilder builder = new TreeBuilder(); - - Element listElement = new Element("list"); - Element entryElement = new Element("entry"); - listElement.addContent(entryElement); - - Controller composite = builder.build(listElement); - - assertEquals(listElement, composite.getModel()); - assertNotNull(composite.getChildren()); - assertEquals(1, composite.getChildren().size()); - assertNull(composite.getParent()); - - Controller 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 - 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. |