Skip to content

Commit d7e852c

Browse files
committed
8209930: Refactor java/util/zip/ZipFile/deletetempjar.sh to plain java test
Backport-of: 6c7a19d
1 parent bb15820 commit d7e852c

File tree

3 files changed

+52
-52
lines changed

3 files changed

+52
-52
lines changed

test/jdk/java/util/zip/ZipFile/DeleteTempJar.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -21,16 +21,6 @@
2121
* questions.
2222
*/
2323

24-
/* @test
25-
@bug 4166799
26-
@summary Make sure URL-downloaded jar files (jar_cache files)
27-
will be deleted when VM exits.
28-
29-
@modules jdk.httpserver
30-
@build DeleteTempJar
31-
@run shell deletetempjar.sh
32-
*/
33-
3424
import java.io.File;
3525
import java.io.FileInputStream;
3626
import java.io.FileOutputStream;
@@ -106,6 +96,5 @@ static boolean equal(Object x, Object y) {
10696
else return fail(x + " not equal to " + y);}
10797
public static void main(String[] args) throws Throwable {
10898
try {realMain(args);} catch (Throwable t) {unexpected(t);}
109-
System.out.println("\nPassed = " + passed + " failed = " + failed);
11099
if (failed > 0) throw new AssertionError("Some tests failed");}
111100
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
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
7+
* published by the Free Software Foundation.
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+
/*
25+
* @test
26+
* @bug 4166799
27+
* @summary Make sure URL-downloaded jar files (jar_cache files)
28+
* will be deleted when VM exits.
29+
* @modules jdk.httpserver
30+
* @library /test/lib
31+
* @build jdk.test.lib.process.*
32+
* DeleteTempJar
33+
* @run main DeleteTempJarTest
34+
*/
35+
36+
import java.nio.file.Files;
37+
import java.nio.file.Paths;
38+
39+
import jdk.test.lib.process.ProcessTools;
40+
import jdk.test.lib.Asserts;
41+
42+
public class DeleteTempJarTest {
43+
44+
public static void main(String[] args) throws Exception {
45+
String tmpFile = ProcessTools.executeTestJvm(DeleteTempJar.class.getName())
46+
.shouldHaveExitValue(0)
47+
.getStdout();
48+
49+
Asserts.assertFalse(Files.exists(Paths.get(tmpFile.trim())));
50+
}
51+
}

test/jdk/java/util/zip/ZipFile/deletetempjar.sh

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)