01: package abbot.tester;
02:
03: import java.awt.Point;
04:
05: import junit.extensions.abbot.TestHelper;
06: import junit.framework.TestCase;
07:
08: public class JTabbedPaneLocationTest extends TestCase {
09:
10: public void testParsePoint() {
11: JTabbedPaneLocation loc = new JTabbedPaneLocation();
12: String parse = "(1,1)";
13: assertEquals("Badly parsed: " + parse, new JTabbedPaneLocation(
14: new Point(1, 1)), loc.parse(parse));
15: }
16:
17: public void testParseIndex() {
18: JTabbedPaneLocation loc = new JTabbedPaneLocation();
19: String parse = "[1]";
20: assertEquals("Badly parsed: " + parse, new JTabbedPaneLocation(
21: 1), loc.parse(parse));
22: parse = " [ 10 ] ";
23: assertEquals("Badly parsed: " + parse, new JTabbedPaneLocation(
24: 10), loc.parse(parse));
25: }
26:
27: public void testParseTabName() {
28: JTabbedPaneLocation loc = new JTabbedPaneLocation();
29: String expected = "tab name";
30: String parse = "\"" + expected + "\"";
31: assertEquals("Badly parsed: " + parse, new JTabbedPaneLocation(
32: expected), loc.parse(parse));
33: }
34:
35: public JTabbedPaneLocationTest(String name) {
36: super (name);
37: }
38:
39: public static void main(String[] args) {
40: TestHelper.runTests(args, JTabbedPaneLocationTest.class);
41: }
42: }
|