8352509: Update jdk.test.lib.SecurityTools jar method to accept List<String> parameter

Reviewed-by: weijun
This commit is contained in:
Mikhail Yankelevich
2025-03-25 13:04:30 +00:00
committed by Weijun Wang
parent 3ac9678ea1
commit fa0b18bfde

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 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
@@ -233,6 +233,17 @@ public class SecurityTools {
return execute(getProcessBuilder("kinit", makeList(args)));
}
/**
* Runs jar.
*
* @param args arguments to jar in the list.
* @return an {@link OutputAnalyzer} object
* @throws Exception if there is an error
*/
public static OutputAnalyzer jar(final List<String> args) throws Exception {
return execute(getProcessBuilder("jar", args));
}
/**
* Runs jar.
*
@@ -241,8 +252,20 @@ public class SecurityTools {
* @return an {@link OutputAnalyzer} object
* @throws Exception if there is an error
*/
public static OutputAnalyzer jar(String args) throws Exception {
return execute(getProcessBuilder("jar", makeList(args)));
public static OutputAnalyzer jar(final String args) throws Exception {
return jar(makeList(args));
}
/**
* Runs jar.
*
* @param args arguments to jar in multiple strings.
* Converted to be a List with List.of.
* @return an {@link OutputAnalyzer} object
* @throws Exception if there is an error
*/
public static OutputAnalyzer jar(final String... args) throws Exception {
return jar(List.of(args));
}
/**