9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 4425852
27 * @author Robert Field
28 *
29 * @modules jdk.jdi
30 * @run build VMConnection
31 * @run compile -g EventQueueDisconnectTest.java
32 * @run driver EventQueueDisconnectTest
33 *
34 * @summary EventQueueDisconnectTest checks to see that
35 * VMDisconnectedException is never thrown before VMDisconnectEvent.
36 *
37 * Failure mode for this test is throwing VMDisconnectedException
38 * on vm.eventQueue().remove();
39 * Does not use a scaffold since we don't want that hiding the exception.
40 */
41 import com.sun.jdi.*;
42 import com.sun.jdi.event.*;
43 import com.sun.jdi.request.*;
44
45
46 /********** target program **********/
47
48 class EventQueueDisconnectTarg {
49 public static void main(String args[]) {
50 for (int i=0; i < 10; ++i) {
51 Say(i);
52 }
53 }
54 static void Say(int what) {
55 System.out.println("Say " + what);
56 }
57 }
58
59 /********** test program **********/
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 4425852
27 * @author Robert Field
28 *
29 * @summary EventQueueDisconnectTest checks to see that
30 * VMDisconnectedException is never thrown before VMDisconnectEvent.
31 *
32 * Failure mode for this test is throwing VMDisconnectedException
33 * on vm.eventQueue().remove();
34 * Does not use a scaffold since we don't want that hiding the exception.
35 *
36 * @run build VMConnection
37 * @run compile -g EventQueueDisconnectTest.java
38 * @run driver EventQueueDisconnectTest
39 */
40 import com.sun.jdi.*;
41 import com.sun.jdi.event.*;
42 import com.sun.jdi.request.*;
43
44
45 /********** target program **********/
46
47 class EventQueueDisconnectTarg {
48 public static void main(String args[]) {
49 for (int i=0; i < 10; ++i) {
50 Say(i);
51 }
52 }
53 static void Say(int what) {
54 System.out.println("Say " + what);
55 }
56 }
57
58 /********** test program **********/
|