Home | History | Annotate | Download | only in ArrayReference
      1 /*
      2  * Licensed to the Apache Software Foundation (ASF) under one or more
      3  * contributor license agreements.  See the NOTICE file distributed with
      4  * this work for additional information regarding copyright ownership.
      5  * The ASF licenses this file to You under the Apache License, Version 2.0
      6  * (the "License"); you may not use this file except in compliance with
      7  * the License.  You may obtain a copy of the License at
      8  *
      9  *     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  */
     22 
     23 /**
     24  * Created on 13.07.2005
     25  */
     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     @Override
     44     public void run() {
     45         logWriter.println("--> Debuggee: SetValues002Debuggee: START");
     46 
     47         objectArrayField = new SetValues002Debuggee[1];
     48         objectArrayField[0] = new SetValues002Debuggee();
     49 
     50         logWriter.println("\n--> Debuggee: SetValues002Debuggee: Before ObjectReference::SetValues command:");
     51         logWriter.println("--> objectArrayField[0] value = " + objectArrayField[0]);
     52 
     53         synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY);
     54         synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
     55 
     56         logWriter.println("\n--> Debuggee: SetValues002Debuggee: After ObjectReference::SetValues command:");
     57         logWriter.println("--> objectArrayField[0] value = " + objectArrayField[0]);
     58         if ( objectArrayField[0] != null ) {
     59             logWriter.println("##> Debuggee: FAILURE: Unexpected value");
     60             logWriter.println("##> Expected value = " + null);
     61             status = failedStatus;
     62         } else {
     63             logWriter.println("--> Debuggee: OK. Expected value");
     64         }
     65 
     66         logWriter.println("--> Debuggee: Send check status for SetValues002Test...\n");
     67         synchronizer.sendMessage(status);
     68 
     69         logWriter.println("--> Debuggee: SetValues002Debuggee: FINISH");
     70     }
     71 
     72     /**
     73      * Starts SetValues002Debuggee with help of runDebuggee() method
     74      * from <A HREF="../../share/Debuggee.html">Debuggee</A> super class.
     75      *
     76      */
     77     public static void main(String [] args) {
     78         runDebuggee(SetValues002Debuggee.class);
     79     }
     80 }
     81