< prev index next >

test/runtime/contended/Options.java

Print this page




   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   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 import jdk.test.lib.*;

  25 
  26 /*
  27  * @test
  28  * @bug     8006997
  29  * @summary ContendedPaddingWidth should be range-checked
  30  *
  31  * @library /testlibrary
  32  * @modules java.base/jdk.internal.misc
  33  *          java.management
  34  * @run main Options
  35  */
  36 public class Options {
  37 
  38     public static void main(String[] args) throws Exception {
  39         ProcessBuilder pb;
  40         OutputAnalyzer output;
  41 
  42         pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=-128", "-version");
  43         output = new OutputAnalyzer(pb.start());
  44         output.shouldContain("ContendedPaddingWidth");
  45         output.shouldContain("outside the allowed range");
  46         output.shouldHaveExitValue(1);
  47 
  48         pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=-8", "-version");
  49         output = new OutputAnalyzer(pb.start());
  50         output.shouldContain("ContendedPaddingWidth");
  51         output.shouldContain("outside the allowed range");




   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   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 import jdk.test.lib.process.ProcessTools;
  25 import jdk.test.lib.process.OutputAnalyzer;
  26 
  27 /*
  28  * @test
  29  * @bug     8006997
  30  * @summary ContendedPaddingWidth should be range-checked
  31  *
  32  * @library /test/lib
  33  * @modules java.base/jdk.internal.misc
  34  *          java.management
  35  * @run main Options
  36  */
  37 public class Options {
  38 
  39     public static void main(String[] args) throws Exception {
  40         ProcessBuilder pb;
  41         OutputAnalyzer output;
  42 
  43         pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=-128", "-version");
  44         output = new OutputAnalyzer(pb.start());
  45         output.shouldContain("ContendedPaddingWidth");
  46         output.shouldContain("outside the allowed range");
  47         output.shouldHaveExitValue(1);
  48 
  49         pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=-8", "-version");
  50         output = new OutputAnalyzer(pb.start());
  51         output.shouldContain("ContendedPaddingWidth");
  52         output.shouldContain("outside the allowed range");


< prev index next >