diff --git a/src/test/java/org/apache/maven/plugins/dependency/TestSkip.java b/src/test/java/org/apache/maven/plugins/dependency/TestSkip.java index 1fbcacb08..2330a6c58 100644 --- a/src/test/java/org/apache/maven/plugins/dependency/TestSkip.java +++ b/src/test/java/org/apache/maven/plugins/dependency/TestSkip.java @@ -18,165 +18,200 @@ */ package org.apache.maven.plugins.dependency; -import java.io.File; +import javax.inject.Inject; -import org.apache.maven.execution.MavenSession; +import org.apache.maven.api.di.Provides; +import org.apache.maven.api.plugin.testing.InjectMojo; +import org.apache.maven.api.plugin.testing.MojoParameter; +import org.apache.maven.api.plugin.testing.MojoTest; import org.apache.maven.model.Plugin; import org.apache.maven.plugin.Mojo; import org.apache.maven.plugin.MojoExecution; -import org.apache.maven.plugin.descriptor.MojoDescriptor; -import org.apache.maven.plugin.descriptor.PluginDescriptor; import org.apache.maven.plugin.logging.Log; -import org.apache.maven.plugins.dependency.testUtils.stubs.DependencyProjectStub; -import org.apache.maven.project.MavenProject; -import org.mockito.ArgumentCaptor; - -import static org.mockito.Mockito.atLeastOnce; -import static org.mockito.Mockito.mock; +import org.apache.maven.plugins.dependency.analyze.AnalyzeDepMgt; +import org.apache.maven.plugins.dependency.analyze.AnalyzeDuplicateMojo; +import org.apache.maven.plugins.dependency.analyze.AnalyzeMojo; +import org.apache.maven.plugins.dependency.analyze.AnalyzeOnlyMojo; +import org.apache.maven.plugins.dependency.analyze.AnalyzeReport; +import org.apache.maven.plugins.dependency.fromConfiguration.CopyMojo; +import org.apache.maven.plugins.dependency.fromConfiguration.UnpackMojo; +import org.apache.maven.plugins.dependency.fromDependencies.BuildClasspathMojo; +import org.apache.maven.plugins.dependency.fromDependencies.CopyDependenciesMojo; +import org.apache.maven.plugins.dependency.fromDependencies.UnpackDependenciesMojo; +import org.apache.maven.plugins.dependency.resolvers.GoOfflineMojo; +import org.apache.maven.plugins.dependency.resolvers.ListMojo; +import org.apache.maven.plugins.dependency.resolvers.OldResolveDependencySourcesMojo; +import org.apache.maven.plugins.dependency.resolvers.ResolveDependenciesMojo; +import org.apache.maven.plugins.dependency.resolvers.ResolvePluginsMojo; +import org.apache.maven.plugins.dependency.tree.TreeMojo; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import static org.mockito.ArgumentMatchers.contains; import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; -public class TestSkip extends AbstractDependencyMojoTestCase { - - @Override - protected void setUp() throws Exception { - super.setUp(); - MavenProject project = new DependencyProjectStub(); - getContainer().addComponent(project, MavenProject.class.getName()); +@ExtendWith(MockitoExtension.class) +@MojoTest +class TestSkip { - MavenSession session = newMavenSession(project); - getContainer().addComponent(session, MavenSession.class.getName()); - } - - public void testSkipAnalyze() throws Exception { - doTest("analyze"); - } + @Inject + private MojoExecution mojoExecution; - public void testSkipAnalyzeDepMgt() throws Exception { - doTest("analyze-dep-mgt"); - } + @Mock + private Log log; - public void testSkipAnalyzeOnly() throws Exception { - doTest("analyze-only"); + @Provides + private Log logProvides() { + return log; } - public void testSkipAnalyzeReport() throws Exception { - doSpecialTest("analyze-report", true); + @Test + @InjectMojo(goal = "analyze") + @MojoParameter(name = "skip", value = "true") + void testSkipAnalyze(AnalyzeMojo mojo) throws Exception { + doTest(mojo); } - public void testSkipAnalyzeDuplicate() throws Exception { - doTest("analyze-duplicate"); + @Test + @InjectMojo(goal = "analyze-dep-mgt") + @MojoParameter(name = "skip", value = "true") + void testSkipAnalyzeDepMgt(AnalyzeDepMgt mojo) throws Exception { + doTest(mojo); } - public void testSkipBuildClasspath() throws Exception { - doTest("build-classpath"); + @Test + @InjectMojo(goal = "analyze-only") + @MojoParameter(name = "skip", value = "true") + void testSkipAnalyzeOnly(AnalyzeOnlyMojo mojo) throws Exception { + doTest(mojo); } - public void testSkipCopy() throws Exception { - doTest("copy"); - } + @Test + @InjectMojo(goal = "analyze-report") + @MojoParameter(name = "skip", value = "true") + void testSkipAnalyzeReport(AnalyzeReport mojo) throws Exception { + Plugin plugin = new Plugin(); + plugin.setArtifactId("maven-dependency-plugin"); + plugin.setVersion("1.0.0"); + when(mojoExecution.getPlugin()).thenReturn(plugin); + when(mojoExecution.getGoal()).thenReturn("analyze-report"); - public void testSkipCopyDependencies() throws Exception { - doTest("copy-dependencies"); + mojo.execute(); + verify(log) + .info(contains( + "Skipping org.apache.maven.plugins:maven-dependency-plugin:1.0.0:analyze-report report goal")); } - public void testSkipGet() throws Exception { - doSpecialTest("get"); + @Test + @InjectMojo(goal = "analyze-duplicate") + @MojoParameter(name = "skip", value = "true") + void testSkipAnalyzeDuplicate(AnalyzeDuplicateMojo mojo) throws Exception { + doTest(mojo); } - public void testSkipGoOffline() throws Exception { - doTest("go-offline"); + @Test + @InjectMojo(goal = "build-classpath") + @MojoParameter(name = "skip", value = "true") + void testSkipBuildClasspath(BuildClasspathMojo mojo) throws Exception { + doTest(mojo); } - public void testSkipList() throws Exception { - doTest("list"); + @Test + @InjectMojo(goal = "copy") + @MojoParameter(name = "skip", value = "true") + void testSkipCopy(CopyMojo mojo) throws Exception { + doTest(mojo); } - public void testSkipProperties() throws Exception { - doTest("properties"); + @Test + @InjectMojo(goal = "copy-dependencies") + @MojoParameter(name = "skip", value = "true") + void testSkipCopyDependencies(CopyDependenciesMojo mojo) throws Exception { + doTest(mojo); } - public void testSkipPurgeLocalRepository() throws Exception { - doSpecialTest("purge-local-repository"); + @Test + @InjectMojo(goal = "get") + @MojoParameter(name = "skip", value = "true") + void testSkipGet(GetMojo mojo) throws Exception { + doTest(mojo); } - public void testSkipResolve() throws Exception { - doTest("resolve"); + @Test + @InjectMojo(goal = "go-offline") + @MojoParameter(name = "skip", value = "true") + void testSkipGoOffline(GoOfflineMojo mojo) throws Exception { + doTest(mojo); } - public void testSkipResolvePlugins() throws Exception { - doTest("resolve-plugins"); + @Test + @InjectMojo(goal = "list") + @MojoParameter(name = "skip", value = "true") + void testSkipList(ListMojo mojo) throws Exception { + doTest(mojo); } - public void testSkipSources() throws Exception { - doTest("sources"); + @Test + @InjectMojo(goal = "properties") + @MojoParameter(name = "skip", value = "true") + void testSkipProperties(PropertiesMojo mojo) throws Exception { + doTest(mojo); } - public void testSkipTree() throws Exception { - doTest("tree"); + @Test + @InjectMojo(goal = "purge-local-repository") + @MojoParameter(name = "skip", value = "true") + void testSkipPurgeLocalRepository(PurgeLocalRepositoryMojo mojo) throws Exception { + doTest(mojo); } - public void testSkipUnpack() throws Exception { - doTest("unpack"); + @Test + @InjectMojo(goal = "resolve") + @MojoParameter(name = "skip", value = "true") + void testSkipResolve(ResolveDependenciesMojo mojo) throws Exception { + doTest(mojo); } - public void testSkipUnpackDependencies() throws Exception { - doTest("unpack-dependencies"); + @Test + @InjectMojo(goal = "resolve-plugins") + @MojoParameter(name = "skip", value = "true") + void testSkipResolvePlugins(ResolvePluginsMojo mojo) throws Exception { + doTest(mojo); } - protected void doTest(String mojoName) throws Exception { - doConfigTest(mojoName, "plugin-config.xml"); + @Test + @InjectMojo(goal = "sources") + @MojoParameter(name = "skip", value = "true") + void testSkipSources(OldResolveDependencySourcesMojo mojo) throws Exception { + doTest(mojo); } - protected void doSpecialTest(String mojoName) throws Exception { - doConfigTest(mojoName, "plugin-" + mojoName + "-config.xml", false); + @Test + @InjectMojo(goal = "tree") + @MojoParameter(name = "skip", value = "true") + void testSkipTree(TreeMojo mojo) throws Exception { + doTest(mojo); } - protected void doSpecialTest(String mojoName, boolean addMojoExecution) throws Exception { - doConfigTest(mojoName, "plugin-" + mojoName + "-config.xml", addMojoExecution); + @Test + @InjectMojo(goal = "unpack") + @MojoParameter(name = "skip", value = "true") + void testSkipUnpack(UnpackMojo mojo) throws Exception { + doTest(mojo); } - private void doConfigTest(String mojoName, String configFile) throws Exception { - doConfigTest(mojoName, configFile, false); + @Test + @InjectMojo(goal = "unpack-dependencies") + @MojoParameter(name = "skip", value = "true") + void testSkipUnpackDependencies(UnpackDependenciesMojo mojo) throws Exception { + doTest(mojo); } - private void doConfigTest(String mojoName, String configFile, boolean addMojoExecution) throws Exception { - File testPom = new File(getBasedir(), "target/test-classes/unit/skip-test/" + configFile); - Mojo mojo = lookupMojo(mojoName, testPom); - assertNotNull("Mojo not found.", mojo); - - if (addMojoExecution) { - setVariableValueToObject(mojo, "mojoExecution", getMockMojoExecution(mojoName)); - } - Log log = mock(Log.class); - mojo.setLog(log); + private void doTest(Mojo mojo) throws Exception { mojo.execute(); - - ArgumentCaptor captor = ArgumentCaptor.forClass(String.class); - verify(log, atLeastOnce()).info(captor.capture()); - String skipMessage; - if (addMojoExecution) { - MojoExecution me = getMockMojoExecution(mojoName); - String reportMojoInfo = me.getPlugin().getId() + ":" + me.getGoal(); - skipMessage = "Skipping " + reportMojoInfo + " report goal"; - } else { - skipMessage = "Skipping plugin execution"; - } - assertTrue(captor.getValue().contains(skipMessage)); - } - - private MojoExecution getMockMojoExecution(String goal) { - MojoDescriptor md = new MojoDescriptor(); - md.setGoal(goal); - - MojoExecution me = new MojoExecution(md); - - PluginDescriptor pd = new PluginDescriptor(); - Plugin p = new Plugin(); - p.setGroupId("org.apache.maven.plugins"); - p.setArtifactId("maven-dependency-plugin"); - pd.setPlugin(p); - md.setPluginDescriptor(pd); - - return me; + verify(log).info(contains("Skipping plugin")); } } diff --git a/src/test/java/org/apache/maven/plugins/dependency/exclusion/ExclusionCheckerTest.java b/src/test/java/org/apache/maven/plugins/dependency/exclusion/ExclusionCheckerTest.java index ad97c810c..2663595df 100644 --- a/src/test/java/org/apache/maven/plugins/dependency/exclusion/ExclusionCheckerTest.java +++ b/src/test/java/org/apache/maven/plugins/dependency/exclusion/ExclusionCheckerTest.java @@ -23,23 +23,23 @@ import java.util.HashSet; import java.util.Set; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import static org.apache.maven.plugins.dependency.exclusion.Coordinates.coordinates; import static org.assertj.core.api.Assertions.assertThat; -public class ExclusionCheckerTest { +class ExclusionCheckerTest { private ExclusionChecker checker; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { checker = new ExclusionChecker(); } @Test - public void shallReportInvalidExclusions() { + void shallReportInvalidExclusions() { Coordinates artifact = coordinates("com.current", "artifact"); Set excludes = new HashSet<>(Arrays.asList( coordinates("com.example", "one"), @@ -59,13 +59,13 @@ public void shallReportInvalidExclusions() { } @Test - public void noViolationsWhenEmptyExclusions() { + void noViolationsWhenEmptyExclusions() { checker.check(coordinates("a", "b"), new HashSet<>(), new HashSet<>()); assertThat(checker.getViolations()).isEmpty(); } @Test - public void shallReportInvalidExclusionsWhenNoDependencies() { + void shallReportInvalidExclusionsWhenNoDependencies() { Coordinates artifact = coordinates("a", "b"); HashSet actualDependencies = new HashSet<>(); checker.check(artifact, new HashSet<>(Collections.singletonList(coordinates("p", "m"))), actualDependencies); @@ -73,7 +73,7 @@ public void shallReportInvalidExclusionsWhenNoDependencies() { } @Test - public void shallHandleWildcardExclusions() { + void shallHandleWildcardExclusions() { Coordinates artifact = coordinates("com.current", "artifact"); Set excludes = new HashSet<>(Collections.singletonList(coordinates("*", "*"))); @@ -86,7 +86,7 @@ public void shallHandleWildcardExclusions() { } @Test - public void shallHandleWildcardGroupIdExclusion() { + void shallHandleWildcardGroupIdExclusion() { Coordinates artifact = coordinates("com.current", "artifact"); Set excludes = new HashSet<>(Collections.singletonList(coordinates("javax", "*"))); diff --git a/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestArtifactItem.java b/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestArtifactItem.java index 63fefb1de..f29043cd8 100644 --- a/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestArtifactItem.java +++ b/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestArtifactItem.java @@ -21,28 +21,16 @@ import java.io.IOException; import org.apache.maven.artifact.Artifact; -import org.apache.maven.plugins.dependency.AbstractDependencyMojoTestCase; +import org.apache.maven.artifact.DefaultArtifact; +import org.junit.jupiter.api.Test; -public class TestArtifactItem extends AbstractDependencyMojoTestCase { +import static org.junit.jupiter.api.Assertions.assertEquals; - @Override - protected String getTestDirectoryName() { - return "artifactItems"; - } - - @Override - protected boolean shouldCreateFiles() { - return false; - } - - @Override - protected void setUp() throws Exception { - // required for mojo lookups to work - super.setUp(); - } +class TestArtifactItem { - public void testArtifactItemConstructor() throws IOException { - Artifact artifact = stubFactory.createArtifact("g", "a", "1.0", Artifact.SCOPE_COMPILE, "jar", "one"); + @Test + void testArtifactItemConstructor() throws IOException { + Artifact artifact = new DefaultArtifact("g", "a", "1.0", Artifact.SCOPE_COMPILE, "jar", "one", null); ArtifactItem item = new ArtifactItem(artifact); @@ -54,7 +42,8 @@ public void testArtifactItemConstructor() throws IOException { assertEquals(item.getType(), artifact.getType()); } - public void testArtifactItemDefaultType() { + @Test + void testArtifactItemDefaultType() { ArtifactItem item = new ArtifactItem(); // check type default assertEquals("jar", item.getType()); diff --git a/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestIncludeExcludeUnpackMojo.java b/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestIncludeExcludeUnpackMojo.java index f42e42aed..4d1ff3ed9 100644 --- a/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestIncludeExcludeUnpackMojo.java +++ b/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestIncludeExcludeUnpackMojo.java @@ -77,7 +77,7 @@ protected void setUp() throws Exception { // programmatically. stubFactory.setSrcFile(new File(getBasedir() + File.separatorChar + PACKED_FILE_PATH)); Artifact artifact = stubFactory.createArtifact("test", "test", "1.0", Artifact.SCOPE_COMPILE, "jar", null); - ArtifactItem item = stubFactory.getArtifactItem(artifact); + ArtifactItem item = new ArtifactItem(artifact); List list = new ArrayList<>(1); list.add(item); assertNotNull(mojo); @@ -205,7 +205,7 @@ public void testNoIncludeExcludes() throws Exception { public void testIncludeArtifactItemOverride() throws Exception { Artifact artifact = stubFactory.createArtifact("test", "test", "1.0", Artifact.SCOPE_COMPILE, "jar", null); - ArtifactItem item = stubFactory.getArtifactItem(artifact); + ArtifactItem item = new ArtifactItem(artifact); item.setIncludes("**/*"); List list = new ArrayList<>(1); list.add(item); @@ -220,7 +220,7 @@ public void testIncludeArtifactItemOverride() throws Exception { public void testExcludeArtifactItemOverride() throws Exception { Artifact artifact = stubFactory.createArtifact("test", "test", "1.0", Artifact.SCOPE_COMPILE, "jar", null); - ArtifactItem item = stubFactory.getArtifactItem(artifact); + ArtifactItem item = new ArtifactItem(artifact); item.setExcludes("**/*"); List list = new ArrayList<>(1); list.add(item); @@ -236,11 +236,11 @@ public void testExcludeArtifactItemOverride() throws Exception { public void testIncludeArtifactItemMultipleMarker() throws Exception { List list = new ArrayList<>(); Artifact artifact = stubFactory.createArtifact("test", "test", "1.0", Artifact.SCOPE_COMPILE, "jar", null); - ArtifactItem item = stubFactory.getArtifactItem(artifact); + ArtifactItem item = new ArtifactItem(artifact); item.setOverWrite("false"); item.setIncludes("**/test2" + UNPACKED_FILE_SUFFIX); list.add(item); - item = stubFactory.getArtifactItem(artifact); + item = new ArtifactItem(artifact); item.setOverWrite("false"); item.setIncludes("**/test3" + UNPACKED_FILE_SUFFIX); list.add(item); @@ -256,11 +256,11 @@ public void testIncludeArtifactItemMultipleMarker() throws Exception { public void testIncludeArtifactItemMultipleExecutions() throws Exception { List list = new ArrayList<>(); Artifact artifact = stubFactory.createArtifact("test", "test", "1.0", Artifact.SCOPE_COMPILE, "jar", null); - ArtifactItem item = stubFactory.getArtifactItem(artifact); + ArtifactItem item = new ArtifactItem(artifact); item.setOverWrite("false"); item.setIncludes("**/test2" + UNPACKED_FILE_SUFFIX); list.add(item); - item = stubFactory.getArtifactItem(artifact); + item = new ArtifactItem(artifact); item.setOverWrite("false"); item.setIncludes("**/test3" + UNPACKED_FILE_SUFFIX); list.add(item); diff --git a/src/test/java/org/apache/maven/plugins/dependency/testUtils/DependencyArtifactStubFactory.java b/src/test/java/org/apache/maven/plugins/dependency/testUtils/DependencyArtifactStubFactory.java index 05a52ef97..163167b09 100644 --- a/src/test/java/org/apache/maven/plugins/dependency/testUtils/DependencyArtifactStubFactory.java +++ b/src/test/java/org/apache/maven/plugins/dependency/testUtils/DependencyArtifactStubFactory.java @@ -52,14 +52,10 @@ public DependencyArtifactStubFactory(File theWorkingDir, boolean theCreateFiles) super(theWorkingDir, theCreateFiles); } - public ArtifactItem getArtifactItem(Artifact artifact) { - return new ArtifactItem(artifact); - } - public List getArtifactItems(Collection artifacts) { List list = new ArrayList<>(); for (Artifact artifact : artifacts) { - list.add(getArtifactItem(artifact)); + list.add(new ArtifactItem(artifact)); } return list; } diff --git a/src/test/java/org/apache/maven/plugins/dependency/utils/TestSilentLog.java b/src/test/java/org/apache/maven/plugins/dependency/utils/TestSilentLog.java index 025e42338..c70fc0ffa 100644 --- a/src/test/java/org/apache/maven/plugins/dependency/utils/TestSilentLog.java +++ b/src/test/java/org/apache/maven/plugins/dependency/utils/TestSilentLog.java @@ -19,13 +19,14 @@ package org.apache.maven.plugins.dependency.utils; import org.apache.maven.plugin.logging.Log; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TestSilentLog { +import static org.junit.jupiter.api.Assertions.assertFalse; + +class TestSilentLog { @Test - public void testLog() { + void testLog() { Log log = new DependencySilentLog(); String text = "Text"; Throwable e = new RuntimeException(); @@ -41,9 +42,9 @@ public void testLog() { log.error(text); log.error(text, e); log.error(e); - Assert.assertFalse(log.isDebugEnabled()); - Assert.assertFalse(log.isErrorEnabled()); - Assert.assertFalse(log.isWarnEnabled()); - Assert.assertFalse(log.isInfoEnabled()); + assertFalse(log.isDebugEnabled()); + assertFalse(log.isErrorEnabled()); + assertFalse(log.isWarnEnabled()); + assertFalse(log.isInfoEnabled()); } } diff --git a/src/test/java/org/apache/maven/plugins/dependency/utils/markers/TestUnpackMarkerFileHandler.java b/src/test/java/org/apache/maven/plugins/dependency/utils/markers/TestUnpackMarkerFileHandler.java index 0609a0e9f..8c7ad4536 100644 --- a/src/test/java/org/apache/maven/plugins/dependency/utils/markers/TestUnpackMarkerFileHandler.java +++ b/src/test/java/org/apache/maven/plugins/dependency/utils/markers/TestUnpackMarkerFileHandler.java @@ -23,46 +23,40 @@ import java.util.List; import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.DefaultArtifact; import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.plugins.dependency.fromConfiguration.ArtifactItem; -import org.apache.maven.plugins.dependency.testUtils.DependencyArtifactStubFactory; import org.apache.maven.plugins.dependency.testUtils.stubs.StubUnpackFileMarkerHandler; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -class TestUnpackMarkerFileHandler extends AbstractMojoTestCase { - List artifactItems = new ArrayList<>(); +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.AssertionsKt.assertNull; - @TempDir - File outputFolder; +class TestUnpackMarkerFileHandler { + private List artifactItems = new ArrayList<>(); @TempDir - protected File testDir; - - protected DependencyArtifactStubFactory stubFactory; + private File outputFolder; - @Override @BeforeEach - protected void setUp() throws Exception { - super.setUp(); - - stubFactory = new DependencyArtifactStubFactory(this.testDir, false); - Artifact artifact = stubFactory.createArtifact("test", "test", "1"); - ArtifactItem artifactItem; - stubFactory.getArtifactItem(artifact); - artifactItems.add(stubFactory.getArtifactItem(stubFactory.createArtifact("test", "test", "1"))); - artifact = stubFactory.createArtifact("test2", "test2", "2"); - artifactItem = new ArtifactItem(artifact); + void setUp() { + ArtifactItem artifactItem = new ArtifactItem(new DefaultArtifact("test", "test", "1", null, "jar", "", null)); + artifactItems.add(artifactItem); + + artifactItem = new ArtifactItem(new DefaultArtifact("test2", "test2", "2", null, "jar", "", null)); artifactItem.setIncludes("**/*.xml"); artifactItems.add(artifactItem); - artifact = stubFactory.createArtifact("test3", "test3", "3"); - artifactItem = new ArtifactItem(artifact); + + artifactItem = new ArtifactItem(new DefaultArtifact("test3", "test3", "3", null, "jar", "", null)); artifactItem.setExcludes("**/*.class"); artifactItems.add(artifactItem); - artifact = stubFactory.createArtifact("test4", "test4", "4"); - artifactItem = new ArtifactItem(artifact); + + artifactItem = new ArtifactItem(new DefaultArtifact("test4", "test4", "4", null, "jar", "", null)); artifactItem.setIncludes("**/*.xml"); artifactItem.setExcludes("**/*.class"); artifactItems.add(artifactItem); diff --git a/src/test/resources/unit/skip-test/plugin-analyze-report-config.xml b/src/test/resources/unit/skip-test/plugin-analyze-report-config.xml deleted file mode 100644 index ac324dd00..000000000 --- a/src/test/resources/unit/skip-test/plugin-analyze-report-config.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - 4.0.0 - - - com.mycompany.app - my-mojo - maven-plugin - 1.0-SNAPSHOT - - my-mojo Maven Mojo - http://maven.apache.org - - - - - maven-dependency-plugin - - true - target/unit-tests/skip-test - - - - - diff --git a/src/test/resources/unit/skip-test/plugin-config.xml b/src/test/resources/unit/skip-test/plugin-config.xml deleted file mode 100644 index 0006e2729..000000000 --- a/src/test/resources/unit/skip-test/plugin-config.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 4.0.0 - - - com.mycompany.app - my-mojo - maven-plugin - 1.0-SNAPSHOT - - my-mojo Maven Mojo - http://maven.apache.org - - - - - maven-dependency-plugin - - true - - - - - diff --git a/src/test/resources/unit/skip-test/plugin-get-config.xml b/src/test/resources/unit/skip-test/plugin-get-config.xml deleted file mode 100644 index 0006e2729..000000000 --- a/src/test/resources/unit/skip-test/plugin-get-config.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 4.0.0 - - - com.mycompany.app - my-mojo - maven-plugin - 1.0-SNAPSHOT - - my-mojo Maven Mojo - http://maven.apache.org - - - - - maven-dependency-plugin - - true - - - - - diff --git a/src/test/resources/unit/skip-test/plugin-purge-local-repository-config.xml b/src/test/resources/unit/skip-test/plugin-purge-local-repository-config.xml deleted file mode 100644 index 0006e2729..000000000 --- a/src/test/resources/unit/skip-test/plugin-purge-local-repository-config.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - 4.0.0 - - - com.mycompany.app - my-mojo - maven-plugin - 1.0-SNAPSHOT - - my-mojo Maven Mojo - http://maven.apache.org - - - - - maven-dependency-plugin - - true - - - - -