This is an automated email from the ASF dual-hosted git repository. elharo pushed a commit to branch MJAVADOC-762 in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git
commit 7c8424a281471786adfe092cbfad74e0f02cca56 Author: Elliotte Rusty Harold <[email protected]> AuthorDate: Mon Jul 10 06:53:58 2023 -0400 don't share state between tests --- .../maven/plugins/javadoc/JavadocReportTest.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java b/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java index d8c836b8..1b615291 100644 --- a/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java +++ b/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java @@ -77,9 +77,6 @@ public class JavadocReportTest extends AbstractMojoTestCase { public static final String OPTIONS_UMLAUT_ENCODING = "Options Umlaut Encoding ö ä ü ß"; - /** flag to copy repo only one time */ - private static boolean TEST_REPO_CREATED = false; - private Path unit; private File localRepo; @@ -98,6 +95,13 @@ public class JavadocReportTest extends AbstractMojoTestCase { createTestRepo(); } + @Override + protected void tearDown() throws Exception { + deleteDirectory(localRepo); + + super.tearDown(); + } + private JavadocReport lookupMojo(Path testPom) throws Exception { JavadocReport mojo = (JavadocReport) lookupMojo("javadoc", testPom.toFile()); @@ -121,10 +125,6 @@ public class JavadocReportTest extends AbstractMojoTestCase { * @throws IOException if any */ private void createTestRepo() throws IOException { - if (TEST_REPO_CREATED) { - return; - } - localRepo.mkdirs(); // ---------------------------------------------------------------------- @@ -145,7 +145,7 @@ public class JavadocReportTest extends AbstractMojoTestCase { // ---------------------------------------------------------------------- // commons-attributes-compiler - // http://www.tullmann.org/pat/taglets/ + // https://www.tullmann.org/pat/taglets/ // ---------------------------------------------------------------------- sourceDir = unit.resolve("taglet-test/artifact-taglet"); @@ -180,8 +180,6 @@ public class JavadocReportTest extends AbstractMojoTestCase { file.delete(); } } - - TEST_REPO_CREATED = true; } /**
