This is an automated email from the ASF dual-hosted git repository. elharo pushed a commit to branch guice in repository https://gitbox.apache.org/repos/asf/maven-jlink-plugin.git
The following commit(s) were added to refs/heads/guice by this push: new 8db9f06 test 8db9f06 is described below commit 8db9f0628f54c632e3ac0352fb61d8bf1910c477 Author: Elliotte Rusty Harold <elh...@ibiblio.org> AuthorDate: Mon Dec 2 12:17:17 2024 -0500 test --- .../maven/plugins/jlink/MultipleLauncherTest.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/test/java/org/apache/maven/plugins/jlink/MultipleLauncherTest.java b/src/test/java/org/apache/maven/plugins/jlink/MultipleLauncherTest.java index 527879f..1eec1be 100644 --- a/src/test/java/org/apache/maven/plugins/jlink/MultipleLauncherTest.java +++ b/src/test/java/org/apache/maven/plugins/jlink/MultipleLauncherTest.java @@ -34,17 +34,12 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; public class MultipleLauncherTest { private JLinkMojo mojo = new JLinkMojo(null, null, null, null); - private Field launcher; - - @BeforeEach - public void setUp() throws NoSuchFieldException, IllegalAccessException { - // It's OK to specify one launcher with "<launcher>" given - launcher = mojo.getClass().getDeclaredField("launcher"); - launcher.setAccessible(true); - } @Test void testSingleLauncher() throws Exception { + // It's OK to specify one launcher with "<launcher>" given + Field launcher = mojo.getClass().getDeclaredField("launcher"); + launcher.setAccessible(true); launcher.set(mojo, "l=com.example.Launch"); // when @@ -69,7 +64,9 @@ public class MultipleLauncherTest { @Test void testMultipleLaunchers() throws Exception { - launcher.set(mojo, List.of("l1=com.example.Launch1", "l2=com.example.Launch2")); + Field launchers = mojo.getClass().getDeclaredField("launchers"); + launchers.setAccessible(true); + launchers.set(mojo, List.of("l1=com.example.Launch1", "l2=com.example.Launch2")); // when List<String> jlinkArgs = mojo.createJlinkArgs(List.of(), List.of()); @@ -80,6 +77,9 @@ public class MultipleLauncherTest { @Test void testInvalidLauncherConfig() throws Exception { + // It's OK to specify one launcher with "<launcher>" given + Field launcher = mojo.getClass().getDeclaredField("launcher"); + launcher.setAccessible(true); launcher.set(mojo, "l3=com.example.Launch3"); Field launchers = mojo.getClass().getDeclaredField("launchers"); launchers.setAccessible(true);