< prev index next >

test/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java

Print this page




  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  * @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 /testlibrary



  30  * @run main TestJcmdOutput
  31  */
  32 
  33 import jdk.test.lib.Asserts;
  34 import jdk.test.lib.DynamicVMOption;
  35 import jdk.test.lib.OutputAnalyzer;
  36 import jdk.test.lib.ProcessTools;
  37 import jdk.test.lib.dcmd.PidJcmdExecutor;
  38 
  39 public class TestJcmdOutput {
  40 
  41     /* Message printed by jcmd for value which is out-of-range */
  42     static final String JCMD_OUT_OF_RANGE_MESSAGE = "error: must have value in range";
  43     /* Message printed by jcmd for value which is not allowed by constraint */
  44     static final String JCMD_CONSTRAINT_MESSAGE = "value violates its flag's constraint";
  45 
  46     public static void main(String[] args) throws Exception {
  47         OutputAnalyzer output;
  48 
  49         System.out.println("Verify jcmd error message and that jcmd does not write errors to the target process output");




  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  * @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 /testlibrary
  30  * @modules java.base/sun.misc
  31  *          java.management
  32  *          jdk.management
  33  * @run main TestJcmdOutput
  34  */
  35 
  36 import jdk.test.lib.Asserts;
  37 import jdk.test.lib.DynamicVMOption;
  38 import jdk.test.lib.OutputAnalyzer;
  39 import jdk.test.lib.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");


< prev index next >