jdk/test/com/sun/jdi/SourceNameFilterTest.java
author xdono
Thu, 02 Oct 2008 19:58:32 -0700
changeset 1247 b4c26443dee5
parent 828 ad3f54bd6ae8
child 5506 202f599c92aa
permissions -rw-r--r--
6754988: Update copyright year Summary: Update for files that have been modified starting July 2008 Reviewed-by: ohair, tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
1247
b4c26443dee5 6754988: Update copyright year
xdono
parents: 828
diff changeset
     2
 * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
2
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
828
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
    26
 *  @bug 4836939 6646613
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 *  @summary JDI add addSourceNameFilter to ClassPrepareRequest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 *  @author jjh
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 SourceNameFilterTest.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 *  @run main SourceNameFilterTest
828
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
    34
 *  @run compile -g:none SourceNameFilterTest.java
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
    35
 *  @run main SourceNameFilterTest
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 */
828
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
    37
// The compile -g:none suppresses the lineNumber table to trigger bug 6646613.
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
    38
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import com.sun.jdi.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import com.sun.jdi.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import com.sun.jdi.request.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    /********** target program **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
class SourceNameFilterTarg {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    static  void bkpt() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    public static void main(String[] args){
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        System.out.println("Howdy!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        LoadedLater1.doit();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        bkpt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        LoadedLater2.doit();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        bkpt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        LoadedLater3.doit();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        bkpt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        System.out.println("Goodbye from SourceNameFilterTarg!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
class LoadedLater1 {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    public static void doit() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        System.out.println("didit1");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
class LoadedLater2 {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    public static void doit() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        System.out.println("didit2");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
class LoadedLater3 {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    public static void doit() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        System.out.println("didit3");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    /********** test program **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
public class SourceNameFilterTest extends TestScaffold {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    ReferenceType targetClass;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    ThreadReference mainThread;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    boolean gotEvent1 = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    boolean gotEvent2 = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    boolean gotEvent3 = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    ClassPrepareRequest cpReq;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    boolean shouldResume = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    SourceNameFilterTest (String args[]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        super(args);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    public static void main(String[] args)      throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        new SourceNameFilterTest(args).startTests();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    public void eventSetComplete(EventSet set) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        //System.out.println("jj: resuming, set = " + set);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        if (shouldResume) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
            set.resume();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
            shouldResume = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    public void classPrepared(ClassPrepareEvent event) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        shouldResume = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        ReferenceType rt = event.referenceType();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        String rtname = rt.name();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        if (rtname.equals("LoadedLater1")) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
            gotEvent1 = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        if (rtname.equals("LoadedLater2")) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
            gotEvent2 = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        if (rtname.equals("LoadedLater3")) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
            gotEvent3 = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        // debug code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        if (false) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
            println("Got ClassPrepareEvent for : " + rtname);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                println("    sourceName = " + rt.sourceName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
            } catch (AbsentInformationException ee) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                failure("failure: absent info on sourceName(): " + ee);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
            String stratum = rt.defaultStratum();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
            println("    defaultStratum = " + stratum);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
                println("    sourceNames = " + rt.sourceNames(stratum));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
            } catch (AbsentInformationException ee) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
                failure("failure: absent info on sourceNames(): " + ee);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
            println("\nAvailable strata:  " + rt.availableStrata());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    /********** test core **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    protected void runTests() throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
         * Get to the top of main()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
         * to determine targetClass and mainThread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        BreakpointEvent bpe = startToMain("SourceNameFilterTarg");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        targetClass = bpe.location().declaringType();
828
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   157
        boolean noSourceName = false;
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   158
        try {
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   159
            targetClass.sourceName();
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   160
        } catch (AbsentInformationException ee) {
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   161
            noSourceName = true;
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   162
        }
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   163
        if (noSourceName) {
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   164
            println("-- Running with no source names");
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   165
        } else {
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   166
            println("-- Running with source names");
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   167
        }
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   168
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        mainThread = bpe.thread();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        EventRequestManager erm = vm().eventRequestManager();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        addListener(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
         * Resume the target listening for events
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
         * This should cause a class prepare event for LoadedLater1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        cpReq = erm.createClassPrepareRequest();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        cpReq.enable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        resumeTo("SourceNameFilterTarg", "bkpt", "()V");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
         * This should cause us to not get a class prepared for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
         * LoadedLater2 since it doesn't come from "jj"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        cpReq.disable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        cpReq.addSourceNameFilter("jj");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        cpReq.enable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        resumeTo("SourceNameFilterTarg", "bkpt", "()V");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        cpReq.disable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
         * This should cause us to get a class prepare event for
828
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   193
         * LoadedLater3 except in the case where -g:none
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   194
         * was used to compile so that there is no LineNumberTable
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   195
         * and therefore, no source name for the class.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        cpReq = erm.createClassPrepareRequest();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        cpReq.addSourceNameFilter("SourceNameFilterTest.java");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        cpReq.enable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        resumeTo("SourceNameFilterTarg", "bkpt", "()V");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        listenUntilVMDisconnect();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        if (!gotEvent1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
            failure("failure: Did not get a class prepare request " +
828
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   206
                    "for LoadedLater1");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        if (gotEvent2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
            failure("failure: Did get a class prepare request " +
828
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   211
                    "for LoadedLater2");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
828
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   214
        if (gotEvent3 && noSourceName) {
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   215
            failure("failure: Did get a class prepare request " +
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   216
                    "for LoadedLater3");
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   217
        }
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   218
        else if (!gotEvent3 && !noSourceName) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
            failure("failure: Did not get a class prepare request " +
828
ad3f54bd6ae8 2157677: ClassPrepareRequest.addSourceNameFilter() does not behave as documented
jjh
parents: 2
diff changeset
   220
                    "for LoadedLater3");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
         * deal with results of test
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
         * if anything has called failure("foo") testFailed will be true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        if (!testFailed) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
            println("SourceNameFilterTest: passed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
            throw new Exception("SourceNameFilterTest: failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
}