73 74 private static final SimpleDateFormat timeStampFormat = 75 new SimpleDateFormat("HH'h'mm'm'ss's'SSS"); 76 77 private static final String timeoutFactor = 78 System.getProperty("test.timeout.factor", "1.0"); 79 80 private static String currentArchiveName; 81 82 // Call this method to start new archive with new unique name 83 public static void startNewArchiveName() { 84 deletePriorArchives(); 85 currentArchiveName = getNewArchiveName(); 86 } 87 88 // Call this method to get current archive name 89 public static String getCurrentArchiveName() { 90 return currentArchiveName; 91 } 92 93 public static String getNewArchiveName() { 94 return getNewArchiveName(null); 95 } 96 97 public static String getNewArchiveName(String stem) { 98 if (stem == null) { 99 stem = "appcds"; 100 } 101 return JSA_FILE_PREFIX + stem + "-" + 102 timeStampFormat.format(new Date()) + ".jsa"; 103 } 104 105 // Attempt to clean old archives to preserve space 106 // Archives are large artifacts (20Mb or more), and much larger than 107 // most other artifacts created in jtreg testing. 108 // Therefore it is a good idea to clean the old archives when they are not needed. 109 // In most cases the deletion attempt will succeed; on rare occasion the 110 // delete operation will fail since the system or VM process still holds a handle 111 // to the file; in such cases the File.delete() operation will silently fail, w/o 112 // throwing an exception, thus allowing testing to continue. | 73 74 private static final SimpleDateFormat timeStampFormat = 75 new SimpleDateFormat("HH'h'mm'm'ss's'SSS"); 76 77 private static final String timeoutFactor = 78 System.getProperty("test.timeout.factor", "1.0"); 79 80 private static String currentArchiveName; 81 82 // Call this method to start new archive with new unique name 83 public static void startNewArchiveName() { 84 deletePriorArchives(); 85 currentArchiveName = getNewArchiveName(); 86 } 87 88 // Call this method to get current archive name 89 public static String getCurrentArchiveName() { 90 return currentArchiveName; 91 } 92 93 public static void setCurrentArchiveName(String archiveName) { 94 currentArchiveName = archiveName; 95 } 96 97 public static String getNewArchiveName() { 98 return getNewArchiveName(null); 99 } 100 101 public static String getNewArchiveName(String stem) { 102 if (stem == null) { 103 stem = "appcds"; 104 } 105 return JSA_FILE_PREFIX + stem + "-" + 106 timeStampFormat.format(new Date()) + ".jsa"; 107 } 108 109 // Attempt to clean old archives to preserve space 110 // Archives are large artifacts (20Mb or more), and much larger than 111 // most other artifacts created in jtreg testing. 112 // Therefore it is a good idea to clean the old archives when they are not needed. 113 // In most cases the deletion attempt will succeed; on rare occasion the 114 // delete operation will fail since the system or VM process still holds a handle 115 // to the file; in such cases the File.delete() operation will silently fail, w/o 116 // throwing an exception, thus allowing testing to continue. |