test/jdk/com/sun/jdi/LaunchCommandLine.java
changeset 49009 1ecb986334cb
parent 47216 71c04702a3d5
equal deleted inserted replaced
49008:d777541fceba 49009:1ecb986334cb
     1 /*
     1 /*
     2  * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    25  * @test
    25  * @test
    26  * @bug 4245011
    26  * @bug 4245011
    27  * @summary Test launcher command line construction
    27  * @summary Test launcher command line construction
    28  * @author Gordon Hirsch
    28  * @author Gordon Hirsch
    29  *
    29  *
    30  * @run build JDIScaffold VMConnection
    30  * @run build TestScaffold VMConnection
    31  * @run compile -g HelloWorld.java
    31  * @run compile -g HelloWorld.java
    32  * @run build LaunchCommandLine
    32  * @run build LaunchCommandLine
    33  *
    33  *
    34  * @run driver LaunchCommandLine
    34  * @run driver LaunchCommandLine
    35  */
    35  */
    37 import com.sun.jdi.event.*;
    37 import com.sun.jdi.event.*;
    38 import com.sun.jdi.request.*;
    38 import com.sun.jdi.request.*;
    39 
    39 
    40 import java.util.List;
    40 import java.util.List;
    41 
    41 
    42 public class LaunchCommandLine extends JDIScaffold {
    42 public class LaunchCommandLine extends TestScaffold {
    43     public static void main(String args[]) throws Exception {
    43     public static void main(String args[]) throws Exception {
    44         new LaunchCommandLine(args).startTests();
    44         new LaunchCommandLine(args).startTests();
    45     }
    45     }
    46 
    46 
    47     LaunchCommandLine(String args[]) {
    47     LaunchCommandLine(String args[]) {
    48         // args are set in code below
    48         // args are set in code below
    49         super();
    49         super(args);
    50     }
    50     }
    51 
    51 
    52     protected void runTests() throws Exception {
    52     protected void runTests() throws Exception {
    53         String[] args = new String[2];
    53         String[] args = new String[2];
    54         args[0] = "-connect";
    54         args[0] = "-connect";
    94         if (!string.equals("a b c")) {
    94         if (!string.equals("a b c")) {
    95             throw new Exception("Bad command line argument value: " + string);
    95             throw new Exception("Bad command line argument value: " + string);
    96         }
    96         }
    97 
    97 
    98         // Allow application to complete
    98         // Allow application to complete
    99         resumeToVMDeath();
    99         resumeToVMDisconnect();
   100     }
   100     }
   101 
   101 
   102 }
   102 }