Skip to content

Commit

Permalink
devonfw#608: implemented requested changes
Browse files Browse the repository at this point in the history
removed hacks
  • Loading branch information
jan-vcapgemini committed Oct 30, 2024
1 parent c39829e commit c7f2c55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions cli/src/test/java/com/devonfw/tools/ide/tool/jmc/JmcTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.devonfw.tools.ide.context.IdeTestContext;
import com.devonfw.tools.ide.os.SystemInfo;
import com.devonfw.tools.ide.os.SystemInfoMock;
import com.devonfw.tools.ide.process.ProcessMode;

/**
* Integration test of {@link Jmc}.
Expand Down Expand Up @@ -59,9 +58,10 @@ public void testJmcRun(String os) {
context.setSystemInfo(systemInfo);
Jmc commandlet = new Jmc(context);

commandlet.arguments.addValue("foo");
commandlet.arguments.addValue("bar");
// act
// hack to log output of test script execution. Original processMode was BACKGROUND.
commandlet.runTool(ProcessMode.DEFAULT, null, "foo", "bar");
commandlet.run();

// assert
assertThat(context).logAtInfo().hasEntries("java jmc", "jmc " + os + " foo bar");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.devonfw.tools.ide.context.IdeTestContext;
import com.devonfw.tools.ide.log.IdeLogEntry;
import com.devonfw.tools.ide.log.IdeLogLevel;
import com.devonfw.tools.ide.process.ProcessMode;
import com.devonfw.tools.ide.tool.java.Java;

/**
Expand Down Expand Up @@ -38,9 +37,9 @@ public void testTomcat() {
Path javaTomcatPath = context.getToolRepositoryPath().resolve("default").resolve("java").resolve("java").resolve(javaVersionTomcat);

// act
// hack to capture output of test script. Original processMode was BACKGROUND.
javaCommandlet.runTool(ProcessMode.DEFAULT, null, "--version");
tomcatCommandlet.runTool(ProcessMode.DEFAULT, null);
javaCommandlet.arguments.addValue("--version");
javaCommandlet.run();
tomcatCommandlet.run();

// assert
assertThat(context.getSoftwarePath().resolve("java/.ide.software.version")).exists().hasContent(javaVersionProject);
Expand Down

0 comments on commit c7f2c55

Please sign in to comment.