8211974: move test/jdk/lib/testlibrary/java/util/jar/*.java to top-level library or a local library

Reviewed-by: rriggs, bchristi, lancea, iignatyev
This commit is contained in:
Ivan Sipka 2020-07-08 20:35:36 +01:00 committed by Igor Ignatyev
parent e5c43ab86e
commit dda0c6cecd
12 changed files with 61 additions and 34 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -29,11 +29,13 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import jdk.test.lib.util.JarBuilder;
/*
* @test
* @bug 8174151
* @summary Test for java.protocol.handler.pkgs with jar protocol handler
* @library /lib/testlibrary/java/util/jar
* @library /test/lib/
* @build jdk.test.lib.util.JarBuilder
* @compile handlers/jar/Handler.java
* @run main/othervm -Djava.protocol.handler.pkgs=handlers JarHandlerPkgPrefix
*/
@ -62,4 +64,5 @@ public class JarHandlerPkgPrefix {
Files.delete(jarPath);
}
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -21,14 +21,13 @@
* questions.
*/
/**
/*
* @test
* @bug 8186334
* @library /lib/testlibrary/java/util/jar
* @build JarBuilder
* @summary Make sure scanning manifest doesn't throw AIOOBE on certain strings containing backticks.
* @library /test/lib/
* @build jdk.test.lib.util.JarBuilder
* @run testng JarBacktickManifest
* @summary Make sure scanning manifest doesn't throw AIOOBE on certain strings
* containing backticks.
*/
import java.io.File;
@ -41,6 +40,8 @@ import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import jdk.test.lib.util.JarBuilder;
public class JarBacktickManifest {
public static final String VERIFY_MANIFEST_JAR = "verifyManifest.jar";

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -28,7 +28,9 @@
* support multi-release jar files
* @library /lib/testlibrary/java/util/jar /test/lib
* @build jdk.test.lib.RandomFactory
* Compiler JarBuilder CreateMultiReleaseTestJars
* CreateMultiReleaseTestJars
* jdk.test.lib.compiler.Compiler
* jdk.test.lib.util.JarBuilder
* @run testng MultiReleaseJarAPI
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -29,7 +29,10 @@
* @modules jdk.jartool
* jdk.compiler
* jdk.httpserver
* @build Compiler JarBuilder CreateMultiReleaseTestJars SimpleHttpServer
* @build CreateMultiReleaseTestJars
* SimpleHttpServer
* jdk.test.lib.compiler.Compiler
* jdk.test.lib.util.JarBuilder
* @run testng MultiReleaseJarHttpProperties
* @run testng/othervm -Djdk.util.jar.version=0 MultiReleaseJarHttpProperties
* @run testng/othervm -Djdk.util.jar.version=8 MultiReleaseJarHttpProperties

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,8 +25,10 @@
* @test
* @bug 8132734 8144062 8194070
* @summary Test the System properties for JarFile that support multi-release jar files
* @library /lib/testlibrary/java/util/jar
* @build Compiler JarBuilder CreateMultiReleaseTestJars
* @library /lib/testlibrary/java/util/jar /test/lib/
* @build CreateMultiReleaseTestJars
* jdk.test.lib.compiler.Compiler
* jdk.test.lib.util.JarBuilder
* @run testng MultiReleaseJarProperties
* @run testng/othervm -Djdk.util.jar.version=0 MultiReleaseJarProperties
* @run testng/othervm -Djdk.util.jar.version=8 MultiReleaseJarProperties

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,8 +25,10 @@
* @test
* @bug 8132734 8144062
* @summary Test potential security related issues
* @library /lib/testlibrary/java/util/jar
* @build Compiler JarBuilder CreateMultiReleaseTestJars
* @library /lib/testlibrary/java/util/jar /test/lib/
* @build CreateMultiReleaseTestJars
* jdk.test.lib.compiler.Compiler
* jdk.test.lib.util.JarBuilder
* @run testng MultiReleaseJarSecurity
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,10 +25,11 @@
* @test
* @bug 8164389 8222440
* @summary walk entries in a multi-release jar file via jdk.zipfs
* @library /lib/testlibrary/java/util/jar
* @modules jdk.jartool
* jdk.zipfs
* @build Compiler JarBuilder
* @library /test/lib/
* @build jdk.test.lib.util.JarBuilder
* jdk.test.lib.compiler.Compiler
* @run testng JFSTester
*/
@ -49,6 +50,8 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import jdk.test.lib.util.JarBuilder;
public class JFSTester {
private URI jarURI;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,11 +25,13 @@
* @test
* @bug 8144355 8144062 8176709 8194070 8193802 8231093
* @summary Test aliasing additions to ZipFileSystem for multi-release jar files
* @library /lib/testlibrary/java/util/jar
* @library /lib/testlibrary/java/util/jar /test/lib/
* @modules jdk.compiler
* jdk.jartool
* jdk.zipfs
* @build Compiler JarBuilder CreateMultiReleaseTestJars
* @build CreateMultiReleaseTestJars
* jdk.test.lib.util.JarBuilder
* jdk.test.lib.compiler.Compiler
* @run testng MultiReleaseJarTest
*/
@ -47,6 +49,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.testng.Assert;
import org.testng.annotations.*;
import jdk.test.lib.util.JarBuilder;
public class MultiReleaseJarTest {
final private int MAJOR_VERSION = Runtime.version().feature();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -37,6 +37,9 @@ import java.util.Map;
import java.util.zip.ZipFile;
import jdk.security.jarsigner.JarSigner;
import jdk.test.lib.util.JarBuilder;
import jdk.test.lib.compiler.Compiler;
public class CreateMultiReleaseTestJars {
final private String main =
"package version;\n\n"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -29,7 +29,10 @@
* @modules jdk.compiler
* jdk.httpserver
* jdk.jartool
* @build Compiler JarBuilder CreateMultiReleaseTestJars SimpleHttpServer
* @build CreateMultiReleaseTestJars
* SimpleHttpServer
* jdk.test.lib.util.JarBuilder
* jdk.test.lib.compiler.Compiler
* @run testng MultiReleaseJarURLConnection
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -20,6 +20,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.test.lib.compiler;
import javax.tools.*;
import java.io.ByteArrayOutputStream;
@ -31,15 +32,15 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
class Compiler {
public class Compiler {
final private Map<String,String> input;
private List<String> options;
Compiler(Map<String,String> input) {
public Compiler(Map<String,String> input) {
this.input = input;
}
Compiler setRelease(int release) {
public Compiler setRelease(int release) {
// Setting the -release option does not work for some reason
// so do it the old fashioned way
// options = Arrays.asList("-release", String.valueOf(release));
@ -48,7 +49,7 @@ class Compiler {
return this;
}
Map<String,byte[]> compile() {
public Map<String,byte[]> compile() {
List<SourceFileObject> cunits = createCompilationUnits();
Map<String,ClassFileObject> cfos = createClassFileObjects();
JavaCompiler jc = ToolProvider.getSystemJavaCompiler();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -20,6 +20,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.test.lib.util;
import java.io.IOException;
import java.io.OutputStream;