jdk/test/java/util/zip/ZipFile/ReadLongZipFileName.java
changeset 22044 2ec604347e5d
parent 5506 202f599c92aa
child 45286 cd809e28c082
equal deleted inserted replaced
22043:e77b5937792c 22044:2ec604347e5d
     1 /*
     1 /*
     2  * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    22  */
    22  */
    23 
    23 
    24 /**
    24 /**
    25  * @test
    25  * @test
    26  * @bug 6374379
    26  * @bug 6374379
       
    27  * @library ../../../../lib/testlibrary
    27  * @summary Verify that we can read zip file names > 255 chars long
    28  * @summary Verify that we can read zip file names > 255 chars long
    28  */
    29  */
    29 
    30 
    30 import java.io.*;
    31 import java.io.*;
    31 import java.util.jar.*;
    32 import java.util.jar.*;
    32 import java.util.zip.*;
    33 import java.util.zip.*;
    33 import java.util.Stack;
    34 import java.util.Stack;
       
    35 import jdk.testlibrary.FileUtils;
    34 
    36 
    35 public class ReadLongZipFileName {
    37 public class ReadLongZipFileName {
    36     private static String entryName = "testFile.txt";;
    38     private static String entryName = "testFile.txt";;
    37 
    39 
    38     public static void realMain(String args[]) {
    40     public static void realMain(String args[]) {
    99             check(myJarFile.delete());
   101             check(myJarFile.delete());
   100         }
   102         }
   101 
   103 
   102         while (! directories.empty()) {
   104         while (! directories.empty()) {
   103             File f = directories.pop();
   105             File f = directories.pop();
   104             check(f.delete());
   106             try {
       
   107                 FileUtils.deleteFileWithRetry(f.toPath());
       
   108             } catch (IOException e) {
       
   109                 unexpected(e, "Fail to clean up directory, " + f);
       
   110                 break;
       
   111             }
   105         }
   112         }
   106     }
   113     }
   107 
   114 
   108     //--------------------- Infrastructure ---------------------------
   115     //--------------------- Infrastructure ---------------------------
   109     static volatile int passed = 0, failed = 0;
   116     static volatile int passed = 0, failed = 0;