From 19094688ed67a9768deaf5f8351621f5d9620ddd Mon Sep 17 00:00:00 2001 From: rfscholte Date: Fri, 26 Oct 2018 15:48:34 +0200 Subject: [PATCH] Fixing AbstractGeneratorTestCase#testGenerator --- .../tools/plugin/generator/AbstractGeneratorTestCase.java | 4 ++-- .../tools/plugin/generator/PluginDescriptorGeneratorTest.java | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/AbstractGeneratorTestCase.java b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/AbstractGeneratorTestCase.java index 50a565b88..e98b1283a 100644 --- a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/AbstractGeneratorTestCase.java +++ b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/AbstractGeneratorTestCase.java @@ -33,6 +33,7 @@ import java.io.File; import java.lang.reflect.Constructor; +import java.nio.file.Files; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -94,8 +95,7 @@ public void testGenerator() pluginDescriptor.setDependencies( Collections.singletonList( dependency ) ); - File destinationDirectory = new File( System.getProperty( "java.io.tmpdir" ), "testGenerator-outDir" ); - FileUtils.deleteDirectory( destinationDirectory ); + File destinationDirectory = Files.createTempDirectory( "testGenerator-outDir" ).toFile(); destinationDirectory.mkdir(); MavenProject mavenProject = new MavenProject(); diff --git a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGeneratorTest.java b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGeneratorTest.java index a1c646e96..c5f5c9e9d 100644 --- a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGeneratorTest.java +++ b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginDescriptorGeneratorTest.java @@ -61,7 +61,6 @@ protected void validate( File destinationDirectory ) // Dependencies // ---------------------------------------------------------------------- - @SuppressWarnings( "unchecked" ) List dependencies = pluginDescriptor.getDependencies(); checkDependency( "testGroup", "testArtifact", "0.0.0", dependencies.get( 0 ) );