aboutsummaryrefslogtreecommitdiffstats
path: root/tests/debugger/BreakpointTester.java
blob: 89275acd61422596e20c3652bd601230e4f75958 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//package debugger;

import com.sun.jdi.*;
import com.sun.jdi.event.*;
import com.sun.jdi.request.*;
import java.io.*;
import java.util.*;
import org.aspectj.tools.debugger.*;

/**
 * BreakpointTester.java
 *
 *
 * Created: Wed Sep 06 15:53:29 2000
 *
 * @author <a href="mailto:palm@parc.xerox.com"Jeffrey Palm</a>
 */

public class BreakpointTester extends Tester {

    public static void main(String[] args) {
        new Main(new BreakpointTester(false), args);
    }

    public BreakpointTester(boolean d) {
        super(d);
    }

    public String getClassName() {
        return "TestClass";
    }

    public boolean test() {
        db();
        Vector locals = new Vector();
        Vector names = new Vector();
        names.add("");
        names.add("system");
        names.add("main");
        IntVector sizes = new IntVector();
        sizes.add(4);
        sizes.add(3);
        sizes.add(1);
        Vector cases = new Vector();
        
        try {
            stopin("main");
            stopin("a");
            stopin("b");
            //stopat("TestClassAspect", 41);
            stopin("c");
            stopat("TestClassAspect", 54);

            int i = 0;
            locals = new Vector();
            locals.add("args");
            cases.add(new Case(PCKG + "TestClass.main", 5, 1, locals, names, sizes, (i++)));

            locals = new Vector();
            cases.add(new Case(PCKG + "TestClass.a", -2, 3, locals, names, sizes, (i++)));

            locals = new Vector();
            cases.add(new Case(PCKG + "TestClass.b", -2, 5, locals, names, sizes, (i++)));

//              locals = new Vector();
//              locals.add("thisJoinPoint");
//              cases.add(new Case(PCKG + "TestClassAspect:41", 41, 6, locals, names, sizes, (i++)));

            locals = new Vector();
            cases.add(new Case(PCKG + "TestClass.c", -2, 7, locals, names, sizes, (i++)));

            locals = new Vector();
            locals.add("thisJoinPoint");
            cases.add(new Case(PCKG + "TestClassAspect:54", 54, 8, locals, names, sizes, (i++)));

            stop(cases);
            startTest();
            
            return true;
        } catch (DebuggerException de) { de.printStackTrace(out);
        }
        return false;
    }
}