< prev index next >

test/java/util/zip/ZipFile/MultiThreadedReadTest.java

Print this page
rev 17324 : 8181759: add explicit @build actions for jdk.test.lib classes in all :tier1 tests
Reviewed-by: duke
rev 17325 : imported patch 8181759-1


   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 /* @test
  25  * @bug 8038491
  26  * @summary Crash in ZipFile.read() when ZipFileInputStream is shared between threads
  27  * @library /test/lib


  28  * @run main MultiThreadedReadTest
  29  * @key randomness
  30  */
  31 
  32 import java.io.File;
  33 import java.io.FileOutputStream;
  34 import java.io.InputStream;
  35 import java.nio.file.Paths;
  36 import java.util.Random;
  37 import java.util.zip.ZipEntry;
  38 import java.util.zip.ZipFile;
  39 import java.util.zip.ZipOutputStream;
  40 import jdk.test.lib.util.FileUtils;
  41 
  42 public class MultiThreadedReadTest extends Thread {
  43 
  44     private static final int NUM_THREADS = 10;
  45     private static final String ZIPFILE_NAME = "large.zip";
  46     private static final String ZIPENTRY_NAME = "random.txt";
  47     private static InputStream is = null;




   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 /* @test
  25  * @bug 8038491
  26  * @summary Crash in ZipFile.read() when ZipFileInputStream is shared between threads
  27  * @library /test/lib
  28  * @build jdk.test.lib.Platform
  29  *        jdk.test.lib.util.FileUtils
  30  * @run main MultiThreadedReadTest
  31  * @key randomness
  32  */
  33 
  34 import java.io.File;
  35 import java.io.FileOutputStream;
  36 import java.io.InputStream;
  37 import java.nio.file.Paths;
  38 import java.util.Random;
  39 import java.util.zip.ZipEntry;
  40 import java.util.zip.ZipFile;
  41 import java.util.zip.ZipOutputStream;
  42 import jdk.test.lib.util.FileUtils;
  43 
  44 public class MultiThreadedReadTest extends Thread {
  45 
  46     private static final int NUM_THREADS = 10;
  47     private static final String ZIPFILE_NAME = "large.zip";
  48     private static final String ZIPENTRY_NAME = "random.txt";
  49     private static InputStream is = null;


< prev index next >