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 /lib/testlibrary
28 * @build jdk.testlibrary.FileUtils
29 * @run main MultiThreadedReadTest
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.testlibrary.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;
48
49 public static void main(String args[]) throws Exception {
|
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 /lib/testlibrary
28 * @build jdk.testlibrary.FileUtils
29 * @run main MultiThreadedReadTest
30 * @key randomness
31 */
32
33 import java.io.File;
34 import java.io.FileOutputStream;
35 import java.io.InputStream;
36 import java.nio.file.Paths;
37 import java.util.Random;
38 import java.util.zip.ZipEntry;
39 import java.util.zip.ZipFile;
40 import java.util.zip.ZipOutputStream;
41 import jdk.testlibrary.FileUtils;
42
43 public class MultiThreadedReadTest extends Thread {
44
45 private static final int NUM_THREADS = 10;
46 private static final String ZIPFILE_NAME = "large.zip";
47 private static final String ZIPENTRY_NAME = "random.txt";
48 private static InputStream is = null;
49
50 public static void main(String args[]) throws Exception {
|