Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions maven-scm-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
<artifactId>commons-lang3</artifactId>
<version>3.19.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*/
package org.apache.maven.scm;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;

/**
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse </a>
Expand Down
42 changes: 21 additions & 21 deletions maven-scm-api/src/test/java/org/apache/maven/scm/ChangeSetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
import java.util.Calendar;
import java.util.Date;

import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
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.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* Tests for the {@link ChangeSet}class
Expand All @@ -46,7 +46,7 @@ public class ChangeSetTest {
/**
* Initialize per test data
*/
@Before
@BeforeEach
public void setUp() {
instance = createInstance();
}
Expand All @@ -67,7 +67,7 @@ private static ChangeSet createInstance() {
public void testAddFileWithFile() {
ChangeFile file = new ChangeFile("maven:dummy");
instance.addFile(file);
assertTrue("File name not found in list", instance.toString().indexOf("maven:dummy") != -1);
assertTrue(instance.toString().indexOf("maven:dummy") != -1, "File name not found in list");

assertTrue(instance.containsFilename("maven:"));
assertTrue(instance.containsFilename(":dummy"));
Expand All @@ -83,17 +83,17 @@ public void testAddFileWithFile() {
public void testToString() {
// dion, Mon Apr 01 00:00:00 EST 2002, comment
String value = instance.toString();
assertTrue("author not found in string", value.indexOf("dion") != -1);
assertTrue("comment not found in string", value.indexOf("comment") != -1);
assertTrue("date not found in string", value.indexOf("Mon Apr 01") != -1);
assertTrue(value.indexOf("dion") != -1, "author not found in string");
assertTrue(value.indexOf("comment") != -1, "comment not found in string");
assertTrue(value.indexOf("Mon Apr 01") != -1, "date not found in string");
}

/**
* Test of getAuthor method
*/
@Test
public void testGetAuthor() {
assertEquals("Author value not retrieved correctly", "dion", instance.getAuthor());
assertEquals("dion", instance.getAuthor(), "Author value not retrieved correctly");
}

/**
Expand All @@ -102,15 +102,15 @@ public void testGetAuthor() {
@Test
public void testSetAuthor() {
instance.setAuthor("maven:dion");
assertEquals("Author not set correctly", "maven:dion", instance.getAuthor());
assertEquals("maven:dion", instance.getAuthor(), "Author not set correctly");
}

/**
* Test of getComment method
*/
@Test
public void testGetComment() {
assertEquals("Comment value not retrieved correctly", "comment", instance.getComment());
assertEquals("comment", instance.getComment(), "Comment value not retrieved correctly");
}

/**
Expand All @@ -119,15 +119,15 @@ public void testGetComment() {
@Test
public void testSetComment() {
instance.setComment("maven:comment");
assertEquals("Comment not set correctly", "maven:comment", instance.getComment());
assertEquals("maven:comment", instance.getComment(), "Comment not set correctly");
}

/**
* Test of getDate method
*/
@Test
public void testGetDate() {
assertEquals("Date value not retrieved correctly", getDate(2002, 3, 1), instance.getDate());
assertEquals(getDate(2002, 3, 1), instance.getDate(), "Date value not retrieved correctly");
}

/**
Expand All @@ -138,7 +138,7 @@ public void testSetDate() {
Calendar cal = Calendar.getInstance();
Date date = cal.getTime();
instance.setDate(date);
assertEquals("Date value not set correctly", date, instance.getDate());
assertEquals(date, instance.getDate(), "Date value not set correctly");
}

/**
Expand All @@ -147,23 +147,23 @@ public void testSetDate() {
@Test
public void testSetDateFromString() {
instance.setDate("2002/03/04 00:00:00");
assertEquals("Date value not set correctly from a string", getDate(2002, 2, 4), instance.getDate());
assertEquals(getDate(2002, 2, 4), instance.getDate(), "Date value not set correctly from a string");
}

/**
* Test of getDateFormatted method
*/
@Test
public void testGetDateFormatted() {
assertEquals("Date not formatted correctly", "2002-04-01", instance.getDateFormatted());
assertEquals("2002-04-01", instance.getDateFormatted(), "Date not formatted correctly");
}

/**
* Test of getDateFormatted method
*/
@Test
public void testGetTimeFormatted() {
assertEquals("Time not formatted correctly", "00:00:00", instance.getTimeFormatted());
assertEquals("00:00:00", instance.getTimeFormatted(), "Time not formatted correctly");
}

public static Date getDate(int year, int month, int day) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
import java.util.Iterator;
import java.util.List;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

/**
* @author dtran
Expand Down Expand Up @@ -60,9 +60,9 @@ public void testFilesList() throws IOException {
assertEquals("**/**", fileSet.getIncludes());
// assertEquals( ScmFileSet.DEFAULT_EXCLUDES, fileSet.getExcludes() );
assertTrue(
fileSet.getFileList().size() > 10,
"List of files should be longer than 10 elements, but received: "
+ fileSet.getFileList().size(),
fileSet.getFileList().size() > 10);
+ fileSet.getFileList().size());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*/
package org.apache.maven.scm;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class ScmResultTest {

Expand All @@ -38,11 +38,11 @@ public class ScmResultTest {
@Test
public void testPasswordsAreMaskedInOutput() throws Exception {
ScmResult result = new ScmResult("git push", "git-push failed", MOCK_ERROR_OUTPUT, false);
assertNotSame("Command output contains password", MOCK_ERROR_OUTPUT, result.getCommandOutput());
assertTrue("Command output not masked", result.getCommandOutput().contains(ScmResult.PASSWORD_PLACE_HOLDER));
assertNotSame(MOCK_ERROR_OUTPUT, result.getCommandOutput(), "Command output contains password");
assertTrue(result.getCommandOutput().contains(ScmResult.PASSWORD_PLACE_HOLDER), "Command output not masked");

result = new ScmResult("git push", "git-push failed", MOCK_ERROR_MULTILINE_OUTPUT, false);
assertNotSame("Command output contains password", MOCK_ERROR_MULTILINE_OUTPUT, result.getCommandOutput());
assertTrue("Command output not masked", result.getCommandOutput().contains(ScmResult.PASSWORD_PLACE_HOLDER));
assertNotSame(MOCK_ERROR_MULTILINE_OUTPUT, result.getCommandOutput(), "Command output contains password");
assertTrue(result.getCommandOutput().contains(ScmResult.PASSWORD_PLACE_HOLDER), "Command output not masked");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
*/
package org.apache.maven.scm.manager;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

/**
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
*/
package org.apache.maven.scm.provider;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* @author <a href="mailto:dennisl@apache.org">Dennis Lundberg</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*/
package org.apache.maven.scm.util;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;

public class FilenameUtilsTest {

Expand Down
26 changes: 18 additions & 8 deletions maven-scm-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,6 @@
<version>1</version>
<scope>provided</scope>
</dependency>

<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
Expand All @@ -160,16 +152,34 @@
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-svntest</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gittest</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@

import org.apache.maven.plugin.testing.AbstractMojoTestCase;
import org.apache.maven.scm.PlexusJUnit4TestCase;
import org.junit.After;
import org.junit.Before;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;

public abstract class AbstractJUnit4MojoTestCase extends AbstractMojoTestCase {
private static final PlexusJUnit4TestCase PLEXUS_JUNIT4_TEST_CASE = new PlexusJUnit4TestCase();

@Before
@BeforeEach
public void setUp() throws Exception {
super.setUp();
PLEXUS_JUNIT4_TEST_CASE.setUp();
}

@After
@AfterEach
public void tearDown() throws Exception {
super.tearDown();
PLEXUS_JUNIT4_TEST_CASE.tearDown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@
import java.io.File;

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.junit.jupiter.api.Assertions.assertEquals;

/**
* Unit Test for BootstrapMojo
*
* @author <a href="mailto:arne@degenring.com">Arne Degenring</a>
*
*/
@RunWith(JUnit4.class)
public class BootstrapMojoTest extends AbstractJUnit4MojoTestCase {
File checkoutDir;

Expand All @@ -42,7 +41,7 @@ public class BootstrapMojoTest extends AbstractJUnit4MojoTestCase {

BootstrapMojo bootstrapMojo;

@Before
@BeforeEach
public void setUp() throws Exception {
super.setUp();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,23 @@
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.scm.ScmTestCase.checkSystemCmdPresence;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
*
*/
@RunWith(JUnit4.class)
public class BranchMojoTest extends AbstractJUnit4MojoTestCase {
File checkoutDir;

File repository;

@Before
@BeforeEach
public void setUp() throws Exception {
super.setUp();

Expand Down
Loading
Loading