diff options
author | ehilsdal <ehilsdal> | 2003-08-28 17:34:03 +0000 |
---|---|---|
committer | ehilsdal <ehilsdal> | 2003-08-28 17:34:03 +0000 |
commit | 8266a6c5d3b1d2a3e72a2f7c3b6b1b287cacc520 (patch) | |
tree | baf606d2f6457c16221a348210341f16877a4e41 | |
parent | c19c596d276457bb01d6f9e48311a6e3e290c7b4 (diff) | |
download | aspectj-8266a6c5d3b1d2a3e72a2f7c3b6b1b287cacc520.tar.gz aspectj-8266a6c5d3b1d2a3e72a2f7c3b6b1b287cacc520.zip |
made everything inherit from Test again
updated section 3 tests
-rw-r--r-- | docs/teaching/exercises/tests/Test2a.java | 3 | ||||
-rw-r--r-- | docs/teaching/exercises/tests/Test2b.java | 4 | ||||
-rw-r--r-- | docs/teaching/exercises/tests/Test2c.java | 4 | ||||
-rw-r--r-- | docs/teaching/exercises/tests/Test2d.java | 3 | ||||
-rw-r--r-- | docs/teaching/exercises/tests/Test2e.java | 3 | ||||
-rw-r--r-- | docs/teaching/exercises/tests/Test2f.java | 1 | ||||
-rw-r--r-- | docs/teaching/exercises/tests/Test3a.java | 43 | ||||
-rw-r--r-- | docs/teaching/exercises/tests/Test3b.java | 48 | ||||
-rw-r--r-- | docs/teaching/exercises/tests/Test3c.java | 40 | ||||
-rw-r--r-- | docs/teaching/exercises/tests/Test4a.java | 1 | ||||
-rw-r--r-- | docs/teaching/exercises/tests/Test4b.java | 1 | ||||
-rw-r--r-- | docs/teaching/exercises/tests/Test4c.java | 1 |
12 files changed, 86 insertions, 66 deletions
diff --git a/docs/teaching/exercises/tests/Test2a.java b/docs/teaching/exercises/tests/Test2a.java index ece7191b7..b67db4c50 100644 --- a/docs/teaching/exercises/tests/Test2a.java +++ b/docs/teaching/exercises/tests/Test2a.java @@ -16,10 +16,9 @@ import figures.*; import junit.framework.*; -public class Test2a extends TestCase { +public class Test2a extends Test { public static void main(String[] args) { - junit.textui.TestRunner.run(Test.class); junit.textui.TestRunner.run(Test2a.class); } diff --git a/docs/teaching/exercises/tests/Test2b.java b/docs/teaching/exercises/tests/Test2b.java index be53f09f3..22550baa7 100644 --- a/docs/teaching/exercises/tests/Test2b.java +++ b/docs/teaching/exercises/tests/Test2b.java @@ -16,9 +16,9 @@ import figures.*; import junit.framework.*; -public class Test2b extends TestCase { +public class Test2b extends Test { + public static void main(String[] args) { - junit.textui.TestRunner.run(Test.class); junit.textui.TestRunner.run(Test2b.class); } diff --git a/docs/teaching/exercises/tests/Test2c.java b/docs/teaching/exercises/tests/Test2c.java index eef336ea2..261c6dfa4 100644 --- a/docs/teaching/exercises/tests/Test2c.java +++ b/docs/teaching/exercises/tests/Test2c.java @@ -16,11 +16,9 @@ import figures.*; import junit.framework.*; -public class Test2c extends TestCase { +public class Test2c extends Test { public static void main(String[] args) { - junit.textui.TestRunner.run(Test.class); - junit.textui.TestRunner.run(Test2b.class); junit.textui.TestRunner.run(Test2c.class); } diff --git a/docs/teaching/exercises/tests/Test2d.java b/docs/teaching/exercises/tests/Test2d.java index 6409e8c8e..92d082c4e 100644 --- a/docs/teaching/exercises/tests/Test2d.java +++ b/docs/teaching/exercises/tests/Test2d.java @@ -16,10 +16,9 @@ import figures.*; import junit.framework.*; -public class Test2d extends TestCase { +public class Test2d extends Test { public static void main(String[] args) { - junit.textui.TestRunner.run(Test.class); junit.textui.TestRunner.run(Test2d.class); } diff --git a/docs/teaching/exercises/tests/Test2e.java b/docs/teaching/exercises/tests/Test2e.java index 6ec31d608..550b158c3 100644 --- a/docs/teaching/exercises/tests/Test2e.java +++ b/docs/teaching/exercises/tests/Test2e.java @@ -16,10 +16,9 @@ import figures.*; import junit.framework.*; -public class Test2e extends TestCase { +public class Test2e extends Test { public static void main(String[] args) { - junit.textui.TestRunner.run(Test.class); junit.textui.TestRunner.run(Test2e.class); } diff --git a/docs/teaching/exercises/tests/Test2f.java b/docs/teaching/exercises/tests/Test2f.java index 30dfa7fa1..f79e7b966 100644 --- a/docs/teaching/exercises/tests/Test2f.java +++ b/docs/teaching/exercises/tests/Test2f.java @@ -19,7 +19,6 @@ import junit.framework.*; public class Test2f extends Test { public static void main(String[] args) { - junit.textui.TestRunner.run(Test.class); junit.textui.TestRunner.run(Test2f.class); } diff --git a/docs/teaching/exercises/tests/Test3a.java b/docs/teaching/exercises/tests/Test3a.java index 4db5450e9..84964d1e8 100644 --- a/docs/teaching/exercises/tests/Test3a.java +++ b/docs/teaching/exercises/tests/Test3a.java @@ -14,8 +14,9 @@ package tests; import figures.*; import support.Log; - import junit.framework.*; +import java.util.List; +import java.util.Arrays; public class Test3a extends Test { @@ -23,26 +24,36 @@ public class Test3a extends Test { junit.textui.TestRunner.run(Test3a.class); } - public void setUp() { + public void testMovePointLog() { + Point p1 = new Point(10, 100); + Log.clear(); - super.setUp(); - } + p1.move(20, 30); + List foundLog = Log.getData(); - public void testCreateLog() { - assertEquals("", Log.getString()); - } + List desiredLog = + Arrays.asList(new String[] { + "execution(void figures.Point.move(int, int))" + }); - public void testMovePointLog() { - p1.move(20, 30); - assertEquals("moving;", Log.getString()); + assertEquals(desiredLog, foundLog); } - public void testSetYPointLog() { - assertEquals("", Log.getString()); - } + public void testMoveLineLog() { + Point p1 = new Point(10, 100); + Point p2 = new Point(20, 200); + Line l = new Line(p1, p2); - public void testGetYPointLog() { - p1.getY(); - assertEquals("", Log.getString()); + Log.clear(); + l.move(20, 30); + List foundLog = Log.getData(); + + List desiredLog = + Arrays.asList(new String[] { + "execution(void figures.Line.move(int, int))", + "execution(void figures.Point.move(int, int))", + "execution(void figures.Point.move(int, int))" + }); + assertEquals(desiredLog, foundLog); } } diff --git a/docs/teaching/exercises/tests/Test3b.java b/docs/teaching/exercises/tests/Test3b.java index c722bce7c..ccf792001 100644 --- a/docs/teaching/exercises/tests/Test3b.java +++ b/docs/teaching/exercises/tests/Test3b.java @@ -14,8 +14,9 @@ package tests; import figures.*; import support.Log; - import junit.framework.*; +import java.util.List; +import java.util.Arrays; public class Test3b extends Test { @@ -23,31 +24,36 @@ public class Test3b extends Test { junit.textui.TestRunner.run(Test3b.class); } - public void setUp() { - super.setUp(); + public void testMovePointLog() { + Point p1 = new Point(10, 100); + Log.clear(); - } + p1.move(20, 30); + List foundLog = Log.getData(); - public void testCreateLog() { - assertEquals("", Log.getString()); - } + List desiredLog = + Arrays.asList(new String[] { + "execution(void figures.Point.move(int, int)) at Point(10, 100)" + }); - public void testCreateWithPointLog() { - g = new Group(p1); - assertEquals("adding Point;", Log.getString()); + assertEquals(desiredLog, foundLog); } - public void testCreateWithoutPointLog() { - g = new Group(l1); - assertEquals("", Log.getString()); - } + public void testMoveLineLog() { + Point p1 = new Point(10, 100); + Point p2 = new Point(20, 200); + Line l = new Line(p1, p2); - public void testAddPointLog() { - g.add(p1); - assertEquals("adding Point;", Log.getString()); - } - public void testAddNonPointLog() { - g.add(l1); - assertEquals("", Log.getString()); + Log.clear(); + l.move(20, 30); + List foundLog = Log.getData(); + + List desiredLog = + Arrays.asList(new String[] { + "execution(void figures.Line.move(int, int)) at Line(Point(10, 100), Point(20, 200))", + "execution(void figures.Point.move(int, int)) at Point(10, 100)", + "execution(void figures.Point.move(int, int)) at Point(20, 200)" + }); + assertEquals(desiredLog, foundLog); } } diff --git a/docs/teaching/exercises/tests/Test3c.java b/docs/teaching/exercises/tests/Test3c.java index a8d888366..b410905e0 100644 --- a/docs/teaching/exercises/tests/Test3c.java +++ b/docs/teaching/exercises/tests/Test3c.java @@ -14,8 +14,9 @@ package tests; import figures.*; import support.Log; - import junit.framework.*; +import java.util.List; +import java.util.Arrays; public class Test3c extends Test { @@ -23,24 +24,29 @@ public class Test3c extends Test { junit.textui.TestRunner.run(Test3c.class); } - public void setUp() { + public void testCreateWithPointLog() { Log.clear(); - super.setUp(); - } - - public void testCreateLog() { - assertEquals("", Log.getString()); + Point p1 = new Point(10, 100); + Group g = new Group(p1); + List foundLog = Log.getData(); + + List desiredLog = + Arrays.asList(new String[] { + "adding Point" + }); + assertEquals(desiredLog, foundLog); } - public void testMoveLonePoint() { - p1 = new Point(0, 0); - p1.move(37, 88); - assertEquals("moving as a part of null;", Log.getString()); - } - - public void testMoveGroupedPoint() { - g = new Group(p1); - p1.move(0, 0); - assertEquals("moving as a part of " + g + ";", Log.getString()); + public void testCreateWithoutPointLog() { + Log.clear(); + Point p1 = new Point(10, 100); + Point p2 = new Point(20, 200); + Line l = new Line(p1, p2); + Group g = new Group(l); + List foundLog = Log.getData(); + + List desiredLog = Arrays.asList(new String[] {}); + assertEquals(desiredLog, foundLog); } } + diff --git a/docs/teaching/exercises/tests/Test4a.java b/docs/teaching/exercises/tests/Test4a.java index f3644765f..b831715c6 100644 --- a/docs/teaching/exercises/tests/Test4a.java +++ b/docs/teaching/exercises/tests/Test4a.java @@ -18,6 +18,7 @@ import java.awt.Rectangle; import junit.framework.*; public class Test4a extends Test { + public static void main(String[] args) { junit.textui.TestRunner.run(Test4a.class); } diff --git a/docs/teaching/exercises/tests/Test4b.java b/docs/teaching/exercises/tests/Test4b.java index adc891008..367f6ee60 100644 --- a/docs/teaching/exercises/tests/Test4b.java +++ b/docs/teaching/exercises/tests/Test4b.java @@ -18,6 +18,7 @@ import java.awt.Rectangle; import junit.framework.*; public class Test4b extends Test { + public static void main(String[] args) { junit.textui.TestRunner.run(Test4b.class); } diff --git a/docs/teaching/exercises/tests/Test4c.java b/docs/teaching/exercises/tests/Test4c.java index c4c5928ce..f295d4807 100644 --- a/docs/teaching/exercises/tests/Test4c.java +++ b/docs/teaching/exercises/tests/Test4c.java @@ -18,6 +18,7 @@ import java.awt.Rectangle; import junit.framework.*; public class Test4c extends Test { + public static void main(String[] args) { junit.textui.TestRunner.run(Test4c.class); } |