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
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

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

/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
Expand All @@ -56,7 +56,7 @@ public void testExistingRepository() throws Exception {

assertNotNull(providerRepository);

assertTrue(providerRepository instanceof LocalScmProviderRepository);
assertInstanceOf(LocalScmProviderRepository.class, providerRepository);

LocalScmProviderRepository local = (LocalScmProviderRepository) providerRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

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

/**
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
Expand Down Expand Up @@ -528,9 +528,7 @@ private ScmRepository testScmRepository(String scmUrl, String expectedToString,

assertNotNull("The provider repository was null.", repository.getProviderRepository());

assertTrue(
"The SCM Repository isn't a " + GitScmProviderRepository.class.getName() + ".",
repository.getProviderRepository() instanceof GitScmProviderRepository);
assertInstanceOf(GitScmProviderRepository.class, repository.getProviderRepository(), "The SCM Repository isn't a " + GitScmProviderRepository.class.getName() + ".");

if (expectedToString != null) {
assertEquals("toString is incorrect", "git:" + expectedToString, repository.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@
import org.apache.maven.scm.tck.command.changelog.ChangeLogCommandTckTest;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* @author <a href="mailto:struberg@yahoo.de">Mark Struberg</a>
Expand Down Expand Up @@ -82,7 +81,7 @@ public void testChangeLogCommandFromHeadAncestorAndHead() throws Exception {
1,
logEntries.size());

assertThat("bad head commit SHA1 retrieved", logEntries.get(0).getRevision(), startsWith("464921b"));
assertTrue(logEntries.get(0).getRevision().startsWith("464921b"), "bad head commit SHA1 retrieved");
}

@Test
Expand Down Expand Up @@ -139,8 +138,8 @@ public void testChangeLogCommandFromVersionToUndefined() throws Exception {
assertEquals(
String.format("changelog for %s.. returned bad number of commits", startVersion), 2, logEntries.size());

assertThat("bad commit SHA1 retrieved", logEntries.get(0).getRevision(), startsWith("464921b"));
assertThat("bad commit SHA1 retrieved", logEntries.get(1).getRevision(), startsWith("db46d63"));
assertTrue(logEntries.get(0).getRevision().startsWith("464921b"), "bad commit SHA1 retrieved");
assertTrue(logEntries.get(1).getRevision().startsWith("db46d63"), "bad commit SHA1 retrieved");
}

@Test
Expand All @@ -161,8 +160,8 @@ public void testChangeLogCommandFromVoneToVtwo() throws Exception {
assertEquals(
String.format("changelog for %s.. returned bad number of commits", startVersion), 2, logEntries.size());

assertThat("bad commit SHA1 retrieved", logEntries.get(0).getRevision(), startsWith("db46d63"));
assertThat("bad commit SHA1 retrieved", logEntries.get(1).getRevision(), startsWith("e3864d9"));
assertTrue(logEntries.get(0).getRevision().startsWith("db46d63"), "bad commit SHA1 retrieved");
assertTrue(logEntries.get(1).getRevision().startsWith("e3864d9"), "bad commit SHA1 retrieved");
}

@Test
Expand Down Expand Up @@ -217,10 +216,10 @@ public void testChangeLogCommandFromVersionToStartOfRepository() throws Exceptio
List<ChangeSet> logEntries = changelogResult.getChangeLog().getChangeSets();
assertEquals(String.format("changelog for %s returned bad number of commits", version), 4, logEntries.size());

assertThat("bad commit SHA1 retrieved", logEntries.get(0).getRevision(), startsWith("db46d63"));
assertThat("bad commit SHA1 retrieved", logEntries.get(1).getRevision(), startsWith("e3864d9"));
assertThat("bad commit SHA1 retrieved", logEntries.get(2).getRevision(), startsWith("0f1e817"));
assertThat("bad commit SHA1 retrieved", logEntries.get(3).getRevision(), startsWith("e75cb5a"));
assertTrue(logEntries.get(0).getRevision().startsWith("db46d63"), "bad commit SHA1 retrieved");
assertTrue(logEntries.get(1).getRevision().startsWith("e3864d9"), "bad commit SHA1 retrieved");
assertTrue(logEntries.get(2).getRevision().startsWith("0f1e817"), "bad commit SHA1 retrieved");
assertTrue(logEntries.get(3).getRevision().startsWith("e75cb5a"), "bad commit SHA1 retrieved");

List<String> tags4 = Arrays.asList("Tag4a", "Tag4b");
List<String> tags2 = Collections.singletonList("Tag2");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

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

/**
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
Expand Down Expand Up @@ -240,9 +240,7 @@ private void testUrl(

assertNotNull("The provider repository was null.", repository.getProviderRepository());

assertTrue(
"The SCM Repository isn't a " + SvnScmProviderRepository.class.getName() + ".",
repository.getProviderRepository() instanceof SvnScmProviderRepository);
assertInstanceOf(SvnScmProviderRepository.class, repository.getProviderRepository(), "The SCM Repository isn't a " + SvnScmProviderRepository.class.getName() + ".");

SvnScmProviderRepository providerRepository = (SvnScmProviderRepository) repository.getProviderRepository();

Expand Down Expand Up @@ -302,14 +300,14 @@ public void testGetParent() {
@Test
public void testGetParentDotSlashEndingURL() {
SvnScmProviderRepository slashDotRepo = new SvnScmProviderRepository("file://a/b/c/././.");
assertTrue(slashDotRepo.getParent() instanceof SvnScmProviderRepository);
assertInstanceOf(SvnScmProviderRepository.class, slashDotRepo.getParent());
assertEquals("file://a/b", ((SvnScmProviderRepository) slashDotRepo.getParent()).getUrl());
}

@Test
public void testGetParentSlashEndingURL() {
SvnScmProviderRepository slashRepo = new SvnScmProviderRepository("file://a/b/c///");
assertTrue(slashRepo.getParent() instanceof SvnScmProviderRepository);
assertInstanceOf(SvnScmProviderRepository.class, slashRepo.getParent());
assertEquals("file://a/b", ((SvnScmProviderRepository) slashRepo.getParent()).getUrl());
}
}
Loading