01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: *
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: /**
20: * @author Anatoly F. Bondarenko
21: * @version $Revision: 1.2 $
22: */
23:
24: /**
25: * Created on 17.03.2005
26: */package org.apache.harmony.jpda.tests.jdwp.ObjectReference;
27:
28: import org.apache.harmony.jpda.tests.share.JPDADebuggeeSynchronizer;
29: import org.apache.harmony.jpda.tests.share.SyncDebuggee;
30:
31: public class SetValues003Debuggee extends SyncDebuggee {
32:
33: static String passedStatus = "PASSED";
34: static String failedStatus = "FAILED";
35: static String status = passedStatus;
36:
37: static SetValues003Debuggee setValues003DebuggeeObject;
38:
39: SetValues003Debuggee_ExtraClass objectField;
40: static SetValues003Debuggee_ExtraClass objectFieldCopy;
41:
42: public void run() {
43: logWriter.println("--> Debuggee: SetValues003Debuggee: START");
44: setValues003DebuggeeObject = new SetValues003Debuggee();
45: setValues003DebuggeeObject.objectField = new SetValues003Debuggee_ExtraClass();
46: objectFieldCopy = setValues003DebuggeeObject.objectField;
47:
48: logWriter
49: .println("\n--> Debuggee: SetValues003Debuggee: Before ObjectReference::SetValues command:");
50: logWriter.println("--> objectField value = "
51: + setValues003DebuggeeObject.objectField);
52: logWriter.println("--> value to set = "
53: + setValues003DebuggeeObject);
54:
55: synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY);
56: synchronizer
57: .receiveMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
58:
59: logWriter
60: .println("\n--> Debuggee: SetValues003Debuggee: After ObjectReference::SetValues command:");
61: logWriter.println("--> objectField value = "
62: + setValues003DebuggeeObject.objectField);
63: if (!objectFieldCopy
64: .equals(setValues003DebuggeeObject.objectField)) {
65: logWriter
66: .println("##> Debuggee: FAILURE: Unexpected value");
67: logWriter
68: .println("##> Expected value = " + objectFieldCopy);
69: status = failedStatus;
70: } else {
71: logWriter.println("--> Debuggee: PASSED: Expected value");
72: }
73:
74: if (status.equals(failedStatus)) {
75: logWriter.println("\n##> Debuggee: Check status = FAILED");
76: } else {
77: logWriter.println("\n--> Debuggee: Check status = PASSED");
78: }
79:
80: logWriter
81: .println("--> Debuggee: Send check status for SetValues003Test...\n");
82: synchronizer.sendMessage(status);
83:
84: logWriter.println("--> Debuggee: SetValues003Debuggee: FINISH");
85: }
86:
87: public static void main(String[] args) {
88: runDebuggee(SetValues003Debuggee.class);
89: }
90: }
91:
92: class SetValues003Debuggee_ExtraClass {
93:
94: }
|