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 13.07.2005
26: */package org.apache.harmony.jpda.tests.jdwp.ArrayReference;
27:
28: import org.apache.harmony.jpda.tests.share.JPDADebuggeeSynchronizer;
29: import org.apache.harmony.jpda.tests.share.SyncDebuggee;
30:
31: /**
32: * Debuggee for JDWP SetValues002Test unit test which
33: * exercises ArrayReference.SetValues command.
34: */
35: public class SetValues002Debuggee extends SyncDebuggee {
36:
37: static String passedStatus = "PASSED";
38: static String failedStatus = "FAILED";
39: static String status = passedStatus;
40:
41: static SetValues002Debuggee objectArrayField[]; // JDWP_TAG_ARRAY = 91
42:
43: public void run() {
44: logWriter.println("--> Debuggee: SetValues002Debuggee: START");
45:
46: objectArrayField = new SetValues002Debuggee[1];
47: objectArrayField[0] = new SetValues002Debuggee();
48:
49: logWriter
50: .println("\n--> Debuggee: SetValues002Debuggee: Before ObjectReference::SetValues command:");
51: logWriter.println("--> objectArrayField[0] value = "
52: + objectArrayField[0]);
53:
54: synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY);
55: synchronizer
56: .receiveMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
57:
58: logWriter
59: .println("\n--> Debuggee: SetValues002Debuggee: After ObjectReference::SetValues command:");
60: logWriter.println("--> objectArrayField[0] value = "
61: + objectArrayField[0]);
62: if (objectArrayField[0] != null) {
63: logWriter
64: .println("##> Debuggee: FAILURE: Unexpected value");
65: logWriter.println("##> Expected value = " + null);
66: status = failedStatus;
67: } else {
68: logWriter.println("--> Debuggee: OK. Expected value");
69: }
70:
71: logWriter
72: .println("--> Debuggee: Send check status for SetValues002Test...\n");
73: synchronizer.sendMessage(status);
74:
75: logWriter.println("--> Debuggee: SetValues002Debuggee: FINISH");
76: }
77:
78: /**
79: * Starts SetValues002Debuggee with help of runDebuggee() method
80: * from <A HREF="../../share/Debuggee.html">Debuggee</A> super class.
81: *
82: */
83: public static void main(String[] args) {
84: runDebuggee(SetValues002Debuggee.class);
85: }
86: }
|