pzygielo commented on code in PR #532:
URL:
https://github.com/apache/maven-dependency-plugin/pull/532#discussion_r2115818604
##########
src/test/java/org/apache/maven/plugins/dependency/AbstractDependencyMojoTestCase.java:
##########
@@ -35,33 +36,52 @@
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.repository.LocalRepositoryManager;
+import org.junit.Before;
import org.sonatype.plexus.build.incremental.DefaultBuildContext;
public abstract class AbstractDependencyMojoTestCase extends
AbstractMojoTestCase {
protected File testDir;
-
protected DependencyArtifactStubFactory stubFactory;
- protected void setUp(String testDirectoryName, boolean createFiles) throws
Exception {
- setUp(testDirectoryName, createFiles, true);
- }
-
- protected void setUp(String testDirectoryName, boolean createFiles,
boolean flattenedPath) throws Exception {
- // required for mojo lookups to work
+ @Override
+ @Before
+ public void setUp() throws Exception {
+ // Initialize mojo lookups as required by AbstractMojoTestCase
super.setUp();
+ // Create a unique temporary test directory to avoid parallel test
conflicts
+ String uniqueDirName = "test-dependency" + UUID.randomUUID();
Review Comment:
> JUnit can create temporary directories with `@Tempdir`.
I'm not sure `@Tempdir` would work here, for the same reason as in
https://github.com/apache/maven-dependency-plugin/pull/532/files#r2115815689.
> Or do we not have JUnit 5 here?
It's not enough in test-time.
--
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]