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