aboutsummaryrefslogtreecommitdiffstats
path: root/docs/teaching/exercises/tests/Test3a.java
diff options
context:
space:
mode:
authorehilsdal <ehilsdal>2003-08-28 17:34:03 +0000
committerehilsdal <ehilsdal>2003-08-28 17:34:03 +0000
commit8266a6c5d3b1d2a3e72a2f7c3b6b1b287cacc520 (patch)
treebaf606d2f6457c16221a348210341f16877a4e41 /docs/teaching/exercises/tests/Test3a.java
parentc19c596d276457bb01d6f9e48311a6e3e290c7b4 (diff)
downloadaspectj-8266a6c5d3b1d2a3e72a2f7c3b6b1b287cacc520.tar.gz
aspectj-8266a6c5d3b1d2a3e72a2f7c3b6b1b287cacc520.zip
made everything inherit from Test again
updated section 3 tests
Diffstat (limited to 'docs/teaching/exercises/tests/Test3a.java')
-rw-r--r--docs/teaching/exercises/tests/Test3a.java43
1 files changed, 27 insertions, 16 deletions
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);
}
}