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.request.WatchpointRequest;
13:
14: /**
15: * Tests for JDI com.sun.jdi.request.WatchpointRequest.
16: */
17: public class WatchpointRequestTest extends AbstractJDITest {
18:
19: private WatchpointRequest fAccessWatchpointRequest,
20: fModificationWatchpointRequest;
21:
22: /**
23: * Creates a new test .
24: */
25: public WatchpointRequestTest() {
26: super ();
27: }
28:
29: /**
30: * Init the fields that are used by this test only.
31: */
32: public void localSetUp() {
33: // Get an acces watchpoint request
34: fAccessWatchpointRequest = getAccessWatchpointRequest();
35:
36: // Get a modification watchpoint request
37: fModificationWatchpointRequest = getModificationWatchpointRequest();
38: }
39:
40: /**
41: * Make sure the test leaves the VM in the same state it found it.
42: */
43: public void localTearDown() {
44: // Delete the watchpoint requests we created in this test
45: fVM.eventRequestManager().deleteEventRequest(
46: fAccessWatchpointRequest);
47: fVM.eventRequestManager().deleteEventRequest(
48: fModificationWatchpointRequest);
49: }
50:
51: /**
52: * Run all tests and output to standard output.
53: * @param args
54: */
55: public static void main(java.lang.String[] args) {
56: new WatchpointRequestTest().runSuite(args);
57: }
58:
59: /**
60: * Gets the name of the test case.
61: * @see junit.framework.TestCase#getName()
62: */
63: public String getName() {
64: return "com.sun.jdi.request.WatchpointRequest";
65: }
66:
67: /**
68: * Test JDI field().
69: */
70: public void testJDIField() {
71: assertEquals("1", getField("fBool"), fAccessWatchpointRequest
72: .field());
73: assertEquals("2", getField("fBool"),
74: fModificationWatchpointRequest.field());
75: }
76: }
|