test/jdk/com/sun/jdi/MonitorEventTest.java
author clanger
Thu, 17 Oct 2019 22:41:36 +0200
changeset 58681 5f14a659a8cb
parent 47216 71c04702a3d5
permissions -rw-r--r--
8232370: Refactor some com.sun.jdi tests to enable IDE integration Reviewed-by: amenkov, cjplummer, sspitsyn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
58681
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
     2
 * Copyright (c) 2005, 2019, Oracle and/or its affiliates. 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
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/**
44423
306c020eb154 8176176: fix @modules in jdk_svc tests
iignatyev
parents: 30376
diff changeset
    25
 * @test
306c020eb154 8176176: fix @modules in jdk_svc tests
iignatyev
parents: 30376
diff changeset
    26
 * @bug 4401399
306c020eb154 8176176: fix @modules in jdk_svc tests
iignatyev
parents: 30376
diff changeset
    27
 * @summary Simple basic test of jdi Monitor request and event.
306c020eb154 8176176: fix @modules in jdk_svc tests
iignatyev
parents: 30376
diff changeset
    28
 * @author Swamy Venkataramanappa
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 *
44423
306c020eb154 8176176: fix @modules in jdk_svc tests
iignatyev
parents: 30376
diff changeset
    30
 * @run build TestScaffold VMConnection TargetListener TargetAdapter
306c020eb154 8176176: fix @modules in jdk_svc tests
iignatyev
parents: 30376
diff changeset
    31
 * @run compile -g MonitorEventTest.java
306c020eb154 8176176: fix @modules in jdk_svc tests
iignatyev
parents: 30376
diff changeset
    32
 * @run driver MonitorEventTest
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 */
58681
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
    34
import com.sun.jdi.ReferenceType;
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
    35
import com.sun.jdi.ThreadReference;
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
    36
import com.sun.jdi.event.BreakpointEvent;
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
    37
import com.sun.jdi.event.MonitorContendedEnterEvent;
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
    38
import com.sun.jdi.event.MonitorContendedEnteredEvent;
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
    39
import com.sun.jdi.event.MonitorWaitEvent;
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
    40
import com.sun.jdi.event.MonitorWaitedEvent;
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
    41
import com.sun.jdi.request.EventRequest;
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
    42
import com.sun.jdi.request.MonitorContendedEnterRequest;
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
    43
import com.sun.jdi.request.MonitorContendedEnteredRequest;
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
    44
import com.sun.jdi.request.MonitorWaitRequest;
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
    45
import com.sun.jdi.request.MonitorWaitedRequest;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
/********** target program **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
58681
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
    49
class MonitorEventTestTarg {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    public static Object endingMonitor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    public static Object startingMonitor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    public static final long timeout = 30 * 6000; // milliseconds
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    public static volatile boolean aboutEnterLock;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    static void foo() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        System.out.println("Howdy!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    public static void main(String[] args){
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        endingMonitor = new Object();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        startingMonitor = new Object();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
        myThread t1 = new myThread();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        foo();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        aboutEnterLock = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        synchronized(endingMonitor) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
            // run thread
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
                // start thread
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
                synchronized (startingMonitor) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
                    t1.start();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
                    startingMonitor.wait(timeout);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
            } catch (InterruptedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
                System.out.println("Interrupted exception " + e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
            Thread.yield();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
            while(!(aboutEnterLock && t1.getState() == Thread.State.BLOCKED)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
                try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                    Thread.sleep(1000);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
                }catch(Exception x){
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
                    System.out.println(x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
            t1.join(timeout);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        } catch (Exception x){
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
            System.out.println("Exception while thread.join :" + x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        System.out.println("Test exiting");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
class myThread extends Thread {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    public void run() {
58681
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
   101
        synchronized(MonitorEventTestTarg.startingMonitor) {
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
   102
            MonitorEventTestTarg.startingMonitor.notify();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        // contended enter wait until main thread release monitor
58681
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
   106
        MonitorEventTestTarg.aboutEnterLock = true;
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
   107
        synchronized (MonitorEventTestTarg.endingMonitor) {
2
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
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    /********** test program **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
public class MonitorEventTest extends TestScaffold {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    ReferenceType targetClass;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    ThreadReference mainThread;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    MonitorContendedEnterRequest contendedEnterRequest;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    MonitorWaitedRequest monitorWaitedRequest;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    MonitorContendedEnteredRequest contendedEnteredRequest;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    MonitorWaitRequest monitorWaitRequest;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    static int actualWaitCount = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    static int actualWaitedCount = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    static int actualContendedEnterCount = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    static int actualContendedEnteredCount= 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    MonitorEventTest (String args[]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        super(args);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    public static void main(String[] args)      throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        new MonitorEventTest(args).startTests();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    /********** event handlers **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    public void monitorContendedEnter(MonitorContendedEnterEvent event) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        actualContendedEnterCount++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    public void monitorContendedEntered(MonitorContendedEnteredEvent event) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        actualContendedEnteredCount++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    public void monitorWait(MonitorWaitEvent event) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        actualWaitCount++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    public void monitorWaited(MonitorWaitedEvent event) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        actualWaitedCount++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    /********** test core **********/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    protected void runTests() throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
         * Get to the top of main()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
         * to determine targetClass and mainThread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
         */
58681
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
   169
        BreakpointEvent bpe = startToMain("MonitorEventTestTarg");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        targetClass = bpe.location().declaringType();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        mainThread = bpe.thread();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        if (vm().canRequestMonitorEvents()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
            contendedEnterRequest = eventRequestManager().createMonitorContendedEnterRequest();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            contendedEnterRequest.setSuspendPolicy(EventRequest.SUSPEND_NONE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
            contendedEnterRequest.enable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
            contendedEnteredRequest = eventRequestManager().createMonitorContendedEnteredRequest();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
            contendedEnteredRequest.setSuspendPolicy(EventRequest.SUSPEND_NONE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            contendedEnteredRequest.enable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            monitorWaitRequest = eventRequestManager().createMonitorWaitRequest();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
            monitorWaitRequest.setSuspendPolicy(EventRequest.SUSPEND_NONE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
            monitorWaitRequest.enable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
            monitorWaitedRequest = eventRequestManager().createMonitorWaitedRequest();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
            monitorWaitedRequest.setSuspendPolicy(EventRequest.SUSPEND_NONE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
            monitorWaitedRequest.enable();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
            System.out.println("request monitor events not supported " );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
58681
5f14a659a8cb 8232370: Refactor some com.sun.jdi tests to enable IDE integration
clanger
parents: 47216
diff changeset
   191
        resumeTo("MonitorEventTestTarg", "foo", "()V");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
         * resume until end
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        listenUntilVMDisconnect();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
         * At least one of each type event should have recevied by this test.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        if (vm().canRequestMonitorEvents()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
            if (actualContendedEnterCount == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                failure("Did not receive any  contended enter event.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
            if (actualContendedEnteredCount == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
                failure("Did not receive any contended entered event. ");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
            if (actualWaitCount == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                failure("Did not receive any contended monitor wait event");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
            if (actualWaitedCount == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
                failure("Did not receive any contended monitor waited event");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
         * deal with results of test
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
         * if anything has called failure("foo") testFailed will be true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        if (!testFailed) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
            println("MonitorEventTest: passed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
            throw new Exception("MonitorEventTest: failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
}