< prev index next >

test/java/io/InputStream/ReadAllBytes.java

Print this page
rev 17325 : 8181761: add explicit @build actions for jdk.test.lib classes in all :tier2 tests
Reviewed-by: duke


  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 java.io.ByteArrayInputStream;
  25 import java.io.FilterInputStream;
  26 import java.io.IOException;
  27 import java.io.InputStream;
  28 import java.util.Arrays;
  29 import java.util.Random;
  30 import jdk.test.lib.RandomFactory;
  31 
  32 /*
  33  * @test
  34  * @bug 8080835
  35  * @library /test/lib

  36  * @run main ReadAllBytes
  37  * @summary Basic test for InputStream.readAllBytes
  38  * @key randomness
  39  */
  40 
  41 public class ReadAllBytes {
  42 
  43     private static Random generator = RandomFactory.getRandom();
  44 
  45     public static void main(String[] args) throws IOException {
  46         test(new byte[]{});
  47         test(new byte[]{1, 2, 3});
  48         test(createRandomBytes(1024));
  49         test(createRandomBytes((1 << 13) - 1));
  50         test(createRandomBytes((1 << 13)));
  51         test(createRandomBytes((1 << 13) + 1));
  52         test(createRandomBytes((1 << 15) - 1));
  53         test(createRandomBytes((1 << 15)));
  54         test(createRandomBytes((1 << 15) + 1));
  55         test(createRandomBytes((1 << 17) - 1));




  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 java.io.ByteArrayInputStream;
  25 import java.io.FilterInputStream;
  26 import java.io.IOException;
  27 import java.io.InputStream;
  28 import java.util.Arrays;
  29 import java.util.Random;
  30 import jdk.test.lib.RandomFactory;
  31 
  32 /*
  33  * @test
  34  * @bug 8080835
  35  * @library /test/lib
  36  * @build jdk.test.lib.RandomFactory
  37  * @run main ReadAllBytes
  38  * @summary Basic test for InputStream.readAllBytes
  39  * @key randomness
  40  */
  41 
  42 public class ReadAllBytes {
  43 
  44     private static Random generator = RandomFactory.getRandom();
  45 
  46     public static void main(String[] args) throws IOException {
  47         test(new byte[]{});
  48         test(new byte[]{1, 2, 3});
  49         test(createRandomBytes(1024));
  50         test(createRandomBytes((1 << 13) - 1));
  51         test(createRandomBytes((1 << 13)));
  52         test(createRandomBytes((1 << 13) + 1));
  53         test(createRandomBytes((1 << 15) - 1));
  54         test(createRandomBytes((1 << 15)));
  55         test(createRandomBytes((1 << 15) + 1));
  56         test(createRandomBytes((1 << 17) - 1));


< prev index next >