< prev index next >

test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java

Print this page
rev 59076 : [mq]: 8243945


  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  * @summary Verify jcmd error message for out-of-range value and for
  27  *          value which is not allowed by constraint. Also check that
  28  *          jcmd does not print an error message to the target process output.
  29  * @library /test/lib
  30  * @modules java.base/jdk.internal.misc
  31  *          java.management
  32  *          jdk.management
  33  * @run main TestJcmdOutput
  34  */
  35 
  36 import jdk.test.lib.Asserts;
  37 import jdk.test.lib.management.DynamicVMOption;
  38 import jdk.test.lib.process.OutputAnalyzer;
  39 import jdk.test.lib.process.ProcessTools;
  40 import jdk.test.lib.dcmd.PidJcmdExecutor;
  41 
  42 public class TestJcmdOutput {
  43 
  44     /* Message printed by jcmd for value which is out-of-range */
  45     static final String JCMD_OUT_OF_RANGE_MESSAGE = "error: must have value in range";
  46     /* Message printed by jcmd for value which is not allowed by constraint */
  47     static final String JCMD_CONSTRAINT_MESSAGE = "value violates its flag's constraint";
  48 
  49     public static void main(String[] args) throws Exception {
  50         OutputAnalyzer output;
  51 
  52         System.out.println("Verify jcmd error message and that jcmd does not write errors to the target process output");
  53         output = new OutputAnalyzer((ProcessTools.createJavaProcessBuilder(




  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  * @summary Verify jcmd error message for out-of-range value and for
  27  *          value which is not allowed by constraint. Also check that
  28  *          jcmd does not print an error message to the target process output.
  29  * @library /test/lib
  30  * @modules java.base/jdk.internal.misc
  31  *          java.management
  32  *          jdk.management
  33  * @run driver TestJcmdOutput
  34  */
  35 
  36 import jdk.test.lib.Asserts;
  37 import jdk.test.lib.management.DynamicVMOption;
  38 import jdk.test.lib.process.OutputAnalyzer;
  39 import jdk.test.lib.process.ProcessTools;
  40 import jdk.test.lib.dcmd.PidJcmdExecutor;
  41 
  42 public class TestJcmdOutput {
  43 
  44     /* Message printed by jcmd for value which is out-of-range */
  45     static final String JCMD_OUT_OF_RANGE_MESSAGE = "error: must have value in range";
  46     /* Message printed by jcmd for value which is not allowed by constraint */
  47     static final String JCMD_CONSTRAINT_MESSAGE = "value violates its flag's constraint";
  48 
  49     public static void main(String[] args) throws Exception {
  50         OutputAnalyzer output;
  51 
  52         System.out.println("Verify jcmd error message and that jcmd does not write errors to the target process output");
  53         output = new OutputAnalyzer((ProcessTools.createJavaProcessBuilder(


< prev index next >