This is an automated email from the ASF dual-hosted git repository.
sjaranowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-scm.git
The following commit(s) were added to refs/heads/master by this push:
new db3e1693d Migration to JUnit 5 - avoid using AbstractMojoTestCase
db3e1693d is described below
commit db3e1693de6217dea17a6e2696886ead8789cbba
Author: Slawomir Jaranowski <[email protected]>
AuthorDate: Sat Jan 24 13:44:10 2026 +0100
Migration to JUnit 5 - avoid using AbstractMojoTestCase
---
maven-scm-plugin/pom.xml | 25 ++---
.../scm/plugin/AbstractJUnit4MojoTestCase.java | 50 ---------
.../apache/maven/scm/plugin/BootstrapMojoTest.java | 10 +-
.../apache/maven/scm/plugin/BranchMojoTest.java | 74 +++++---------
.../apache/maven/scm/plugin/ChangeLogMojoTest.java | 113 +++++++--------------
.../apache/maven/scm/plugin/CheckoutMojoTest.java | 84 +++++++--------
.../apache/maven/scm/plugin/ExportMojoTest.java | 44 ++++----
.../org/apache/maven/scm/plugin/TagMojoTest.java | 75 ++++++--------
.../org/apache/maven/scm/plugin/UntagMojoTest.java | 80 +++++----------
.../apache/maven/scm/plugin/UpdateMojoTest.java | 47 ++++-----
.../src/test/resources/mojos/branch/branch.xml | 1 -
.../src/test/resources/mojos/branch/checkout.xml | 1 -
.../test/resources/mojos/changelog/changelog.xml | 1 -
.../changelog/changelogWithBadConnectionUrl.xml | 1 -
.../changelog/changelogWithBadUserDateFormat.xml | 1 -
.../mojos/changelog/changelogWithParameters.xml | 2 +-
.../mojos/checkout/checkoutUsingExport.xml | 1 -
.../mojos/checkout/checkoutWithConnectionUrl.xml | 1 -
.../checkout/checkoutWithExcludesIncludes.xml | 1 -
.../src/test/resources/mojos/export/export.xml | 1 -
.../mojos/export/exportWithExcludesIncludes.xml | 1 -
.../src/test/resources/mojos/tag/checkout.xml | 1 -
.../src/test/resources/mojos/tag/tag.xml | 1 -
.../test/resources/mojos/tag/tagWithTimestamp.xml | 1 -
.../test/resources/mojos/untag/checkout-tag.xml | 1 -
.../src/test/resources/mojos/untag/checkout.xml | 3 +-
.../src/test/resources/mojos/untag/tag.xml | 2 +-
.../src/test/resources/mojos/untag/untag.xml | 2 +-
.../mojos/update/updateWithConnectionUrl.xml | 2 -
29 files changed, 212 insertions(+), 415 deletions(-)
diff --git a/maven-scm-plugin/pom.xml b/maven-scm-plugin/pom.xml
index f501f9db2..920bab917 100644
--- a/maven-scm-plugin/pom.xml
+++ b/maven-scm-plugin/pom.xml
@@ -142,23 +142,12 @@
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.junit.vintage</groupId>
- <artifactId>junit-vintage-engine</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>3.5.0</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-compat</artifactId>
- <version>${mavenVersion}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-test</artifactId>
@@ -174,6 +163,11 @@
<artifactId>maven-scm-provider-gittest</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -183,12 +177,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <systemProperties>
- <property>
- <name>settings.security</name>
-
<value>${project.build.testOutputDirectory}/settings-security.xml</value>
- </property>
- </systemProperties>
+ <systemPropertyVariables>
+
<settings.security>${project.build.testOutputDirectory}/settings-security.xml</settings.security>
+ </systemPropertyVariables>
</configuration>
</plugin>
<plugin>
diff --git
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/AbstractJUnit4MojoTestCase.java
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/AbstractJUnit4MojoTestCase.java
deleted file mode 100644
index a169c93a7..000000000
---
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/AbstractJUnit4MojoTestCase.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.maven.scm.plugin;
-
-import java.io.File;
-
-import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.apache.maven.scm.PlexusJUnit4TestCase;
-import org.junit.After;
-import org.junit.Before;
-
-public abstract class AbstractJUnit4MojoTestCase extends AbstractMojoTestCase {
- private static final PlexusJUnit4TestCase PLEXUS_JUNIT4_TEST_CASE = new
PlexusJUnit4TestCase();
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- PLEXUS_JUNIT4_TEST_CASE.setUp();
- }
-
- @After
- public void tearDown() throws Exception {
- super.tearDown();
- PLEXUS_JUNIT4_TEST_CASE.tearDown();
- }
-
- public static String getBasedir() {
- return PLEXUS_JUNIT4_TEST_CASE.getBasedir();
- }
-
- public static File getTestFile(final String path) {
- return PLEXUS_JUNIT4_TEST_CASE.getTestFile(getBasedir(), path);
- }
-}
diff --git
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/BootstrapMojoTest.java
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/BootstrapMojoTest.java
index 4f0ff6a6b..3bbc67ff8 100644
---
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/BootstrapMojoTest.java
+++
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/BootstrapMojoTest.java
@@ -35,15 +35,15 @@
class BootstrapMojoTest {
@TempDir
- File tempDir;
+ private File tempDir;
- File checkoutDir;
+ private File checkoutDir;
- File projectDir;
+ private File projectDir;
- File goalDir;
+ private File goalDir;
- BootstrapMojo bootstrapMojo;
+ private BootstrapMojo bootstrapMojo;
@BeforeEach
void setUp() throws Exception {
diff --git
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/BranchMojoTest.java
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/BranchMojoTest.java
index 91bd82b4c..92610a6af 100644
---
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/BranchMojoTest.java
+++
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/BranchMojoTest.java
@@ -20,88 +20,66 @@
import java.io.File;
-import org.apache.maven.scm.PlexusJUnit4TestCase;
+import org.apache.maven.api.plugin.testing.Basedir;
+import org.apache.maven.api.plugin.testing.InjectMojo;
+import org.apache.maven.api.plugin.testing.MojoTest;
import org.apache.maven.scm.provider.svn.SvnScmTestUtils;
import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.StringUtils;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import static org.apache.maven.api.plugin.testing.MojoExtension.getBasedir;
+import static org.apache.maven.api.plugin.testing.MojoExtension.getTestFile;
import static org.apache.maven.scm.ScmTestCase.checkSystemCmdPresence;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* @author <a href="mailto:[email protected]">Emmanuel Venisse</a>
*
*/
-@RunWith(JUnit4.class)
-public class BranchMojoTest extends AbstractJUnit4MojoTestCase {
- File checkoutDir;
+@MojoTest
+class BranchMojoTest {
+ private File checkoutDir;
- File repository;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
+ @BeforeEach
+ void setUp() throws Exception {
checkoutDir = getTestFile("target/checkout");
FileUtils.forceDelete(checkoutDir);
- repository = getTestFile("target/repository");
+ File repository = getTestFile("target/repository");
FileUtils.forceDelete(repository);
checkSystemCmdPresence(SvnScmTestUtils.SVNADMIN_COMMAND_LINE);
SvnScmTestUtils.initializeRepository(repository);
-
- checkSystemCmdPresence(SvnScmTestUtils.SVN_COMMAND_LINE);
-
- CheckoutMojo checkoutMojo = (CheckoutMojo)
- lookupMojo("checkout",
getTestFile("src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml"));
- checkoutMojo.setWorkingDirectory(new File(getBasedir()));
-
- String connectionUrl = checkoutMojo.getConnectionUrl();
- connectionUrl = StringUtils.replace(connectionUrl, "${basedir}",
getBasedir());
- connectionUrl = StringUtils.replace(connectionUrl, "\\", "/");
- checkoutMojo.setConnectionUrl(connectionUrl);
-
- checkoutMojo.setCheckoutDirectory(checkoutDir);
-
- checkoutMojo.execute();
}
@Test
- public void testBranch() throws Exception {
+ @Basedir("/mojos/branch")
+ void testBranch(
+ @InjectMojo(goal = "branch", pom = "branch.xml") BranchMojo mojo,
+ @InjectMojo(goal = "checkout", pom =
"../checkout/checkoutWithConnectionUrl.xml")
+ CheckoutMojo checkoutMojoInit,
+ @InjectMojo(goal = "checkout", pom = "checkout.xml") CheckoutMojo
checkoutMojo)
+ throws Exception {
checkSystemCmdPresence(SvnScmTestUtils.SVNADMIN_COMMAND_LINE);
- BranchMojo mojo = (BranchMojo)
- lookupMojo("branch",
PlexusJUnit4TestCase.getTestFile("src/test/resources/mojos/branch/branch.xml"));
- mojo.setWorkingDirectory(checkoutDir);
+ checkoutMojoInit.execute();
- String connectionUrl = mojo.getConnectionUrl();
- connectionUrl = StringUtils.replace(connectionUrl, "${basedir}",
PlexusJUnit4TestCase.getBasedir());
- connectionUrl = StringUtils.replace(connectionUrl, "\\", "/");
- mojo.setConnectionUrl(connectionUrl);
+ mojo.setWorkingDirectory(checkoutDir);
mojo.execute();
- CheckoutMojo checkoutMojo = (CheckoutMojo) lookupMojo(
- "checkout",
PlexusJUnit4TestCase.getTestFile("src/test/resources/mojos/branch/checkout.xml"));
- checkoutMojo.setWorkingDirectory(new
File(PlexusJUnit4TestCase.getBasedir()));
-
- connectionUrl = checkoutMojo.getConnectionUrl();
- connectionUrl = StringUtils.replace(connectionUrl, "${basedir}",
PlexusJUnit4TestCase.getBasedir());
- connectionUrl = StringUtils.replace(connectionUrl, "\\", "/");
- checkoutMojo.setConnectionUrl(connectionUrl);
+ checkoutMojo.setWorkingDirectory(new File(getBasedir()));
- File branchCheckoutDir =
PlexusJUnit4TestCase.getTestFile("target/branches/mybranch");
+ File branchCheckoutDir = getTestFile("target/branches/mybranch");
if (branchCheckoutDir.exists()) {
FileUtils.deleteDirectory(branchCheckoutDir);
}
- checkoutMojo.setCheckoutDirectory(branchCheckoutDir);
assertFalse(new File(branchCheckoutDir, "pom.xml").exists());
checkoutMojo.execute();
diff --git
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ChangeLogMojoTest.java
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ChangeLogMojoTest.java
index 9d6805912..58f74edc8 100644
---
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ChangeLogMojoTest.java
+++
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ChangeLogMojoTest.java
@@ -18,115 +18,80 @@
*/
package org.apache.maven.scm.plugin;
+import javax.inject.Inject;
+
import java.io.File;
+import org.apache.maven.api.plugin.testing.Basedir;
+import org.apache.maven.api.plugin.testing.InjectMojo;
+import org.apache.maven.api.plugin.testing.MojoTest;
import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.scm.PlexusJUnit4TestCase;
+import org.apache.maven.plugin.logging.Log;
import org.apache.maven.scm.provider.svn.SvnScmTestUtils;
-import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.StringUtils;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import static org.apache.maven.api.plugin.testing.MojoExtension.getTestFile;
import static org.apache.maven.scm.ScmTestCase.checkSystemCmdPresence;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.atMost;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
/**
* @author <a href="mailto:[email protected]">Emmanuel Venisse</a>
*
*/
-@RunWith(JUnit4.class)
-public class ChangeLogMojoTest extends AbstractJUnit4MojoTestCase {
- File repository;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- repository = getTestFile("target/repository");
+@MojoTest
+@Basedir("/mojos/changelog")
+class ChangeLogMojoTest {
- FileUtils.forceDelete(repository);
+ @Inject
+ private Log log;
+ @BeforeEach
+ void setUp() throws Exception {
checkSystemCmdPresence(SvnScmTestUtils.SVNADMIN_COMMAND_LINE);
+ File repository = getTestFile("target/repository");
SvnScmTestUtils.initializeRepository(repository);
}
@Test
- public void testChangeLog() throws Exception {
+ @InjectMojo(goal = "changelog", pom = "changelog.xml")
+ void testChangeLog(ChangeLogMojo mojo) throws Exception {
checkSystemCmdPresence(SvnScmTestUtils.SVN_COMMAND_LINE);
- ChangeLogMojo mojo = (ChangeLogMojo)
- lookupMojo("changelog",
getTestFile("src/test/resources/mojos/changelog/changelog.xml"));
-
- String connectionUrl = mojo.getConnectionUrl();
- connectionUrl = StringUtils.replace(connectionUrl, "${basedir}",
PlexusJUnit4TestCase.getBasedir());
- connectionUrl = StringUtils.replace(connectionUrl, "\\", "/");
- mojo.setConnectionUrl(connectionUrl);
- mojo.setWorkingDirectory(new File(PlexusJUnit4TestCase.getBasedir()));
- mojo.setConnectionType("connection");
mojo.execute();
+ // verify log messages as result of mojo execution
+ verify(log, times(8)).debug(anyString());
}
@Test
- public void testChangeLogWithParameters() throws Exception {
+ @InjectMojo(goal = "changelog", pom = "changelogWithParameters.xml")
+ void testChangeLogWithParameters(ChangeLogMojo mojo) throws Exception {
checkSystemCmdPresence(SvnScmTestUtils.SVN_COMMAND_LINE);
- ChangeLogMojo mojo = (ChangeLogMojo)
- lookupMojo("changelog",
getTestFile("src/test/resources/mojos/changelog/changelogWithParameters.xml"));
-
- String connectionUrl = mojo.getConnectionUrl();
- connectionUrl = StringUtils.replace(connectionUrl, "${basedir}",
PlexusJUnit4TestCase.getBasedir());
- connectionUrl = StringUtils.replace(connectionUrl, "\\", "/");
- mojo.setConnectionUrl(connectionUrl);
- mojo.setWorkingDirectory(new File(getBasedir()));
- mojo.setConnectionType("connection");
-
mojo.execute();
+ // verify log messages as result of mojo execution
+ verify(log, atMost(7)).debug(anyString());
}
@Test
- public void testChangeLogWithBadUserDateFormat() throws Exception {
- ChangeLogMojo mojo = (ChangeLogMojo) lookupMojo(
- "changelog",
getTestFile("src/test/resources/mojos/changelog/changelogWithBadUserDateFormat.xml"));
-
- String connectionUrl = mojo.getConnectionUrl();
- connectionUrl = StringUtils.replace(connectionUrl, "${basedir}",
getBasedir());
- connectionUrl = StringUtils.replace(connectionUrl, "\\", "/");
- mojo.setConnectionUrl(connectionUrl);
- mojo.setWorkingDirectory(new File(getBasedir()));
- mojo.setConnectionType("connection");
-
- try {
- mojo.execute();
-
- fail("mojo execution must fail.");
- } catch (MojoExecutionException e) {
- assertNotNull(e.getMessage());
- }
+ @InjectMojo(goal = "changelog", pom = "changelogWithBadUserDateFormat.xml")
+ void testChangeLogWithBadUserDateFormat(ChangeLogMojo mojo) throws
Exception {
+ MojoExecutionException exception =
assertThrows(MojoExecutionException.class, mojo::execute);
+ assertTrue(exception.getMessage().contains("Please use this date
pattern: yyyyMMdd"));
}
@Test
- public void testChangeLogWithBadConnectionUrl() throws Exception {
+ @InjectMojo(goal = "changelog", pom = "changelogWithBadConnectionUrl.xml")
+ void testChangeLogWithBadConnectionUrl(ChangeLogMojo mojo) throws
Exception {
checkSystemCmdPresence(SvnScmTestUtils.SVN_COMMAND_LINE);
- ChangeLogMojo mojo = (ChangeLogMojo) lookupMojo(
- "changelog",
getTestFile("src/test/resources/mojos/changelog/changelogWithBadConnectionUrl.xml"));
-
- String connectionUrl = mojo.getConnectionUrl();
- connectionUrl = StringUtils.replace(connectionUrl, "${basedir}",
getBasedir());
- connectionUrl = StringUtils.replace(connectionUrl, "\\", "/");
- mojo.setConnectionUrl(connectionUrl);
- mojo.setWorkingDirectory(new File(getBasedir()));
- mojo.setConnectionType("connection");
-
- try {
- mojo.execute();
-
- fail("mojo execution must fail.");
- } catch (MojoExecutionException e) {
- assertNotNull(e.getMessage());
- }
+ MojoExecutionException exception =
assertThrows(MojoExecutionException.class, mojo::execute);
+ assertTrue(exception.getMessage().contains("Command failed: The svn
command failed."));
}
}
diff --git
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java
index ac0823e38..5ed6267b7 100644
---
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java
+++
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java
@@ -20,33 +20,38 @@
import java.io.File;
+import org.apache.maven.api.plugin.testing.Basedir;
+import org.apache.maven.api.plugin.testing.InjectMojo;
+import org.apache.maven.api.plugin.testing.MojoTest;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.scm.provider.ScmProviderRepositoryWithHost;
import org.apache.maven.scm.provider.svn.SvnScmTestUtils;
import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.StringUtils;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import static org.apache.maven.api.plugin.testing.MojoExtension.getTestFile;
import static org.apache.maven.scm.ScmTestCase.checkSystemCmdPresence;
-import static org.junit.Assert.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.AssertionsKt.assertNotNull;
/**
* @author <a href="mailto:[email protected]">Emmanuel Venisse</a>
*
*/
-@RunWith(JUnit4.class)
-public class CheckoutMojoTest extends AbstractJUnit4MojoTestCase {
- File checkoutDir;
+@MojoTest
+@Basedir("/mojos/checkout")
+class CheckoutMojoTest {
+ private File checkoutDir;
- File repository;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
+ private File repository;
+ @BeforeEach
+ void setUp() throws Exception {
checkoutDir = getTestFile("target/checkout");
repository = getTestFile("target/repository");
@@ -55,14 +60,11 @@ public void setUp() throws Exception {
}
@Test
- public void testSkipCheckoutWhenCheckoutDirectoryExistsAndSkip() throws
Exception {
+ @InjectMojo(goal = "checkout", pom =
"checkoutWhenCheckoutDirectoryExistsAndSkip.xml")
+ void testSkipCheckoutWhenCheckoutDirectoryExistsAndSkip(CheckoutMojo mojo)
throws Exception {
FileUtils.forceDelete(checkoutDir);
checkoutDir.mkdirs();
- CheckoutMojo mojo = (CheckoutMojo) lookupMojo(
- "checkout",
-
getTestFile("src/test/resources/mojos/checkout/checkoutWhenCheckoutDirectoryExistsAndSkip.xml"));
-
mojo.setCheckoutDirectory(checkoutDir);
mojo.execute();
@@ -71,36 +73,25 @@ public void
testSkipCheckoutWhenCheckoutDirectoryExistsAndSkip() throws Exceptio
}
@Test
- public void testSkipCheckoutWithConnectionUrl() throws Exception {
+ @InjectMojo(goal = "checkout", pom = "checkoutWithConnectionUrl.xml")
+ void testSkipCheckoutWithConnectionUrl(CheckoutMojo mojo) throws Exception
{
checkSystemCmdPresence(SvnScmTestUtils.SVNADMIN_COMMAND_LINE);
- FileUtils.forceDelete(checkoutDir);
-
SvnScmTestUtils.initializeRepository(repository);
checkSystemCmdPresence(SvnScmTestUtils.SVN_COMMAND_LINE);
- CheckoutMojo mojo = (CheckoutMojo)
- lookupMojo("checkout",
getTestFile("src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml"));
- mojo.setWorkingDirectory(new File(getBasedir()));
-
- String connectionUrl = mojo.getConnectionUrl();
- connectionUrl = StringUtils.replace(connectionUrl, "${basedir}",
getBasedir());
- connectionUrl = StringUtils.replace(connectionUrl, "\\", "/");
- mojo.setConnectionUrl(connectionUrl);
-
mojo.setCheckoutDirectory(checkoutDir);
mojo.execute();
}
@Test
- public void testSkipCheckoutWithoutConnectionUrl() throws Exception {
+ @InjectMojo(goal = "checkout", pom = "checkoutWithoutConnectionUrl.xml")
+ void testSkipCheckoutWithoutConnectionUrl(CheckoutMojo mojo) throws
Exception {
FileUtils.forceDelete(checkoutDir);
checkoutDir.mkdirs();
- CheckoutMojo mojo = (CheckoutMojo) lookupMojo(
- "checkout",
getTestFile("src/test/resources/mojos/checkout/checkoutWithoutConnectionUrl.xml"));
try {
mojo.execute();
@@ -112,16 +103,14 @@ public void testSkipCheckoutWithoutConnectionUrl() throws
Exception {
}
@Test
- public void testUseExport() throws Exception {
+ @InjectMojo(goal = "checkout", pom = "checkoutUsingExport.xml")
+ void testUseExport(CheckoutMojo mojo) throws Exception {
checkSystemCmdPresence(SvnScmTestUtils.SVN_COMMAND_LINE);
FileUtils.forceDelete(checkoutDir);
checkoutDir.mkdirs();
- CheckoutMojo mojo = (CheckoutMojo)
- lookupMojo("checkout",
getTestFile("src/test/resources/mojos/checkout/checkoutUsingExport.xml"));
-
mojo.setCheckoutDirectory(checkoutDir);
mojo.execute();
@@ -131,7 +120,8 @@ public void testUseExport() throws Exception {
}
@Test
- public void testExcludeInclude() throws Exception {
+ @InjectMojo(goal = "checkout", pom = "checkoutWithExcludesIncludes.xml")
+ void testExcludeInclude(CheckoutMojo mojo) throws Exception {
checkSystemCmdPresence(SvnScmTestUtils.SVNADMIN_COMMAND_LINE);
FileUtils.forceDelete(checkoutDir);
@@ -142,9 +132,6 @@ public void testExcludeInclude() throws Exception {
checkSystemCmdPresence(SvnScmTestUtils.SVN_COMMAND_LINE);
- CheckoutMojo mojo = (CheckoutMojo) lookupMojo(
- "checkout",
getTestFile("src/test/resources/mojos/checkout/checkoutWithExcludesIncludes.xml"));
-
mojo.setCheckoutDirectory(checkoutDir);
mojo.execute();
@@ -158,21 +145,20 @@ public void testExcludeInclude() throws Exception {
}
@Test
- public void testEncryptedPasswordFromSettings() throws Exception {
- File pom =
getTestFile("src/test/resources/mojos/checkout/checkoutEncryptedPasswordFromSettings.xml");
- CheckoutMojo mojo = (CheckoutMojo) lookupMojo("checkout", pom);
+ @InjectMojo(goal = "checkout", pom =
"checkoutEncryptedPasswordFromSettings.xml")
+ void testEncryptedPasswordFromSettings(CheckoutMojo mojo) throws Exception
{
ScmProviderRepositoryWithHost repo =
(ScmProviderRepositoryWithHost)
mojo.getScmRepository().getProviderRepository();
assertNotEquals(
- "Raw encrypted Password was returned instead of the decrypted
plaintext version",
"{Ael0S2tnXv8H3X+gHKpZAvAA25D8+gmU2w2RrGaf5v8=}",
- repo.getPassword());
+ repo.getPassword(),
+ "Raw encrypted Password was returned instead of the decrypted
plaintext version");
assertNotEquals(
- "Raw encrypted Passphrase was returned instead of the
decrypted plaintext version",
"{7zK9P8hNVeUHbTsjiA/vnOs0zUXbND+9MBNPvdvl+x4=}",
- repo.getPassphrase());
+ repo.getPassphrase(),
+ "Raw encrypted Passphrase was returned instead of the
decrypted plaintext version");
assertEquals("testuser", repo.getUser());
assertEquals("testpass", repo.getPassword());
diff --git
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ExportMojoTest.java
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ExportMojoTest.java
index b940c545b..e06666b67 100644
---
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ExportMojoTest.java
+++
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ExportMojoTest.java
@@ -20,27 +20,32 @@
import java.io.File;
+import org.apache.maven.api.plugin.testing.Basedir;
+import org.apache.maven.api.plugin.testing.InjectMojo;
+import org.apache.maven.api.plugin.testing.MojoTest;
import org.apache.maven.scm.provider.svn.SvnScmTestUtils;
import org.codehaus.plexus.util.FileUtils;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import static org.apache.maven.api.plugin.testing.MojoExtension.getTestFile;
import static org.apache.maven.scm.ScmTestCase.checkSystemCmdPresence;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
/**
*
*/
-@RunWith(JUnit4.class)
-public class ExportMojoTest extends AbstractJUnit4MojoTestCase {
- File exportDir;
+@MojoTest
+@Basedir("/mojos/export")
+class ExportMojoTest {
+ private File exportDir;
- File repository;
+ private File repository;
- @Before
- public void setUp() throws Exception {
- super.setUp();
+ @BeforeEach
+ void setUp() throws Exception {
exportDir = getTestFile("target/export");
@@ -50,15 +55,14 @@ public void setUp() throws Exception {
}
@Test
- public void testExport() throws Exception {
+ @InjectMojo(goal = "export", pom = "export.xml")
+ void testExport(ExportMojo mojo) throws Exception {
checkSystemCmdPresence(SvnScmTestUtils.SVNADMIN_COMMAND_LINE);
SvnScmTestUtils.initializeRepository(repository);
checkSystemCmdPresence(SvnScmTestUtils.SVN_COMMAND_LINE);
- ExportMojo mojo = (ExportMojo) lookupMojo("export",
getTestFile("src/test/resources/mojos/export/export.xml"));
-
mojo.setExportDirectory(exportDir.getAbsoluteFile());
mojo.execute();
@@ -68,12 +72,10 @@ public void testExport() throws Exception {
}
@Test
- public void testSkipExportIfExists() throws Exception {
+ @InjectMojo(goal = "export", pom =
"exportWhenExportDirectoryExistsAndSkip.xml")
+ void testSkipExportIfExists(ExportMojo mojo) throws Exception {
exportDir.mkdirs();
- ExportMojo mojo = (ExportMojo) lookupMojo(
- "export",
getTestFile("src/test/resources/mojos/export/exportWhenExportDirectoryExistsAndSkip.xml"));
-
mojo.setExportDirectory(exportDir);
mojo.execute();
@@ -82,7 +84,8 @@ public void testSkipExportIfExists() throws Exception {
}
@Test
- public void testExcludeInclude() throws Exception {
+ @InjectMojo(goal = "export", pom = "exportWithExcludesIncludes.xml")
+ void testExcludeInclude(ExportMojo mojo) throws Exception {
checkSystemCmdPresence(SvnScmTestUtils.SVNADMIN_COMMAND_LINE);
SvnScmTestUtils.initializeRepository(repository);
@@ -91,9 +94,6 @@ public void testExcludeInclude() throws Exception {
checkSystemCmdPresence(SvnScmTestUtils.SVN_COMMAND_LINE);
- ExportMojo mojo = (ExportMojo)
- lookupMojo("export",
getTestFile("src/test/resources/mojos/export/exportWithExcludesIncludes.xml"));
-
mojo.setExportDirectory(exportDir);
mojo.execute();
diff --git
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/TagMojoTest.java
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/TagMojoTest.java
index 0628c02a0..6e299d432 100644
---
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/TagMojoTest.java
+++
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/TagMojoTest.java
@@ -20,83 +20,63 @@
import java.io.File;
+import org.apache.maven.api.plugin.testing.Basedir;
+import org.apache.maven.api.plugin.testing.InjectMojo;
+import org.apache.maven.api.plugin.testing.MojoTest;
import org.apache.maven.scm.provider.svn.SvnScmTestUtils;
import org.codehaus.plexus.util.FileUtils;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import static org.apache.maven.api.plugin.testing.MojoExtension.getTestFile;
import static org.apache.maven.scm.ScmTestCase.checkSystemCmdPresence;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* @author <a href="mailto:[email protected]">Emmanuel Venisse</a>
*
*/
-@RunWith(JUnit4.class)
-public class TagMojoTest extends AbstractJUnit4MojoTestCase {
- File checkoutDir;
+@MojoTest
+@Basedir("/mojos/tag")
+public class TagMojoTest {
+ private File checkoutDir;
- File repository;
-
- @Before
+ @BeforeEach
public void setUp() throws Exception {
- super.setUp();
checkoutDir = getTestFile("target/checkout");
FileUtils.forceDelete(checkoutDir);
- repository = getTestFile("target/repository");
+ File repository = getTestFile("target/repository");
FileUtils.forceDelete(repository);
checkSystemCmdPresence(SvnScmTestUtils.SVNADMIN_COMMAND_LINE);
SvnScmTestUtils.initializeRepository(repository);
-
- checkSystemCmdPresence(SvnScmTestUtils.SVN_COMMAND_LINE);
-
- CheckoutMojo checkoutMojo = (CheckoutMojo)
- lookupMojo("checkout",
getTestFile("src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml"));
- checkoutMojo.setWorkingDirectory(new File(getBasedir()));
-
- setupConnectionUrl(checkoutMojo);
-
- checkoutMojo.setCheckoutDirectory(checkoutDir);
-
- checkoutMojo.execute();
- }
-
- private static void setupConnectionUrl(AbstractScmMojo mojo) {
- String connectionUrl = mojo.getConnectionUrl();
- connectionUrl = connectionUrl.replace("${basedir}", getBasedir());
- connectionUrl = connectionUrl.replace('\\', '/');
- mojo.setConnectionUrl(connectionUrl);
}
@Test
- public void testTag() throws Exception {
+ void testTag(
+ @InjectMojo(goal = "tag", pom = "tag.xml") TagMojo mojo,
+ @InjectMojo(goal = "checkout", pom =
"../checkout/checkoutWithConnectionUrl.xml")
+ CheckoutMojo checkoutMojoInit,
+ @InjectMojo(goal = "checkout", pom = "checkout.xml") CheckoutMojo
checkoutMojo)
+ throws Exception {
checkSystemCmdPresence(SvnScmTestUtils.SVN_COMMAND_LINE);
- TagMojo mojo = (TagMojo) lookupMojo("tag",
getTestFile("src/test/resources/mojos/tag/tag.xml"));
- mojo.setWorkingDirectory(checkoutDir);
+ checkoutMojoInit.execute();
- setupConnectionUrl(mojo);
+ mojo.setWorkingDirectory(checkoutDir);
mojo.execute();
- CheckoutMojo checkoutMojo =
- (CheckoutMojo) lookupMojo("checkout",
getTestFile("src/test/resources/mojos/tag/checkout.xml"));
- checkoutMojo.setWorkingDirectory(new File(getBasedir()));
-
- setupConnectionUrl(checkoutMojo);
-
File tagCheckoutDir = getTestFile("target/tags/mytag");
if (tagCheckoutDir.exists()) {
FileUtils.deleteDirectory(tagCheckoutDir);
}
- checkoutMojo.setCheckoutDirectory(tagCheckoutDir);
assertFalse(new File(tagCheckoutDir, "pom.xml").exists());
checkoutMojo.execute();
@@ -104,13 +84,16 @@ public void testTag() throws Exception {
}
@Test
- public void testTagWithTimestamp() throws Exception {
+ void testTagWithTimestamp(
+ @InjectMojo(goal = "tag", pom = "tag.xml") TagMojo mojo,
+ @InjectMojo(goal = "checkout", pom =
"../checkout/checkoutWithConnectionUrl.xml")
+ CheckoutMojo checkoutMojoInit)
+ throws Exception {
checkSystemCmdPresence(SvnScmTestUtils.SVN_COMMAND_LINE);
- TagMojo mojo = (TagMojo) lookupMojo("tag",
getTestFile("src/test/resources/mojos/tag/tagWithTimestamp.xml"));
- mojo.setWorkingDirectory(checkoutDir);
+ checkoutMojoInit.execute();
- setupConnectionUrl(mojo);
+ mojo.setWorkingDirectory(checkoutDir);
mojo.execute();
}
diff --git
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UntagMojoTest.java
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UntagMojoTest.java
index db2081482..bb717c262 100644
---
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UntagMojoTest.java
+++
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UntagMojoTest.java
@@ -20,65 +20,52 @@
import java.io.File;
+import org.apache.maven.api.plugin.testing.Basedir;
+import org.apache.maven.api.plugin.testing.InjectMojo;
+import org.apache.maven.api.plugin.testing.MojoTest;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.scm.provider.git.GitScmTestUtils;
import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.StringUtils;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import static org.apache.maven.api.plugin.testing.MojoExtension.getTestFile;
import static org.apache.maven.scm.ScmTestCase.checkSystemCmdPresence;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.fail;
-@RunWith(JUnit4.class)
-public class UntagMojoTest extends AbstractJUnit4MojoTestCase {
- File checkoutDir;
+@MojoTest
+@Basedir("/mojos/untag")
+class UntagMojoTest {
+ private File checkoutDir;
- File repository;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
+ @BeforeEach
+ void setUp() throws Exception {
+ // super.setUp();
checkoutDir = getTestFile("target/checkout");
- repository = getTestFile("target/repository");
+ File repository = getTestFile("target/repository");
checkSystemCmdPresence(GitScmTestUtils.GIT_COMMAND_LINE);
GitScmTestUtils.initRepo("src/test/resources/git", repository,
checkoutDir);
-
- CheckoutMojo checkoutMojo =
- (CheckoutMojo) lookupMojo("checkout",
getTestFile("src/test/resources/mojos/untag/checkout.xml"));
- checkoutMojo.setWorkingDirectory(checkoutDir);
-
- String connectionUrl = checkoutMojo.getConnectionUrl();
- connectionUrl = StringUtils.replace(connectionUrl, "${basedir}",
getBasedir());
- connectionUrl = StringUtils.replace(connectionUrl, "\\", "/");
- checkoutMojo.setConnectionUrl(connectionUrl);
-
- checkoutMojo.setCheckoutDirectory(checkoutDir);
-
- checkoutMojo.execute();
-
- // Add a default user to the config
- GitScmTestUtils.setDefaultGitConfig(checkoutDir);
}
@Test
- public void testUntag() throws Exception {
+ void testUntag(
+ @InjectMojo(goal = "tag", pom = "tag.xml") TagMojo tagMojo,
+ @InjectMojo(goal = "untag", pom = "untag.xml") UntagMojo untagMojo,
+ @InjectMojo(goal = "checkout", pom = "checkout.xml") CheckoutMojo
checkoutMojoInit,
+ @InjectMojo(goal = "checkout", pom = "checkout-tag.xml")
CheckoutMojo checkoutMojo)
+ throws Exception {
checkSystemCmdPresence(GitScmTestUtils.GIT_COMMAND_LINE);
- TagMojo tagMojo = (TagMojo) lookupMojo("tag",
getTestFile("src/test/resources/mojos/untag/tag.xml"));
- tagMojo.setWorkingDirectory(checkoutDir);
- tagMojo.setConnectionUrl(getConnectionLocalAddress(tagMojo));
- tagMojo.execute();
+ checkoutMojoInit.execute();
+ // Add a default user to the config
+ GitScmTestUtils.setDefaultGitConfig(checkoutDir);
- CheckoutMojo checkoutMojo =
- (CheckoutMojo) lookupMojo("checkout",
getTestFile("src/test/resources/mojos/untag/checkout-tag.xml"));
- checkoutMojo.setWorkingDirectory(new File(getBasedir()));
- checkoutMojo.setConnectionUrl(getConnectionLocalAddress(checkoutMojo));
+ tagMojo.execute();
File tagCheckoutDir = getTestFile("target/tags/mytag");
@@ -86,14 +73,8 @@ public void testUntag() throws Exception {
FileUtils.deleteDirectory(tagCheckoutDir);
}
- checkoutMojo.setCheckoutDirectory(tagCheckoutDir);
checkoutMojo.execute();
-
- UntagMojo mojo = (UntagMojo) lookupMojo("untag",
getTestFile("src/test/resources/mojos/untag/untag.xml"));
- mojo.setWorkingDirectory(checkoutDir);
- mojo.setConnectionUrl(getConnectionLocalAddress(mojo));
-
- mojo.execute();
+ untagMojo.execute();
FileUtils.deleteDirectory(tagCheckoutDir);
@@ -105,11 +86,4 @@ public void testUntag() throws Exception {
assertNotNull(e.getMessage());
}
}
-
- private String getConnectionLocalAddress(AbstractScmMojo mojo) {
- String connectionUrl = mojo.getConnectionUrl();
- connectionUrl = StringUtils.replace(connectionUrl, "${basedir}",
getBasedir());
- connectionUrl = StringUtils.replace(connectionUrl, "\\", "/");
- return connectionUrl;
- }
}
diff --git
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UpdateMojoTest.java
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UpdateMojoTest.java
index b5af852ef..e4864da54 100644
---
a/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UpdateMojoTest.java
+++
b/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UpdateMojoTest.java
@@ -20,31 +20,31 @@
import java.io.File;
+import org.apache.maven.api.plugin.testing.Basedir;
+import org.apache.maven.api.plugin.testing.InjectMojo;
+import org.apache.maven.api.plugin.testing.MojoTest;
import org.apache.maven.scm.provider.svn.SvnScmTestUtils;
import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.StringUtils;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import static org.apache.maven.api.plugin.testing.MojoExtension.getTestFile;
import static org.apache.maven.scm.ScmTestCase.checkSystemCmdPresence;
/**
* @author <a href="mailto:[email protected]">Emmanuel Venisse</a>
*
*/
-@RunWith(JUnit4.class)
-public class UpdateMojoTest extends AbstractJUnit4MojoTestCase {
- File checkoutDir;
+@MojoTest
+@Basedir("/mojos/update")
+class UpdateMojoTest {
- File repository;
+ private File repository;
- @Before
- public void setUp() throws Exception {
- super.setUp();
+ @BeforeEach
+ void setUp() throws Exception {
- checkoutDir = getTestFile("target/checkout");
+ File checkoutDir = getTestFile("target/checkout");
repository = getTestFile("target/repository");
@@ -52,31 +52,18 @@ public void setUp() throws Exception {
}
@Test
- public void testSkipCheckoutWithConnectionUrl() throws Exception {
+ void testSkipCheckoutWithConnectionUrl(
+ @InjectMojo(goal = "update", pom = "updateWithConnectionUrl.xml")
UpdateMojo updateMojo,
+ @InjectMojo(goal = "checkout", pom =
"../checkout/checkoutWithConnectionUrl.xml") CheckoutMojo checkoutMojo)
+ throws Exception {
checkSystemCmdPresence(SvnScmTestUtils.SVNADMIN_COMMAND_LINE);
SvnScmTestUtils.initializeRepository(repository);
checkSystemCmdPresence(SvnScmTestUtils.SVN_COMMAND_LINE);
- CheckoutMojo checkoutMojo = (CheckoutMojo)
- lookupMojo("checkout",
getTestFile("src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml"));
-
- String connectionUrl = checkoutMojo.getConnectionUrl();
- connectionUrl = StringUtils.replace(connectionUrl, "${basedir}",
getBasedir());
- connectionUrl = StringUtils.replace(connectionUrl, "\\", "/");
- checkoutMojo.setConnectionUrl(connectionUrl);
-
checkoutMojo.execute();
- UpdateMojo updateMojo = (UpdateMojo)
- lookupMojo("update",
getTestFile("src/test/resources/mojos/update/updateWithConnectionUrl.xml"));
-
- connectionUrl = updateMojo.getConnectionUrl();
- connectionUrl = StringUtils.replace(connectionUrl, "${basedir}",
getBasedir());
- connectionUrl = StringUtils.replace(connectionUrl, "\\", "/");
- updateMojo.setConnectionUrl(connectionUrl);
-
updateMojo.execute();
}
}
diff --git a/maven-scm-plugin/src/test/resources/mojos/branch/branch.xml
b/maven-scm-plugin/src/test/resources/mojos/branch/branch.xml
index 31a835812..2c4a7e3ff 100644
--- a/maven-scm-plugin/src/test/resources/mojos/branch/branch.xml
+++ b/maven-scm-plugin/src/test/resources/mojos/branch/branch.xml
@@ -23,7 +23,6 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
<connectionUrl>scm:svn:file:///${basedir}/target/repository/trunk</connectionUrl>
<connectionType>connection</connectionType>
<branch>mybranch</branch>
diff --git a/maven-scm-plugin/src/test/resources/mojos/branch/checkout.xml
b/maven-scm-plugin/src/test/resources/mojos/branch/checkout.xml
index 14545f8c8..90cc262c0 100644
--- a/maven-scm-plugin/src/test/resources/mojos/branch/checkout.xml
+++ b/maven-scm-plugin/src/test/resources/mojos/branch/checkout.xml
@@ -23,7 +23,6 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
<checkoutDirectory>target/branches/mybranch</checkoutDirectory>
<connectionType>connection</connectionType>
<connectionUrl>scm:svn:file:///${basedir}/target/repository/trunk</connectionUrl>
diff --git a/maven-scm-plugin/src/test/resources/mojos/changelog/changelog.xml
b/maven-scm-plugin/src/test/resources/mojos/changelog/changelog.xml
index cca511883..2251ef085 100644
--- a/maven-scm-plugin/src/test/resources/mojos/changelog/changelog.xml
+++ b/maven-scm-plugin/src/test/resources/mojos/changelog/changelog.xml
@@ -23,7 +23,6 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
<connectionUrl>scm:svn:file:///${basedir}/target/repository</connectionUrl>
<connectionType>connection</connectionType>
</configuration>
diff --git
a/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithBadConnectionUrl.xml
b/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithBadConnectionUrl.xml
index 812f28b53..006099dd4 100644
---
a/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithBadConnectionUrl.xml
+++
b/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithBadConnectionUrl.xml
@@ -23,7 +23,6 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
<connectionUrl>scm:svn:http://a.bad.host/repos/trunk</connectionUrl>
<connectionType>connection</connectionType>
</configuration>
diff --git
a/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithBadUserDateFormat.xml
b/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithBadUserDateFormat.xml
index 5a7739a2f..6943711cf 100644
---
a/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithBadUserDateFormat.xml
+++
b/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithBadUserDateFormat.xml
@@ -23,7 +23,6 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
<connectionUrl>scm:svn:file:///${basedir}/target/repository</connectionUrl>
<connectionType>connection</connectionType>
<startDate>aabbccddeeffgg</startDate>
diff --git
a/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithParameters.xml
b/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithParameters.xml
index bed0ff637..686e3f4d3 100644
---
a/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithParameters.xml
+++
b/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithParameters.xml
@@ -23,7 +23,7 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
+<!-- <settings
implementation="org.apache.maven.settings.Settings"/>-->
<connectionUrl>scm:svn:file:///${basedir}/target/repository</connectionUrl>
<connectionType>connection</connectionType>
<startDate>2004-11-01</startDate>
diff --git
a/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutUsingExport.xml
b/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutUsingExport.xml
index 54ca84c09..61d5588e8 100644
--- a/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutUsingExport.xml
+++ b/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutUsingExport.xml
@@ -23,7 +23,6 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
<checkoutDirectory>target/checkout</checkoutDirectory>
<connectionType>connection</connectionType>
<useExport>true</useExport>
diff --git
a/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml
b/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml
index a2c17802b..be11976da 100644
---
a/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml
+++
b/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml
@@ -23,7 +23,6 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
<checkoutDirectory>target/checkout</checkoutDirectory>
<connectionType>connection</connectionType>
<connectionUrl>scm:svn:file:///${basedir}/target/repository/trunk</connectionUrl>
diff --git
a/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithExcludesIncludes.xml
b/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithExcludesIncludes.xml
index e39769796..dd386d126 100644
---
a/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithExcludesIncludes.xml
+++
b/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithExcludesIncludes.xml
@@ -23,7 +23,6 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
<checkoutDirectory>target/checkout</checkoutDirectory>
<connectionType>connection</connectionType>
<connectionUrl>scm:svn:file:///${basedir}/target/repository/trunk</connectionUrl>
diff --git a/maven-scm-plugin/src/test/resources/mojos/export/export.xml
b/maven-scm-plugin/src/test/resources/mojos/export/export.xml
index 160a3295a..f75cf1282 100644
--- a/maven-scm-plugin/src/test/resources/mojos/export/export.xml
+++ b/maven-scm-plugin/src/test/resources/mojos/export/export.xml
@@ -23,7 +23,6 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
<exportDirectory>target/export</exportDirectory>
<connectionType>connection</connectionType>
<connectionUrl>scm:svn:file:///${basedir}/target/repository/trunk</connectionUrl>
diff --git
a/maven-scm-plugin/src/test/resources/mojos/export/exportWithExcludesIncludes.xml
b/maven-scm-plugin/src/test/resources/mojos/export/exportWithExcludesIncludes.xml
index f6b6d869b..d8635d54a 100644
---
a/maven-scm-plugin/src/test/resources/mojos/export/exportWithExcludesIncludes.xml
+++
b/maven-scm-plugin/src/test/resources/mojos/export/exportWithExcludesIncludes.xml
@@ -23,7 +23,6 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
<exportDirectory>target/export</exportDirectory>
<connectionType>connection</connectionType>
<connectionUrl>scm:svn:file:///${basedir}/target/repository/trunk</connectionUrl>
diff --git a/maven-scm-plugin/src/test/resources/mojos/tag/checkout.xml
b/maven-scm-plugin/src/test/resources/mojos/tag/checkout.xml
index b8b802214..2c05087cb 100644
--- a/maven-scm-plugin/src/test/resources/mojos/tag/checkout.xml
+++ b/maven-scm-plugin/src/test/resources/mojos/tag/checkout.xml
@@ -23,7 +23,6 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
<checkoutDirectory>target/tags/mytag</checkoutDirectory>
<connectionType>connection</connectionType>
<connectionUrl>scm:svn:file:///${basedir}/target/repository/trunk</connectionUrl>
diff --git a/maven-scm-plugin/src/test/resources/mojos/tag/tag.xml
b/maven-scm-plugin/src/test/resources/mojos/tag/tag.xml
index dafa0f335..daecbfd8d 100644
--- a/maven-scm-plugin/src/test/resources/mojos/tag/tag.xml
+++ b/maven-scm-plugin/src/test/resources/mojos/tag/tag.xml
@@ -23,7 +23,6 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
<connectionUrl>scm:svn:file:///${basedir}/target/repository/trunk</connectionUrl>
<connectionType>connection</connectionType>
<tag>mytag</tag>
diff --git a/maven-scm-plugin/src/test/resources/mojos/tag/tagWithTimestamp.xml
b/maven-scm-plugin/src/test/resources/mojos/tag/tagWithTimestamp.xml
index 6cc374542..a6f6657e7 100644
--- a/maven-scm-plugin/src/test/resources/mojos/tag/tagWithTimestamp.xml
+++ b/maven-scm-plugin/src/test/resources/mojos/tag/tagWithTimestamp.xml
@@ -23,7 +23,6 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
<connectionUrl>scm:svn:file:///${basedir}/target/repository/trunk</connectionUrl>
<connectionType>connection</connectionType>
<tag>mytag</tag>
diff --git a/maven-scm-plugin/src/test/resources/mojos/untag/checkout-tag.xml
b/maven-scm-plugin/src/test/resources/mojos/untag/checkout-tag.xml
index cbf1c57c5..30044d7bd 100644
--- a/maven-scm-plugin/src/test/resources/mojos/untag/checkout-tag.xml
+++ b/maven-scm-plugin/src/test/resources/mojos/untag/checkout-tag.xml
@@ -23,7 +23,6 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
<checkoutDirectory>target/tags/mytag</checkoutDirectory>
<connectionType>connection</connectionType>
<scmVersion>mytag</scmVersion>
diff --git a/maven-scm-plugin/src/test/resources/mojos/untag/checkout.xml
b/maven-scm-plugin/src/test/resources/mojos/untag/checkout.xml
index e29441dc3..88373097e 100644
--- a/maven-scm-plugin/src/test/resources/mojos/untag/checkout.xml
+++ b/maven-scm-plugin/src/test/resources/mojos/untag/checkout.xml
@@ -23,8 +23,7 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
- <checkoutDirectory>target/tags/mytag</checkoutDirectory>
+ <checkoutDirectory>target/checkout</checkoutDirectory>
<connectionType>connection</connectionType>
<connectionUrl>scm:git:file:///${basedir}/target/repository</connectionUrl>
</configuration>
diff --git a/maven-scm-plugin/src/test/resources/mojos/untag/tag.xml
b/maven-scm-plugin/src/test/resources/mojos/untag/tag.xml
index 91e2359c2..db0b17181 100644
--- a/maven-scm-plugin/src/test/resources/mojos/untag/tag.xml
+++ b/maven-scm-plugin/src/test/resources/mojos/untag/tag.xml
@@ -23,7 +23,7 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
+ <workingDirectory>target/checkout</workingDirectory>
<connectionUrl>scm:git:file:///${basedir}/target/repository</connectionUrl>
<connectionType>connection</connectionType>
<tag>mytag</tag>
diff --git a/maven-scm-plugin/src/test/resources/mojos/untag/untag.xml
b/maven-scm-plugin/src/test/resources/mojos/untag/untag.xml
index 91e2359c2..db0b17181 100644
--- a/maven-scm-plugin/src/test/resources/mojos/untag/untag.xml
+++ b/maven-scm-plugin/src/test/resources/mojos/untag/untag.xml
@@ -23,7 +23,7 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
+ <workingDirectory>target/checkout</workingDirectory>
<connectionUrl>scm:git:file:///${basedir}/target/repository</connectionUrl>
<connectionType>connection</connectionType>
<tag>mytag</tag>
diff --git
a/maven-scm-plugin/src/test/resources/mojos/update/updateWithConnectionUrl.xml
b/maven-scm-plugin/src/test/resources/mojos/update/updateWithConnectionUrl.xml
index 494f9f11d..cf7bc6af4 100644
---
a/maven-scm-plugin/src/test/resources/mojos/update/updateWithConnectionUrl.xml
+++
b/maven-scm-plugin/src/test/resources/mojos/update/updateWithConnectionUrl.xml
@@ -23,8 +23,6 @@
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
- <settings implementation="org.apache.maven.settings.Settings"/>
- <project
implementation="org.apache.maven.plugin.testing.stubs.MavenProjectStub"/>
<connectionType>connection</connectionType>
<connectionUrl>scm:svn:file:///${basedir}/target/repository/trunk</connectionUrl>
<workingDirectory>target/checkout</workingDirectory>