Skip to content

Commit 622f239

Browse files
author
Mandy Chung
committed
8304163: Move jdk.internal.module.ModuleInfoWriter to the test library
Reviewed-by: jpai, alanb
1 parent 4c8c993 commit 622f239

File tree

17 files changed

+135
-63
lines changed

17 files changed

+135
-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: 8 additions & 4 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
@@ -35,13 +35,17 @@
3535
* @test
3636
* @bug 8221730
3737
* @summary Test of diagnostic command VM.version (tests all DCMD executors)
38-
* @library /test/lib
39-
* /vmTestbase
40-
* @modules java.base/jdk.internal.misc
38+
* @modules java.base/jdk.internal.classfile
39+
* java.base/jdk.internal.classfile.attribute
40+
* java.base/jdk.internal.classfile.constantpool
41+
* java.base/jdk.internal.classfile.java.lang.constant
42+
* java.base/jdk.internal.misc
4143
* java.base/jdk.internal.module
4244
* java.compiler
4345
* java.management
4446
* jdk.internal.jvmstat/sun.jvmstat.monitor
47+
* @library /test/lib
48+
* /vmTestbase
4549
* @run testng/othervm -XX:+UsePerfData VMVersionTest
4650
*/
4751
public class VMVersionTest {

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

Lines changed: 8 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,14 @@
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.classfile
30+
* java.base/jdk.internal.classfile.attribute
31+
* java.base/jdk.internal.classfile.constantpool
32+
* java.base/jdk.internal.classfile.java.lang.constant
33+
* java.base/jdk.internal.module
2934
* @library /test/lib
30-
* @modules java.base/jdk.internal.module
3135
* @build jdk.test.lib.util.JarUtils
36+
* jdk.test.lib.util.ModuleInfoWriter
3237
* @build TestClassLoader TestClient
3338
* @run main ClassLoaderTest -noPolicy
3439
* @run main ClassLoaderTest -validPolicy
@@ -48,9 +53,9 @@
4853
import java.util.Collections;
4954
import java.util.LinkedList;
5055
import java.util.List;
51-
import jdk.internal.module.ModuleInfoWriter;
5256
import jdk.test.lib.process.ProcessTools;
5357
import jdk.test.lib.util.JarUtils;
58+
import jdk.test.lib.util.ModuleInfoWriter;
5459

5560
public class ClassLoaderTest {
5661

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

Lines changed: 8 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.*;
@@ -52,7 +52,13 @@
5252
* @test
5353
* @modules java.base/jdk.internal.org.objectweb.asm
5454
* java.base/jdk.internal.org.objectweb.asm.commons
55+
* java.base/jdk.internal.classfile
56+
* java.base/jdk.internal.classfile.attribute
57+
* java.base/jdk.internal.classfile.constantpool
58+
* java.base/jdk.internal.classfile.java.lang.constant
5559
* java.base/jdk.internal.module
60+
* @library /test/lib
61+
* @build jdk.test.lib.util.ModuleInfoWriter
5662
* @run testng AnnotationsTest
5763
* @summary Basic test of annotations on modules
5864
*/

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

Lines changed: 9 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,13 @@
2323

2424
/**
2525
* @test
26-
* @modules java.base/jdk.internal.module
26+
* @modules java.base/jdk.internal.classfile
27+
* java.base/jdk.internal.classfile.attribute
28+
* java.base/jdk.internal.classfile.constantpool
29+
* java.base/jdk.internal.classfile.java.lang.constant
30+
* java.base/jdk.internal.module
31+
* @library /test/lib
32+
* @build jdk.test.lib.util.ModuleInfoWriter
2733
* @run testng ClassFileVersionsTest
2834
* @summary Test parsing of module-info.class with different class file versions
2935
*/
@@ -36,7 +42,7 @@
3642

3743
import static java.lang.module.ModuleDescriptor.Requires.Modifier.*;
3844

39-
import jdk.internal.module.ModuleInfoWriter;
45+
import jdk.test.lib.util.ModuleInfoWriter;
4046

4147
import org.testng.annotations.DataProvider;
4248
import org.testng.annotations.Test;

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

Lines changed: 8 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,15 @@
2323

2424
/**
2525
* @test
26-
* @library /test/lib
2726
* @modules java.base/jdk.internal.access
27+
* java.base/jdk.internal.classfile
28+
* java.base/jdk.internal.classfile.attribute
29+
* java.base/jdk.internal.classfile.constantpool
30+
* java.base/jdk.internal.classfile.java.lang.constant
2831
* java.base/jdk.internal.module
32+
* @library /test/lib
2933
* @build ConfigurationTest
34+
* jdk.test.lib.util.ModuleInfoWriter
3035
* jdk.test.lib.util.ModuleUtils
3136
* @run testng ConfigurationTest
3237
* @summary Basic tests for java.lang.module.Configuration
@@ -47,10 +52,10 @@
4752
import java.util.List;
4853
import java.util.Set;
4954

55+
import jdk.test.lib.util.ModuleInfoWriter;
5056
import jdk.test.lib.util.ModuleUtils;
5157

5258
import jdk.internal.access.SharedSecrets;
53-
import jdk.internal.module.ModuleInfoWriter;
5459
import jdk.internal.module.ModuleTarget;
5560
import org.testng.annotations.DataProvider;
5661
import org.testng.annotations.Test;

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2022, 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
@@ -25,10 +25,13 @@
2525
* @test
2626
* @bug 8142968 8158456 8298875
2727
* @modules java.base/jdk.internal.access
28-
* java.base/jdk.internal.module
2928
* java.base/jdk.internal.classfile
3029
* java.base/jdk.internal.classfile.attribute
30+
* java.base/jdk.internal.classfile.constantpool
3131
* java.base/jdk.internal.classfile.java.lang.constant
32+
* java.base/jdk.internal.module
33+
* @library /test/lib
34+
* @build jdk.test.lib.util.ModuleInfoWriter
3235
* @run testng ModuleDescriptorTest
3336
* @summary Basic test for java.lang.module.ModuleDescriptor and its builder
3437
*/
@@ -64,7 +67,7 @@
6467
import jdk.internal.classfile.attribute.ModuleAttribute;
6568
import jdk.internal.classfile.java.lang.constant.PackageDesc;
6669
import jdk.internal.classfile.java.lang.constant.ModuleDesc;
67-
import jdk.internal.module.ModuleInfoWriter;
70+
import jdk.test.lib.util.ModuleInfoWriter;
6871
import org.testng.annotations.DataProvider;
6972
import org.testng.annotations.Test;
7073
import static org.testng.Assert.*;

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

Lines changed: 9 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,13 @@
2323

2424
/**
2525
* @test
26-
* @modules java.base/jdk.internal.module
27-
* @build ModuleFinderTest
26+
* @modules java.base/jdk.internal.classfile
27+
* java.base/jdk.internal.classfile.attribute
28+
* java.base/jdk.internal.classfile.constantpool
29+
* java.base/jdk.internal.classfile.java.lang.constant
30+
* java.base/jdk.internal.module
31+
* @library /test/lib
32+
* @build ModuleFinderTest jdk.test.lib.util.ModuleInfoWriter
2833
* @run testng ModuleFinderTest
2934
* @summary Basic tests for java.lang.module.ModuleFinder
3035
*/
@@ -45,7 +50,7 @@
4550
import java.util.jar.JarOutputStream;
4651
import java.util.stream.Collectors;
4752

48-
import jdk.internal.module.ModuleInfoWriter;
53+
import jdk.test.lib.util.ModuleInfoWriter;
4954

5055
import org.testng.annotations.Test;
5156
import static org.testng.Assert.*;

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

Lines changed: 9 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,13 @@
2424
/**
2525
* @test
2626
* @modules java.base/jdk.internal.access
27+
* java.base/jdk.internal.classfile
28+
* java.base/jdk.internal.classfile.attribute
29+
* java.base/jdk.internal.classfile.constantpool
30+
* java.base/jdk.internal.classfile.java.lang.constant
2731
* java.base/jdk.internal.module
32+
* @library /test/lib
33+
* @build jdk.test.lib.util.ModuleInfoWriter
2834
* @run testng ModuleNamesTest
2935
* @summary Basic test of reading a module-info.class with module names that
3036
* are legal in class files but not legal in the Java Language
@@ -42,7 +48,8 @@
4248
import java.util.Set;
4349

4450
import jdk.internal.access.SharedSecrets;
45-
import jdk.internal.module.ModuleInfoWriter;
51+
52+
import jdk.test.lib.util.ModuleInfoWriter;
4653

4754
import org.testng.annotations.DataProvider;
4855
import org.testng.annotations.Test;

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

Lines changed: 10 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,15 @@
2323

2424
/**
2525
* @test
26+
* @modules java.base/jdk.internal.classfile
27+
* java.base/jdk.internal.classfile.attribute
28+
* java.base/jdk.internal.classfile.constantpool
29+
* java.base/jdk.internal.classfile.java.lang.constant
30+
* java.base/jdk.internal.module
2631
* @library /test/lib
27-
* @modules java.base/jdk.internal.module
28-
* @build MultiReleaseJarTest jdk.test.lib.util.JarUtils
32+
* @build MultiReleaseJarTest
33+
* jdk.test.lib.util.JarUtils
34+
* jdk.test.lib.util.ModuleInfoWriter
2935
* @run testng MultiReleaseJarTest
3036
* @run testng/othervm -Djdk.util.jar.enableMultiRelease=false MultiReleaseJarTest
3137
* @summary Basic test of modular JARs as multi-release JARs
@@ -54,7 +60,7 @@
5460
import java.util.jar.Attributes;
5561
import java.util.jar.Manifest;
5662

57-
import jdk.internal.module.ModuleInfoWriter;
63+
import jdk.test.lib.util.ModuleInfoWriter;
5864
import jdk.test.lib.util.JarUtils;
5965

6066
import org.testng.annotations.Test;

0 commit comments

Comments
 (0)