< prev index next >

test/hotspot/jtreg/runtime/contended/Options.java

Print this page
rev 59076 : [mq]: 8243945


  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");
  53         output.shouldHaveExitValue(1);
  54 
  55         pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=-1", "-version");




  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 driver 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");
  53         output.shouldHaveExitValue(1);
  54 
  55         pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=-1", "-version");


< prev index next >