Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo committed Dec 2, 2024
1 parent d788b1f commit 8db9f06
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,12 @@
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
Expand All @@ -69,7 +64,9 @@ void testOneMultipleLauncher() throws Exception {

@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());
Expand All @@ -80,6 +77,9 @@ void testMultipleLaunchers() throws Exception {

@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);
Expand Down

0 comments on commit 8db9f06

Please sign in to comment.