Skip to content

Commit 6cc8472

Browse files
committed
8304163: Move jdk.internal.module.ModuleInfoWriter to the test library
Reviewed-by: phh Backport-of: 622f239448c2a96a74202621ee84c181d79fbde4
1 parent 9f3c646 commit 6cc8472

File tree

17 files changed

+106
-63
lines changed

17 files changed

+106
-63
lines changed

test/hotspot/jtreg/serviceability/dcmd/framework/TestProcessModuleLauncher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2023, 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,7 +21,7 @@
2121
* questions.
2222
*/
2323

24-
import jdk.internal.module.ModuleInfoWriter;
24+
import jdk.test.lib.util.ModuleInfoWriter;
2525

2626
import java.io.File;
2727
import java.io.IOException;

test/hotspot/jtreg/serviceability/dcmd/framework/VMVersionTest.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2023, 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
@@ -34,14 +34,16 @@
3434
* @test
3535
* @bug 8221730
3636
* @summary Test of diagnostic command VM.version (tests all DCMD executors)
37-
* @library /test/lib
38-
* /vmTestbase
39-
* @requires vm.flagless
40-
* @modules java.base/jdk.internal.misc
37+
* @modules java.base/jdk.internal.org.objectweb.asm
38+
* java.base/jdk.internal.org.objectweb.asm.commons
39+
* java.base/jdk.internal.misc
4140
* java.base/jdk.internal.module
4241
* java.compiler
4342
* java.management
4443
* jdk.internal.jvmstat/sun.jvmstat.monitor
44+
* @library /test/lib
45+
* /vmTestbase
46+
* @requires vm.flagless
4547
* @run testng/othervm -XX:+UsePerfData VMVersionTest
4648
*/
4749
public class VMVersionTest {

test/jdk/java/lang/ClassLoader/securityManager/ClassLoaderTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2023, 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
@@ -26,9 +26,12 @@
2626
* @bug 8168423
2727
* @summary Different types of ClassLoader running with(out) SecurityManager and
2828
* (in)valid security policy file.
29+
* @modules java.base/jdk.internal.org.objectweb.asm
30+
* java.base/jdk.internal.org.objectweb.asm.commons
31+
* java.base/jdk.internal.module
2932
* @library /test/lib
30-
* @modules java.base/jdk.internal.module
3133
* @build jdk.test.lib.util.JarUtils
34+
* jdk.test.lib.util.ModuleInfoWriter
3235
* @build TestClassLoader TestClient
3336
* @run main ClassLoaderTest -noPolicy
3437
* @run main ClassLoaderTest -validPolicy
@@ -48,9 +51,9 @@
4851
import java.util.Collections;
4952
import java.util.LinkedList;
5053
import java.util.List;
51-
import jdk.internal.module.ModuleInfoWriter;
5254
import jdk.test.lib.process.ProcessTools;
5355
import jdk.test.lib.util.JarUtils;
56+
import jdk.test.lib.util.ModuleInfoWriter;
5457

5558
public class ClassLoaderTest {
5659

test/jdk/java/lang/ModuleTests/AnnotationsTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2023, 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
@@ -36,14 +36,14 @@
3636
import java.util.List;
3737
import java.util.Set;
3838

39-
import jdk.internal.module.ModuleInfoWriter;
4039
import jdk.internal.org.objectweb.asm.AnnotationVisitor;
4140
import jdk.internal.org.objectweb.asm.Attribute;
4241
import jdk.internal.org.objectweb.asm.ClassReader;
4342
import jdk.internal.org.objectweb.asm.ClassVisitor;
4443
import jdk.internal.org.objectweb.asm.ClassWriter;
4544
import jdk.internal.org.objectweb.asm.Opcodes;
4645
import jdk.internal.org.objectweb.asm.commons.ModuleTargetAttribute;
46+
import jdk.test.lib.util.ModuleInfoWriter;
4747

4848
import org.testng.annotations.Test;
4949
import static org.testng.Assert.*;
@@ -53,6 +53,8 @@
5353
* @modules java.base/jdk.internal.org.objectweb.asm
5454
* java.base/jdk.internal.org.objectweb.asm.commons
5555
* java.base/jdk.internal.module
56+
* @library /test/lib
57+
* @build jdk.test.lib.util.ModuleInfoWriter
5658
* @run testng AnnotationsTest
5759
* @summary Basic test of annotations on modules
5860
*/

test/jdk/java/lang/module/ClassFileVersionsTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2023, 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
@@ -23,7 +23,11 @@
2323

2424
/**
2525
* @test
26-
* @modules java.base/jdk.internal.module
26+
* @modules java.base/jdk.internal.org.objectweb.asm
27+
* java.base/jdk.internal.org.objectweb.asm.commons
28+
* java.base/jdk.internal.module
29+
* @library /test/lib
30+
* @build jdk.test.lib.util.ModuleInfoWriter
2731
* @run testng ClassFileVersionsTest
2832
* @summary Test parsing of module-info.class with different class file versions
2933
*/
@@ -36,7 +40,7 @@
3640

3741
import static java.lang.module.ModuleDescriptor.Requires.Modifier.*;
3842

39-
import jdk.internal.module.ModuleInfoWriter;
43+
import jdk.test.lib.util.ModuleInfoWriter;
4044

4145
import org.testng.annotations.DataProvider;
4246
import org.testng.annotations.Test;

test/jdk/java/lang/module/ConfigurationTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2023, 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
@@ -23,10 +23,13 @@
2323

2424
/**
2525
* @test
26-
* @library /test/lib
2726
* @modules java.base/jdk.internal.access
27+
* java.base/jdk.internal.org.objectweb.asm
28+
* java.base/jdk.internal.org.objectweb.asm.commons
2829
* java.base/jdk.internal.module
30+
* @library /test/lib
2931
* @build ConfigurationTest
32+
* jdk.test.lib.util.ModuleInfoWriter
3033
* jdk.test.lib.util.ModuleUtils
3134
* @run testng ConfigurationTest
3235
* @summary Basic tests for java.lang.module.Configuration
@@ -47,10 +50,10 @@
4750
import java.util.List;
4851
import java.util.Set;
4952

53+
import jdk.test.lib.util.ModuleInfoWriter;
5054
import jdk.test.lib.util.ModuleUtils;
5155

5256
import jdk.internal.access.SharedSecrets;
53-
import jdk.internal.module.ModuleInfoWriter;
5457
import jdk.internal.module.ModuleTarget;
5558
import org.testng.annotations.DataProvider;
5659
import org.testng.annotations.Test;

test/jdk/java/lang/module/ModuleDescriptorTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2023, 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
@@ -24,7 +24,11 @@
2424
/**
2525
* @test
2626
* @modules java.base/jdk.internal.access
27+
* java.base/jdk.internal.org.objectweb.asm
28+
* java.base/jdk.internal.org.objectweb.asm.commons
2729
* java.base/jdk.internal.module
30+
* @library /test/lib
31+
* @build jdk.test.lib.util.ModuleInfoWriter
2832
* @run testng ModuleDescriptorTest
2933
* @summary Basic test for java.lang.module.ModuleDescriptor and its builder
3034
*/
@@ -56,7 +60,7 @@
5660

5761
import jdk.internal.access.JavaLangModuleAccess;
5862
import jdk.internal.access.SharedSecrets;
59-
import jdk.internal.module.ModuleInfoWriter;
63+
import jdk.test.lib.util.ModuleInfoWriter;
6064
import org.testng.annotations.DataProvider;
6165
import org.testng.annotations.Test;
6266
import static org.testng.Assert.*;

test/jdk/java/lang/module/ModuleFinderTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2023, 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
@@ -23,8 +23,11 @@
2323

2424
/**
2525
* @test
26-
* @modules java.base/jdk.internal.module
27-
* @build ModuleFinderTest
26+
* @modules java.base/jdk.internal.org.objectweb.asm
27+
* java.base/jdk.internal.org.objectweb.asm.commons
28+
* java.base/jdk.internal.module
29+
* @library /test/lib
30+
* @build ModuleFinderTest jdk.test.lib.util.ModuleInfoWriter
2831
* @run testng ModuleFinderTest
2932
* @summary Basic tests for java.lang.module.ModuleFinder
3033
*/
@@ -45,7 +48,7 @@
4548
import java.util.jar.JarOutputStream;
4649
import java.util.stream.Collectors;
4750

48-
import jdk.internal.module.ModuleInfoWriter;
51+
import jdk.test.lib.util.ModuleInfoWriter;
4952

5053
import org.testng.annotations.Test;
5154
import static org.testng.Assert.*;

test/jdk/java/lang/module/ModuleNamesTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2023, 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
@@ -24,7 +24,11 @@
2424
/**
2525
* @test
2626
* @modules java.base/jdk.internal.access
27+
* java.base/jdk.internal.org.objectweb.asm
28+
* java.base/jdk.internal.org.objectweb.asm.commons
2729
* java.base/jdk.internal.module
30+
* @library /test/lib
31+
* @build jdk.test.lib.util.ModuleInfoWriter
2832
* @run testng ModuleNamesTest
2933
* @summary Basic test of reading a module-info.class with module names that
3034
* are legal in class files but not legal in the Java Language
@@ -42,7 +46,8 @@
4246
import java.util.Set;
4347

4448
import jdk.internal.access.SharedSecrets;
45-
import jdk.internal.module.ModuleInfoWriter;
49+
50+
import jdk.test.lib.util.ModuleInfoWriter;
4651

4752
import org.testng.annotations.DataProvider;
4853
import org.testng.annotations.Test;

test/jdk/java/lang/module/MultiReleaseJarTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2023, 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
@@ -23,9 +23,13 @@
2323

2424
/**
2525
* @test
26+
* @modules java.base/jdk.internal.org.objectweb.asm
27+
* java.base/jdk.internal.org.objectweb.asm.commons
28+
* java.base/jdk.internal.module
2629
* @library /test/lib
27-
* @modules java.base/jdk.internal.module
28-
* @build MultiReleaseJarTest jdk.test.lib.util.JarUtils
30+
* @build MultiReleaseJarTest
31+
* jdk.test.lib.util.JarUtils
32+
* jdk.test.lib.util.ModuleInfoWriter
2933
* @run testng MultiReleaseJarTest
3034
* @run testng/othervm -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarTest
3135
* @summary Basic test of modular JARs as multi-release JARs
@@ -54,7 +58,7 @@
5458
import java.util.jar.Attributes;
5559
import java.util.jar.Manifest;
5660

57-
import jdk.internal.module.ModuleInfoWriter;
61+
import jdk.test.lib.util.ModuleInfoWriter;
5862
import jdk.test.lib.util.JarUtils;
5963

6064
import org.testng.annotations.Test;

0 commit comments

Comments
 (0)