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 JTableHeaderLocationTest extends TestCase {
09:
10: public void testParsePoint() {
11: JTableHeaderLocation loc = new JTableHeaderLocation();
12: String parse = "(1,1)";
13: assertEquals("Badly parsed: " + parse,
14: new JTableHeaderLocation(new Point(1, 1)), loc
15: .parse(parse));
16: }
17:
18: public void testParseColumn() {
19: JTableHeaderLocation loc = new JTableHeaderLocation();
20: String parse = "[1]";
21: assertEquals("Badly parsed: " + parse,
22: new JTableHeaderLocation(1), loc.parse(parse));
23: parse = " [ 10 ] ";
24: assertEquals("Badly parsed: " + parse,
25: new JTableHeaderLocation(10), loc.parse(parse));
26: }
27:
28: public void testParseValue() {
29: JTableHeaderLocation loc = new JTableHeaderLocation();
30: String parse = "\"some name\"";
31: assertEquals("Badly parsed: " + parse,
32: new JTableHeaderLocation(parse.substring(1, parse
33: .length() - 1)), loc.parse(parse));
34: }
35:
36: public JTableHeaderLocationTest(String name) {
37: super (name);
38: }
39:
40: public static void main(String[] args) {
41: TestHelper.runTests(args, JTableHeaderLocationTest.class);
42: }
43: }
|