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