diff options
author | ehilsdal <ehilsdal> | 2003-08-28 15:11:12 +0000 |
---|---|---|
committer | ehilsdal <ehilsdal> | 2003-08-28 15:11:12 +0000 |
commit | f3929cad6a0e6d6973483dd23c7aea68b6e7fed1 (patch) | |
tree | 7caf9b0ac3e5a52c0341dfc8b9061be49287b599 /docs/teaching/exercises/tests/Test2c.java | |
parent | f1a7345a62bd1f227dd64fcd7c2d519c8911ae5c (diff) | |
download | aspectj-f3929cad6a0e6d6973483dd23c7aea68b6e7fed1.tar.gz aspectj-f3929cad6a0e6d6973483dd23c7aea68b6e7fed1.zip |
updated section 2
Diffstat (limited to 'docs/teaching/exercises/tests/Test2c.java')
-rw-r--r-- | docs/teaching/exercises/tests/Test2c.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/docs/teaching/exercises/tests/Test2c.java b/docs/teaching/exercises/tests/Test2c.java index 153739fc0..01c4978e4 100644 --- a/docs/teaching/exercises/tests/Test2c.java +++ b/docs/teaching/exercises/tests/Test2c.java @@ -16,30 +16,31 @@ import figures.*; import junit.framework.*; -public class Test2c extends Test { +public class Test2c extends TestCase { public Test2c(String name) { super(name); } public static void main(String[] args) { + junit.textui.TestRunner.run(Test.class); + junit.textui.TestRunner.run(Test2b.class); junit.textui.TestRunner.run(Test2c.class); } - public void setUp() { - super.setUp(); - } + public void testSelf() { + Point p1 = new Point(10, 100); + Group g = new Group(p1); - public void testNull() { try { - g.add(null); + g.add(g); fail("should have thrown IllegalArgumentException"); } catch (IllegalArgumentException ea) { } } - public void testSelf() { - try { - g.add(g); - fail("should have thrown IllegalArgumentException"); - } catch (IllegalArgumentException ea) { - } + public void testNotSelf() { + Point p1 = new Point(10, 100); + Group g1 = new Group(p1); + Group g2 = new Group(p1); + + g1.add(g2); } } |