94 }
95
96 File zip = new File(diagnosticOutputZip).getAbsoluteFile();
97 Assert.assertTrue(zip.toString(), zip.exists());
98 try {
99 int bgv = 0;
100 int cfg = 0;
101 ZipFile dd = new ZipFile(diagnosticOutputZip);
102 List<String> entries = new ArrayList<>();
103 for (Enumeration<? extends ZipEntry> e = dd.entries(); e.hasMoreElements();) {
104 ZipEntry ze = e.nextElement();
105 String name = ze.getName();
106 entries.add(name);
107 if (name.endsWith(".bgv")) {
108 bgv++;
109 } else if (name.endsWith(".cfg")) {
110 cfg++;
111 }
112 }
113 if (bgv == 0) {
114 Assert.fail(String.format("Expected at least one .bgv file in %s: %s", diagnosticOutputZip, entries));
115 }
116 if (cfg == 0) {
117 Assert.fail(String.format("Expected at least one .cfg file in %s: %s", diagnosticOutputZip, entries));
118 }
119 } finally {
120 zip.delete();
121 }
122 }
123 }
|
94 }
95
96 File zip = new File(diagnosticOutputZip).getAbsoluteFile();
97 Assert.assertTrue(zip.toString(), zip.exists());
98 try {
99 int bgv = 0;
100 int cfg = 0;
101 ZipFile dd = new ZipFile(diagnosticOutputZip);
102 List<String> entries = new ArrayList<>();
103 for (Enumeration<? extends ZipEntry> e = dd.entries(); e.hasMoreElements();) {
104 ZipEntry ze = e.nextElement();
105 String name = ze.getName();
106 entries.add(name);
107 if (name.endsWith(".bgv")) {
108 bgv++;
109 } else if (name.endsWith(".cfg")) {
110 cfg++;
111 }
112 }
113 if (bgv == 0) {
114 Assert.fail(String.format("Expected at least one .bgv file in %s: %s%n%s", diagnosticOutputZip, entries, proc));
115 }
116 if (cfg == 0) {
117 Assert.fail(String.format("Expected at least one .cfg file in %s: %s", diagnosticOutputZip, entries));
118 }
119 } finally {
120 zip.delete();
121 }
122 }
123 }
|