01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: TestParsedBlockData.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.template;
09:
10: import junit.framework.TestCase;
11:
12: public class TestParsedBlockData extends TestCase {
13: public TestParsedBlockData(String name) {
14: super (name);
15: }
16:
17: public void testInstantiation() {
18: ParsedBlockData block_data = new ParsedBlockData();
19:
20: assertEquals(block_data.countParts(), 0);
21: }
22:
23: public void testParts() {
24: ParsedBlockData block_data = new ParsedBlockData();
25: ParsedBlockPart block_part1 = new ParsedBlockText("text");
26: ParsedBlockPart block_part2 = new ParsedBlockText("text");
27: ParsedBlockPart block_part3 = new ParsedBlockText("text");
28:
29: block_data.addPart(block_part1);
30: block_data.addPart(block_part2);
31: block_data.addPart(block_part3);
32:
33: assertEquals(block_data.countParts(), 3);
34: assertSame(block_data.getPart(0), block_part1);
35: assertSame(block_data.getPart(1), block_part2);
36: assertSame(block_data.getPart(2), block_part3);
37: }
38: }
|