diff --git a/test/lib/jdk/test/lib/SecurityTools.java b/test/lib/jdk/test/lib/SecurityTools.java index ff13343ad32..2bc56ad4c43 100644 --- a/test/lib/jdk/test/lib/SecurityTools.java +++ b/test/lib/jdk/test/lib/SecurityTools.java @@ -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 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)); } /**