01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.debug.jdi.tests;
11:
12: import com.sun.jdi.VMDisconnectedException;
13:
14: /**
15: * Tests for JDI com.sun.jdi.event.VMDisconnectEvent.
16: */
17: public class VMDisposeTest extends AbstractJDITest {
18: /**
19: * Creates a new test.
20: */
21: public VMDisposeTest() {
22: super ();
23: }
24:
25: /**
26: * Init the fields that are used by this test only.
27: */
28: public void localSetUp() {
29: }
30:
31: /**
32: * Run all tests and output to standard output.
33: * @param args
34: */
35: public static void main(java.lang.String[] args) {
36: new VMDisposeTest().runSuite(args);
37: }
38:
39: /**
40: * Gets the name of the test case.
41: * @see junit.framework.TestCase#getName()
42: */
43: public String getName() {
44: return "com.sun.jdi.VirtualMachine.dispose";
45: }
46:
47: /**
48: * Test that we received the event.
49: */
50: public void testJDIVMDispose() {
51: fVM.dispose();
52: try {
53: fVM.allThreads();
54: assertTrue("1", false);
55: } catch (VMDisconnectedException e) {
56: }
57:
58: try {
59: // Reconnect to running VM.
60: connectToVM();
61: fVM.allThreads();
62: } catch (VMDisconnectedException e) {
63: assertTrue("3", false);
64: }
65: }
66: }
|