test/java/io/BufferedInputStream/LargeCopyWithMark.java

Print this page
rev 9529 : 8034960: Serviceability tests using @library failing with java.lang.NoClassDefFoundError


   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 /* @test
  25  * @bug 7129312
  26  * @summary BufferedInputStream calculates negative array size with large
  27  *          streams and mark
  28  * @library /lib/testlibrary

  29  * @run main/othervm LargeCopyWithMark
  30  */
  31 
  32 import java.io.BufferedInputStream;
  33 import java.io.IOException;
  34 import java.io.InputStream;
  35 import java.io.OutputStream;
  36 import static jdk.testlibrary.ProcessTools.*;
  37 
  38 
  39 public class LargeCopyWithMark {
  40 
  41     public static void main(String[] args) throws Exception {
  42         if (! System.getProperty("os.arch").contains("64")) {
  43             System.out.println("Test runs on 64 bit platforms");
  44             return;
  45         }
  46         ProcessBuilder pb = createJavaProcessBuilder("-Xmx4G",
  47                 "-ea:LargeCopyWithMark$Child",
  48                 "LargeCopyWithMark$Child");




   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 /* @test
  25  * @bug 7129312
  26  * @summary BufferedInputStream calculates negative array size with large
  27  *          streams and mark
  28  * @library /lib/testlibrary
  29  * @build jdk.testlibrary.*
  30  * @run main/othervm LargeCopyWithMark
  31  */
  32 
  33 import java.io.BufferedInputStream;
  34 import java.io.IOException;
  35 import java.io.InputStream;
  36 import java.io.OutputStream;
  37 import static jdk.testlibrary.ProcessTools.*;
  38 
  39 
  40 public class LargeCopyWithMark {
  41 
  42     public static void main(String[] args) throws Exception {
  43         if (! System.getProperty("os.arch").contains("64")) {
  44             System.out.println("Test runs on 64 bit platforms");
  45             return;
  46         }
  47         ProcessBuilder pb = createJavaProcessBuilder("-Xmx4G",
  48                 "-ea:LargeCopyWithMark$Child",
  49                 "LargeCopyWithMark$Child");