< prev index next >

test/runtime/CompressedOops/CompressedClassSpaceSize.java

Print this page




   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 /*
  25  * @test
  26  * @bug 8022865
  27  * @summary Tests for the -XX:CompressedClassSpaceSize command line option
  28  * @library /testlibrary

  29  * @run main CompressedClassSpaceSize
  30  */
  31 import com.oracle.java.testlibrary.*;
  32 
  33 public class CompressedClassSpaceSize {
  34 
  35     public static void main(String[] args) throws Exception {
  36         ProcessBuilder pb;
  37         OutputAnalyzer output;
  38         if (Platform.is64bit()) {
  39             // Minimum size is 1MB
  40             pb = ProcessTools.createJavaProcessBuilder("-XX:CompressedClassSpaceSize=0",
  41                                                        "-version");
  42             output = new OutputAnalyzer(pb.start());
  43             output.shouldContain("CompressedClassSpaceSize of 0 is invalid")
  44                   .shouldHaveExitValue(1);
  45 
  46             // Invalid size of -1 should be handled correctly
  47             pb = ProcessTools.createJavaProcessBuilder("-XX:CompressedClassSpaceSize=-1",
  48                                                        "-version");




   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 /*
  25  * @test
  26  * @bug 8022865
  27  * @summary Tests for the -XX:CompressedClassSpaceSize command line option
  28  * @library /testlibrary
  29  * @build com.oracle.java.testlibrary.*
  30  * @run main CompressedClassSpaceSize
  31  */
  32 import com.oracle.java.testlibrary.*;
  33 
  34 public class CompressedClassSpaceSize {
  35 
  36     public static void main(String[] args) throws Exception {
  37         ProcessBuilder pb;
  38         OutputAnalyzer output;
  39         if (Platform.is64bit()) {
  40             // Minimum size is 1MB
  41             pb = ProcessTools.createJavaProcessBuilder("-XX:CompressedClassSpaceSize=0",
  42                                                        "-version");
  43             output = new OutputAnalyzer(pb.start());
  44             output.shouldContain("CompressedClassSpaceSize of 0 is invalid")
  45                   .shouldHaveExitValue(1);
  46 
  47             // Invalid size of -1 should be handled correctly
  48             pb = ProcessTools.createJavaProcessBuilder("-XX:CompressedClassSpaceSize=-1",
  49                                                        "-version");


< prev index next >