1 package com.wikihouse.wildcats0201.jdbcchart.dom4j;
2
3 import junit.framework.TestCase;
4
5 import com.wikihouse.wildcats0201.jdbcchart.dto.ChartFile;
6 import com.wikihouse.wildcats0201.jdbcchart.dto.ChartXMLDTO;
7 import com.wikihouse.wildcats0201.jdbcchart.dto.Item;
8 import com.wikihouse.wildcats0201.jdbcchart.dto.Label;
9
10 /***
11 * <B>XMLParseImplTest </B>.
12 *
13 * @author $Author: wildcats $
14 * @version $Revision: 2 $
15 */
16 public class XMLParseImplTest extends TestCase {
17
18
19
20
21
22 public void testRead() {
23 XMLParser parseImpl = XMLParserFactory.create();
24 ChartXMLDTO dto = parseImpl.read("./src/conf/Chart.xml");
25 ChartFile file = dto.getFile();
26 assertEquals("image", file.getPath());
27 assertEquals("xy", file.getName());
28 assertEquals(
29 "SELECT x_value, y1_value, y2_value, y3_value FROM jdbc_chart",
30 dto.getSQL().getText());
31 Item[] items = dto.getSeries();
32 assertEquals("one", items[0].getName());
33 assertEquals("two", items[1].getName());
34 assertEquals("three", items[2].getName());
35 Label label = dto.getLabel();
36 assertEquals("SampleReadByJDBC - XYDataset -", label.getTitle());
37 assertEquals("domain", label.getXLabel());
38 assertEquals("range", label.getYLabel());
39 }
40
41 }