jdk/test/com/sun/jdi/LocalVariableEqual.java
author mikejwre
Thu, 25 Mar 2010 15:05:15 -0700
changeset 5074 9c9bfe8f3a47
parent 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Added tag jdk7-b87 for changeset 8367da959bab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2003-2004 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 *  @test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 *  @bug 4916263
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 *  @summary Test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 *  @author Serguei Spitsyn
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 *  @run build TestScaffold VMConnection TargetListener TargetAdapter
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 *  @run compile -g LocalVariableEqual.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 *  @run main LocalVariableEqual
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import com.sun.jdi.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import com.sun.jdi.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import com.sun.jdi.request.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    /********** target program **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
class LocalVariableEqualTarg {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    public static void main(String[] args){
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
        int intVar = 10;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
        System.out.println("LocalVariableEqualTarg: Started");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        intVar = staticMeth(intVar);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        System.out.println("LocalVariableEqualTarg: Finished");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    public static int staticMeth(int intArg) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        System.out.println("staticMeth: Started");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        int result;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
             { boolean bool_1 = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
               intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
               {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
                 { byte byte_2 = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
                   intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
                 }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
                 byte byte_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
                 intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
               }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
             boolean bool_2 = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
             intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
             {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
               {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
                 { char   char_1 = '1';
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
                   intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
                 }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
                 short  short_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
                 intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
               }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
             { short  short_2 = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
               intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
             char   char_2 = '2';
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
             intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
             { int int_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
               intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
             long long_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
             intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
             { float  float_1 = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
               intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
             double double_2 = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
             intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
             { String string_1 = "1";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
               intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
             Object obj_2 = new Object();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
             intArg++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        result = 10;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        System.out.println("staticMeth: Finished");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        return result;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    /********** test program **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
public class LocalVariableEqual extends TestScaffold {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    ReferenceType targetClass;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    ThreadReference mainThread;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    LocalVariableEqual (String args[]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        super(args);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    public static void main(String[] args) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        new LocalVariableEqual(args).startTests();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    /********** test assist **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    Method getMethod(String className, String methodName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        List refs = vm().classesByName(className);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        if (refs.size() != 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
            failure("Test failure: " + refs.size() +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                    " ReferenceTypes named: " + className);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        ReferenceType refType = (ReferenceType)refs.get(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        List meths = refType.methodsByName(methodName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        if (meths.size() != 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
            failure("Test failure: " + meths.size() +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
                    " methods named: " + methodName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        return (Method)meths.get(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    void printVariable(LocalVariable lv, int index) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        if (lv == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
            println(" Var  name: null");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        String tyname = lv.typeName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        println(" Var: " + lv.name() + ", index: " + index + ", type: " + tyname +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
                ", Signature: " + lv.type().signature());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        // Sorry, there is no way to take local variable slot numbers using JDI!
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        // It is because method LocalVariableImpl.slot() is private.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    void compareTwoEqualVars(LocalVariable lv1, LocalVariable lv2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        if (lv1.equals(lv2)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
            println(" Success: equality of local vars detected");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
            failure(" Failure: equality of local vars is NOT detected");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        if (lv1.hashCode() == lv2.hashCode()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
            println(" Success: hashCode's of equal local vars are equal");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
            failure(" Failure: hashCode's of equal local vars differ");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        if (lv1.compareTo(lv2) == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
            println(" Success: compareTo() is correct for equal local vars");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            failure(" Failure: compareTo() is NOT correct for equal local vars");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    void compareTwoDifferentVars(LocalVariable lv1, LocalVariable lv2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        if (!lv1.equals(lv2)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
            println(" Success: difference of local vars detected");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
            failure(" Failure: difference of local vars is NOT detected");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        if (lv1.hashCode() != lv2.hashCode()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
            println(" Success: hashCode's of different local vars differ");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
            failure(" Failure: hashCode's of different local vars are equal");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        if (lv1.compareTo(lv2) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
            println(" Success: compareTo() is correct for different local vars");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
            failure(" Failure: compareTo() is NOT correct for different local vars");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    void compareAllVariables(String className, String methodName) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        println("compareAllVariables for method: " + className + "." + methodName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        Method method = getMethod(className, methodName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        List localVars;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            localVars = method.variables();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
            println("\n Success: got a list of all method variables: " + methodName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        catch (com.sun.jdi.AbsentInformationException ex) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
            failure("\n AbsentInformationException has been thrown");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        // We consider N*N combinations for set of N variables
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        int index1 = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        for (Iterator it1 = localVars.iterator(); it1.hasNext(); index1++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
            LocalVariable lv1 = (LocalVariable) it1.next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
            int index2 = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
            for (Iterator it2 = localVars.iterator(); it2.hasNext(); index2++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
                LocalVariable lv2 = (LocalVariable) it2.next();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
                println("\n Two variables:");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                printVariable(lv1, index1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                printVariable(lv2, index2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                println("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                if (index1 == index2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                    compareTwoEqualVars(lv1, lv2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                    compareTwoDifferentVars(lv1, lv2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        println("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    /********** test core **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    protected void runTests() throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
         * Get to the top of main() to determine targetClass and mainThread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        BreakpointEvent bpe = startToMain("LocalVariableEqualTarg");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        println("startToMain(LocalVariableEqualTarg)");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        compareAllVariables("LocalVariableEqualTarg", "staticMeth");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
         * resume until the end
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
        listenUntilVMDisconnect();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
         * deal with results of test
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
         * if anything has called failure("foo") testFailed will be true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
        if (!testFailed) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
            println("\nLocalVariableEqual: passed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
            throw new Exception("\nLocalVariableEqual: FAILED");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
}