KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > cms > module > ModuleDefinitionTest


1 /**
2  *
3  * Magnolia and its source-code is licensed under the LGPL.
4  * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5  * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6  * you are required to provide proper attribution to obinary.
7  * If you reproduce or distribute the document without making any substantive modifications to its content,
8  * please use the following attribution line:
9  *
10  * Copyright 1993-2006 obinary Ltd. (http://www.obinary.com) All rights reserved.
11  *
12  */

13 package info.magnolia.cms.module;
14
15 import junit.framework.TestCase;
16
17 /**
18  * @author gjoseph
19  * @version $Revision: $ ($Author: $)
20  */

21 public class ModuleDefinitionTest extends TestCase {
22     private ModuleDefinition md;
23
24     protected void setUp() throws Exception JavaDoc {
25         super.setUp();
26         md = new ModuleDefinition();
27         PropertyDefinition p1 = new PropertyDefinition();
28         PropertyDefinition p2 = new PropertyDefinition();
29         PropertyDefinition p3 = new PropertyDefinition();
30         p1.setName("abc");
31         p1.setValue("123");
32         p2.setName("baby");
33         p2.setValue("you and me");
34         p3.setName("doremi");
35         p3.setValue("la la la");
36         md.addProperty(p1);
37         md.addProperty(p2);
38         md.addProperty(p3);
39     }
40
41     public void testGetPropertyJustWorks() {
42         assertEquals("you and me", md.getProperty("baby"));
43     }
44
45     public void testGetPropertyReturnsNullForUnknownProperties() {
46         assertEquals(null, md.getProperty("Blame it on the boogie"));
47     }
48
49 }
50
Popular Tags