cstamas commented on code in PR #11249:
URL: https://github.com/apache/maven/pull/11249#discussion_r2425928691
##########
impl/maven-executor/src/test/java/org/apache/maven/cling/executor/impl/ToolboxToolTest.java:
##########
@@ -25,32 +25,43 @@
import java.util.Map;
import eu.maveniverse.maven.mimir.testing.MimirInfuser;
+import org.apache.maven.api.cli.Executor;
import org.apache.maven.api.cli.ExecutorRequest;
import org.apache.maven.cling.executor.ExecutorHelper;
-import org.apache.maven.cling.executor.MavenExecutorTestSupport;
+import org.apache.maven.cling.executor.embedded.EmbeddedMavenExecutor;
+import org.apache.maven.cling.executor.forked.ForkedMavenExecutor;
import org.apache.maven.cling.executor.internal.HelperImpl;
import org.apache.maven.cling.executor.internal.ToolboxTool;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.api.io.CleanupMode;
import org.junit.jupiter.api.io.TempDir;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
-import static
org.apache.maven.cling.executor.MavenExecutorTestSupport.mvn3ExecutorRequestBuilder;
-import static
org.apache.maven.cling.executor.MavenExecutorTestSupport.mvn4ExecutorRequestBuilder;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
+@Timeout(15)
public class ToolboxToolTest {
- private static final String VERSION = "0.7.4";
+ private static final Executor EMBEDDED_MAVEN_EXECUTOR = new
EmbeddedMavenExecutor();
+ private static final Executor FORKED_MAVEN_EXECUTOR = new
ForkedMavenExecutor();
- @TempDir
- private static Path userHome;
+ private static final String VERSION = "0.13.7";
- @BeforeAll
- static void beforeAll() throws Exception {
+ @TempDir(cleanup = CleanupMode.NEVER)
+ private static Path tempDir;
+
+ private Path userHome;
+
+ @BeforeEach
+ void beforeEach(TestInfo testInfo) throws Exception {
+ userHome =
tempDir.resolve(testInfo.getTestMethod().orElseThrow().getName());
+ Files.createDirectories(userHome);
MimirInfuser.infuseUW(userHome);
+
+ System.out.println("=== " +
testInfo.getTestMethod().orElseThrow().getName());
Review Comment:
While in general I completely agree about this stance, in this very case I'd
leave them; their reason of existence is really to easy our work of "figuring
out what happens". As all these tests are testing "execution of maven to
provide us some information" (with all the play of force stdout plus quiet
mode). As long as we cannot "configure output to terminal and file
differently", I think it is simplest and "cheapest" to leave them. The reason I
did not want logger in test CP, is to keep CP classpath "as pristine as
possible", as we have SLF4J logging already present, in "embedded" JVM.
So this is my 5 cents, I can remove all this if you insist, but again, the
point is to have them in surefire grabbed stdout for easier debugging, thats
all. I'd not remove them, nor would use "fully fledged logging framework"
either, but without them we are left in dark (as maven cannot write to stdout
one thing, while logging another to file).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]