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/Test2e.java | |
parent | f1a7345a62bd1f227dd64fcd7c2d519c8911ae5c (diff) | |
download | aspectj-f3929cad6a0e6d6973483dd23c7aea68b6e7fed1.tar.gz aspectj-f3929cad6a0e6d6973483dd23c7aea68b6e7fed1.zip |
updated section 2
Diffstat (limited to 'docs/teaching/exercises/tests/Test2e.java')
-rw-r--r-- | docs/teaching/exercises/tests/Test2e.java | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/docs/teaching/exercises/tests/Test2e.java b/docs/teaching/exercises/tests/Test2e.java index dfa456138..09ab65790 100644 --- a/docs/teaching/exercises/tests/Test2e.java +++ b/docs/teaching/exercises/tests/Test2e.java @@ -16,27 +16,24 @@ import figures.*; import junit.framework.*; -public class Test2e extends Test { +public class Test2e extends TestCase { public Test2e(String name) { super(name); } public static void main(String[] args) { + junit.textui.TestRunner.run(Test.class); junit.textui.TestRunner.run(Test2e.class); } - public void setUp() { - super.setUp(); - } - - public void testEasy() { - Box sq = new Box(0, 0, 10, 10); - sq.move(5,5); - assertEquals(sq.getP0().getX(), 5); - assertEquals(sq.getP0().getY(), 5); - + public void testSloth() { + Point sp = new SlothfulPoint(10, 10); try { - sq.getP0().setX(100); - sq.move(37, 1); + sp.move(10, 10); fail("should have thrown IllegalStateException"); } catch (IllegalStateException e) { } } + + public void testNonSloth() { + Point p1 = new Point(10, 100); + p1.move(3, 30); + } } |