8346050: Update BuildTestLib.gmk to build whole testlibrary

Reviewed-by: weijun, ihse
This commit is contained in:
Leonid Mesnik 2025-02-18 20:06:05 +00:00
parent e1d0a9c832
commit 62d93f2a22
5 changed files with 21 additions and 6 deletions

View File

@ -52,10 +52,14 @@ $(eval $(call SetupJavaCompilation, BUILD_WB_JAR, \
TARGETS += $(BUILD_WB_JAR)
ifeq ($(call isTargetOs, linux), false)
BUILD_TEST_LIB_JAR_EXCLUDES := jdk/test/lib/containers
endif
$(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \
SRC := $(TEST_LIB_SOURCE_DIR), \
EXCLUDES := jdk/test/lib/containers jdk/test/lib/security, \
EXCLUDES := $(BUILD_TEST_LIB_JAR_EXCLUDES), \
BIN := $(TEST_LIB_SUPPORT)/test-lib_classes, \
HEADERS := $(TEST_LIB_SUPPORT)/test-lib_headers, \
JAR := $(TEST_LIB_SUPPORT)/test-lib.jar, \
@ -64,6 +68,10 @@ $(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \
--add-exports java.base/jdk.internal.classfile.attribute=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile.constantpool=ALL-UNNAMED \
--add-exports java.base/jdk.internal.module=ALL-UNNAMED \
--add-exports java.base/jdk.internal.platform=ALL-UNNAMED \
--add-exports java.base/sun.security.pkcs=ALL-UNNAMED \
--add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED \
--add-exports java.base/sun.security.x509=ALL-UNNAMED \
--enable-preview, \
))

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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,7 +21,7 @@
* questions.
*/
/**
/*
*
* @author Sean Mullan
* @author Steve Hanna
@ -645,7 +645,9 @@ public class CertUtils {
* This class is useful for overriding one or more methods of an
* X509Certificate for testing purposes.
*/
@SuppressWarnings("deprecation")
public static class ForwardingX509Certificate extends X509Certificate {
private static final long serialVersionUID = -8453912214640985478L;
private final X509Certificate cert;
public ForwardingX509Certificate(X509Certificate cert) {
this.cert = cert;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, 2025, 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,8 @@ import java.security.SecureRandom;
/// bytes are exhausted.
public class FixedSecureRandom extends SecureRandom {
private static final long serialVersionUID = -8753752741562231543L;
private byte[] buffer;
private int offset;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, 2025, 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
@ -35,6 +35,8 @@ import java.util.Random;
*/
public class SeededSecureRandom extends SecureRandom {
private static final long serialVersionUID = 4657031557630518194L;
private final Random rnd;
public static long seed() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2025, 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
@ -559,6 +559,7 @@ public class XMLUtils {
/**
* Adds a new rule to "jdk.xml.dsig.secureValidationPolicy"
*/
@SuppressWarnings("dangling-doc-comments")
public static void addPolicy(String rule) {
String value = Security.getProperty("jdk.xml.dsig.secureValidationPolicy");
value = rule + "," + value;