01: package org.uispec4j;
02:
03: import org.uispec4j.utils.UIComponentFactory;
04: import org.uispec4j.xml.XmlAssert;
05:
06: import javax.swing.*;
07:
08: public class TreeComponentTest extends UIComponentTestCase {
09: public void testGetComponentTypeName() throws Exception {
10: assertEquals("tree", UIComponentFactory.createUIComponent(
11: new JTree()).getDescriptionTypeName());
12: }
13:
14: public void testGetDescription() throws Exception {
15: JTree jTree = new JTree();
16: jTree.setName("myTree");
17: Tree tree = new Tree(jTree);
18: XmlAssert.assertEquivalent("<tree name='myTree'/>", tree
19: .getDescription());
20: }
21:
22: public void testFactory() throws Exception {
23: checkFactory(new JButton(), Button.class);
24: }
25:
26: protected UIComponent createComponent() {
27: return new Tree(new JTree());
28: }
29:
30: }
|