[Exmmt-commit] SF.net SVN: exmmt: [78] net.sourceforge.exmmt.test/trunk/src/net/sourceforge/exmmt/b
Status: Inactive
Brought to you by:
lgrammel
|
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. |