blob: a7e092d1f02392a82046499a1fdfe90263105cc0 (
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.harmony.jpda.tests.jdwp.Events;
import org.apache.harmony.jpda.tests.share.JPDADebuggeeSynchronizer;
import org.apache.harmony.jpda.tests.share.SyncDebuggee;
/**
* Debuggee for Breakpoint002Test unit test.
*/
public class Breakpoint002Debuggee extends SyncDebuggee {
int mIntField = 5;
long mLongField = 5l;
Object mObjectField = "this is an object field";
private void breakpointReturnVoid() {
return;
}
private int breakpointReturnIntConst() {
return 1;
}
private long breakpointReturnLongConst() {
return 1l;
}
private int breakpointReturnIntArg(int arg) {
return arg;
}
private long breakpointReturnLongArg(long arg) {
return arg;
}
private Object breakpointReturnObjectArg(Object arg) {
return arg;
}
private int breakpointIntGetter() {
return mIntField;
}
private long breakpointLongGetter() {
return mLongField;
}
private Object breakpointObjectGetter() {
return mObjectField;
}
private void breakpointIntSetter(int val) {
mIntField = val;
}
private void breakpointLongSetter(long val) {
mLongField = val;
}
private void breakpointObjectSetter(Object val) {
mObjectField = val;
}
private void callSmallMethods() {
logWriter.println("Calling breakpointReturnVoid");
breakpointReturnVoid();
logWriter.println("Calling breakpointReturnIntConst");
int intConstant = breakpointReturnIntConst();
logWriter.println("intConstant = " + intConstant);
logWriter.println("Calling breakpointReturnLongConst");
long longConstant = breakpointReturnLongConst();
logWriter.println("longConstant = " + longConstant);
logWriter.println("Calling breakpointReturnIntArg");
int intArg = breakpointReturnIntArg(5);
logWriter.println("intArg = " + intArg);
logWriter.println("Calling breakpointReturnLongArg");
long longArg = breakpointReturnLongArg(5l);
logWriter.println("longArg = " + longArg);
logWriter.println("Calling breakpointReturnLongArg");
Object objectArg = breakpointReturnObjectArg("this is a string argument");
logWriter.println("objectArg = " + objectArg);
logWriter.println("Calling breakpointIntGetter");
int intField = breakpointIntGetter();
logWriter.println("mIntField = " + intField);
logWriter.println("Calling breakpointLongGetter");
long longField = breakpointLongGetter();
logWriter.println("mLongField = " + longField);
logWriter.println("Calling breakpointObjectGetter");
Object objectField = breakpointObjectGetter();
logWriter.println("mObjectField = " + objectField);
logWriter.println("Calling breakpointIntSetter");
breakpointIntSetter(10);
logWriter.println("Calling breakpointLongGetter");
breakpointLongSetter(10l);
logWriter.println("Calling breakpointObjectSetter");
breakpointObjectSetter("this is a new object field value");
}
@Override
public void run() {
synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY);
logWriter.println("Breakpoint002Debuggee started");
synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
callSmallMethods();
logWriter.println("Breakpoint002Debuggee finished");
}
public static void main(String[] args) {
runDebuggee(Breakpoint002Debuggee.class);
}
}
|