01: package abbot.script.parsers;
02:
03: import javax.swing.tree.TreePath;
04:
05: import junit.extensions.abbot.TestHelper;
06: import junit.framework.TestCase;
07:
08: public class TreePathParserTest extends TestCase {
09:
10: private TreePathParser parser;
11:
12: public void testConvertSingleNode() {
13: String arg = "[root]";
14: TreePath path = (TreePath) parser.parse(arg);
15: assertEquals("Wrong path generated", arg, path.toString());
16: }
17:
18: public void testConvertMultipleNodes() {
19: String arg = "[root, parent, child]";
20: TreePath path = (TreePath) parser.parse(arg);
21: assertEquals("Wrong path generated", arg, path.toString());
22: }
23:
24: public void testHiddenRoot() {
25: String arg = "[null, parent, child]";
26: TreePath path = (TreePath) parser.parse(arg);
27: assertEquals("Wrong path generated", arg, path.toString());
28: }
29:
30: protected void setUp() {
31: parser = new TreePathParser();
32: }
33:
34: public TreePathParserTest(String name) {
35: super (name);
36: }
37:
38: public static void main(String[] args) {
39: TestHelper.runTests(args, TreePathParserTest.class);
40: }
41: }
|