mirror of https://github.com/apache/maven.git
[MNG-7451] - Remove public modifier from test methods / test classes
This commit is contained in:
parent
d7d8544669
commit
c49c4e0b18
|
@ -34,10 +34,10 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class GlobalSettingsTest {
|
class GlobalSettingsTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testValidGlobalSettings() throws Exception {
|
void testValidGlobalSettings() throws Exception {
|
||||||
String basedir = System.getProperty("basedir", System.getProperty("user.dir"));
|
String basedir = System.getProperty("basedir", System.getProperty("user.dir"));
|
||||||
|
|
||||||
File globalSettingsFile = new File(basedir, "src/assembly/maven/conf/settings.xml");
|
File globalSettingsFile = new File(basedir, "src/assembly/maven/conf/settings.xml");
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
|
|
||||||
public class SettingsTest {
|
class SettingsTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSetLocalRepository() {
|
void testSetLocalRepository() {
|
||||||
|
|
|
@ -35,14 +35,14 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class ArtifactUtilsTest {
|
class ArtifactUtilsTest {
|
||||||
|
|
||||||
private Artifact newArtifact(String aid) {
|
private Artifact newArtifact(String aid) {
|
||||||
return new DefaultArtifact("group", aid, VersionRange.createFromVersion("1.0"), "test", "jar", "tests", null);
|
return new DefaultArtifact("group", aid, VersionRange.createFromVersion("1.0"), "test", "jar", "tests", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testIsSnapshot() {
|
void testIsSnapshot() {
|
||||||
assertFalse(ArtifactUtils.isSnapshot(null));
|
assertFalse(ArtifactUtils.isSnapshot(null));
|
||||||
assertFalse(ArtifactUtils.isSnapshot(""));
|
assertFalse(ArtifactUtils.isSnapshot(""));
|
||||||
assertFalse(ArtifactUtils.isSnapshot("1.2.3"));
|
assertFalse(ArtifactUtils.isSnapshot("1.2.3"));
|
||||||
|
@ -53,7 +53,7 @@ public class ArtifactUtilsTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testToSnapshotVersion() {
|
void testToSnapshotVersion() {
|
||||||
assertEquals("1.2.3", ArtifactUtils.toSnapshotVersion("1.2.3"));
|
assertEquals("1.2.3", ArtifactUtils.toSnapshotVersion("1.2.3"));
|
||||||
assertEquals("1.2.3-SNAPSHOT", ArtifactUtils.toSnapshotVersion("1.2.3-SNAPSHOT"));
|
assertEquals("1.2.3-SNAPSHOT", ArtifactUtils.toSnapshotVersion("1.2.3-SNAPSHOT"));
|
||||||
assertEquals("1.2.3-SNAPSHOT", ArtifactUtils.toSnapshotVersion("1.2.3-20090413.094722-2"));
|
assertEquals("1.2.3-SNAPSHOT", ArtifactUtils.toSnapshotVersion("1.2.3-20090413.094722-2"));
|
||||||
|
@ -64,7 +64,7 @@ public class ArtifactUtilsTest {
|
||||||
* Tests that the ordering of the map resembles the ordering of the input collection of artifacts.
|
* Tests that the ordering of the map resembles the ordering of the input collection of artifacts.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testArtifactMapByVersionlessIdOrdering() throws Exception {
|
void testArtifactMapByVersionlessIdOrdering() throws Exception {
|
||||||
List<Artifact> list = new ArrayList<>();
|
List<Artifact> list = new ArrayList<>();
|
||||||
list.add(newArtifact("b"));
|
list.add(newArtifact("b"));
|
||||||
list.add(newArtifact("a"));
|
list.add(newArtifact("a"));
|
||||||
|
|
|
@ -27,7 +27,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
public class DefaultArtifactTest {
|
class DefaultArtifactTest {
|
||||||
|
|
||||||
private DefaultArtifact artifact;
|
private DefaultArtifact artifact;
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public class DefaultArtifactTest {
|
||||||
private ArtifactHandlerMock artifactHandler;
|
private ArtifactHandlerMock artifactHandler;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setUp() throws Exception {
|
void setUp() throws Exception {
|
||||||
artifactHandler = new ArtifactHandlerMock();
|
artifactHandler = new ArtifactHandlerMock();
|
||||||
versionRange = VersionRange.createFromVersion(version);
|
versionRange = VersionRange.createFromVersion(version);
|
||||||
artifact = new DefaultArtifact(groupId, artifactId, versionRange, scope, type, classifier, artifactHandler);
|
artifact = new DefaultArtifact(groupId, artifactId, versionRange, scope, type, classifier, artifactHandler);
|
||||||
|
@ -60,7 +60,7 @@ public class DefaultArtifactTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetVersionReturnsResolvedVersionOnSnapshot() {
|
void testGetVersionReturnsResolvedVersionOnSnapshot() {
|
||||||
assertEquals(snapshotResolvedVersion, snapshotArtifact.getVersion());
|
assertEquals(snapshotResolvedVersion, snapshotArtifact.getVersion());
|
||||||
|
|
||||||
// this is FOUL!
|
// this is FOUL!
|
||||||
|
@ -70,55 +70,55 @@ public class DefaultArtifactTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetDependencyConflictId() {
|
void testGetDependencyConflictId() {
|
||||||
assertEquals(groupId + ":" + artifactId + ":" + type + ":" + classifier, artifact.getDependencyConflictId());
|
assertEquals(groupId + ":" + artifactId + ":" + type + ":" + classifier, artifact.getDependencyConflictId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetDependencyConflictIdNullGroupId() {
|
void testGetDependencyConflictIdNullGroupId() {
|
||||||
artifact.setGroupId(null);
|
artifact.setGroupId(null);
|
||||||
assertEquals(null + ":" + artifactId + ":" + type + ":" + classifier, artifact.getDependencyConflictId());
|
assertEquals(null + ":" + artifactId + ":" + type + ":" + classifier, artifact.getDependencyConflictId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetDependencyConflictIdNullClassifier() {
|
void testGetDependencyConflictIdNullClassifier() {
|
||||||
artifact = new DefaultArtifact(groupId, artifactId, versionRange, scope, type, null, artifactHandler);
|
artifact = new DefaultArtifact(groupId, artifactId, versionRange, scope, type, null, artifactHandler);
|
||||||
assertEquals(groupId + ":" + artifactId + ":" + type, artifact.getDependencyConflictId());
|
assertEquals(groupId + ":" + artifactId + ":" + type, artifact.getDependencyConflictId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetDependencyConflictIdNullScope() {
|
void testGetDependencyConflictIdNullScope() {
|
||||||
artifact.setScope(null);
|
artifact.setScope(null);
|
||||||
assertEquals(groupId + ":" + artifactId + ":" + type + ":" + classifier, artifact.getDependencyConflictId());
|
assertEquals(groupId + ":" + artifactId + ":" + type + ":" + classifier, artifact.getDependencyConflictId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testToString() {
|
void testToString() {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
groupId + ":" + artifactId + ":" + type + ":" + classifier + ":" + version + ":" + scope,
|
groupId + ":" + artifactId + ":" + type + ":" + classifier + ":" + version + ":" + scope,
|
||||||
artifact.toString());
|
artifact.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testToStringNullGroupId() {
|
void testToStringNullGroupId() {
|
||||||
artifact.setGroupId(null);
|
artifact.setGroupId(null);
|
||||||
assertEquals(artifactId + ":" + type + ":" + classifier + ":" + version + ":" + scope, artifact.toString());
|
assertEquals(artifactId + ":" + type + ":" + classifier + ":" + version + ":" + scope, artifact.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testToStringNullClassifier() {
|
void testToStringNullClassifier() {
|
||||||
artifact = new DefaultArtifact(groupId, artifactId, versionRange, scope, type, null, artifactHandler);
|
artifact = new DefaultArtifact(groupId, artifactId, versionRange, scope, type, null, artifactHandler);
|
||||||
assertEquals(groupId + ":" + artifactId + ":" + type + ":" + version + ":" + scope, artifact.toString());
|
assertEquals(groupId + ":" + artifactId + ":" + type + ":" + version + ":" + scope, artifact.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testToStringNullScope() {
|
void testToStringNullScope() {
|
||||||
artifact.setScope(null);
|
artifact.setScope(null);
|
||||||
assertEquals(groupId + ":" + artifactId + ":" + type + ":" + classifier + ":" + version, artifact.toString());
|
assertEquals(groupId + ":" + artifactId + ":" + type + ":" + classifier + ":" + version, artifact.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testComparisonByVersion() {
|
void testComparisonByVersion() {
|
||||||
Artifact artifact1 = new DefaultArtifact(
|
Artifact artifact1 = new DefaultArtifact(
|
||||||
groupId, artifactId, VersionRange.createFromVersion("5.0"), scope, type, classifier, artifactHandler);
|
groupId, artifactId, VersionRange.createFromVersion("5.0"), scope, type, classifier, artifactHandler);
|
||||||
Artifact artifact2 = new DefaultArtifact(
|
Artifact artifact2 = new DefaultArtifact(
|
||||||
|
@ -134,7 +134,7 @@ public class DefaultArtifactTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNonResolvedVersionRangeConsistentlyYieldsNullVersions() throws Exception {
|
void testNonResolvedVersionRangeConsistentlyYieldsNullVersions() throws Exception {
|
||||||
VersionRange vr = VersionRange.createFromVersionSpec("[1.0,2.0)");
|
VersionRange vr = VersionRange.createFromVersionSpec("[1.0,2.0)");
|
||||||
artifact = new DefaultArtifact(groupId, artifactId, vr, scope, type, null, artifactHandler);
|
artifact = new DefaultArtifact(groupId, artifactId, vr, scope, type, null, artifactHandler);
|
||||||
assertNull(artifact.getVersion());
|
assertNull(artifact.getVersion());
|
||||||
|
|
|
@ -32,10 +32,10 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
public class ComparableVersionIT {
|
class ComparableVersionIT {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test() throws Exception {
|
void test() throws Exception {
|
||||||
Files.walkFileTree(Paths.get("target"), new SimpleFileVisitor<Path>() {
|
Files.walkFileTree(Paths.get("target"), new SimpleFileVisitor<Path>() {
|
||||||
Pattern mavenArtifactJar = Pattern.compile("maven-artifact-[\\d.]+(-SNAPSHOT)?\\.jar");
|
Pattern mavenArtifactJar = Pattern.compile("maven-artifact-[\\d.]+(-SNAPSHOT)?\\.jar");
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
* @author <a href="mailto:hboutemy@apache.org">Hervé Boutemy</a>
|
* @author <a href="mailto:hboutemy@apache.org">Hervé Boutemy</a>
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public class ComparableVersionTest {
|
class ComparableVersionTest {
|
||||||
private ComparableVersion newComparable(String version) {
|
private ComparableVersion newComparable(String version) {
|
||||||
ComparableVersion ret = new ComparableVersion(version);
|
ComparableVersion ret = new ComparableVersion(version);
|
||||||
String canonical = ret.getCanonical();
|
String canonical = ret.getCanonical();
|
||||||
|
@ -115,17 +115,17 @@ public class ComparableVersionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVersionsQualifier() {
|
void testVersionsQualifier() {
|
||||||
checkVersionsOrder(VERSIONS_QUALIFIER);
|
checkVersionsOrder(VERSIONS_QUALIFIER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVersionsNumber() {
|
void testVersionsNumber() {
|
||||||
checkVersionsOrder(VERSIONS_NUMBER);
|
checkVersionsOrder(VERSIONS_NUMBER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVersionsEqual() {
|
void testVersionsEqual() {
|
||||||
newComparable("1.0-alpha");
|
newComparable("1.0-alpha");
|
||||||
checkVersionsEqual("1", "1");
|
checkVersionsEqual("1", "1");
|
||||||
checkVersionsEqual("1", "1.0");
|
checkVersionsEqual("1", "1.0");
|
||||||
|
@ -178,7 +178,7 @@ public class ComparableVersionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVersionComparing() {
|
void testVersionComparing() {
|
||||||
checkVersionsOrder("1", "2");
|
checkVersionsOrder("1", "2");
|
||||||
checkVersionsOrder("1.5", "2");
|
checkVersionsOrder("1.5", "2");
|
||||||
checkVersionsOrder("1", "2.5");
|
checkVersionsOrder("1", "2.5");
|
||||||
|
@ -209,13 +209,13 @@ public class ComparableVersionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLeadingZeroes() {
|
void testLeadingZeroes() {
|
||||||
checkVersionsOrder("0.7", "2");
|
checkVersionsOrder("0.7", "2");
|
||||||
checkVersionsOrder("0.2", "1.0.7");
|
checkVersionsOrder("0.2", "1.0.7");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetCanonical() {
|
void testGetCanonical() {
|
||||||
// MNG-7700
|
// MNG-7700
|
||||||
newComparable("0.x");
|
newComparable("0.x");
|
||||||
newComparable("0-x");
|
newComparable("0-x");
|
||||||
|
@ -236,7 +236,7 @@ public class ComparableVersionTest {
|
||||||
* <a href="https://netbeans.org/bugzilla/show_bug.cgi?id=226100">226100</a>
|
* <a href="https://netbeans.org/bugzilla/show_bug.cgi?id=226100">226100</a>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testMng5568() {
|
void testMng5568() {
|
||||||
String a = "6.1.0";
|
String a = "6.1.0";
|
||||||
String b = "6.1.0rc3";
|
String b = "6.1.0rc3";
|
||||||
String c = "6.1H.5-beta"; // this is the unusual version string, with 'H' in the middle
|
String c = "6.1H.5-beta"; // this is the unusual version string, with 'H' in the middle
|
||||||
|
@ -250,7 +250,7 @@ public class ComparableVersionTest {
|
||||||
* Test <a href="https://jira.apache.org/jira/browse/MNG-6572">MNG-6572</a> optimization.
|
* Test <a href="https://jira.apache.org/jira/browse/MNG-6572">MNG-6572</a> optimization.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testMng6572() {
|
void testMng6572() {
|
||||||
String a = "20190126.230843"; // resembles a SNAPSHOT
|
String a = "20190126.230843"; // resembles a SNAPSHOT
|
||||||
String b = "1234567890.12345"; // 10 digit number
|
String b = "1234567890.12345"; // 10 digit number
|
||||||
String c = "123456789012345.1H.5-beta"; // 15 digit number
|
String c = "123456789012345.1H.5-beta"; // 15 digit number
|
||||||
|
@ -269,7 +269,7 @@ public class ComparableVersionTest {
|
||||||
* (related to MNG-6572 optimization)
|
* (related to MNG-6572 optimization)
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testVersionEqualWithLeadingZeroes() {
|
void testVersionEqualWithLeadingZeroes() {
|
||||||
// versions with string lengths from 1 to 19
|
// versions with string lengths from 1 to 19
|
||||||
String[] arr = new String[] {
|
String[] arr = new String[] {
|
||||||
"0000000000000000001",
|
"0000000000000000001",
|
||||||
|
@ -301,7 +301,7 @@ public class ComparableVersionTest {
|
||||||
* (related to MNG-6572 optimization)
|
* (related to MNG-6572 optimization)
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testVersionZeroEqualWithLeadingZeroes() {
|
void testVersionZeroEqualWithLeadingZeroes() {
|
||||||
// versions with string lengths from 1 to 19
|
// versions with string lengths from 1 to 19
|
||||||
String[] arr = new String[] {
|
String[] arr = new String[] {
|
||||||
"0000000000000000000",
|
"0000000000000000000",
|
||||||
|
@ -333,7 +333,7 @@ public class ComparableVersionTest {
|
||||||
* for qualifiers that start with "-0.", which was showing A == C and B == C but A < B.
|
* for qualifiers that start with "-0.", which was showing A == C and B == C but A < B.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testMng6964() {
|
void testMng6964() {
|
||||||
String a = "1-0.alpha";
|
String a = "1-0.alpha";
|
||||||
String b = "1-0.beta";
|
String b = "1-0.beta";
|
||||||
String c = "1";
|
String c = "1";
|
||||||
|
@ -344,7 +344,7 @@ public class ComparableVersionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLocaleIndependent() {
|
void testLocaleIndependent() {
|
||||||
Locale orig = Locale.getDefault();
|
Locale orig = Locale.getDefault();
|
||||||
Locale[] locales = {Locale.ENGLISH, new Locale("tr"), Locale.getDefault()};
|
Locale[] locales = {Locale.ENGLISH, new Locale("tr"), Locale.getDefault()};
|
||||||
try {
|
try {
|
||||||
|
@ -358,7 +358,7 @@ public class ComparableVersionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testReuse() {
|
void testReuse() {
|
||||||
ComparableVersion c1 = new ComparableVersion("1");
|
ComparableVersion c1 = new ComparableVersion("1");
|
||||||
c1.parseVersion("2");
|
c1.parseVersion("2");
|
||||||
|
|
||||||
|
@ -373,7 +373,7 @@ public class ComparableVersionTest {
|
||||||
* 1.0.0.X1 < 1.0.0-X2 for any string X
|
* 1.0.0.X1 < 1.0.0-X2 for any string X
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testMng7644() {
|
void testMng7644() {
|
||||||
for (String x : new String[] {"abc", "alpha", "a", "beta", "b", "def", "milestone", "m", "RC"}) {
|
for (String x : new String[] {"abc", "alpha", "a", "beta", "b", "def", "milestone", "m", "RC"}) {
|
||||||
// 1.0.0.X1 < 1.0.0-X2 for any string x
|
// 1.0.0.X1 < 1.0.0-X2 for any string x
|
||||||
checkVersionsOrder("1.0.0." + x + "1", "1.0.0-" + x + "2");
|
checkVersionsOrder("1.0.0." + x + "1", "1.0.0-" + x + "2");
|
||||||
|
|
|
@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
||||||
*/
|
*/
|
||||||
public class DefaultArtifactVersionTest {
|
class DefaultArtifactVersionTest {
|
||||||
private ArtifactVersion newArtifactVersion(String version) {
|
private ArtifactVersion newArtifactVersion(String version) {
|
||||||
return new DefaultArtifactVersion(version);
|
return new DefaultArtifactVersion(version);
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ public class DefaultArtifactVersionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVersionParsing() {
|
void testVersionParsing() {
|
||||||
checkVersionParsing("1", 1, 0, 0, 0, null);
|
checkVersionParsing("1", 1, 0, 0, 0, null);
|
||||||
checkVersionParsing("1.2", 1, 2, 0, 0, null);
|
checkVersionParsing("1.2", 1, 2, 0, 0, null);
|
||||||
checkVersionParsing("1.2.3", 1, 2, 3, 0, null);
|
checkVersionParsing("1.2.3", 1, 2, 3, 0, null);
|
||||||
|
@ -86,7 +86,7 @@ public class DefaultArtifactVersionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVersionComparing() {
|
void testVersionComparing() {
|
||||||
assertVersionEqual("1", "1");
|
assertVersionEqual("1", "1");
|
||||||
assertVersionOlder("1", "2");
|
assertVersionOlder("1", "2");
|
||||||
assertVersionOlder("1.5", "2");
|
assertVersionOlder("1.5", "2");
|
||||||
|
@ -133,7 +133,7 @@ public class DefaultArtifactVersionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVersionSnapshotComparing() {
|
void testVersionSnapshotComparing() {
|
||||||
assertVersionEqual("1-SNAPSHOT", "1-SNAPSHOT");
|
assertVersionEqual("1-SNAPSHOT", "1-SNAPSHOT");
|
||||||
assertVersionOlder("1-SNAPSHOT", "2-SNAPSHOT");
|
assertVersionOlder("1-SNAPSHOT", "2-SNAPSHOT");
|
||||||
assertVersionOlder("1.5-SNAPSHOT", "2-SNAPSHOT");
|
assertVersionOlder("1.5-SNAPSHOT", "2-SNAPSHOT");
|
||||||
|
@ -167,14 +167,14 @@ public class DefaultArtifactVersionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSnapshotVsReleases() {
|
void testSnapshotVsReleases() {
|
||||||
assertVersionOlder("1.0-RC1", "1.0-SNAPSHOT");
|
assertVersionOlder("1.0-RC1", "1.0-SNAPSHOT");
|
||||||
assertVersionOlder("1.0-rc1", "1.0-SNAPSHOT");
|
assertVersionOlder("1.0-rc1", "1.0-SNAPSHOT");
|
||||||
assertVersionOlder("1.0-rc-1", "1.0-SNAPSHOT");
|
assertVersionOlder("1.0-rc-1", "1.0-SNAPSHOT");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testHashCode() {
|
void testHashCode() {
|
||||||
ArtifactVersion v1 = newArtifactVersion("1");
|
ArtifactVersion v1 = newArtifactVersion("1");
|
||||||
ArtifactVersion v2 = newArtifactVersion("1.0");
|
ArtifactVersion v2 = newArtifactVersion("1.0");
|
||||||
assertTrue(v1.equals(v2));
|
assertTrue(v1.equals(v2));
|
||||||
|
@ -182,12 +182,12 @@ public class DefaultArtifactVersionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEqualsNullSafe() {
|
void testEqualsNullSafe() {
|
||||||
assertFalse(newArtifactVersion("1").equals(null));
|
assertFalse(newArtifactVersion("1").equals(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEqualsTypeSafe() {
|
void testEqualsTypeSafe() {
|
||||||
assertFalse(newArtifactVersion("1").equals("non-an-artifact-version-instance"));
|
assertFalse(newArtifactVersion("1").equals("non-an-artifact-version-instance"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
||||||
*/
|
*/
|
||||||
public class VersionRangeTest {
|
class VersionRangeTest {
|
||||||
private static final String CHECK_NUM_RESTRICTIONS = "check number of restrictions";
|
private static final String CHECK_NUM_RESTRICTIONS = "check number of restrictions";
|
||||||
|
|
||||||
private static final String CHECK_UPPER_BOUND = "check upper bound";
|
private static final String CHECK_UPPER_BOUND = "check upper bound";
|
||||||
|
@ -53,7 +53,7 @@ public class VersionRangeTest {
|
||||||
private static final String CHECK_SELECTED_VERSION = "check selected version";
|
private static final String CHECK_SELECTED_VERSION = "check selected version";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testRange() throws InvalidVersionSpecificationException, OverConstrainedVersionException {
|
void testRange() throws InvalidVersionSpecificationException, OverConstrainedVersionException {
|
||||||
Artifact artifact = null;
|
Artifact artifact = null;
|
||||||
|
|
||||||
VersionRange range = VersionRange.createFromVersionSpec("(,1.0]");
|
VersionRange range = VersionRange.createFromVersionSpec("(,1.0]");
|
||||||
|
@ -157,14 +157,14 @@ public class VersionRangeTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSameUpperAndLowerBoundRoundtrip() throws InvalidVersionSpecificationException {
|
void testSameUpperAndLowerBoundRoundtrip() throws InvalidVersionSpecificationException {
|
||||||
VersionRange range = VersionRange.createFromVersionSpec("[1.0]");
|
VersionRange range = VersionRange.createFromVersionSpec("[1.0]");
|
||||||
VersionRange range2 = VersionRange.createFromVersionSpec(range.toString());
|
VersionRange range2 = VersionRange.createFromVersionSpec(range.toString());
|
||||||
assertEquals(range, range2);
|
assertEquals(range, range2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInvalidRanges() {
|
void testInvalidRanges() {
|
||||||
checkInvalidRange("(1.0)");
|
checkInvalidRange("(1.0)");
|
||||||
checkInvalidRange("[1.0)");
|
checkInvalidRange("[1.0)");
|
||||||
checkInvalidRange("(1.0]");
|
checkInvalidRange("(1.0]");
|
||||||
|
@ -182,7 +182,7 @@ public class VersionRangeTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testIntersections() throws InvalidVersionSpecificationException {
|
void testIntersections() throws InvalidVersionSpecificationException {
|
||||||
VersionRange range1 = VersionRange.createFromVersionSpec("1.0");
|
VersionRange range1 = VersionRange.createFromVersionSpec("1.0");
|
||||||
VersionRange range2 = VersionRange.createFromVersionSpec("1.1");
|
VersionRange range2 = VersionRange.createFromVersionSpec("1.1");
|
||||||
VersionRange mergedRange = range1.restrict(range2);
|
VersionRange mergedRange = range1.restrict(range2);
|
||||||
|
@ -664,7 +664,7 @@ public class VersionRangeTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testReleaseRangeBoundsContainsSnapshots() throws InvalidVersionSpecificationException {
|
void testReleaseRangeBoundsContainsSnapshots() throws InvalidVersionSpecificationException {
|
||||||
VersionRange range = VersionRange.createFromVersionSpec("[1.0,1.2]");
|
VersionRange range = VersionRange.createFromVersionSpec("[1.0,1.2]");
|
||||||
|
|
||||||
assertTrue(range.containsVersion(new DefaultArtifactVersion("1.1-SNAPSHOT")));
|
assertTrue(range.containsVersion(new DefaultArtifactVersion("1.1-SNAPSHOT")));
|
||||||
|
@ -673,7 +673,7 @@ public class VersionRangeTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSnapshotRangeBoundsCanContainSnapshots() throws InvalidVersionSpecificationException {
|
void testSnapshotRangeBoundsCanContainSnapshots() throws InvalidVersionSpecificationException {
|
||||||
VersionRange range = VersionRange.createFromVersionSpec("[1.0,1.2-SNAPSHOT]");
|
VersionRange range = VersionRange.createFromVersionSpec("[1.0,1.2-SNAPSHOT]");
|
||||||
|
|
||||||
assertTrue(range.containsVersion(new DefaultArtifactVersion("1.1-SNAPSHOT")));
|
assertTrue(range.containsVersion(new DefaultArtifactVersion("1.1-SNAPSHOT")));
|
||||||
|
@ -686,7 +686,7 @@ public class VersionRangeTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSnapshotSoftVersionCanContainSnapshot() throws InvalidVersionSpecificationException {
|
void testSnapshotSoftVersionCanContainSnapshot() throws InvalidVersionSpecificationException {
|
||||||
VersionRange range = VersionRange.createFromVersionSpec("1.0-SNAPSHOT");
|
VersionRange range = VersionRange.createFromVersionSpec("1.0-SNAPSHOT");
|
||||||
|
|
||||||
assertTrue(range.containsVersion(new DefaultArtifactVersion("1.0-SNAPSHOT")));
|
assertTrue(range.containsVersion(new DefaultArtifactVersion("1.0-SNAPSHOT")));
|
||||||
|
@ -700,7 +700,7 @@ public class VersionRangeTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testContains() throws InvalidVersionSpecificationException {
|
void testContains() throws InvalidVersionSpecificationException {
|
||||||
ArtifactVersion actualVersion = new DefaultArtifactVersion("2.0.5");
|
ArtifactVersion actualVersion = new DefaultArtifactVersion("2.0.5");
|
||||||
assertTrue(enforceVersion("2.0.5", actualVersion));
|
assertTrue(enforceVersion("2.0.5", actualVersion));
|
||||||
assertTrue(enforceVersion("2.0.4", actualVersion));
|
assertTrue(enforceVersion("2.0.4", actualVersion));
|
||||||
|
@ -723,13 +723,13 @@ public class VersionRangeTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOrder0() {
|
void testOrder0() {
|
||||||
// assertTrue( new DefaultArtifactVersion( "1.0-alpha10" ).compareTo( new DefaultArtifactVersion( "1.0-alpha1" )
|
// assertTrue( new DefaultArtifactVersion( "1.0-alpha10" ).compareTo( new DefaultArtifactVersion( "1.0-alpha1" )
|
||||||
// ) > 0 );
|
// ) > 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCache() throws InvalidVersionSpecificationException {
|
void testCache() throws InvalidVersionSpecificationException {
|
||||||
VersionRange range = VersionRange.createFromVersionSpec("[1.0,1.2]");
|
VersionRange range = VersionRange.createFromVersionSpec("[1.0,1.2]");
|
||||||
assertSame(range, VersionRange.createFromVersionSpec("[1.0,1.2]")); // same instance from spec cache
|
assertSame(range, VersionRange.createFromVersionSpec("[1.0,1.2]")); // same instance from spec cache
|
||||||
|
|
||||||
|
|
|
@ -25,10 +25,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
|
|
||||||
public class DefaultProblemCollectorTest {
|
class DefaultProblemCollectorTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetProblems() {
|
void testGetProblems() {
|
||||||
DefaultProblemCollector collector = new DefaultProblemCollector(null);
|
DefaultProblemCollector collector = new DefaultProblemCollector(null);
|
||||||
assertNotNull(collector.getProblems());
|
assertNotNull(collector.getProblems());
|
||||||
assertEquals(0, collector.getProblems().size());
|
assertEquals(0, collector.getProblems().size());
|
||||||
|
@ -56,7 +56,7 @@ public class DefaultProblemCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSetSource() {
|
void testSetSource() {
|
||||||
DefaultProblemCollector collector = new DefaultProblemCollector(null);
|
DefaultProblemCollector collector = new DefaultProblemCollector(null);
|
||||||
|
|
||||||
collector.add(null, "PROBLEM1", -1, -1, null);
|
collector.add(null, "PROBLEM1", -1, -1, null);
|
||||||
|
|
|
@ -25,10 +25,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertSame;
|
import static org.junit.jupiter.api.Assertions.assertSame;
|
||||||
|
|
||||||
public class DefaultProblemTest {
|
class DefaultProblemTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetSeverity() {
|
void testGetSeverity() {
|
||||||
DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null);
|
DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null);
|
||||||
assertEquals(Severity.ERROR, problem.getSeverity());
|
assertEquals(Severity.ERROR, problem.getSeverity());
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ public class DefaultProblemTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetLineNumber() {
|
void testGetLineNumber() {
|
||||||
DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null);
|
DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null);
|
||||||
assertEquals(-1, problem.getLineNumber());
|
assertEquals(-1, problem.getLineNumber());
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public class DefaultProblemTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetColumnNumber() {
|
void testGetColumnNumber() {
|
||||||
DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null);
|
DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null);
|
||||||
assertEquals(-1, problem.getColumnNumber());
|
assertEquals(-1, problem.getColumnNumber());
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ public class DefaultProblemTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetException() {
|
void testGetException() {
|
||||||
DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null);
|
DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null);
|
||||||
assertNull(problem.getException());
|
assertNull(problem.getException());
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ public class DefaultProblemTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetSource() {
|
void testGetSource() {
|
||||||
DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null);
|
DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null);
|
||||||
assertEquals("", problem.getSource());
|
assertEquals("", problem.getSource());
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ public class DefaultProblemTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetLocation() {
|
void testGetLocation() {
|
||||||
DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null);
|
DefaultProblem problem = new DefaultProblem(null, null, null, -1, -1, null);
|
||||||
assertEquals("", problem.getLocation());
|
assertEquals("", problem.getLocation());
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ public class DefaultProblemTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetMessage() {
|
void testGetMessage() {
|
||||||
DefaultProblem problem = new DefaultProblem("MESSAGE", null, null, -1, -1, null);
|
DefaultProblem problem = new DefaultProblem("MESSAGE", null, null, -1, -1, null);
|
||||||
assertEquals("MESSAGE", problem.getMessage());
|
assertEquals("MESSAGE", problem.getMessage());
|
||||||
|
|
||||||
|
|
|
@ -27,17 +27,17 @@ import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
public class FileSourceTest {
|
class FileSourceTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFileSource() {
|
void testFileSource() {
|
||||||
NullPointerException e = assertThrows(
|
NullPointerException e = assertThrows(
|
||||||
NullPointerException.class, () -> new FileSource(null), "Should fail, since you must specify a file");
|
NullPointerException.class, () -> new FileSource(null), "Should fail, since you must specify a file");
|
||||||
assertEquals("file cannot be null", e.getMessage());
|
assertEquals("file cannot be null", e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetInputStream() throws Exception {
|
void testGetInputStream() throws Exception {
|
||||||
File txtFile = new File("target/test-classes/source.txt");
|
File txtFile = new File("target/test-classes/source.txt");
|
||||||
FileSource source = new FileSource(txtFile);
|
FileSource source = new FileSource(txtFile);
|
||||||
|
|
||||||
|
@ -49,14 +49,14 @@ public class FileSourceTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetLocation() {
|
void testGetLocation() {
|
||||||
File txtFile = new File("target/test-classes/source.txt");
|
File txtFile = new File("target/test-classes/source.txt");
|
||||||
FileSource source = new FileSource(txtFile);
|
FileSource source = new FileSource(txtFile);
|
||||||
assertEquals(txtFile.getAbsolutePath(), source.getLocation());
|
assertEquals(txtFile.getAbsolutePath(), source.getLocation());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetFile() {
|
void testGetFile() {
|
||||||
File txtFile = new File("target/test-classes/source.txt");
|
File txtFile = new File("target/test-classes/source.txt");
|
||||||
FileSource source = new FileSource(txtFile);
|
FileSource source = new FileSource(txtFile);
|
||||||
assertEquals(txtFile.getAbsoluteFile(), source.getFile());
|
assertEquals(txtFile.getAbsoluteFile(), source.getFile());
|
||||||
|
|
|
@ -25,10 +25,10 @@ import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotSame;
|
import static org.junit.jupiter.api.Assertions.assertNotSame;
|
||||||
|
|
||||||
public class ProblemCollectorFactoryTest {
|
class ProblemCollectorFactoryTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNewInstance() {
|
void testNewInstance() {
|
||||||
ProblemCollector collector1 = ProblemCollectorFactory.newInstance(null);
|
ProblemCollector collector1 = ProblemCollectorFactory.newInstance(null);
|
||||||
|
|
||||||
Problem problem = new DefaultProblem("MESSAGE1", null, null, -1, -1, null);
|
Problem problem = new DefaultProblem("MESSAGE1", null, null, -1, -1, null);
|
||||||
|
|
|
@ -25,9 +25,9 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
public class StringSourceTest {
|
class StringSourceTest {
|
||||||
@Test
|
@Test
|
||||||
public void testGetInputStream() throws Exception {
|
void testGetInputStream() throws Exception {
|
||||||
StringSource source = new StringSource("Hello World!");
|
StringSource source = new StringSource("Hello World!");
|
||||||
|
|
||||||
try (InputStream is = source.getInputStream();
|
try (InputStream is = source.getInputStream();
|
||||||
|
@ -37,7 +37,7 @@ public class StringSourceTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetLocation() {
|
void testGetLocation() {
|
||||||
StringSource source = new StringSource("Hello World!");
|
StringSource source = new StringSource("Hello World!");
|
||||||
assertEquals("(memory)", source.getLocation());
|
assertEquals("(memory)", source.getLocation());
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public class StringSourceTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetContent() {
|
void testGetContent() {
|
||||||
StringSource source = new StringSource(null);
|
StringSource source = new StringSource(null);
|
||||||
assertEquals("", source.getContent());
|
assertEquals("", source.getContent());
|
||||||
|
|
||||||
|
|
|
@ -28,17 +28,17 @@ import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
public class UrlSourceTest {
|
class UrlSourceTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUrlSource() {
|
void testUrlSource() {
|
||||||
NullPointerException e = assertThrows(
|
NullPointerException e = assertThrows(
|
||||||
NullPointerException.class, () -> new UrlSource(null), "Should fail, since you must specify a url");
|
NullPointerException.class, () -> new UrlSource(null), "Should fail, since you must specify a url");
|
||||||
assertEquals("url cannot be null", e.getMessage());
|
assertEquals("url cannot be null", e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetInputStream() throws Exception {
|
void testGetInputStream() throws Exception {
|
||||||
URL txtFile = new File("target/test-classes/source.txt").toURI().toURL();
|
URL txtFile = new File("target/test-classes/source.txt").toURI().toURL();
|
||||||
UrlSource source = new UrlSource(txtFile);
|
UrlSource source = new UrlSource(txtFile);
|
||||||
try (InputStream is = source.getInputStream();
|
try (InputStream is = source.getInputStream();
|
||||||
|
@ -48,7 +48,7 @@ public class UrlSourceTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetLocation() throws Exception {
|
void testGetLocation() throws Exception {
|
||||||
URL txtFile = new File("target/test-classes/source.txt").toURI().toURL();
|
URL txtFile = new File("target/test-classes/source.txt").toURI().toURL();
|
||||||
UrlSource source = new UrlSource(txtFile);
|
UrlSource source = new UrlSource(txtFile);
|
||||||
assertEquals(txtFile.toExternalForm(), source.getLocation());
|
assertEquals(txtFile.toExternalForm(), source.getLocation());
|
||||||
|
|
|
@ -39,7 +39,7 @@ import static org.mockito.Mockito.mock;
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||||
*/
|
*/
|
||||||
public class ArtifactDeployerTest extends AbstractArtifactComponentTestCase {
|
class ArtifactDeployerTest extends AbstractArtifactComponentTestCase {
|
||||||
@Inject
|
@Inject
|
||||||
private ArtifactDeployer artifactDeployer;
|
private ArtifactDeployer artifactDeployer;
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ public class ArtifactDeployerTest extends AbstractArtifactComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testArtifactInstallation() throws Exception {
|
void testArtifactInstallation() throws Exception {
|
||||||
sessionScope.enter();
|
sessionScope.enter();
|
||||||
try {
|
try {
|
||||||
sessionScope.seed(MavenSession.class, mock(MavenSession.class));
|
sessionScope.seed(MavenSession.class, mock(MavenSession.class));
|
||||||
|
|
|
@ -28,13 +28,13 @@ import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
@PlexusTest
|
@PlexusTest
|
||||||
public class DefaultArtifactFactoryTest {
|
class DefaultArtifactFactoryTest {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ArtifactFactory factory;
|
ArtifactFactory factory;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPropagationOfSystemScopeRegardlessOfInheritedScope() {
|
void testPropagationOfSystemScopeRegardlessOfInheritedScope() {
|
||||||
Artifact artifact = factory.createDependencyArtifact(
|
Artifact artifact = factory.createDependencyArtifact(
|
||||||
"test-grp", "test-artifact", VersionRange.createFromVersion("1.0"), "type", null, "system", "provided");
|
"test-grp", "test-artifact", VersionRange.createFromVersion("1.0"), "type", null, "system", "provided");
|
||||||
Artifact artifact2 = factory.createDependencyArtifact(
|
Artifact artifact2 = factory.createDependencyArtifact(
|
||||||
|
|
|
@ -34,7 +34,7 @@ import static org.mockito.Mockito.mock;
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||||
*/
|
*/
|
||||||
public class ArtifactInstallerTest extends AbstractArtifactComponentTestCase {
|
class ArtifactInstallerTest extends AbstractArtifactComponentTestCase {
|
||||||
@Inject
|
@Inject
|
||||||
private ArtifactInstaller artifactInstaller;
|
private ArtifactInstaller artifactInstaller;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public class ArtifactInstallerTest extends AbstractArtifactComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testArtifactInstallation() throws Exception {
|
void testArtifactInstallation() throws Exception {
|
||||||
sessionScope.enter();
|
sessionScope.enter();
|
||||||
try {
|
try {
|
||||||
sessionScope.seed(MavenSession.class, mock(MavenSession.class));
|
sessionScope.seed(MavenSession.class, mock(MavenSession.class));
|
||||||
|
|
|
@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
public class MavenArtifactRepositoryTest {
|
class MavenArtifactRepositoryTest {
|
||||||
private static class MavenArtifactRepositorySubclass extends MavenArtifactRepository {
|
private static class MavenArtifactRepositorySubclass extends MavenArtifactRepository {
|
||||||
String id;
|
String id;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ public class MavenArtifactRepositoryTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testHashCodeEquals() {
|
void testHashCodeEquals() {
|
||||||
MavenArtifactRepositorySubclass r1 = new MavenArtifactRepositorySubclass("foo");
|
MavenArtifactRepositorySubclass r1 = new MavenArtifactRepositorySubclass("foo");
|
||||||
MavenArtifactRepositorySubclass r2 = new MavenArtifactRepositorySubclass("foo");
|
MavenArtifactRepositorySubclass r2 = new MavenArtifactRepositorySubclass("foo");
|
||||||
MavenArtifactRepositorySubclass r3 = new MavenArtifactRepositorySubclass("bar");
|
MavenArtifactRepositorySubclass r3 = new MavenArtifactRepositorySubclass("bar");
|
||||||
|
|
|
@ -30,11 +30,11 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
*
|
*
|
||||||
* @author Mauro Talevi
|
* @author Mauro Talevi
|
||||||
*/
|
*/
|
||||||
public class ArtifactResolutionExceptionTest {
|
class ArtifactResolutionExceptionTest {
|
||||||
private static final String LS = System.lineSeparator();
|
private static final String LS = System.lineSeparator();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMissingArtifactMessageFormat() {
|
void testMissingArtifactMessageFormat() {
|
||||||
String message = "Missing artifact";
|
String message = "Missing artifact";
|
||||||
String indentation = " ";
|
String indentation = " ";
|
||||||
String groupId = "aGroupId";
|
String groupId = "aGroupId";
|
||||||
|
|
|
@ -52,7 +52,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
/**
|
/**
|
||||||
* @author Jason van Zyl
|
* @author Jason van Zyl
|
||||||
*/
|
*/
|
||||||
public class ArtifactResolverTest extends AbstractArtifactComponentTestCase {
|
class ArtifactResolverTest extends AbstractArtifactComponentTestCase {
|
||||||
@Inject
|
@Inject
|
||||||
private ArtifactResolver artifactResolver;
|
private ArtifactResolver artifactResolver;
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ public class ArtifactResolverTest extends AbstractArtifactComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolutionOfASingleArtifactWhereTheArtifactIsPresentInTheLocalRepository() throws Exception {
|
void testResolutionOfASingleArtifactWhereTheArtifactIsPresentInTheLocalRepository() throws Exception {
|
||||||
Artifact a = createLocalArtifact("a", "1.0");
|
Artifact a = createLocalArtifact("a", "1.0");
|
||||||
|
|
||||||
artifactResolver.resolve(a, remoteRepositories(), localRepository());
|
artifactResolver.resolve(a, remoteRepositories(), localRepository());
|
||||||
|
@ -88,9 +88,8 @@ public class ArtifactResolverTest extends AbstractArtifactComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void
|
void testResolutionOfASingleArtifactWhereTheArtifactIsNotPresentLocallyAndMustBeRetrievedFromTheRemoteRepository()
|
||||||
testResolutionOfASingleArtifactWhereTheArtifactIsNotPresentLocallyAndMustBeRetrievedFromTheRemoteRepository()
|
throws Exception {
|
||||||
throws Exception {
|
|
||||||
Artifact b = createRemoteArtifact("b", "1.0-SNAPSHOT");
|
Artifact b = createRemoteArtifact("b", "1.0-SNAPSHOT");
|
||||||
deleteLocalArtifact(b);
|
deleteLocalArtifact(b);
|
||||||
artifactResolver.resolve(b, remoteRepositories(), localRepository());
|
artifactResolver.resolve(b, remoteRepositories(), localRepository());
|
||||||
|
@ -104,7 +103,7 @@ public class ArtifactResolverTest extends AbstractArtifactComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTransitiveResolutionWhereAllArtifactsArePresentInTheLocalRepository() throws Exception {
|
void testTransitiveResolutionWhereAllArtifactsArePresentInTheLocalRepository() throws Exception {
|
||||||
Artifact g = createLocalArtifact("g", "1.0");
|
Artifact g = createLocalArtifact("g", "1.0");
|
||||||
|
|
||||||
Artifact h = createLocalArtifact("h", "1.0");
|
Artifact h = createLocalArtifact("h", "1.0");
|
||||||
|
@ -126,7 +125,7 @@ public class ArtifactResolverTest extends AbstractArtifactComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void
|
void
|
||||||
testTransitiveResolutionWhereAllArtifactsAreNotPresentInTheLocalRepositoryAndMustBeRetrievedFromTheRemoteRepository()
|
testTransitiveResolutionWhereAllArtifactsAreNotPresentInTheLocalRepositoryAndMustBeRetrievedFromTheRemoteRepository()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
Artifact i = createRemoteArtifact("i", "1.0-SNAPSHOT");
|
Artifact i = createRemoteArtifact("i", "1.0-SNAPSHOT");
|
||||||
|
@ -152,7 +151,7 @@ public class ArtifactResolverTest extends AbstractArtifactComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolutionFailureWhenArtifactNotPresentInRemoteRepository() throws Exception {
|
void testResolutionFailureWhenArtifactNotPresentInRemoteRepository() throws Exception {
|
||||||
Artifact k = createArtifact("k", "1.0");
|
Artifact k = createArtifact("k", "1.0");
|
||||||
|
|
||||||
assertThrows(
|
assertThrows(
|
||||||
|
@ -162,7 +161,7 @@ public class ArtifactResolverTest extends AbstractArtifactComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolutionOfAnArtifactWhereOneRemoteRepositoryIsBadButOneIsGood() throws Exception {
|
void testResolutionOfAnArtifactWhereOneRemoteRepositoryIsBadButOneIsGood() throws Exception {
|
||||||
Artifact l = createRemoteArtifact("l", "1.0-SNAPSHOT");
|
Artifact l = createRemoteArtifact("l", "1.0-SNAPSHOT");
|
||||||
deleteLocalArtifact(l);
|
deleteLocalArtifact(l);
|
||||||
|
|
||||||
|
@ -187,7 +186,7 @@ public class ArtifactResolverTest extends AbstractArtifactComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTransitiveResolutionOrder() throws Exception {
|
void testTransitiveResolutionOrder() throws Exception {
|
||||||
Artifact m = createLocalArtifact("m", "1.0");
|
Artifact m = createLocalArtifact("m", "1.0");
|
||||||
|
|
||||||
Artifact n = createLocalArtifact("n", "1.0");
|
Artifact n = createLocalArtifact("n", "1.0");
|
||||||
|
|
|
@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
public class DefaultArtifactResolverTest extends AbstractArtifactComponentTestCase {
|
class DefaultArtifactResolverTest extends AbstractArtifactComponentTestCase {
|
||||||
@Inject
|
@Inject
|
||||||
private ArtifactResolver artifactResolver;
|
private ArtifactResolver artifactResolver;
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public class DefaultArtifactResolverTest extends AbstractArtifactComponentTestCa
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMNG4738() throws Exception {
|
void testMNG4738() throws Exception {
|
||||||
Artifact g = createLocalArtifact("g", "1.0");
|
Artifact g = createLocalArtifact("g", "1.0");
|
||||||
createLocalArtifact("h", "1.0");
|
createLocalArtifact("h", "1.0");
|
||||||
artifactResolver.resolveTransitively(
|
artifactResolver.resolveTransitively(
|
||||||
|
@ -88,7 +88,7 @@ public class DefaultArtifactResolverTest extends AbstractArtifactComponentTestCa
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLookup() throws Exception {
|
void testLookup() throws Exception {
|
||||||
ArtifactResolver resolver = getContainer().lookup(ArtifactResolver.class, "default");
|
ArtifactResolver resolver = getContainer().lookup(ArtifactResolver.class, "default");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,14 +31,14 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class AndArtifactFilterTest {
|
class AndArtifactFilterTest {
|
||||||
|
|
||||||
private ArtifactFilter newSubFilter() {
|
private ArtifactFilter newSubFilter() {
|
||||||
return artifact -> false;
|
return artifact -> false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEquals() {
|
void testEquals() {
|
||||||
AndArtifactFilter filter1 = new AndArtifactFilter();
|
AndArtifactFilter filter1 = new AndArtifactFilter();
|
||||||
|
|
||||||
AndArtifactFilter filter2 = new AndArtifactFilter(Arrays.asList(newSubFilter()));
|
AndArtifactFilter filter2 = new AndArtifactFilter(Arrays.asList(newSubFilter()));
|
||||||
|
|
|
@ -28,10 +28,10 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
/**
|
/**
|
||||||
* @author Igor Fedorenko
|
* @author Igor Fedorenko
|
||||||
*/
|
*/
|
||||||
public class FilterHashEqualsTest {
|
class FilterHashEqualsTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testIncludesExcludesArtifactFilter() {
|
void testIncludesExcludesArtifactFilter() {
|
||||||
List<String> patterns = Arrays.asList("c", "d", "e");
|
List<String> patterns = Arrays.asList("c", "d", "e");
|
||||||
|
|
||||||
IncludesArtifactFilter f1 = new IncludesArtifactFilter(patterns);
|
IncludesArtifactFilter f1 = new IncludesArtifactFilter(patterns);
|
||||||
|
|
|
@ -31,14 +31,14 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class OrArtifactFilterTest {
|
class OrArtifactFilterTest {
|
||||||
|
|
||||||
private ArtifactFilter newSubFilter() {
|
private ArtifactFilter newSubFilter() {
|
||||||
return artifact -> false;
|
return artifact -> false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEquals() {
|
void testEquals() {
|
||||||
OrArtifactFilter filter1 = new OrArtifactFilter();
|
OrArtifactFilter filter1 = new OrArtifactFilter();
|
||||||
|
|
||||||
OrArtifactFilter filter2 = new OrArtifactFilter(Arrays.asList(newSubFilter()));
|
OrArtifactFilter filter2 = new OrArtifactFilter(Arrays.asList(newSubFilter()));
|
||||||
|
|
|
@ -30,14 +30,14 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class ScopeArtifactFilterTest {
|
class ScopeArtifactFilterTest {
|
||||||
|
|
||||||
private Artifact newArtifact(String scope) {
|
private Artifact newArtifact(String scope) {
|
||||||
return new DefaultArtifact("g", "a", "1.0", scope, "jar", "", null);
|
return new DefaultArtifact("g", "a", "1.0", scope, "jar", "", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInclude_Compile() {
|
void testInclude_Compile() {
|
||||||
ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_COMPILE);
|
ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_COMPILE);
|
||||||
|
|
||||||
assertTrue(filter.include(newArtifact(Artifact.SCOPE_COMPILE)));
|
assertTrue(filter.include(newArtifact(Artifact.SCOPE_COMPILE)));
|
||||||
|
@ -48,7 +48,7 @@ public class ScopeArtifactFilterTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInclude_CompilePlusRuntime() {
|
void testInclude_CompilePlusRuntime() {
|
||||||
ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_COMPILE_PLUS_RUNTIME);
|
ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_COMPILE_PLUS_RUNTIME);
|
||||||
|
|
||||||
assertTrue(filter.include(newArtifact(Artifact.SCOPE_COMPILE)));
|
assertTrue(filter.include(newArtifact(Artifact.SCOPE_COMPILE)));
|
||||||
|
@ -59,7 +59,7 @@ public class ScopeArtifactFilterTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInclude_Runtime() {
|
void testInclude_Runtime() {
|
||||||
ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME);
|
ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME);
|
||||||
|
|
||||||
assertTrue(filter.include(newArtifact(Artifact.SCOPE_COMPILE)));
|
assertTrue(filter.include(newArtifact(Artifact.SCOPE_COMPILE)));
|
||||||
|
@ -70,7 +70,7 @@ public class ScopeArtifactFilterTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInclude_RuntimePlusSystem() {
|
void testInclude_RuntimePlusSystem() {
|
||||||
ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME_PLUS_SYSTEM);
|
ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME_PLUS_SYSTEM);
|
||||||
|
|
||||||
assertTrue(filter.include(newArtifact(Artifact.SCOPE_COMPILE)));
|
assertTrue(filter.include(newArtifact(Artifact.SCOPE_COMPILE)));
|
||||||
|
@ -81,7 +81,7 @@ public class ScopeArtifactFilterTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInclude_Test() {
|
void testInclude_Test() {
|
||||||
ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_TEST);
|
ScopeArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_TEST);
|
||||||
|
|
||||||
assertTrue(filter.include(newArtifact(Artifact.SCOPE_COMPILE)));
|
assertTrue(filter.include(newArtifact(Artifact.SCOPE_COMPILE)));
|
||||||
|
|
|
@ -35,12 +35,12 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
/** @author Jason van Zyl */
|
/** @author Jason van Zyl */
|
||||||
@PlexusTest
|
@PlexusTest
|
||||||
public class TransformationManagerTest {
|
class TransformationManagerTest {
|
||||||
@Inject
|
@Inject
|
||||||
ArtifactTransformationManager tm;
|
ArtifactTransformationManager tm;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTransformationManager() {
|
void testTransformationManager() {
|
||||||
List<ArtifactTransformation> tms = tm.getArtifactTransformations();
|
List<ArtifactTransformation> tms = tm.getArtifactTransformations();
|
||||||
|
|
||||||
assertEquals(3, tms.size());
|
assertEquals(3, tms.size());
|
||||||
|
|
|
@ -37,7 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
|
|
||||||
@PlexusTest
|
@PlexusTest
|
||||||
public class DefaultProfileManagerTest {
|
class DefaultProfileManagerTest {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
PlexusContainer container;
|
PlexusContainer container;
|
||||||
|
@ -47,7 +47,7 @@ public class DefaultProfileManagerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testShouldActivateDefaultProfile() throws Exception {
|
void testShouldActivateDefaultProfile() throws Exception {
|
||||||
Profile notActivated = new Profile();
|
Profile notActivated = new Profile();
|
||||||
notActivated.setId("notActivated");
|
notActivated.setId("notActivated");
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ public class DefaultProfileManagerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testShouldNotActivateDefaultProfile() throws Exception {
|
void testShouldNotActivateDefaultProfile() throws Exception {
|
||||||
Profile syspropActivated = new Profile();
|
Profile syspropActivated = new Profile();
|
||||||
syspropActivated.setId("syspropActivated");
|
syspropActivated.setId("syspropActivated");
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ public class DefaultProfileManagerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testShouldNotActivateReversalOfPresentSystemProperty() throws Exception {
|
void testShouldNotActivateReversalOfPresentSystemProperty() throws Exception {
|
||||||
Profile syspropActivated = new Profile();
|
Profile syspropActivated = new Profile();
|
||||||
syspropActivated.setId("syspropActivated");
|
syspropActivated.setId("syspropActivated");
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ public class DefaultProfileManagerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testShouldOverrideAndActivateInactiveProfile() throws Exception {
|
void testShouldOverrideAndActivateInactiveProfile() throws Exception {
|
||||||
Profile syspropActivated = new Profile();
|
Profile syspropActivated = new Profile();
|
||||||
syspropActivated.setId("syspropActivated");
|
syspropActivated.setId("syspropActivated");
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ public class DefaultProfileManagerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testShouldOverrideAndDeactivateActiveProfile() throws Exception {
|
void testShouldOverrideAndDeactivateActiveProfile() throws Exception {
|
||||||
Profile syspropActivated = new Profile();
|
Profile syspropActivated = new Profile();
|
||||||
syspropActivated.setId("syspropActivated");
|
syspropActivated.setId("syspropActivated");
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ public class DefaultProfileManagerTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Disabled
|
@Disabled
|
||||||
public void testOsActivationProfile() throws Exception {
|
void testOsActivationProfile() throws Exception {
|
||||||
/*
|
/*
|
||||||
Profile osActivated = new Profile();
|
Profile osActivated = new Profile();
|
||||||
osActivated.setId( "os-profile" );
|
osActivated.setId( "os-profile" );
|
||||||
|
|
|
@ -32,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
|
|
||||||
public class ProjectClasspathTest extends AbstractMavenProjectTestCase {
|
class ProjectClasspathTest extends AbstractMavenProjectTestCase {
|
||||||
static final String dir = "projects/scope/";
|
static final String dir = "projects/scope/";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -51,7 +51,7 @@ public class ProjectClasspathTest extends AbstractMavenProjectTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testProjectClasspath() throws Exception {
|
void testProjectClasspath() throws Exception {
|
||||||
File f = getFileForClasspathResource(dir + "project-with-scoped-dependencies.xml");
|
File f = getFileForClasspathResource(dir + "project-with-scoped-dependencies.xml");
|
||||||
|
|
||||||
MavenProject project = getProjectWithDependencies(f);
|
MavenProject project = getProjectWithDependencies(f);
|
||||||
|
|
|
@ -35,7 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
*
|
*
|
||||||
* @author Jason van Zyl
|
* @author Jason van Zyl
|
||||||
*/
|
*/
|
||||||
public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// p4 inherits from p3
|
// p4 inherits from p3
|
||||||
|
@ -51,7 +51,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testProjectInheritance() throws Exception {
|
void testProjectInheritance() throws Exception {
|
||||||
MavenProject p4 = getProject(projectFile("p4"));
|
MavenProject p4 = getProject(projectFile("p4"));
|
||||||
|
|
||||||
assertEquals("p4", p4.getName());
|
assertEquals("p4", p4.getName());
|
||||||
|
|
|
@ -31,7 +31,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
*
|
*
|
||||||
* @author Jason van Zyl
|
* @author Jason van Zyl
|
||||||
*/
|
*/
|
||||||
public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// p4 inherits from p3
|
// p4 inherits from p3
|
||||||
|
@ -47,7 +47,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testProjectInheritance() throws Exception {
|
void testProjectInheritance() throws Exception {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Check p0 value for org name
|
// Check p0 value for org name
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
|
@ -45,7 +45,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author Jason van Zyl
|
* @author Jason van Zyl
|
||||||
*/
|
*/
|
||||||
public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// p4 inherits from p3
|
// p4 inherits from p3
|
||||||
|
@ -61,7 +61,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testProjectInheritance() throws Exception {
|
void testProjectInheritance() throws Exception {
|
||||||
File localRepo = getLocalRepositoryPath();
|
File localRepo = getLocalRepositoryPath();
|
||||||
|
|
||||||
System.out.println("Local repository is at: " + localRepo.getAbsolutePath());
|
System.out.println("Local repository is at: " + localRepo.getAbsolutePath());
|
||||||
|
|
|
@ -37,7 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
*
|
*
|
||||||
* @author Jason van Zyl
|
* @author Jason van Zyl
|
||||||
*/
|
*/
|
||||||
public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// p1 inherits from p0
|
// p1 inherits from p0
|
||||||
|
@ -50,7 +50,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testProjectInheritance() throws Exception {
|
void testProjectInheritance() throws Exception {
|
||||||
File localRepo = getLocalRepositoryPath();
|
File localRepo = getLocalRepositoryPath();
|
||||||
File pom0 = new File(localRepo, "p0/pom.xml");
|
File pom0 = new File(localRepo, "p0/pom.xml");
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:pschneider@gmail.com">Patrick Schneider</a>
|
* @author <a href="mailto:pschneider@gmail.com">Patrick Schneider</a>
|
||||||
*/
|
*/
|
||||||
public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// p1 inherits from p0
|
// p1 inherits from p0
|
||||||
|
@ -54,7 +54,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDependencyManagementOverridesTransitiveDependencyVersion() throws Exception {
|
void testDependencyManagementOverridesTransitiveDependencyVersion() throws Exception {
|
||||||
File localRepo = getLocalRepositoryPath();
|
File localRepo = getLocalRepositoryPath();
|
||||||
File pom0 = new File(localRepo, "p0/pom.xml");
|
File pom0 = new File(localRepo, "p0/pom.xml");
|
||||||
File pom0Basedir = pom0.getParentFile();
|
File pom0Basedir = pom0.getParentFile();
|
||||||
|
|
|
@ -35,7 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author <a href="rgoers@apache.org">Ralph Goers</a>
|
* @author <a href="rgoers@apache.org">Ralph Goers</a>
|
||||||
*/
|
*/
|
||||||
public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// p1 inherits from p0
|
// p1 inherits from p0
|
||||||
|
@ -48,7 +48,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDependencyManagement() throws Exception {
|
void testDependencyManagement() throws Exception {
|
||||||
File localRepo = getLocalRepositoryPath();
|
File localRepo = getLocalRepositoryPath();
|
||||||
File pom0 = new File(localRepo, "p0/pom.xml");
|
File pom0 = new File(localRepo, "p0/pom.xml");
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author <a href="rgoers@apache.org">Ralph Goers</a>
|
* @author <a href="rgoers@apache.org">Ralph Goers</a>
|
||||||
*/
|
*/
|
||||||
public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// p1 inherits from p0
|
// p1 inherits from p0
|
||||||
|
@ -49,7 +49,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDependencyManagement() throws Exception {
|
void testDependencyManagement() throws Exception {
|
||||||
File localRepo = getLocalRepositoryPath();
|
File localRepo = getLocalRepositoryPath();
|
||||||
File pom0 = new File(localRepo, "p0/pom.xml");
|
File pom0 = new File(localRepo, "p0/pom.xml");
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author Jason van Zyl
|
* @author Jason van Zyl
|
||||||
*/
|
*/
|
||||||
public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// p1 inherits from p0
|
// p1 inherits from p0
|
||||||
|
@ -49,7 +49,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDependencyManagement() throws Exception {
|
void testDependencyManagement() throws Exception {
|
||||||
File localRepo = getLocalRepositoryPath();
|
File localRepo = getLocalRepositoryPath();
|
||||||
File pom0 = new File(localRepo, "p0/pom.xml");
|
File pom0 = new File(localRepo, "p0/pom.xml");
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author <a href="rgoers@apache.org">Ralph Goers</a>
|
* @author <a href="rgoers@apache.org">Ralph Goers</a>
|
||||||
*/
|
*/
|
||||||
public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// p1 inherits from p0
|
// p1 inherits from p0
|
||||||
|
@ -49,7 +49,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDependencyManagement() throws Exception {
|
void testDependencyManagement() throws Exception {
|
||||||
File localRepo = getLocalRepositoryPath();
|
File localRepo = getLocalRepositoryPath();
|
||||||
File pom0 = new File(localRepo, "p0/pom.xml");
|
File pom0 = new File(localRepo, "p0/pom.xml");
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:pschneider@gmail.com">Patrick Schneider</a>
|
* @author <a href="mailto:pschneider@gmail.com">Patrick Schneider</a>
|
||||||
*/
|
*/
|
||||||
public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// p1 inherits from p0
|
// p1 inherits from p0
|
||||||
|
@ -61,7 +61,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
* a & b only.
|
* a & b only.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testDependencyManagementExclusionsExcludeTransitively() throws Exception {
|
void testDependencyManagementExclusionsExcludeTransitively() throws Exception {
|
||||||
File localRepo = getLocalRepositoryPath();
|
File localRepo = getLocalRepositoryPath();
|
||||||
|
|
||||||
File pom0 = new File(localRepo, "p0/pom.xml");
|
File pom0 = new File(localRepo, "p0/pom.xml");
|
||||||
|
@ -96,7 +96,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testDependencyManagementExclusionDoesNotOverrideGloballyForTransitives() throws Exception {
|
void testDependencyManagementExclusionDoesNotOverrideGloballyForTransitives() throws Exception {
|
||||||
File localRepo = getLocalRepositoryPath();
|
File localRepo = getLocalRepositoryPath();
|
||||||
|
|
||||||
File pom0 = new File(localRepo, "p0/pom.xml");
|
File pom0 = new File(localRepo, "p0/pom.xml");
|
||||||
|
|
|
@ -42,7 +42,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:pschneider@gmail.com">Patrick Schneider</a>
|
* @author <a href="mailto:pschneider@gmail.com">Patrick Schneider</a>
|
||||||
*/
|
*/
|
||||||
public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// p1 inherits from p0
|
// p1 inherits from p0
|
||||||
|
@ -55,7 +55,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDependencyManagementOverridesTransitiveDependencyVersion() throws Exception {
|
void testDependencyManagementOverridesTransitiveDependencyVersion() throws Exception {
|
||||||
File localRepo = getLocalRepositoryPath();
|
File localRepo = getLocalRepositoryPath();
|
||||||
|
|
||||||
File pom0 = new File(localRepo, "p0/pom.xml");
|
File pom0 = new File(localRepo, "p0/pom.xml");
|
||||||
|
|
|
@ -33,7 +33,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
* @author <a href="mailto:pschneider@gmail.com">Patrick Schneider</a>
|
* @author <a href="mailto:pschneider@gmail.com">Patrick Schneider</a>
|
||||||
* @see <a href="https://issues.apache.org/jira/browse/MNG-2919">MNG-2919</a>
|
* @see <a href="https://issues.apache.org/jira/browse/MNG-2919">MNG-2919</a>
|
||||||
*/
|
*/
|
||||||
public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// p1 inherits from p0
|
// p1 inherits from p0
|
||||||
|
@ -46,7 +46,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDependencyManagementDoesNotOverrideScopeOfCurrentArtifact() throws Exception {
|
void testDependencyManagementDoesNotOverrideScopeOfCurrentArtifact() throws Exception {
|
||||||
File localRepo = getLocalRepositoryPath();
|
File localRepo = getLocalRepositoryPath();
|
||||||
|
|
||||||
File pom0 = new File(localRepo, "p0/pom.xml");
|
File pom0 = new File(localRepo, "p0/pom.xml");
|
||||||
|
|
|
@ -33,7 +33,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
* Verifies that plugin execution sections in the parent POM that have
|
* Verifies that plugin execution sections in the parent POM that have
|
||||||
* inherit == false are not inherited to the child POM.
|
* inherit == false are not inherited to the child POM.
|
||||||
*/
|
*/
|
||||||
public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// p1 inherits from p0
|
// p1 inherits from p0
|
||||||
|
@ -46,7 +46,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFalsePluginExecutionInheritValue() throws Exception {
|
void testFalsePluginExecutionInheritValue() throws Exception {
|
||||||
File localRepo = getLocalRepositoryPath();
|
File localRepo = getLocalRepositoryPath();
|
||||||
|
|
||||||
File pom0 = new File(localRepo, "p0/pom.xml");
|
File pom0 = new File(localRepo, "p0/pom.xml");
|
||||||
|
|
|
@ -31,7 +31,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
*
|
*
|
||||||
* @author jdcasey
|
* @author jdcasey
|
||||||
*/
|
*/
|
||||||
public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// p1 inherits from p0
|
// p1 inherits from p0
|
||||||
|
@ -44,7 +44,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testScmInfoCalculatedCorrectlyOnParentAndChildRead() throws Exception {
|
void testScmInfoCalculatedCorrectlyOnParentAndChildRead() throws Exception {
|
||||||
File localRepo = getLocalRepositoryPath();
|
File localRepo = getLocalRepositoryPath();
|
||||||
|
|
||||||
File pom0 = new File(localRepo, "p0/pom.xml");
|
File pom0 = new File(localRepo, "p0/pom.xml");
|
||||||
|
@ -74,7 +74,7 @@ public class ProjectInheritanceTest extends AbstractProjectInheritanceTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testScmInfoCalculatedCorrectlyOnChildOnlyRead() throws Exception {
|
void testScmInfoCalculatedCorrectlyOnChildOnlyRead() throws Exception {
|
||||||
File localRepo = getLocalRepositoryPath();
|
File localRepo = getLocalRepositoryPath();
|
||||||
|
|
||||||
File pom1 = new File(localRepo, "p0/modules/p1/pom.xml");
|
File pom1 = new File(localRepo, "p0/modules/p1/pom.xml");
|
||||||
|
|
|
@ -25,10 +25,10 @@ import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class DefaultPathTranslatorTest {
|
class DefaultPathTranslatorTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAlignToBasedirWhereBasedirExpressionIsTheCompleteValue() {
|
void testAlignToBasedirWhereBasedirExpressionIsTheCompleteValue() {
|
||||||
File basedir = new File(System.getProperty("java.io.tmpdir"), "test").getAbsoluteFile();
|
File basedir = new File(System.getProperty("java.io.tmpdir"), "test").getAbsoluteFile();
|
||||||
|
|
||||||
String aligned = new DefaultPathTranslator().alignToBaseDirectory("${basedir}", basedir);
|
String aligned = new DefaultPathTranslator().alignToBaseDirectory("${basedir}", basedir);
|
||||||
|
@ -37,7 +37,7 @@ public class DefaultPathTranslatorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAlignToBasedirWhereBasedirExpressionIsTheValuePrefix() {
|
void testAlignToBasedirWhereBasedirExpressionIsTheValuePrefix() {
|
||||||
File basedir = new File(System.getProperty("java.io.tmpdir"), "test").getAbsoluteFile();
|
File basedir = new File(System.getProperty("java.io.tmpdir"), "test").getAbsoluteFile();
|
||||||
|
|
||||||
String aligned = new DefaultPathTranslator().alignToBaseDirectory("${basedir}/dir", basedir);
|
String aligned = new DefaultPathTranslator().alignToBaseDirectory("${basedir}/dir", basedir);
|
||||||
|
@ -46,7 +46,7 @@ public class DefaultPathTranslatorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnalignToBasedirWherePathEqualsBasedir() {
|
void testUnalignToBasedirWherePathEqualsBasedir() {
|
||||||
File basedir = new File(System.getProperty("java.io.tmpdir"), "test").getAbsoluteFile();
|
File basedir = new File(System.getProperty("java.io.tmpdir"), "test").getAbsoluteFile();
|
||||||
|
|
||||||
String unaligned = new DefaultPathTranslator().unalignFromBaseDirectory(basedir.getAbsolutePath(), basedir);
|
String unaligned = new DefaultPathTranslator().unalignFromBaseDirectory(basedir.getAbsolutePath(), basedir);
|
||||||
|
|
|
@ -24,9 +24,9 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
|
|
||||||
public class DefaultMirrorSelectorTest {
|
class DefaultMirrorSelectorTest {
|
||||||
@Test
|
@Test
|
||||||
public void testMirrorWithMirrorOfPatternContainingANegationIsNotSelected() {
|
void testMirrorWithMirrorOfPatternContainingANegationIsNotSelected() {
|
||||||
ArtifactRepository repository = new DefaultArtifactRepository("snapshots.repo", "http://whatever", null);
|
ArtifactRepository repository = new DefaultArtifactRepository("snapshots.repo", "http://whatever", null);
|
||||||
String pattern = "external:*, !snapshots.repo";
|
String pattern = "external:*, !snapshots.repo";
|
||||||
assertFalse(DefaultMirrorSelector.matchPattern(repository, pattern));
|
assertFalse(DefaultMirrorSelector.matchPattern(repository, pattern));
|
||||||
|
|
|
@ -55,7 +55,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
@PlexusTest
|
@PlexusTest
|
||||||
public class LegacyRepositorySystemTest {
|
class LegacyRepositorySystemTest {
|
||||||
@Inject
|
@Inject
|
||||||
private RepositorySystem repositorySystem;
|
private RepositorySystem repositorySystem;
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ public class LegacyRepositorySystemTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatASystemScopedDependencyIsNotResolvedFromRepositories() throws Exception {
|
void testThatASystemScopedDependencyIsNotResolvedFromRepositories() throws Exception {
|
||||||
//
|
//
|
||||||
// We should get a whole slew of dependencies resolving this artifact transitively
|
// We should get a whole slew of dependencies resolving this artifact transitively
|
||||||
//
|
//
|
||||||
|
@ -170,7 +170,7 @@ public class LegacyRepositorySystemTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLocalRepositoryBasedir() throws Exception {
|
void testLocalRepositoryBasedir() throws Exception {
|
||||||
File localRepoDir = new File("").getAbsoluteFile();
|
File localRepoDir = new File("").getAbsoluteFile();
|
||||||
|
|
||||||
ArtifactRepository localRepo = repositorySystem.createLocalRepository(localRepoDir);
|
ArtifactRepository localRepo = repositorySystem.createLocalRepository(localRepoDir);
|
||||||
|
|
|
@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertSame;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
@PlexusTest
|
@PlexusTest
|
||||||
public class MirrorProcessorTest {
|
class MirrorProcessorTest {
|
||||||
@Inject
|
@Inject
|
||||||
private DefaultMirrorSelector mirrorSelector;
|
private DefaultMirrorSelector mirrorSelector;
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ public class MirrorProcessorTest {
|
||||||
private ArtifactRepositoryFactory repositorySystem;
|
private ArtifactRepositoryFactory repositorySystem;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExternalURL() {
|
void testExternalURL() {
|
||||||
assertTrue(DefaultMirrorSelector.isExternalRepo(getRepo("foo", "http://somehost")));
|
assertTrue(DefaultMirrorSelector.isExternalRepo(getRepo("foo", "http://somehost")));
|
||||||
assertTrue(DefaultMirrorSelector.isExternalRepo(getRepo("foo", "http://somehost:9090/somepath")));
|
assertTrue(DefaultMirrorSelector.isExternalRepo(getRepo("foo", "http://somehost:9090/somepath")));
|
||||||
assertTrue(DefaultMirrorSelector.isExternalRepo(getRepo("foo", "ftp://somehost")));
|
assertTrue(DefaultMirrorSelector.isExternalRepo(getRepo("foo", "ftp://somehost")));
|
||||||
|
@ -66,7 +66,7 @@ public class MirrorProcessorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMirrorLookup() {
|
void testMirrorLookup() {
|
||||||
Mirror mirrorA = newMirror("a", "a", "http://a");
|
Mirror mirrorA = newMirror("a", "a", "http://a");
|
||||||
Mirror mirrorB = newMirror("b", "b", "http://b");
|
Mirror mirrorB = newMirror("b", "b", "http://b");
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ public class MirrorProcessorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMirrorWildcardLookup() {
|
void testMirrorWildcardLookup() {
|
||||||
Mirror mirrorA = newMirror("a", "a", "http://a");
|
Mirror mirrorA = newMirror("a", "a", "http://a");
|
||||||
Mirror mirrorB = newMirror("b", "b", "http://b");
|
Mirror mirrorB = newMirror("b", "b", "http://b");
|
||||||
Mirror mirrorC = newMirror("c", "*", "http://wildcard");
|
Mirror mirrorC = newMirror("c", "*", "http://wildcard");
|
||||||
|
@ -95,7 +95,7 @@ public class MirrorProcessorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMirrorStopOnFirstMatch() {
|
void testMirrorStopOnFirstMatch() {
|
||||||
// exact matches win first
|
// exact matches win first
|
||||||
Mirror mirrorA2 = newMirror("a2", "a,b", "http://a2");
|
Mirror mirrorA2 = newMirror("a2", "a,b", "http://a2");
|
||||||
Mirror mirrorA = newMirror("a", "a", "http://a");
|
Mirror mirrorA = newMirror("a", "a", "http://a");
|
||||||
|
@ -123,7 +123,7 @@ public class MirrorProcessorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPatterns() {
|
void testPatterns() {
|
||||||
assertTrue(DefaultMirrorSelector.matchPattern(getRepo("a"), "*"));
|
assertTrue(DefaultMirrorSelector.matchPattern(getRepo("a"), "*"));
|
||||||
assertTrue(DefaultMirrorSelector.matchPattern(getRepo("a"), "*,"));
|
assertTrue(DefaultMirrorSelector.matchPattern(getRepo("a"), "*,"));
|
||||||
assertTrue(DefaultMirrorSelector.matchPattern(getRepo("a"), ",*,"));
|
assertTrue(DefaultMirrorSelector.matchPattern(getRepo("a"), ",*,"));
|
||||||
|
@ -159,7 +159,7 @@ public class MirrorProcessorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPatternsWithExternal() {
|
void testPatternsWithExternal() {
|
||||||
assertTrue(DefaultMirrorSelector.matchPattern(getRepo("a", "http://localhost"), "*"));
|
assertTrue(DefaultMirrorSelector.matchPattern(getRepo("a", "http://localhost"), "*"));
|
||||||
assertFalse(DefaultMirrorSelector.matchPattern(getRepo("a", "http://localhost"), "external:*"));
|
assertFalse(DefaultMirrorSelector.matchPattern(getRepo("a", "http://localhost"), "external:*"));
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ public class MirrorProcessorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLayoutPattern() {
|
void testLayoutPattern() {
|
||||||
assertTrue(DefaultMirrorSelector.matchesLayout("default", null));
|
assertTrue(DefaultMirrorSelector.matchesLayout("default", null));
|
||||||
assertTrue(DefaultMirrorSelector.matchesLayout("default", ""));
|
assertTrue(DefaultMirrorSelector.matchesLayout("default", ""));
|
||||||
assertTrue(DefaultMirrorSelector.matchesLayout("default", "*"));
|
assertTrue(DefaultMirrorSelector.matchesLayout("default", "*"));
|
||||||
|
@ -192,7 +192,7 @@ public class MirrorProcessorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMirrorLayoutConsideredForMatching() {
|
void testMirrorLayoutConsideredForMatching() {
|
||||||
ArtifactRepository repo = getRepo("a");
|
ArtifactRepository repo = getRepo("a");
|
||||||
|
|
||||||
Mirror mirrorA = newMirror("a", "a", null, "http://a");
|
Mirror mirrorA = newMirror("a", "a", null, "http://a");
|
||||||
|
|
|
@ -39,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
public class DefaultUpdateCheckManagerTest extends AbstractArtifactComponentTestCase {
|
class DefaultUpdateCheckManagerTest extends AbstractArtifactComponentTestCase {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ArtifactFactory artifactFactory;
|
private ArtifactFactory artifactFactory;
|
||||||
|
@ -60,7 +60,7 @@ public class DefaultUpdateCheckManagerTest extends AbstractArtifactComponentTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testArtifact() throws Exception {
|
void testArtifact() throws Exception {
|
||||||
ArtifactRepository remoteRepository = remoteRepository();
|
ArtifactRepository remoteRepository = remoteRepository();
|
||||||
|
|
||||||
ArtifactRepository localRepository = localRepository();
|
ArtifactRepository localRepository = localRepository();
|
||||||
|
@ -88,7 +88,7 @@ public class DefaultUpdateCheckManagerTest extends AbstractArtifactComponentTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMissingArtifact() throws Exception {
|
void testMissingArtifact() throws Exception {
|
||||||
ArtifactRepository remoteRepository = remoteRepository();
|
ArtifactRepository remoteRepository = remoteRepository();
|
||||||
|
|
||||||
ArtifactRepository localRepository = localRepository();
|
ArtifactRepository localRepository = localRepository();
|
||||||
|
@ -113,7 +113,7 @@ public class DefaultUpdateCheckManagerTest extends AbstractArtifactComponentTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPom() throws Exception {
|
void testPom() throws Exception {
|
||||||
ArtifactRepository remoteRepository = remoteRepository();
|
ArtifactRepository remoteRepository = remoteRepository();
|
||||||
|
|
||||||
ArtifactRepository localRepository = localRepository();
|
ArtifactRepository localRepository = localRepository();
|
||||||
|
@ -141,7 +141,7 @@ public class DefaultUpdateCheckManagerTest extends AbstractArtifactComponentTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMissingPom() throws Exception {
|
void testMissingPom() throws Exception {
|
||||||
ArtifactRepository remoteRepository = remoteRepository();
|
ArtifactRepository remoteRepository = remoteRepository();
|
||||||
|
|
||||||
ArtifactRepository localRepository = localRepository();
|
ArtifactRepository localRepository = localRepository();
|
||||||
|
@ -166,7 +166,7 @@ public class DefaultUpdateCheckManagerTest extends AbstractArtifactComponentTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMetadata() throws Exception {
|
void testMetadata() throws Exception {
|
||||||
ArtifactRepository remoteRepository = remoteRepository();
|
ArtifactRepository remoteRepository = remoteRepository();
|
||||||
|
|
||||||
ArtifactRepository localRepository = localRepository();
|
ArtifactRepository localRepository = localRepository();
|
||||||
|
@ -194,7 +194,7 @@ public class DefaultUpdateCheckManagerTest extends AbstractArtifactComponentTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMissingMetadata() throws Exception {
|
void testMissingMetadata() throws Exception {
|
||||||
ArtifactRepository remoteRepository = remoteRepository();
|
ArtifactRepository remoteRepository = remoteRepository();
|
||||||
|
|
||||||
ArtifactRepository localRepository = localRepository();
|
ArtifactRepository localRepository = localRepository();
|
||||||
|
@ -220,7 +220,7 @@ public class DefaultUpdateCheckManagerTest extends AbstractArtifactComponentTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testArtifactTouchFileName() throws Exception {
|
void testArtifactTouchFileName() throws Exception {
|
||||||
ArtifactRepository localRepository = localRepository();
|
ArtifactRepository localRepository = localRepository();
|
||||||
|
|
||||||
Artifact a = artifactFactory.createArtifactWithClassifier("groupId", "a", "0.0.1-SNAPSHOT", "jar", null);
|
Artifact a = artifactFactory.createArtifactWithClassifier("groupId", "a", "0.0.1-SNAPSHOT", "jar", null);
|
||||||
|
|
|
@ -60,7 +60,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
* @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
|
* @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
|
||||||
*/
|
*/
|
||||||
@PlexusTest
|
@PlexusTest
|
||||||
public class DefaultWagonManagerTest {
|
class DefaultWagonManagerTest {
|
||||||
@Inject
|
@Inject
|
||||||
private WagonManager wagonManager;
|
private WagonManager wagonManager;
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ public class DefaultWagonManagerTest {
|
||||||
private ArtifactRepositoryFactory artifactRepositoryFactory;
|
private ArtifactRepositoryFactory artifactRepositoryFactory;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnnecessaryRepositoryLookup() throws Exception {
|
void testUnnecessaryRepositoryLookup() throws Exception {
|
||||||
Artifact artifact = createTestPomArtifact("target/test-data/get-missing-pom");
|
Artifact artifact = createTestPomArtifact("target/test-data/get-missing-pom");
|
||||||
|
|
||||||
List<ArtifactRepository> repos = new ArrayList<>();
|
List<ArtifactRepository> repos = new ArrayList<>();
|
||||||
|
@ -105,7 +105,7 @@ public class DefaultWagonManagerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetMissingJar() throws TransferFailedException, UnsupportedProtocolException, IOException {
|
void testGetMissingJar() throws TransferFailedException, UnsupportedProtocolException, IOException {
|
||||||
Artifact artifact = createTestArtifact("target/test-data/get-missing-jar", "jar");
|
Artifact artifact = createTestArtifact("target/test-data/get-missing-jar", "jar");
|
||||||
|
|
||||||
ArtifactRepository repo = createStringRepo();
|
ArtifactRepository repo = createStringRepo();
|
||||||
|
@ -116,7 +116,7 @@ public class DefaultWagonManagerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetMissingJarForced() throws TransferFailedException, UnsupportedProtocolException, IOException {
|
void testGetMissingJarForced() throws TransferFailedException, UnsupportedProtocolException, IOException {
|
||||||
Artifact artifact = createTestArtifact("target/test-data/get-missing-jar", "jar");
|
Artifact artifact = createTestArtifact("target/test-data/get-missing-jar", "jar");
|
||||||
|
|
||||||
ArtifactRepository repo = createStringRepo();
|
ArtifactRepository repo = createStringRepo();
|
||||||
|
@ -127,7 +127,7 @@ public class DefaultWagonManagerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetRemoteJar()
|
void testGetRemoteJar()
|
||||||
throws TransferFailedException, ResourceDoesNotExistException, UnsupportedProtocolException, IOException {
|
throws TransferFailedException, ResourceDoesNotExistException, UnsupportedProtocolException, IOException {
|
||||||
Artifact artifact = createTestArtifact("target/test-data/get-remote-jar", "jar");
|
Artifact artifact = createTestArtifact("target/test-data/get-remote-jar", "jar");
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ public class DefaultWagonManagerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDefaultWagonManager() throws Exception {
|
void testDefaultWagonManager() throws Exception {
|
||||||
assertWagon("a");
|
assertWagon("a");
|
||||||
|
|
||||||
assertWagon("b");
|
assertWagon("b");
|
||||||
|
@ -214,7 +214,7 @@ public class DefaultWagonManagerTest {
|
||||||
* Check that transfer listeners are properly removed after getArtifact and putArtifact
|
* Check that transfer listeners are properly removed after getArtifact and putArtifact
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testWagonTransferListenerRemovedAfterGetArtifactAndPutArtifact() throws Exception {
|
void testWagonTransferListenerRemovedAfterGetArtifactAndPutArtifact() throws Exception {
|
||||||
Artifact artifact = createTestArtifact("target/test-data/transfer-listener", "jar");
|
Artifact artifact = createTestArtifact("target/test-data/transfer-listener", "jar");
|
||||||
ArtifactRepository repo = createStringRepo();
|
ArtifactRepository repo = createStringRepo();
|
||||||
StringWagon wagon = (StringWagon) wagonManager.getWagon("string");
|
StringWagon wagon = (StringWagon) wagonManager.getWagon("string");
|
||||||
|
@ -248,7 +248,7 @@ public class DefaultWagonManagerTest {
|
||||||
*/
|
*/
|
||||||
@Disabled
|
@Disabled
|
||||||
@Test
|
@Test
|
||||||
public void testChecksumVerification() throws Exception {
|
void testChecksumVerification() throws Exception {
|
||||||
ArtifactRepositoryPolicy policy = new ArtifactRepositoryPolicy(
|
ArtifactRepositoryPolicy policy = new ArtifactRepositoryPolicy(
|
||||||
true, ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, ArtifactRepositoryPolicy.CHECKSUM_POLICY_FAIL);
|
true, ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, ArtifactRepositoryPolicy.CHECKSUM_POLICY_FAIL);
|
||||||
|
|
||||||
|
@ -305,7 +305,7 @@ public class DefaultWagonManagerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPerLookupInstantiation() throws Exception {
|
void testPerLookupInstantiation() throws Exception {
|
||||||
String protocol = "perlookup";
|
String protocol = "perlookup";
|
||||||
|
|
||||||
Wagon one = wagonManager.getWagon(protocol);
|
Wagon one = wagonManager.getWagon(protocol);
|
||||||
|
|
|
@ -39,19 +39,19 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
@PlexusTest
|
@PlexusTest
|
||||||
public class LegacyRepositorySystemTest {
|
class LegacyRepositorySystemTest {
|
||||||
@Inject
|
@Inject
|
||||||
private RepositorySystem repositorySystem;
|
private RepositorySystem repositorySystem;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatLocalRepositoryWithSpacesIsProperlyHandled() throws Exception {
|
void testThatLocalRepositoryWithSpacesIsProperlyHandled() throws Exception {
|
||||||
File basedir = new File("target/spacy path").getAbsoluteFile();
|
File basedir = new File("target/spacy path").getAbsoluteFile();
|
||||||
ArtifactRepository repo = repositorySystem.createLocalRepository(basedir);
|
ArtifactRepository repo = repositorySystem.createLocalRepository(basedir);
|
||||||
assertEquals(basedir, new File(repo.getBasedir()));
|
assertEquals(basedir, new File(repo.getBasedir()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAuthenticationHandling() {
|
void testAuthenticationHandling() {
|
||||||
Server server = new Server();
|
Server server = new Server();
|
||||||
server.setId("repository");
|
server.setId("repository");
|
||||||
server.setUsername("jason");
|
server.setUsername("jason");
|
||||||
|
|
|
@ -64,7 +64,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
||||||
*/
|
*/
|
||||||
@PlexusTest
|
@PlexusTest
|
||||||
public class DefaultArtifactCollectorTest {
|
class DefaultArtifactCollectorTest {
|
||||||
@Inject
|
@Inject
|
||||||
private LegacyArtifactCollector artifactCollector;
|
private LegacyArtifactCollector artifactCollector;
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
private static final String GROUP_ID = "test";
|
private static final String GROUP_ID = "test";
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setUp() throws Exception {
|
void setUp() throws Exception {
|
||||||
source = new Source();
|
source = new Source();
|
||||||
|
|
||||||
projectArtifact = createArtifactSpec("project", "1.0", null);
|
projectArtifact = createArtifactSpec("project", "1.0", null);
|
||||||
|
@ -86,7 +86,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Disabled("works, but we don't fail on cycles presently")
|
@Disabled("works, but we don't fail on cycles presently")
|
||||||
public void testCircularDependencyNotIncludingCurrentProject()
|
void testCircularDependencyNotIncludingCurrentProject()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec b = a.addDependency("b", "1.0");
|
ArtifactSpec b = a.addDependency("b", "1.0");
|
||||||
|
@ -99,7 +99,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Disabled("works, but we don't fail on cycles presently")
|
@Disabled("works, but we don't fail on cycles presently")
|
||||||
public void testCircularDependencyIncludingCurrentProject()
|
void testCircularDependencyIncludingCurrentProject()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec b = a.addDependency("b", "1.0");
|
ArtifactSpec b = a.addDependency("b", "1.0");
|
||||||
|
@ -111,7 +111,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveWithFilter() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
void testResolveWithFilter() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec b = a.addDependency("b", "1.0");
|
ArtifactSpec b = a.addDependency("b", "1.0");
|
||||||
ArtifactSpec c = a.addDependency("c", "3.0");
|
ArtifactSpec c = a.addDependency("c", "3.0");
|
||||||
|
@ -131,7 +131,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveCorrectDependenciesWhenDifferentDependenciesOnNearest()
|
void testResolveCorrectDependenciesWhenDifferentDependenciesOnNearest()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec b = a.addDependency("b", "1.0");
|
ArtifactSpec b = a.addDependency("b", "1.0");
|
||||||
|
@ -152,7 +152,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Disabled
|
@Disabled
|
||||||
public void testResolveCorrectDependenciesWhenDifferentDependenciesOnNewest()
|
void testResolveCorrectDependenciesWhenDifferentDependenciesOnNewest()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
// TODO use newest conflict resolver
|
// TODO use newest conflict resolver
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
|
@ -174,7 +174,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Disabled
|
@Disabled
|
||||||
public void testResolveCorrectDependenciesWhenDifferentDependenciesOnNewestVersionReplaced()
|
void testResolveCorrectDependenciesWhenDifferentDependenciesOnNewestVersionReplaced()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
// TODO use newest conflict resolver
|
// TODO use newest conflict resolver
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
|
@ -195,8 +195,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveNearestNewestIsNearest()
|
void testResolveNearestNewestIsNearest() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec b = a.addDependency("b", "1.0");
|
ArtifactSpec b = a.addDependency("b", "1.0");
|
||||||
ArtifactSpec c = a.addDependency("c", "3.0");
|
ArtifactSpec c = a.addDependency("c", "3.0");
|
||||||
|
@ -212,8 +211,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveNearestOldestIsNearest()
|
void testResolveNearestOldestIsNearest() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec b = a.addDependency("b", "1.0");
|
ArtifactSpec b = a.addDependency("b", "1.0");
|
||||||
ArtifactSpec c = a.addDependency("c", "2.0");
|
ArtifactSpec c = a.addDependency("c", "2.0");
|
||||||
|
@ -229,8 +227,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveLocalNewestIsLocal()
|
void testResolveLocalNewestIsLocal() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
a.addDependency("b", "2.0");
|
a.addDependency("b", "2.0");
|
||||||
ArtifactSpec b = createArtifactSpec("b", "3.0");
|
ArtifactSpec b = createArtifactSpec("b", "3.0");
|
||||||
|
@ -241,8 +238,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveLocalOldestIsLocal()
|
void testResolveLocalOldestIsLocal() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
a.addDependency("b", "3.0");
|
a.addDependency("b", "3.0");
|
||||||
ArtifactSpec b = createArtifactSpec("b", "2.0");
|
ArtifactSpec b = createArtifactSpec("b", "2.0");
|
||||||
|
@ -253,7 +249,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveLocalWithNewerVersionButLesserScope()
|
void testResolveLocalWithNewerVersionButLesserScope()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("commons-logging", "1.0");
|
ArtifactSpec a = createArtifactSpec("commons-logging", "1.0");
|
||||||
a.addDependency("junit", "3.7");
|
a.addDependency("junit", "3.7");
|
||||||
|
@ -267,7 +263,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveLocalWithNewerVersionButLesserScopeResolvedFirst()
|
void testResolveLocalWithNewerVersionButLesserScopeResolvedFirst()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec b = createArtifactSpec("junit", "3.8.1", Artifact.SCOPE_TEST);
|
ArtifactSpec b = createArtifactSpec("junit", "3.8.1", Artifact.SCOPE_TEST);
|
||||||
ArtifactSpec a = createArtifactSpec("commons-logging", "1.0");
|
ArtifactSpec a = createArtifactSpec("commons-logging", "1.0");
|
||||||
|
@ -281,8 +277,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveNearestWithRanges()
|
void testResolveNearestWithRanges() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec b = a.addDependency("b", "1.0");
|
ArtifactSpec b = a.addDependency("b", "1.0");
|
||||||
ArtifactSpec c = a.addDependency("c", "2.0");
|
ArtifactSpec c = a.addDependency("c", "2.0");
|
||||||
|
@ -298,8 +293,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveRangeWithManagedVersion()
|
void testResolveRangeWithManagedVersion() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec b = a.addDependency("b", "[1.0,3.0]");
|
ArtifactSpec b = a.addDependency("b", "[1.0,3.0]");
|
||||||
|
|
||||||
|
@ -312,7 +306,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCompatibleRanges() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
void testCompatibleRanges() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec b = a.addDependency("b", "1.0");
|
ArtifactSpec b = a.addDependency("b", "1.0");
|
||||||
a.addDependency("c", "[2.0,2.5]");
|
a.addDependency("c", "[2.0,2.5]");
|
||||||
|
@ -329,7 +323,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testIncompatibleRanges() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
void testIncompatibleRanges() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec b = a.addDependency("b", "1.0");
|
ArtifactSpec b = a.addDependency("b", "1.0");
|
||||||
a.addDependency("c", "[2.4,3.0]");
|
a.addDependency("c", "[2.4,3.0]");
|
||||||
|
@ -342,7 +336,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnboundedRangeWhenVersionUnavailable()
|
void testUnboundedRangeWhenVersionUnavailable()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec b = a.addDependency("b", "1.0");
|
ArtifactSpec b = a.addDependency("b", "1.0");
|
||||||
|
@ -355,8 +349,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnboundedRangeBelowLastRelease()
|
void testUnboundedRangeBelowLastRelease() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
createArtifactSpec("c", "1.5");
|
createArtifactSpec("c", "1.5");
|
||||||
ArtifactSpec c = createArtifactSpec("c", "2.0");
|
ArtifactSpec c = createArtifactSpec("c", "2.0");
|
||||||
|
@ -370,8 +363,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnboundedRangeAboveLastRelease()
|
void testUnboundedRangeAboveLastRelease() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
createArtifactSpec("c", "2.0");
|
createArtifactSpec("c", "2.0");
|
||||||
a.addDependency("c", "[10.0,)");
|
a.addDependency("c", "[10.0,)");
|
||||||
|
@ -382,7 +374,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveManagedVersion() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
void testResolveManagedVersion() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
a.addDependency("b", "3.0", Artifact.SCOPE_RUNTIME);
|
a.addDependency("b", "3.0", Artifact.SCOPE_RUNTIME);
|
||||||
|
|
||||||
|
@ -394,7 +386,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCollectChangesVersionOfOriginatingArtifactIfInDependencyManagementHasDifferentVersion()
|
void testCollectChangesVersionOfOriginatingArtifactIfInDependencyManagementHasDifferentVersion()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
|
|
||||||
|
@ -411,7 +403,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveCompileScopeOverTestScope()
|
void testResolveCompileScopeOverTestScope()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec c = createArtifactSpec("c", "3.0", Artifact.SCOPE_TEST);
|
ArtifactSpec c = createArtifactSpec("c", "3.0", Artifact.SCOPE_TEST);
|
||||||
|
@ -429,7 +421,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveRuntimeScopeOverTestScope()
|
void testResolveRuntimeScopeOverTestScope()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec c = createArtifactSpec("c", "3.0", Artifact.SCOPE_TEST);
|
ArtifactSpec c = createArtifactSpec("c", "3.0", Artifact.SCOPE_TEST);
|
||||||
|
@ -447,7 +439,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveCompileScopeOverRuntimeScope()
|
void testResolveCompileScopeOverRuntimeScope()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec root = createArtifactSpec("root", "1.0");
|
ArtifactSpec root = createArtifactSpec("root", "1.0");
|
||||||
ArtifactSpec a = root.addDependency("a", "1.0");
|
ArtifactSpec a = root.addDependency("a", "1.0");
|
||||||
|
@ -467,7 +459,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveCompileScopeOverProvidedScope()
|
void testResolveCompileScopeOverProvidedScope()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec c = createArtifactSpec("c", "3.0", Artifact.SCOPE_PROVIDED);
|
ArtifactSpec c = createArtifactSpec("c", "3.0", Artifact.SCOPE_PROVIDED);
|
||||||
|
@ -485,7 +477,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveRuntimeScopeOverProvidedScope()
|
void testResolveRuntimeScopeOverProvidedScope()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec c = createArtifactSpec("c", "3.0", Artifact.SCOPE_PROVIDED);
|
ArtifactSpec c = createArtifactSpec("c", "3.0", Artifact.SCOPE_PROVIDED);
|
||||||
|
@ -503,8 +495,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testProvidedScopeNotTransitive()
|
void testProvidedScopeNotTransitive() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0", Artifact.SCOPE_PROVIDED);
|
ArtifactSpec a = createArtifactSpec("a", "1.0", Artifact.SCOPE_PROVIDED);
|
||||||
ArtifactSpec b = createArtifactSpec("b", "1.0");
|
ArtifactSpec b = createArtifactSpec("b", "1.0");
|
||||||
b.addDependency("c", "3.0", Artifact.SCOPE_PROVIDED);
|
b.addDependency("c", "3.0", Artifact.SCOPE_PROVIDED);
|
||||||
|
@ -514,7 +505,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOptionalNotTransitive() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
void testOptionalNotTransitive() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec b = createArtifactSpec("b", "1.0");
|
ArtifactSpec b = createArtifactSpec("b", "1.0");
|
||||||
b.addDependency("c", "3.0", true);
|
b.addDependency("c", "3.0", true);
|
||||||
|
@ -524,7 +515,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOptionalIncludedAtRoot() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
void testOptionalIncludedAtRoot() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
|
|
||||||
ArtifactSpec b = createArtifactSpec("b", "1.0", true);
|
ArtifactSpec b = createArtifactSpec("b", "1.0", true);
|
||||||
|
@ -534,7 +525,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testScopeUpdate() throws InvalidVersionSpecificationException, ArtifactResolutionException {
|
void testScopeUpdate() throws InvalidVersionSpecificationException, ArtifactResolutionException {
|
||||||
/* farthest = compile */
|
/* farthest = compile */
|
||||||
checkScopeUpdate(Artifact.SCOPE_COMPILE, Artifact.SCOPE_COMPILE, Artifact.SCOPE_COMPILE);
|
checkScopeUpdate(Artifact.SCOPE_COMPILE, Artifact.SCOPE_COMPILE, Artifact.SCOPE_COMPILE);
|
||||||
checkScopeUpdate(Artifact.SCOPE_COMPILE, Artifact.SCOPE_PROVIDED, Artifact.SCOPE_COMPILE);
|
checkScopeUpdate(Artifact.SCOPE_COMPILE, Artifact.SCOPE_PROVIDED, Artifact.SCOPE_COMPILE);
|
||||||
|
@ -635,7 +626,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Disabled
|
@Disabled
|
||||||
public void testOptionalNotTransitiveButVersionIsInfluential()
|
void testOptionalNotTransitiveButVersionIsInfluential()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
ArtifactSpec b = createArtifactSpec("b", "1.0");
|
ArtifactSpec b = createArtifactSpec("b", "1.0");
|
||||||
|
@ -656,7 +647,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTestScopeNotTransitive() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
void testTestScopeNotTransitive() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0", Artifact.SCOPE_TEST);
|
ArtifactSpec a = createArtifactSpec("a", "1.0", Artifact.SCOPE_TEST);
|
||||||
ArtifactSpec b = createArtifactSpec("b", "1.0");
|
ArtifactSpec b = createArtifactSpec("b", "1.0");
|
||||||
b.addDependency("c", "3.0", Artifact.SCOPE_TEST);
|
b.addDependency("c", "3.0", Artifact.SCOPE_TEST);
|
||||||
|
@ -666,7 +657,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSnapshotNotIncluded() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
void testSnapshotNotIncluded() throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
a.addDependency("b", "[1.0,)");
|
a.addDependency("b", "[1.0,)");
|
||||||
createArtifactSpec("b", "1.0-SNAPSHOT");
|
createArtifactSpec("b", "1.0-SNAPSHOT");
|
||||||
|
@ -684,7 +675,7 @@ public class DefaultArtifactCollectorTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Disabled("that one does not work")
|
@Disabled("that one does not work")
|
||||||
public void testOverConstrainedVersionException()
|
void testOverConstrainedVersionException()
|
||||||
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
throws ArtifactResolutionException, InvalidVersionSpecificationException {
|
||||||
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
ArtifactSpec a = createArtifactSpec("a", "1.0");
|
||||||
a.addDependency("b", "[1.0, 2.0)");
|
a.addDependency("b", "[1.0, 2.0)");
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test;
|
||||||
* @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
|
* @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
|
||||||
* @see FarthestConflictResolver
|
* @see FarthestConflictResolver
|
||||||
*/
|
*/
|
||||||
public class FarthestConflictResolverTest extends AbstractConflictResolverTest {
|
class FarthestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
// constructors -----------------------------------------------------------
|
// constructors -----------------------------------------------------------
|
||||||
|
|
||||||
public FarthestConflictResolverTest() throws Exception {
|
public FarthestConflictResolverTest() throws Exception {
|
||||||
|
@ -44,7 +44,7 @@ public class FarthestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testDepth() {
|
void testDepth() {
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
ResolutionNode b1n = createResolutionNode(b1);
|
ResolutionNode b1n = createResolutionNode(b1);
|
||||||
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
||||||
|
@ -60,7 +60,7 @@ public class FarthestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testDepthReversed() {
|
void testDepthReversed() {
|
||||||
ResolutionNode b1n = createResolutionNode(b1);
|
ResolutionNode b1n = createResolutionNode(b1);
|
||||||
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
|
@ -76,7 +76,7 @@ public class FarthestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testEqual() {
|
void testEqual() {
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
ResolutionNode a2n = createResolutionNode(a2);
|
ResolutionNode a2n = createResolutionNode(a2);
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ public class FarthestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testEqualReversed() {
|
void testEqualReversed() {
|
||||||
ResolutionNode a2n = createResolutionNode(a2);
|
ResolutionNode a2n = createResolutionNode(a2);
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test;
|
||||||
* @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
|
* @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
|
||||||
* @see NearestConflictResolver
|
* @see NearestConflictResolver
|
||||||
*/
|
*/
|
||||||
public class NearestConflictResolverTest extends AbstractConflictResolverTest {
|
class NearestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
// constructors -----------------------------------------------------------
|
// constructors -----------------------------------------------------------
|
||||||
|
|
||||||
public NearestConflictResolverTest() throws Exception {
|
public NearestConflictResolverTest() throws Exception {
|
||||||
|
@ -44,7 +44,7 @@ public class NearestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testDepth() {
|
void testDepth() {
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
ResolutionNode b1n = createResolutionNode(b1);
|
ResolutionNode b1n = createResolutionNode(b1);
|
||||||
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
||||||
|
@ -60,7 +60,7 @@ public class NearestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testDepthReversed() {
|
void testDepthReversed() {
|
||||||
ResolutionNode b1n = createResolutionNode(b1);
|
ResolutionNode b1n = createResolutionNode(b1);
|
||||||
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
|
@ -76,7 +76,7 @@ public class NearestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testEqual() {
|
void testEqual() {
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
ResolutionNode a2n = createResolutionNode(a2);
|
ResolutionNode a2n = createResolutionNode(a2);
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ public class NearestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testEqualReversed() {
|
void testEqualReversed() {
|
||||||
ResolutionNode a2n = createResolutionNode(a2);
|
ResolutionNode a2n = createResolutionNode(a2);
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test;
|
||||||
* @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
|
* @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
|
||||||
* @see NewestConflictResolver
|
* @see NewestConflictResolver
|
||||||
*/
|
*/
|
||||||
public class NewestConflictResolverTest extends AbstractConflictResolverTest {
|
class NewestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
// constructors -----------------------------------------------------------
|
// constructors -----------------------------------------------------------
|
||||||
|
|
||||||
public NewestConflictResolverTest() throws Exception {
|
public NewestConflictResolverTest() throws Exception {
|
||||||
|
@ -44,7 +44,7 @@ public class NewestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testDepth() {
|
void testDepth() {
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
ResolutionNode b1n = createResolutionNode(b1);
|
ResolutionNode b1n = createResolutionNode(b1);
|
||||||
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
||||||
|
@ -60,7 +60,7 @@ public class NewestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testDepthReversed() {
|
void testDepthReversed() {
|
||||||
ResolutionNode b1n = createResolutionNode(b1);
|
ResolutionNode b1n = createResolutionNode(b1);
|
||||||
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
|
@ -76,7 +76,7 @@ public class NewestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testEqual() {
|
void testEqual() {
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
ResolutionNode a2n = createResolutionNode(a2);
|
ResolutionNode a2n = createResolutionNode(a2);
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ public class NewestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testEqualReversed() {
|
void testEqualReversed() {
|
||||||
ResolutionNode a2n = createResolutionNode(a2);
|
ResolutionNode a2n = createResolutionNode(a2);
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test;
|
||||||
* @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
|
* @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
|
||||||
* @see OldestConflictResolver
|
* @see OldestConflictResolver
|
||||||
*/
|
*/
|
||||||
public class OldestConflictResolverTest extends AbstractConflictResolverTest {
|
class OldestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
// constructors -----------------------------------------------------------
|
// constructors -----------------------------------------------------------
|
||||||
|
|
||||||
public OldestConflictResolverTest() throws Exception {
|
public OldestConflictResolverTest() throws Exception {
|
||||||
|
@ -44,7 +44,7 @@ public class OldestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testDepth() {
|
void testDepth() {
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
ResolutionNode b1n = createResolutionNode(b1);
|
ResolutionNode b1n = createResolutionNode(b1);
|
||||||
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
||||||
|
@ -60,7 +60,7 @@ public class OldestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testDepthReversed() {
|
void testDepthReversed() {
|
||||||
ResolutionNode b1n = createResolutionNode(b1);
|
ResolutionNode b1n = createResolutionNode(b1);
|
||||||
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
ResolutionNode a2n = createResolutionNode(a2, b1n);
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
|
@ -76,7 +76,7 @@ public class OldestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testEqual() {
|
void testEqual() {
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
ResolutionNode a2n = createResolutionNode(a2);
|
ResolutionNode a2n = createResolutionNode(a2);
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ public class OldestConflictResolverTest extends AbstractConflictResolverTest {
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testEqualReversed() {
|
void testEqualReversed() {
|
||||||
ResolutionNode a2n = createResolutionNode(a2);
|
ResolutionNode a2n = createResolutionNode(a2);
|
||||||
ResolutionNode a1n = createResolutionNode(a1);
|
ResolutionNode a1n = createResolutionNode(a1);
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@PlexusTest
|
@PlexusTest
|
||||||
public class DefaultClasspathTransformationTest {
|
class DefaultClasspathTransformationTest {
|
||||||
@Inject
|
@Inject
|
||||||
ClasspathTransformation transform;
|
ClasspathTransformation transform;
|
||||||
|
|
||||||
|
@ -44,9 +44,10 @@ public class DefaultClasspathTransformationTest {
|
||||||
MetadataGraphVertex v2;
|
MetadataGraphVertex v2;
|
||||||
MetadataGraphVertex v3;
|
MetadataGraphVertex v3;
|
||||||
MetadataGraphVertex v4;
|
MetadataGraphVertex v4;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setUp() throws Exception {
|
void setUp() throws Exception {
|
||||||
graph = new MetadataGraph(4, 3);
|
graph = new MetadataGraph(4, 3);
|
||||||
/*
|
/*
|
||||||
* v2
|
* v2
|
||||||
|
@ -72,9 +73,10 @@ public class DefaultClasspathTransformationTest {
|
||||||
graph.addEdge(v3, v4, new MetadataGraphEdge("1.1", true, ArtifactScopeEnum.runtime, null, 2, 2));
|
graph.addEdge(v3, v4, new MetadataGraphEdge("1.1", true, ArtifactScopeEnum.runtime, null, 2, 2));
|
||||||
graph.addEdge(v3, v4, new MetadataGraphEdge("1.2", true, ArtifactScopeEnum.test, null, 2, 2));
|
graph.addEdge(v3, v4, new MetadataGraphEdge("1.2", true, ArtifactScopeEnum.test, null, 2, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
@Test
|
@Test
|
||||||
public void testCompileClasspathTransform() throws Exception {
|
void testCompileClasspathTransform() throws Exception {
|
||||||
ClasspathContainer res;
|
ClasspathContainer res;
|
||||||
|
|
||||||
res = transform.transform(graph, ArtifactScopeEnum.compile, false);
|
res = transform.transform(graph, ArtifactScopeEnum.compile, false);
|
||||||
|
@ -83,9 +85,10 @@ public class DefaultClasspathTransformationTest {
|
||||||
assertNotNull(res.getClasspath(), "null classpath after compile transform");
|
assertNotNull(res.getClasspath(), "null classpath after compile transform");
|
||||||
assertEquals(3, res.getClasspath().size(), "compile classpath should have 3 entries");
|
assertEquals(3, res.getClasspath().size(), "compile classpath should have 3 entries");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
@Test
|
@Test
|
||||||
public void testRuntimeClasspathTransform() throws Exception {
|
void testRuntimeClasspathTransform() throws Exception {
|
||||||
ClasspathContainer res;
|
ClasspathContainer res;
|
||||||
|
|
||||||
res = transform.transform(graph, ArtifactScopeEnum.runtime, false);
|
res = transform.transform(graph, ArtifactScopeEnum.runtime, false);
|
||||||
|
@ -97,9 +100,10 @@ public class DefaultClasspathTransformationTest {
|
||||||
ArtifactMetadata md = res.getClasspath().get(3);
|
ArtifactMetadata md = res.getClasspath().get(3);
|
||||||
assertEquals("1.1", md.getVersion(), "runtime artifact version should be 1.1");
|
assertEquals("1.1", md.getVersion(), "runtime artifact version should be 1.1");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
@Test
|
@Test
|
||||||
public void testTestClasspathTransform() throws Exception {
|
void testTestClasspathTransform() throws Exception {
|
||||||
ClasspathContainer res;
|
ClasspathContainer res;
|
||||||
|
|
||||||
res = transform.transform(graph, ArtifactScopeEnum.test, false);
|
res = transform.transform(graph, ArtifactScopeEnum.test, false);
|
||||||
|
|
|
@ -28,22 +28,24 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
|
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class DefaultGraphConflictResolutionPolicyTest {
|
class DefaultGraphConflictResolutionPolicyTest {
|
||||||
GraphConflictResolutionPolicy policy;
|
GraphConflictResolutionPolicy policy;
|
||||||
MetadataGraphEdge e1;
|
MetadataGraphEdge e1;
|
||||||
MetadataGraphEdge e2;
|
MetadataGraphEdge e2;
|
||||||
MetadataGraphEdge e3;
|
MetadataGraphEdge e3;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setUp() throws Exception {
|
void setUp() throws Exception {
|
||||||
policy = new DefaultGraphConflictResolutionPolicy();
|
policy = new DefaultGraphConflictResolutionPolicy();
|
||||||
e1 = new MetadataGraphEdge("1.1", true, null, null, 2, 1);
|
e1 = new MetadataGraphEdge("1.1", true, null, null, 2, 1);
|
||||||
e2 = new MetadataGraphEdge("1.2", true, null, null, 3, 2);
|
e2 = new MetadataGraphEdge("1.2", true, null, null, 3, 2);
|
||||||
e3 = new MetadataGraphEdge("1.2", true, null, null, 2, 3);
|
e3 = new MetadataGraphEdge("1.2", true, null, null, 2, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
@Test
|
@Test
|
||||||
public void testDefaultPolicy() throws Exception {
|
void testDefaultPolicy() throws Exception {
|
||||||
MetadataGraphEdge res;
|
MetadataGraphEdge res;
|
||||||
|
|
||||||
res = policy.apply(e1, e2);
|
res = policy.apply(e1, e2);
|
||||||
|
|
|
@ -34,7 +34,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@PlexusTest
|
@PlexusTest
|
||||||
public class DefaultGraphConflictResolverTest {
|
class DefaultGraphConflictResolverTest {
|
||||||
@Inject
|
@Inject
|
||||||
GraphConflictResolver resolver;
|
GraphConflictResolver resolver;
|
||||||
|
|
||||||
|
@ -44,9 +44,10 @@ public class DefaultGraphConflictResolverTest {
|
||||||
MetadataGraphVertex v2;
|
MetadataGraphVertex v2;
|
||||||
MetadataGraphVertex v3;
|
MetadataGraphVertex v3;
|
||||||
MetadataGraphVertex v4;
|
MetadataGraphVertex v4;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setUp() throws Exception {
|
void setUp() throws Exception {
|
||||||
/*
|
/*
|
||||||
* v2
|
* v2
|
||||||
* v1<
|
* v1<
|
||||||
|
@ -72,9 +73,10 @@ public class DefaultGraphConflictResolverTest {
|
||||||
graph.addEdge(v3, v4, new MetadataGraphEdge("1.1", true, ArtifactScopeEnum.runtime, null, 2, 1));
|
graph.addEdge(v3, v4, new MetadataGraphEdge("1.1", true, ArtifactScopeEnum.runtime, null, 2, 1));
|
||||||
graph.addEdge(v3, v4, new MetadataGraphEdge("1.2", true, ArtifactScopeEnum.provided, null, 2, 2));
|
graph.addEdge(v3, v4, new MetadataGraphEdge("1.2", true, ArtifactScopeEnum.provided, null, 2, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
@Test
|
@Test
|
||||||
public void testCompileResolution() throws Exception {
|
void testCompileResolution() throws Exception {
|
||||||
MetadataGraph res;
|
MetadataGraph res;
|
||||||
|
|
||||||
res = resolver.resolveConflicts(graph, ArtifactScopeEnum.compile);
|
res = resolver.resolveConflicts(graph, ArtifactScopeEnum.compile);
|
||||||
|
@ -113,9 +115,10 @@ public class DefaultGraphConflictResolverTest {
|
||||||
res.getIncidentEdges(v4).get(0).getVersion(),
|
res.getIncidentEdges(v4).get(0).getVersion(),
|
||||||
"wrong edge v3-v4 in the resulting graph after resolver");
|
"wrong edge v3-v4 in the resulting graph after resolver");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
@Test
|
@Test
|
||||||
public void testRuntimeResolution() throws Exception {
|
void testRuntimeResolution() throws Exception {
|
||||||
MetadataGraph res;
|
MetadataGraph res;
|
||||||
|
|
||||||
res = resolver.resolveConflicts(graph, ArtifactScopeEnum.runtime);
|
res = resolver.resolveConflicts(graph, ArtifactScopeEnum.runtime);
|
||||||
|
@ -153,9 +156,10 @@ public class DefaultGraphConflictResolverTest {
|
||||||
res.getIncidentEdges(v4).get(0).getVersion(),
|
res.getIncidentEdges(v4).get(0).getVersion(),
|
||||||
"wrong edge v3-v4 in the resulting graph after resolver");
|
"wrong edge v3-v4 in the resulting graph after resolver");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
@Test
|
@Test
|
||||||
public void testTestResolution() throws Exception {
|
void testTestResolution() throws Exception {
|
||||||
MetadataGraph res;
|
MetadataGraph res;
|
||||||
|
|
||||||
res = resolver.resolveConflicts(graph, ArtifactScopeEnum.test);
|
res = resolver.resolveConflicts(graph, ArtifactScopeEnum.test);
|
||||||
|
|
|
@ -41,7 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
public class DefaultMavenTest extends AbstractCoreMavenComponentTestCase {
|
class DefaultMavenTest extends AbstractCoreMavenComponentTestCase {
|
||||||
@Singleton
|
@Singleton
|
||||||
@Named("WsrClassCatcher")
|
@Named("WsrClassCatcher")
|
||||||
private static final class WsrClassCatcher extends AbstractMavenLifecycleParticipant {
|
private static final class WsrClassCatcher extends AbstractMavenLifecycleParticipant {
|
||||||
|
@ -62,7 +62,7 @@ public class DefaultMavenTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEnsureResolverSessionHasMavenWorkspaceReader() throws Exception {
|
void testEnsureResolverSessionHasMavenWorkspaceReader() throws Exception {
|
||||||
WsrClassCatcher wsrClassCatcher =
|
WsrClassCatcher wsrClassCatcher =
|
||||||
(WsrClassCatcher) getContainer().lookup(AbstractMavenLifecycleParticipant.class, "WsrClassCatcher");
|
(WsrClassCatcher) getContainer().lookup(AbstractMavenLifecycleParticipant.class, "WsrClassCatcher");
|
||||||
Maven maven = getContainer().lookup(Maven.class);
|
Maven maven = getContainer().lookup(Maven.class);
|
||||||
|
@ -77,7 +77,7 @@ public class DefaultMavenTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatErrorDuringProjectDependencyGraphCreationAreStored() throws Exception {
|
void testThatErrorDuringProjectDependencyGraphCreationAreStored() throws Exception {
|
||||||
MavenExecutionRequest request =
|
MavenExecutionRequest request =
|
||||||
createMavenExecutionRequest(getProject("cyclic-reference")).setGoals(asList("validate"));
|
createMavenExecutionRequest(getProject("cyclic-reference")).setGoals(asList("validate"));
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ public class DefaultMavenTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMavenProjectNoDuplicateArtifacts() throws Exception {
|
void testMavenProjectNoDuplicateArtifacts() throws Exception {
|
||||||
MavenProjectHelper mavenProjectHelper = getContainer().lookup(MavenProjectHelper.class);
|
MavenProjectHelper mavenProjectHelper = getContainer().lookup(MavenProjectHelper.class);
|
||||||
MavenProject mavenProject = new MavenProject();
|
MavenProject mavenProject = new MavenProject();
|
||||||
mavenProject.setArtifact(new DefaultArtifact("g", "a", "1.0", Artifact.SCOPE_TEST, "jar", "", null));
|
mavenProject.setArtifact(new DefaultArtifact("g", "a", "1.0", Artifact.SCOPE_TEST, "jar", "", null));
|
||||||
|
|
|
@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
|
|
||||||
public class MavenLifecycleParticipantTest extends AbstractCoreMavenComponentTestCase {
|
class MavenLifecycleParticipantTest extends AbstractCoreMavenComponentTestCase {
|
||||||
|
|
||||||
private static final String INJECTED_ARTIFACT_ID = "injected";
|
private static final String INJECTED_ARTIFACT_ID = "injected";
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ public class MavenLifecycleParticipantTest extends AbstractCoreMavenComponentTes
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDependencyInjection() throws Exception {
|
void testDependencyInjection() throws Exception {
|
||||||
PlexusContainer container = getContainer();
|
PlexusContainer container = getContainer();
|
||||||
|
|
||||||
ComponentDescriptor<? extends AbstractMavenLifecycleParticipant> cd =
|
ComponentDescriptor<? extends AbstractMavenLifecycleParticipant> cd =
|
||||||
|
@ -122,7 +122,7 @@ public class MavenLifecycleParticipantTest extends AbstractCoreMavenComponentTes
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testReactorDependencyInjection() throws Exception {
|
void testReactorDependencyInjection() throws Exception {
|
||||||
List<String> reactorOrder =
|
List<String> reactorOrder =
|
||||||
getReactorOrder("lifecycle-participant-reactor-dependency-injection", InjectReactorDependency.class);
|
getReactorOrder("lifecycle-participant-reactor-dependency-injection", InjectReactorDependency.class);
|
||||||
assertEquals(Arrays.asList("parent", "module-b", "module-a"), reactorOrder);
|
assertEquals(Arrays.asList("parent", "module-b", "module-a"), reactorOrder);
|
||||||
|
|
|
@ -36,7 +36,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.hamcrest.Matchers.endsWith;
|
import static org.hamcrest.Matchers.endsWith;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
public class ProjectDependenciesResolverTest extends AbstractCoreMavenComponentTestCase {
|
class ProjectDependenciesResolverTest extends AbstractCoreMavenComponentTestCase {
|
||||||
@Inject
|
@Inject
|
||||||
private ProjectDependenciesResolver resolver;
|
private ProjectDependenciesResolver resolver;
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ public class ProjectDependenciesResolverTest extends AbstractCoreMavenComponentT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSystemScopeDependencies() throws Exception {
|
void testSystemScopeDependencies() throws Exception {
|
||||||
MavenSession session = createMavenSession(null);
|
MavenSession session = createMavenSession(null);
|
||||||
MavenProject project = session.getCurrentProject();
|
MavenProject project = session.getCurrentProject();
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ public class ProjectDependenciesResolverTest extends AbstractCoreMavenComponentT
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSystemScopeDependencyIsPresentInTheCompileClasspathElements() throws Exception {
|
void testSystemScopeDependencyIsPresentInTheCompileClasspathElements() throws Exception {
|
||||||
File pom = getProject("it0063");
|
File pom = getProject("it0063");
|
||||||
|
|
||||||
Properties eps = new Properties();
|
Properties eps = new Properties();
|
||||||
|
|
|
@ -32,12 +32,12 @@ import static org.codehaus.plexus.testing.PlexusExtension.getTestFile;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
@PlexusTest
|
@PlexusTest
|
||||||
public class ArtifactHandlerTest {
|
class ArtifactHandlerTest {
|
||||||
@Inject
|
@Inject
|
||||||
PlexusContainer container;
|
PlexusContainer container;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAptConsistency() throws Exception {
|
void testAptConsistency() throws Exception {
|
||||||
File apt = getTestFile("src/site/apt/artifact-handlers.apt");
|
File apt = getTestFile("src/site/apt/artifact-handlers.apt");
|
||||||
|
|
||||||
List<String> lines = Files.readAllLines(apt.toPath());
|
List<String> lines = Files.readAllLines(apt.toPath());
|
||||||
|
|
|
@ -31,18 +31,18 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
public class ExclusionArtifactFilterTest {
|
class ExclusionArtifactFilterTest {
|
||||||
private Artifact artifact;
|
private Artifact artifact;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
void setup() {
|
||||||
artifact = mock(Artifact.class);
|
artifact = mock(Artifact.class);
|
||||||
when(artifact.getGroupId()).thenReturn("org.apache.maven");
|
when(artifact.getGroupId()).thenReturn("org.apache.maven");
|
||||||
when(artifact.getArtifactId()).thenReturn("maven-core");
|
when(artifact.getArtifactId()).thenReturn("maven-core");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExcludeExact() {
|
void testExcludeExact() {
|
||||||
Exclusion exclusion = new Exclusion();
|
Exclusion exclusion = new Exclusion();
|
||||||
exclusion.setGroupId("org.apache.maven");
|
exclusion.setGroupId("org.apache.maven");
|
||||||
exclusion.setArtifactId("maven-core");
|
exclusion.setArtifactId("maven-core");
|
||||||
|
@ -52,7 +52,7 @@ public class ExclusionArtifactFilterTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExcludeNoMatch() {
|
void testExcludeNoMatch() {
|
||||||
Exclusion exclusion = new Exclusion();
|
Exclusion exclusion = new Exclusion();
|
||||||
exclusion.setGroupId("org.apache.maven");
|
exclusion.setGroupId("org.apache.maven");
|
||||||
exclusion.setArtifactId("maven-model");
|
exclusion.setArtifactId("maven-model");
|
||||||
|
@ -62,7 +62,7 @@ public class ExclusionArtifactFilterTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExcludeGroupIdWildcard() {
|
void testExcludeGroupIdWildcard() {
|
||||||
Exclusion exclusion = new Exclusion();
|
Exclusion exclusion = new Exclusion();
|
||||||
exclusion.setGroupId("*");
|
exclusion.setGroupId("*");
|
||||||
exclusion.setArtifactId("maven-core");
|
exclusion.setArtifactId("maven-core");
|
||||||
|
@ -72,7 +72,7 @@ public class ExclusionArtifactFilterTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExcludeGroupIdWildcardNoMatch() {
|
void testExcludeGroupIdWildcardNoMatch() {
|
||||||
Exclusion exclusion = new Exclusion();
|
Exclusion exclusion = new Exclusion();
|
||||||
exclusion.setGroupId("*");
|
exclusion.setGroupId("*");
|
||||||
exclusion.setArtifactId("maven-compat");
|
exclusion.setArtifactId("maven-compat");
|
||||||
|
@ -82,7 +82,7 @@ public class ExclusionArtifactFilterTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExcludeArtifactIdWildcard() {
|
void testExcludeArtifactIdWildcard() {
|
||||||
Exclusion exclusion = new Exclusion();
|
Exclusion exclusion = new Exclusion();
|
||||||
exclusion.setGroupId("org.apache.maven");
|
exclusion.setGroupId("org.apache.maven");
|
||||||
exclusion.setArtifactId("*");
|
exclusion.setArtifactId("*");
|
||||||
|
@ -92,7 +92,7 @@ public class ExclusionArtifactFilterTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExcludeArtifactIdWildcardNoMatch() {
|
void testExcludeArtifactIdWildcardNoMatch() {
|
||||||
Exclusion exclusion = new Exclusion();
|
Exclusion exclusion = new Exclusion();
|
||||||
exclusion.setGroupId("org.apache.groovy");
|
exclusion.setGroupId("org.apache.groovy");
|
||||||
exclusion.setArtifactId("*");
|
exclusion.setArtifactId("*");
|
||||||
|
@ -102,7 +102,7 @@ public class ExclusionArtifactFilterTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExcludeAllWildcard() {
|
void testExcludeAllWildcard() {
|
||||||
Exclusion exclusion = new Exclusion();
|
Exclusion exclusion = new Exclusion();
|
||||||
exclusion.setGroupId("*");
|
exclusion.setGroupId("*");
|
||||||
exclusion.setArtifactId("*");
|
exclusion.setArtifactId("*");
|
||||||
|
@ -112,7 +112,7 @@ public class ExclusionArtifactFilterTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMultipleExclusionsExcludeArtifactIdWildcard() {
|
void testMultipleExclusionsExcludeArtifactIdWildcard() {
|
||||||
Exclusion exclusion1 = new Exclusion();
|
Exclusion exclusion1 = new Exclusion();
|
||||||
exclusion1.setGroupId("org.apache.groovy");
|
exclusion1.setGroupId("org.apache.groovy");
|
||||||
exclusion1.setArtifactId("*");
|
exclusion1.setArtifactId("*");
|
||||||
|
@ -127,7 +127,7 @@ public class ExclusionArtifactFilterTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMultipleExclusionsExcludeGroupIdWildcard() {
|
void testMultipleExclusionsExcludeGroupIdWildcard() {
|
||||||
Exclusion exclusion1 = new Exclusion();
|
Exclusion exclusion1 = new Exclusion();
|
||||||
exclusion1.setGroupId("*");
|
exclusion1.setGroupId("*");
|
||||||
exclusion1.setArtifactId("maven-model");
|
exclusion1.setArtifactId("maven-model");
|
||||||
|
|
|
@ -37,17 +37,17 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
/**
|
/**
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class DefaultBeanConfiguratorPathTest {
|
class DefaultBeanConfiguratorPathTest {
|
||||||
|
|
||||||
private BeanConfigurator configurator;
|
private BeanConfigurator configurator;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setUp() throws Exception {
|
void setUp() throws Exception {
|
||||||
configurator = new DefaultBeanConfigurator();
|
configurator = new DefaultBeanConfigurator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() throws Exception {
|
void tearDown() throws Exception {
|
||||||
configurator = null;
|
configurator = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ public class DefaultBeanConfiguratorPathTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMinimal() throws BeanConfigurationException {
|
void testMinimal() throws BeanConfigurationException {
|
||||||
SomeBean bean = new SomeBean();
|
SomeBean bean = new SomeBean();
|
||||||
|
|
||||||
Xpp3Dom config = toConfig("<file>test</file>");
|
Xpp3Dom config = toConfig("<file>test</file>");
|
||||||
|
@ -74,7 +74,7 @@ public class DefaultBeanConfiguratorPathTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPreAndPostProcessing() throws BeanConfigurationException {
|
void testPreAndPostProcessing() throws BeanConfigurationException {
|
||||||
SomeBean bean = new SomeBean();
|
SomeBean bean = new SomeBean();
|
||||||
|
|
||||||
Xpp3Dom config = toConfig("<file>${test}</file>");
|
Xpp3Dom config = toConfig("<file>${test}</file>");
|
||||||
|
@ -98,7 +98,7 @@ public class DefaultBeanConfiguratorPathTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testChildConfigurationElement() throws BeanConfigurationException {
|
void testChildConfigurationElement() throws BeanConfigurationException {
|
||||||
SomeBean bean = new SomeBean();
|
SomeBean bean = new SomeBean();
|
||||||
|
|
||||||
Xpp3Dom config = toConfig("<wrapper><file>test</file></wrapper>");
|
Xpp3Dom config = toConfig("<wrapper><file>test</file></wrapper>");
|
||||||
|
|
|
@ -35,17 +35,17 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
/**
|
/**
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class DefaultBeanConfiguratorTest {
|
class DefaultBeanConfiguratorTest {
|
||||||
|
|
||||||
private BeanConfigurator configurator;
|
private BeanConfigurator configurator;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setUp() throws Exception {
|
void setUp() throws Exception {
|
||||||
configurator = new DefaultBeanConfigurator();
|
configurator = new DefaultBeanConfigurator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() throws Exception {
|
void tearDown() throws Exception {
|
||||||
configurator = null;
|
configurator = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ public class DefaultBeanConfiguratorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMinimal() throws BeanConfigurationException {
|
void testMinimal() throws BeanConfigurationException {
|
||||||
SomeBean bean = new SomeBean();
|
SomeBean bean = new SomeBean();
|
||||||
|
|
||||||
Xpp3Dom config = toConfig("<file>test</file>");
|
Xpp3Dom config = toConfig("<file>test</file>");
|
||||||
|
@ -72,7 +72,7 @@ public class DefaultBeanConfiguratorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPreAndPostProcessing() throws BeanConfigurationException {
|
void testPreAndPostProcessing() throws BeanConfigurationException {
|
||||||
SomeBean bean = new SomeBean();
|
SomeBean bean = new SomeBean();
|
||||||
|
|
||||||
Xpp3Dom config = toConfig("<file>${test}</file>");
|
Xpp3Dom config = toConfig("<file>${test}</file>");
|
||||||
|
@ -96,7 +96,7 @@ public class DefaultBeanConfiguratorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testChildConfigurationElement() throws BeanConfigurationException {
|
void testChildConfigurationElement() throws BeanConfigurationException {
|
||||||
SomeBean bean = new SomeBean();
|
SomeBean bean = new SomeBean();
|
||||||
|
|
||||||
Xpp3Dom config = toConfig("<wrapper><file>test</file></wrapper>");
|
Xpp3Dom config = toConfig("<wrapper><file>test</file></wrapper>");
|
||||||
|
|
|
@ -35,7 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:baerrach@apache.org">Barrie Treloar</a>
|
* @author <a href="mailto:baerrach@apache.org">Barrie Treloar</a>
|
||||||
*/
|
*/
|
||||||
public class DefaultExceptionHandlerTest {
|
class DefaultExceptionHandlerTest {
|
||||||
/**
|
/**
|
||||||
* Running Maven under JDK7 may cause connection issues because IPv6 is used by default.
|
* Running Maven under JDK7 may cause connection issues because IPv6 is used by default.
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -47,7 +47,7 @@ public class DefaultExceptionHandlerTest {
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testJdk7ipv6() {
|
void testJdk7ipv6() {
|
||||||
ConnectException connEx = new ConnectException("Connection refused: connect");
|
ConnectException connEx = new ConnectException("Connection refused: connect");
|
||||||
IOException ioEx = new IOException("Unable to establish loopback connection", connEx);
|
IOException ioEx = new IOException("Unable to establish loopback connection", connEx);
|
||||||
MojoExecutionException mojoEx =
|
MojoExecutionException mojoEx =
|
||||||
|
@ -61,7 +61,7 @@ public class DefaultExceptionHandlerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testHandleExceptionAetherClassNotFound() {
|
void testHandleExceptionAetherClassNotFound() {
|
||||||
Throwable cause2 = new NoClassDefFoundError("org/sonatype/aether/RepositorySystem");
|
Throwable cause2 = new NoClassDefFoundError("org/sonatype/aether/RepositorySystem");
|
||||||
Plugin plugin = new Plugin();
|
Plugin plugin = new Plugin();
|
||||||
Exception cause = new PluginContainerException(plugin, null, null, cause2);
|
Exception cause = new PluginContainerException(plugin, null, null, cause2);
|
||||||
|
@ -79,7 +79,7 @@ public class DefaultExceptionHandlerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testHandleExceptionNoClassDefFoundErrorNull() {
|
void testHandleExceptionNoClassDefFoundErrorNull() {
|
||||||
Throwable cause2 = new NoClassDefFoundError();
|
Throwable cause2 = new NoClassDefFoundError();
|
||||||
Plugin plugin = new Plugin();
|
Plugin plugin = new Plugin();
|
||||||
Exception cause = new PluginContainerException(plugin, null, null, cause2);
|
Exception cause = new PluginContainerException(plugin, null, null, cause2);
|
||||||
|
|
|
@ -31,18 +31,18 @@ import static java.util.Collections.singletonList;
|
||||||
import static org.hamcrest.MatcherAssert.assertThat;
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
|
|
||||||
public class DefaultBuildResumptionAnalyzerTest {
|
class DefaultBuildResumptionAnalyzerTest {
|
||||||
private final DefaultBuildResumptionAnalyzer analyzer = new DefaultBuildResumptionAnalyzer();
|
private final DefaultBuildResumptionAnalyzer analyzer = new DefaultBuildResumptionAnalyzer();
|
||||||
|
|
||||||
private MavenExecutionResult executionResult;
|
private MavenExecutionResult executionResult;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void before() {
|
void before() {
|
||||||
executionResult = new DefaultMavenExecutionResult();
|
executionResult = new DefaultMavenExecutionResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void resumeFromGetsDetermined() {
|
void resumeFromGetsDetermined() {
|
||||||
MavenProject projectA = createSucceededMavenProject("A");
|
MavenProject projectA = createSucceededMavenProject("A");
|
||||||
MavenProject projectB = createFailedMavenProject("B");
|
MavenProject projectB = createFailedMavenProject("B");
|
||||||
executionResult.setTopologicallySortedProjects(asList(projectA, projectB));
|
executionResult.setTopologicallySortedProjects(asList(projectA, projectB));
|
||||||
|
@ -54,7 +54,7 @@ public class DefaultBuildResumptionAnalyzerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void resumeFromIsIgnoredWhenFirstProjectFails() {
|
void resumeFromIsIgnoredWhenFirstProjectFails() {
|
||||||
MavenProject projectA = createFailedMavenProject("A");
|
MavenProject projectA = createFailedMavenProject("A");
|
||||||
MavenProject projectB = createMavenProject("B");
|
MavenProject projectB = createMavenProject("B");
|
||||||
executionResult.setTopologicallySortedProjects(asList(projectA, projectB));
|
executionResult.setTopologicallySortedProjects(asList(projectA, projectB));
|
||||||
|
@ -65,7 +65,7 @@ public class DefaultBuildResumptionAnalyzerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void projectsSucceedingAfterFailedProjectsAreExcluded() {
|
void projectsSucceedingAfterFailedProjectsAreExcluded() {
|
||||||
MavenProject projectA = createSucceededMavenProject("A");
|
MavenProject projectA = createSucceededMavenProject("A");
|
||||||
MavenProject projectB = createFailedMavenProject("B");
|
MavenProject projectB = createFailedMavenProject("B");
|
||||||
MavenProject projectC = createSucceededMavenProject("C");
|
MavenProject projectC = createSucceededMavenProject("C");
|
||||||
|
@ -78,7 +78,7 @@ public class DefaultBuildResumptionAnalyzerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void projectsDependingOnFailedProjectsAreNotExcluded() {
|
void projectsDependingOnFailedProjectsAreNotExcluded() {
|
||||||
MavenProject projectA = createSucceededMavenProject("A");
|
MavenProject projectA = createSucceededMavenProject("A");
|
||||||
MavenProject projectB = createFailedMavenProject("B");
|
MavenProject projectB = createFailedMavenProject("B");
|
||||||
MavenProject projectC = createSkippedMavenProject("C");
|
MavenProject projectC = createSkippedMavenProject("C");
|
||||||
|
@ -92,7 +92,7 @@ public class DefaultBuildResumptionAnalyzerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void projectsFailingAfterAnotherFailedProjectAreNotExcluded() {
|
void projectsFailingAfterAnotherFailedProjectAreNotExcluded() {
|
||||||
MavenProject projectA = createSucceededMavenProject("A");
|
MavenProject projectA = createSucceededMavenProject("A");
|
||||||
MavenProject projectB = createFailedMavenProject("B");
|
MavenProject projectB = createFailedMavenProject("B");
|
||||||
MavenProject projectC = createSucceededMavenProject("C");
|
MavenProject projectC = createSucceededMavenProject("C");
|
||||||
|
|
|
@ -32,11 +32,11 @@ import static org.hamcrest.Matchers.containsInAnyOrder;
|
||||||
import static org.hamcrest.Matchers.empty;
|
import static org.hamcrest.Matchers.empty;
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
|
|
||||||
public class DefaultBuildResumptionDataRepositoryTest {
|
class DefaultBuildResumptionDataRepositoryTest {
|
||||||
private final DefaultBuildResumptionDataRepository repository = new DefaultBuildResumptionDataRepository();
|
private final DefaultBuildResumptionDataRepository repository = new DefaultBuildResumptionDataRepository();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void resumeFromPropertyGetsApplied() {
|
void resumeFromPropertyGetsApplied() {
|
||||||
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
|
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
properties.setProperty("remainingProjects", ":module-a");
|
properties.setProperty("remainingProjects", ":module-a");
|
||||||
|
@ -47,7 +47,7 @@ public class DefaultBuildResumptionDataRepositoryTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void resumeFromPropertyDoesNotOverrideExistingRequestParameters() {
|
void resumeFromPropertyDoesNotOverrideExistingRequestParameters() {
|
||||||
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
|
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
|
||||||
request.setResumeFrom(":module-b");
|
request.setResumeFrom(":module-b");
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
|
@ -59,7 +59,7 @@ public class DefaultBuildResumptionDataRepositoryTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void projectsFromPropertyGetsAddedToExistingRequestParameters() {
|
void projectsFromPropertyGetsAddedToExistingRequestParameters() {
|
||||||
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
|
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
|
||||||
List<String> selectedProjects = new ArrayList<>();
|
List<String> selectedProjects = new ArrayList<>();
|
||||||
selectedProjects.add(":module-a");
|
selectedProjects.add(":module-a");
|
||||||
|
@ -75,7 +75,7 @@ public class DefaultBuildResumptionDataRepositoryTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void selectedProjectsAreNotAddedWhenPropertyValueIsEmpty() {
|
void selectedProjectsAreNotAddedWhenPropertyValueIsEmpty() {
|
||||||
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
|
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
properties.setProperty("remainingProjects", "");
|
properties.setProperty("remainingProjects", "");
|
||||||
|
@ -86,7 +86,7 @@ public class DefaultBuildResumptionDataRepositoryTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void applyResumptionData_shouldLoadData() {
|
void applyResumptionData_shouldLoadData() {
|
||||||
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
|
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
|
||||||
Build build = new Build();
|
Build build = new Build();
|
||||||
build.setDirectory("src/test/resources/org/apache/maven/execution/");
|
build.setDirectory("src/test/resources/org/apache/maven/execution/");
|
||||||
|
|
|
@ -32,12 +32,12 @@ import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
@PlexusTest
|
@PlexusTest
|
||||||
public class DefaultMavenExecutionRequestPopulatorTest {
|
class DefaultMavenExecutionRequestPopulatorTest {
|
||||||
@Inject
|
@Inject
|
||||||
MavenExecutionRequestPopulator testee;
|
MavenExecutionRequestPopulator testee;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPluginRepositoryInjection() throws Exception {
|
void testPluginRepositoryInjection() throws Exception {
|
||||||
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
|
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
|
||||||
|
|
||||||
Repository r = new Repository();
|
Repository r = new Repository();
|
||||||
|
|
|
@ -32,9 +32,9 @@ import static org.junit.jupiter.api.Assertions.assertNotSame;
|
||||||
/**
|
/**
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class DefaultMavenExecutionTest {
|
class DefaultMavenExecutionTest {
|
||||||
@Test
|
@Test
|
||||||
public void testCopyDefault() {
|
void testCopyDefault() {
|
||||||
MavenExecutionRequest original = new DefaultMavenExecutionRequest();
|
MavenExecutionRequest original = new DefaultMavenExecutionRequest();
|
||||||
MavenExecutionRequest copy = DefaultMavenExecutionRequest.copy(original);
|
MavenExecutionRequest copy = DefaultMavenExecutionRequest.copy(original);
|
||||||
assertNotNull(copy);
|
assertNotNull(copy);
|
||||||
|
@ -42,7 +42,7 @@ public class DefaultMavenExecutionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResultWithNullTopologicallySortedProjectsIsEmptyList() {
|
void testResultWithNullTopologicallySortedProjectsIsEmptyList() {
|
||||||
MavenExecutionResult result = new DefaultMavenExecutionResult();
|
MavenExecutionResult result = new DefaultMavenExecutionResult();
|
||||||
result.setTopologicallySortedProjects(null);
|
result.setTopologicallySortedProjects(null);
|
||||||
List<MavenProject> projects = result.getTopologicallySortedProjects();
|
List<MavenProject> projects = result.getTopologicallySortedProjects();
|
||||||
|
|
|
@ -30,9 +30,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertSame;
|
import static org.junit.jupiter.api.Assertions.assertSame;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
public class MojoExecutionScopeTest {
|
class MojoExecutionScopeTest {
|
||||||
@Test
|
@Test
|
||||||
public void testNestedEnter() throws Exception {
|
void testNestedEnter() throws Exception {
|
||||||
MojoExecutionScope scope = new MojoExecutionScope();
|
MojoExecutionScope scope = new MojoExecutionScope();
|
||||||
|
|
||||||
scope.enter();
|
scope.enter();
|
||||||
|
@ -55,7 +55,7 @@ public class MojoExecutionScopeTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMultiKeyInstance() throws Exception {
|
void testMultiKeyInstance() throws Exception {
|
||||||
MojoExecutionScope scope = new MojoExecutionScope();
|
MojoExecutionScope scope = new MojoExecutionScope();
|
||||||
scope.enter();
|
scope.enter();
|
||||||
|
|
||||||
|
|
|
@ -331,7 +331,7 @@ class DefaultGraphBuilderTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void before() throws Exception {
|
void before() throws Exception {
|
||||||
graphBuilder = new DefaultGraphBuilder(
|
graphBuilder = new DefaultGraphBuilder(
|
||||||
mock(BuildResumptionDataRepository.class),
|
mock(BuildResumptionDataRepository.class),
|
||||||
pomlessCollectionStrategy,
|
pomlessCollectionStrategy,
|
||||||
|
|
|
@ -33,7 +33,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
/**
|
/**
|
||||||
* @author Kristian Rosenvold
|
* @author Kristian Rosenvold
|
||||||
*/
|
*/
|
||||||
public class DefaultProjectDependencyGraphTest {
|
class DefaultProjectDependencyGraphTest {
|
||||||
|
|
||||||
private final MavenProject aProject = createA();
|
private final MavenProject aProject = createA();
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public class DefaultProjectDependencyGraphTest {
|
||||||
private final MavenProject transitiveOnly = createProject(Arrays.asList(toDependency(depender3)), "depender5");
|
private final MavenProject transitiveOnly = createProject(Arrays.asList(toDependency(depender3)), "depender5");
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetSortedProjects() throws DuplicateProjectException, CycleDetectedException {
|
void testGetSortedProjects() throws DuplicateProjectException, CycleDetectedException {
|
||||||
ProjectDependencyGraph graph = new DefaultProjectDependencyGraph(Arrays.asList(depender1, aProject));
|
ProjectDependencyGraph graph = new DefaultProjectDependencyGraph(Arrays.asList(depender1, aProject));
|
||||||
final List<MavenProject> sortedProjects = graph.getSortedProjects();
|
final List<MavenProject> sortedProjects = graph.getSortedProjects();
|
||||||
assertEquals(aProject, sortedProjects.get(0));
|
assertEquals(aProject, sortedProjects.get(0));
|
||||||
|
@ -57,7 +57,7 @@ public class DefaultProjectDependencyGraphTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVerifyExpectedParentStructure() throws CycleDetectedException, DuplicateProjectException {
|
void testVerifyExpectedParentStructure() throws CycleDetectedException, DuplicateProjectException {
|
||||||
// This test verifies the baseline structure used in subsequent tests. If this fails, the rest will fail.
|
// This test verifies the baseline structure used in subsequent tests. If this fails, the rest will fail.
|
||||||
ProjectDependencyGraph graph = threeProjectsDependingOnASingle();
|
ProjectDependencyGraph graph = threeProjectsDependingOnASingle();
|
||||||
final List<MavenProject> sortedProjects = graph.getSortedProjects();
|
final List<MavenProject> sortedProjects = graph.getSortedProjects();
|
||||||
|
@ -68,8 +68,7 @@ public class DefaultProjectDependencyGraphTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVerifyThatDownstreamProjectsComeInSortedOrder()
|
void testVerifyThatDownstreamProjectsComeInSortedOrder() throws CycleDetectedException, DuplicateProjectException {
|
||||||
throws CycleDetectedException, DuplicateProjectException {
|
|
||||||
final List<MavenProject> downstreamProjects =
|
final List<MavenProject> downstreamProjects =
|
||||||
threeProjectsDependingOnASingle().getDownstreamProjects(aProject, true);
|
threeProjectsDependingOnASingle().getDownstreamProjects(aProject, true);
|
||||||
assertEquals(depender1, downstreamProjects.get(0));
|
assertEquals(depender1, downstreamProjects.get(0));
|
||||||
|
@ -78,7 +77,7 @@ public class DefaultProjectDependencyGraphTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTransitivesInOrder() throws CycleDetectedException, DuplicateProjectException {
|
void testTransitivesInOrder() throws CycleDetectedException, DuplicateProjectException {
|
||||||
final ProjectDependencyGraph graph =
|
final ProjectDependencyGraph graph =
|
||||||
new DefaultProjectDependencyGraph(Arrays.asList(depender1, depender4, depender2, depender3, aProject));
|
new DefaultProjectDependencyGraph(Arrays.asList(depender1, depender4, depender2, depender3, aProject));
|
||||||
|
|
||||||
|
@ -90,7 +89,7 @@ public class DefaultProjectDependencyGraphTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNonTransitivesInOrder() throws CycleDetectedException, DuplicateProjectException {
|
void testNonTransitivesInOrder() throws CycleDetectedException, DuplicateProjectException {
|
||||||
final ProjectDependencyGraph graph =
|
final ProjectDependencyGraph graph =
|
||||||
new DefaultProjectDependencyGraph(Arrays.asList(depender1, depender4, depender2, depender3, aProject));
|
new DefaultProjectDependencyGraph(Arrays.asList(depender1, depender4, depender2, depender3, aProject));
|
||||||
|
|
||||||
|
@ -102,7 +101,7 @@ public class DefaultProjectDependencyGraphTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testWithTransitiveOnly() throws CycleDetectedException, DuplicateProjectException {
|
void testWithTransitiveOnly() throws CycleDetectedException, DuplicateProjectException {
|
||||||
final ProjectDependencyGraph graph = new DefaultProjectDependencyGraph(
|
final ProjectDependencyGraph graph = new DefaultProjectDependencyGraph(
|
||||||
Arrays.asList(depender1, transitiveOnly, depender2, depender3, aProject));
|
Arrays.asList(depender1, transitiveOnly, depender2, depender3, aProject));
|
||||||
|
|
||||||
|
@ -114,7 +113,7 @@ public class DefaultProjectDependencyGraphTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testWithMissingTransitiveOnly() throws CycleDetectedException, DuplicateProjectException {
|
void testWithMissingTransitiveOnly() throws CycleDetectedException, DuplicateProjectException {
|
||||||
final ProjectDependencyGraph graph = new DefaultProjectDependencyGraph(
|
final ProjectDependencyGraph graph = new DefaultProjectDependencyGraph(
|
||||||
Arrays.asList(depender1, transitiveOnly, depender2, depender3, aProject));
|
Arrays.asList(depender1, transitiveOnly, depender2, depender3, aProject));
|
||||||
|
|
||||||
|
@ -125,7 +124,7 @@ public class DefaultProjectDependencyGraphTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetUpstreamProjects() throws CycleDetectedException, DuplicateProjectException {
|
void testGetUpstreamProjects() throws CycleDetectedException, DuplicateProjectException {
|
||||||
ProjectDependencyGraph graph = threeProjectsDependingOnASingle();
|
ProjectDependencyGraph graph = threeProjectsDependingOnASingle();
|
||||||
final List<MavenProject> downstreamProjects = graph.getUpstreamProjects(depender1, true);
|
final List<MavenProject> downstreamProjects = graph.getUpstreamProjects(depender1, true);
|
||||||
assertEquals(aProject, downstreamProjects.get(0));
|
assertEquals(aProject, downstreamProjects.get(0));
|
||||||
|
|
|
@ -25,10 +25,10 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
public class MultilineMessageHelperTest {
|
class MultilineMessageHelperTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBuilderCommon() {
|
void testBuilderCommon() {
|
||||||
List<String> msgs = new ArrayList<>();
|
List<String> msgs = new ArrayList<>();
|
||||||
msgs.add("*****************************************************************");
|
msgs.add("*****************************************************************");
|
||||||
msgs.add("* Your build is requesting parallel execution, but project *");
|
msgs.add("* Your build is requesting parallel execution, but project *");
|
||||||
|
@ -51,7 +51,7 @@ public class MultilineMessageHelperTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMojoExecutor() {
|
void testMojoExecutor() {
|
||||||
List<String> msgs = new ArrayList<>();
|
List<String> msgs = new ArrayList<>();
|
||||||
msgs.add("*****************************************************************");
|
msgs.add("*****************************************************************");
|
||||||
msgs.add("* An aggregator Mojo is already executing in parallel build, *");
|
msgs.add("* An aggregator Mojo is already executing in parallel build, *");
|
||||||
|
|
|
@ -37,9 +37,9 @@ import static org.mockito.Mockito.when;
|
||||||
/**
|
/**
|
||||||
* UT for {@link ReverseTreeRepositoryListener}.
|
* UT for {@link ReverseTreeRepositoryListener}.
|
||||||
*/
|
*/
|
||||||
public class ReverseTreeRepositoryListenerTest {
|
class ReverseTreeRepositoryListenerTest {
|
||||||
@Test
|
@Test
|
||||||
public void isLocalRepositoryArtifactTest() {
|
void isLocalRepositoryArtifactTest() {
|
||||||
File baseDir = new File("local/repository");
|
File baseDir = new File("local/repository");
|
||||||
LocalRepository localRepository = new LocalRepository(baseDir);
|
LocalRepository localRepository = new LocalRepository(baseDir);
|
||||||
RepositorySystemSession session = mock(RepositorySystemSession.class);
|
RepositorySystemSession session = mock(RepositorySystemSession.class);
|
||||||
|
@ -60,7 +60,7 @@ public class ReverseTreeRepositoryListenerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void isMissingArtifactTest() {
|
void isMissingArtifactTest() {
|
||||||
File baseDir = new File("local/repository");
|
File baseDir = new File("local/repository");
|
||||||
LocalRepository localRepository = new LocalRepository(baseDir);
|
LocalRepository localRepository = new LocalRepository(baseDir);
|
||||||
RepositorySystemSession session = mock(RepositorySystemSession.class);
|
RepositorySystemSession session = mock(RepositorySystemSession.class);
|
||||||
|
@ -75,7 +75,7 @@ public class ReverseTreeRepositoryListenerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void lookupCollectStepDataTest() {
|
void lookupCollectStepDataTest() {
|
||||||
RequestTrace doesNotHaveIt =
|
RequestTrace doesNotHaveIt =
|
||||||
RequestTrace.newChild(null, "foo").newChild("bar").newChild("baz");
|
RequestTrace.newChild(null, "foo").newChild("bar").newChild("baz");
|
||||||
assertThat(ReverseTreeRepositoryListener.lookupCollectStepData(doesNotHaveIt), nullValue());
|
assertThat(ReverseTreeRepositoryListener.lookupCollectStepData(doesNotHaveIt), nullValue());
|
||||||
|
|
|
@ -32,10 +32,10 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
public class PropertiesAsMapTest {
|
class PropertiesAsMapTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPropertiesAsMap() {
|
void testPropertiesAsMap() {
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
props.setProperty("foo1", "bar1");
|
props.setProperty("foo1", "bar1");
|
||||||
props.setProperty("foo2", "bar2");
|
props.setProperty("foo2", "bar2");
|
||||||
|
|
|
@ -55,7 +55,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
@PlexusTest
|
@PlexusTest
|
||||||
public class TestApi {
|
class TestApi {
|
||||||
|
|
||||||
Session session;
|
Session session;
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,9 @@ import org.apache.maven.model.building.TransformerContext;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.xmlunit.assertj.XmlAssert;
|
import org.xmlunit.assertj.XmlAssert;
|
||||||
|
|
||||||
public class ConsumerPomArtifactTransformerTest {
|
class ConsumerPomArtifactTransformerTest {
|
||||||
@Test
|
@Test
|
||||||
public void transform() throws Exception {
|
void transform() throws Exception {
|
||||||
Path beforePomFile =
|
Path beforePomFile =
|
||||||
Paths.get("src/test/resources/projects/transform/before.pom").toAbsolutePath();
|
Paths.get("src/test/resources/projects/transform/before.pom").toAbsolutePath();
|
||||||
Path afterPomFile =
|
Path afterPomFile =
|
||||||
|
|
|
@ -43,47 +43,47 @@ import static org.mockito.Mockito.when;
|
||||||
* @author Kristian Rosenvold
|
* @author Kristian Rosenvold
|
||||||
*/
|
*/
|
||||||
@PlexusTest
|
@PlexusTest
|
||||||
public class DefaultLifecyclesTest {
|
class DefaultLifecyclesTest {
|
||||||
@Inject
|
@Inject
|
||||||
private DefaultLifecycles defaultLifeCycles;
|
private DefaultLifecycles defaultLifeCycles;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDefaultLifecycles() {
|
void testDefaultLifecycles() {
|
||||||
final List<Lifecycle> lifecycles = defaultLifeCycles.getLifeCycles();
|
final List<Lifecycle> lifecycles = defaultLifeCycles.getLifeCycles();
|
||||||
assertThat(lifecycles, hasSize(4));
|
assertThat(lifecycles, hasSize(4));
|
||||||
assertThat(DefaultLifecycles.STANDARD_LIFECYCLES, arrayWithSize(4));
|
assertThat(DefaultLifecycles.STANDARD_LIFECYCLES, arrayWithSize(4));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDefaultLifecycle() {
|
void testDefaultLifecycle() {
|
||||||
final Lifecycle lifecycle = getLifeCycleById("default");
|
final Lifecycle lifecycle = getLifeCycleById("default");
|
||||||
assertThat(lifecycle.getId(), is("default"));
|
assertThat(lifecycle.getId(), is("default"));
|
||||||
assertThat(lifecycle.getPhases(), hasSize(23));
|
assertThat(lifecycle.getPhases(), hasSize(23));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCleanLifecycle() {
|
void testCleanLifecycle() {
|
||||||
final Lifecycle lifecycle = getLifeCycleById("clean");
|
final Lifecycle lifecycle = getLifeCycleById("clean");
|
||||||
assertThat(lifecycle.getId(), is("clean"));
|
assertThat(lifecycle.getId(), is("clean"));
|
||||||
assertThat(lifecycle.getPhases(), hasSize(3));
|
assertThat(lifecycle.getPhases(), hasSize(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSiteLifecycle() {
|
void testSiteLifecycle() {
|
||||||
final Lifecycle lifecycle = getLifeCycleById("site");
|
final Lifecycle lifecycle = getLifeCycleById("site");
|
||||||
assertThat(lifecycle.getId(), is("site"));
|
assertThat(lifecycle.getId(), is("site"));
|
||||||
assertThat(lifecycle.getPhases(), hasSize(4));
|
assertThat(lifecycle.getPhases(), hasSize(4));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testWrapperLifecycle() {
|
void testWrapperLifecycle() {
|
||||||
final Lifecycle lifecycle = getLifeCycleById("wrapper");
|
final Lifecycle lifecycle = getLifeCycleById("wrapper");
|
||||||
assertThat(lifecycle.getId(), is("wrapper"));
|
assertThat(lifecycle.getId(), is("wrapper"));
|
||||||
assertThat(lifecycle.getPhases(), hasSize(1));
|
assertThat(lifecycle.getPhases(), hasSize(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCustomLifecycle() throws ComponentLookupException {
|
void testCustomLifecycle() throws ComponentLookupException {
|
||||||
List<Lifecycle> myLifecycles = new ArrayList<>();
|
List<Lifecycle> myLifecycles = new ArrayList<>();
|
||||||
Lifecycle myLifecycle =
|
Lifecycle myLifecycle =
|
||||||
new Lifecycle("etl", Arrays.asList("extract", "transform", "load"), Collections.emptyMap());
|
new Lifecycle("etl", Arrays.asList("extract", "transform", "load"), Collections.emptyMap());
|
||||||
|
|
|
@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
*
|
*
|
||||||
* @author Kristian Rosenvold
|
* @author Kristian Rosenvold
|
||||||
*/
|
*/
|
||||||
public class LifecycleExecutorSubModulesTest extends AbstractCoreMavenComponentTestCase {
|
class LifecycleExecutorSubModulesTest extends AbstractCoreMavenComponentTestCase {
|
||||||
@Inject
|
@Inject
|
||||||
private DefaultLifecycles defaultLifeCycles;
|
private DefaultLifecycles defaultLifeCycles;
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ public class LifecycleExecutorSubModulesTest extends AbstractCoreMavenComponentT
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreation() throws Exception {
|
void testCreation() throws Exception {
|
||||||
assertNotNull(defaultLifeCycles);
|
assertNotNull(defaultLifeCycles);
|
||||||
assertNotNull(mojoExecutor);
|
assertNotNull(mojoExecutor);
|
||||||
assertNotNull(lifeCycleBuilder);
|
assertNotNull(lifeCycleBuilder);
|
||||||
|
|
|
@ -56,7 +56,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
public class LifecycleExecutorTest extends AbstractCoreMavenComponentTestCase {
|
class LifecycleExecutorTest extends AbstractCoreMavenComponentTestCase {
|
||||||
@Inject
|
@Inject
|
||||||
private DefaultLifecycleExecutor lifecycleExecutor;
|
private DefaultLifecycleExecutor lifecycleExecutor;
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ public class LifecycleExecutorTest extends AbstractCoreMavenComponentTestCase {
|
||||||
// -----------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCalculationOfBuildPlanWithIndividualTaskWherePluginIsSpecifiedInThePom() throws Exception {
|
void testCalculationOfBuildPlanWithIndividualTaskWherePluginIsSpecifiedInThePom() throws Exception {
|
||||||
// We are doing something like "mvn resources:resources" where no version is specified but this
|
// We are doing something like "mvn resources:resources" where no version is specified but this
|
||||||
// project we are working on has the version specified in the POM so the version should come from there.
|
// project we are working on has the version specified in the POM so the version should come from there.
|
||||||
File pom = getProject("project-basic");
|
File pom = getProject("project-basic");
|
||||||
|
@ -100,7 +100,7 @@ public class LifecycleExecutorTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCalculationOfBuildPlanWithIndividualTaskOfTheCleanLifecycle() throws Exception {
|
void testCalculationOfBuildPlanWithIndividualTaskOfTheCleanLifecycle() throws Exception {
|
||||||
// We are doing something like "mvn clean:clean" where no version is specified but this
|
// We are doing something like "mvn clean:clean" where no version is specified but this
|
||||||
// project we are working on has the version specified in the POM so the version should come from there.
|
// project we are working on has the version specified in the POM so the version should come from there.
|
||||||
File pom = getProject("project-basic");
|
File pom = getProject("project-basic");
|
||||||
|
@ -122,7 +122,7 @@ public class LifecycleExecutorTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCalculationOfBuildPlanWithIndividualTaskOfTheCleanCleanGoal() throws Exception {
|
void testCalculationOfBuildPlanWithIndividualTaskOfTheCleanCleanGoal() throws Exception {
|
||||||
// We are doing something like "mvn clean:clean" where no version is specified but this
|
// We are doing something like "mvn clean:clean" where no version is specified but this
|
||||||
// project we are working on has the version specified in the POM so the version should come from there.
|
// project we are working on has the version specified in the POM so the version should come from there.
|
||||||
File pom = getProject("project-basic");
|
File pom = getProject("project-basic");
|
||||||
|
@ -258,7 +258,7 @@ public class LifecycleExecutorTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLifecycleQueryingUsingADefaultLifecyclePhase() throws Exception {
|
void testLifecycleQueryingUsingADefaultLifecyclePhase() throws Exception {
|
||||||
File pom = getProject("project-with-additional-lifecycle-elements");
|
File pom = getProject("project-with-additional-lifecycle-elements");
|
||||||
MavenSession session = createMavenSession(pom);
|
MavenSession session = createMavenSession(pom);
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
@ -297,14 +297,14 @@ public class LifecycleExecutorTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLifecyclePluginsRetrievalForDefaultLifecycle() throws Exception {
|
void testLifecyclePluginsRetrievalForDefaultLifecycle() throws Exception {
|
||||||
List<Plugin> plugins = new ArrayList<>(lifecycleExecutor.getPluginsBoundByDefaultToAllLifecycles("jar"));
|
List<Plugin> plugins = new ArrayList<>(lifecycleExecutor.getPluginsBoundByDefaultToAllLifecycles("jar"));
|
||||||
|
|
||||||
assertThat(plugins.toString(), plugins, hasSize(9));
|
assertThat(plugins.toString(), plugins, hasSize(9));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPluginConfigurationCreation() throws Exception {
|
void testPluginConfigurationCreation() throws Exception {
|
||||||
File pom = getProject("project-with-additional-lifecycle-elements");
|
File pom = getProject("project-with-additional-lifecycle-elements");
|
||||||
MavenSession session = createMavenSession(pom);
|
MavenSession session = createMavenSession(pom);
|
||||||
MojoDescriptor mojoDescriptor = mojoDescriptorCreator.getMojoDescriptor(
|
MojoDescriptor mojoDescriptor = mojoDescriptorCreator.getMojoDescriptor(
|
||||||
|
@ -328,7 +328,7 @@ public class LifecycleExecutorTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInvalidGoalName() throws Exception {
|
void testInvalidGoalName() throws Exception {
|
||||||
File pom = getProject("project-basic");
|
File pom = getProject("project-basic");
|
||||||
MavenSession session = createMavenSession(pom);
|
MavenSession session = createMavenSession(pom);
|
||||||
MojoNotFoundException e = assertThrows(
|
MojoNotFoundException e = assertThrows(
|
||||||
|
@ -346,7 +346,7 @@ public class LifecycleExecutorTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPluginPrefixRetrieval() throws Exception {
|
void testPluginPrefixRetrieval() throws Exception {
|
||||||
File pom = getProject("project-basic");
|
File pom = getProject("project-basic");
|
||||||
MavenSession session = createMavenSession(pom);
|
MavenSession session = createMavenSession(pom);
|
||||||
Plugin plugin = mojoDescriptorCreator.findPluginForPrefix("resources", session);
|
Plugin plugin = mojoDescriptorCreator.findPluginForPrefix("resources", session);
|
||||||
|
@ -357,7 +357,7 @@ public class LifecycleExecutorTest extends AbstractCoreMavenComponentTestCase {
|
||||||
// Prefixes
|
// Prefixes
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFindingPluginPrefixForCleanClean() throws Exception {
|
void testFindingPluginPrefixForCleanClean() throws Exception {
|
||||||
File pom = getProject("project-basic");
|
File pom = getProject("project-basic");
|
||||||
MavenSession session = createMavenSession(pom);
|
MavenSession session = createMavenSession(pom);
|
||||||
Plugin plugin = mojoDescriptorCreator.findPluginForPrefix("clean", session);
|
Plugin plugin = mojoDescriptorCreator.findPluginForPrefix("clean", session);
|
||||||
|
@ -365,7 +365,7 @@ public class LifecycleExecutorTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSetupMojoExecution() throws Exception {
|
void testSetupMojoExecution() throws Exception {
|
||||||
File pom = getProject("mojo-configuration");
|
File pom = getProject("mojo-configuration");
|
||||||
|
|
||||||
MavenSession session = createMavenSession(pom);
|
MavenSession session = createMavenSession(pom);
|
||||||
|
@ -385,7 +385,7 @@ public class LifecycleExecutorTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExecutionListeners() throws Exception {
|
void testExecutionListeners() throws Exception {
|
||||||
final File pom = getProject("project-basic");
|
final File pom = getProject("project-basic");
|
||||||
final MavenSession session = createMavenSession(pom);
|
final MavenSession session = createMavenSession(pom);
|
||||||
session.setProjectDependencyGraph(new ProjectDependencyGraph() {
|
session.setProjectDependencyGraph(new ProjectDependencyGraph() {
|
||||||
|
|
|
@ -32,10 +32,10 @@ import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
/**
|
/**
|
||||||
* @author Kristian Rosenvold
|
* @author Kristian Rosenvold
|
||||||
*/
|
*/
|
||||||
public class MavenExecutionPlanTest {
|
class MavenExecutionPlanTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFindLastInPhase() throws Exception {
|
void testFindLastInPhase() throws Exception {
|
||||||
MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan();
|
MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan();
|
||||||
|
|
||||||
ExecutionPlanItem expected = plan.findLastInPhase("package");
|
ExecutionPlanItem expected = plan.findLastInPhase("package");
|
||||||
|
@ -45,7 +45,7 @@ public class MavenExecutionPlanTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThreadSafeMojos() throws Exception {
|
void testThreadSafeMojos() throws Exception {
|
||||||
MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan();
|
MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan();
|
||||||
final Set<Plugin> unSafePlugins = plan.getNonThreadSafePlugins();
|
final Set<Plugin> unSafePlugins = plan.getNonThreadSafePlugins();
|
||||||
// There is only a single threadsafe plugin here...
|
// There is only a single threadsafe plugin here...
|
||||||
|
@ -53,7 +53,7 @@ public class MavenExecutionPlanTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFindLastWhenFirst() throws Exception {
|
void testFindLastWhenFirst() throws Exception {
|
||||||
MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan();
|
MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan();
|
||||||
|
|
||||||
ExecutionPlanItem beerPhase = plan.findLastInPhase(
|
ExecutionPlanItem beerPhase = plan.findLastInPhase(
|
||||||
|
@ -62,7 +62,7 @@ public class MavenExecutionPlanTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFindLastInPhaseMisc() throws Exception {
|
void testFindLastInPhaseMisc() throws Exception {
|
||||||
MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan();
|
MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan();
|
||||||
|
|
||||||
assertNull(plan.findLastInPhase("pacXkage"));
|
assertNull(plan.findLastInPhase("pacXkage"));
|
||||||
|
|
|
@ -29,10 +29,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertSame;
|
import static org.junit.jupiter.api.Assertions.assertSame;
|
||||||
|
|
||||||
public class BuildListCalculatorTest {
|
class BuildListCalculatorTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCalculateProjectBuilds() throws Exception {
|
void testCalculateProjectBuilds() throws Exception {
|
||||||
LifecycleTaskSegmentCalculator lifecycleTaskSegmentCalculator = getTaskSegmentCalculator();
|
LifecycleTaskSegmentCalculator lifecycleTaskSegmentCalculator = getTaskSegmentCalculator();
|
||||||
BuildListCalculator buildListCalculator = new BuildListCalculator();
|
BuildListCalculator buildListCalculator = new BuildListCalculator();
|
||||||
final MavenSession session = ProjectDependencyGraphStub.getMavenSession();
|
final MavenSession session = ProjectDependencyGraphStub.getMavenSession();
|
||||||
|
|
|
@ -48,9 +48,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
/**
|
/**
|
||||||
* @author Kristian Rosenvold
|
* @author Kristian Rosenvold
|
||||||
*/
|
*/
|
||||||
public class ConcurrencyDependencyGraphTest {
|
class ConcurrencyDependencyGraphTest {
|
||||||
@Test
|
@Test
|
||||||
public void testConcurrencyGraphPrimaryVersion()
|
void testConcurrencyGraphPrimaryVersion()
|
||||||
throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException,
|
throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException,
|
||||||
NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException,
|
NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException,
|
||||||
PluginResolutionException, LifecyclePhaseNotFoundException, LifecycleNotFoundException {
|
PluginResolutionException, LifecyclePhaseNotFoundException, LifecycleNotFoundException {
|
||||||
|
@ -80,7 +80,7 @@ public class ConcurrencyDependencyGraphTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testConcurrencyGraphDifferentCompletionOrder()
|
void testConcurrencyGraphDifferentCompletionOrder()
|
||||||
throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException,
|
throws InvalidPluginDescriptorException, PluginVersionResolutionException, PluginDescriptorParsingException,
|
||||||
NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException,
|
NoPluginFoundForPrefixException, MojoNotFoundException, PluginNotFoundException,
|
||||||
PluginResolutionException, LifecyclePhaseNotFoundException, LifecycleNotFoundException {
|
PluginResolutionException, LifecyclePhaseNotFoundException, LifecycleNotFoundException {
|
||||||
|
|
|
@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
|
|
||||||
public class LifecycleDependencyResolverTest extends AbstractCoreMavenComponentTestCase {
|
class LifecycleDependencyResolverTest extends AbstractCoreMavenComponentTestCase {
|
||||||
@Inject
|
@Inject
|
||||||
private LifecycleDependencyResolver resolver;
|
private LifecycleDependencyResolver resolver;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public class LifecycleDependencyResolverTest extends AbstractCoreMavenComponentT
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCachedReactorProjectDependencies() throws Exception {
|
void testCachedReactorProjectDependencies() throws Exception {
|
||||||
MavenSession session = createMavenSession(
|
MavenSession session = createMavenSession(
|
||||||
new File("src/test/projects/lifecycle-dependency-resolver/pom.xml"), new Properties(), true);
|
new File("src/test/projects/lifecycle-dependency-resolver/pom.xml"), new Properties(), true);
|
||||||
Collection<String> scopesToCollect = null;
|
Collection<String> scopesToCollect = null;
|
||||||
|
|
|
@ -34,10 +34,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
/**
|
/**
|
||||||
* @author Kristian Rosenvold
|
* @author Kristian Rosenvold
|
||||||
*/
|
*/
|
||||||
public class LifecycleExecutionPlanCalculatorTest extends AbstractCoreMavenComponentTestCase {
|
class LifecycleExecutionPlanCalculatorTest extends AbstractCoreMavenComponentTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCalculateExecutionPlanWithGoalTasks() throws Exception {
|
void testCalculateExecutionPlanWithGoalTasks() throws Exception {
|
||||||
MojoDescriptorCreator mojoDescriptorCreator = createMojoDescriptorCreator();
|
MojoDescriptorCreator mojoDescriptorCreator = createMojoDescriptorCreator();
|
||||||
LifecycleExecutionPlanCalculator lifecycleExecutionPlanCalculator =
|
LifecycleExecutionPlanCalculator lifecycleExecutionPlanCalculator =
|
||||||
createExecutionPlaceCalculator(mojoDescriptorCreator);
|
createExecutionPlaceCalculator(mojoDescriptorCreator);
|
||||||
|
|
|
@ -44,12 +44,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
|
|
||||||
@PlexusTest
|
@PlexusTest
|
||||||
public class LifecycleModuleBuilderTest {
|
class LifecycleModuleBuilderTest {
|
||||||
@Inject
|
@Inject
|
||||||
PlexusContainer container;
|
PlexusContainer container;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCurrentProject() throws Exception {
|
void testCurrentProject() throws Exception {
|
||||||
List<MavenProject> currentProjects = new ArrayList<>();
|
List<MavenProject> currentProjects = new ArrayList<>();
|
||||||
MojoExecutorStub mojoExecutor = new MojoExecutorStub() {
|
MojoExecutorStub mojoExecutor = new MojoExecutorStub() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -31,9 +31,9 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
/**
|
/**
|
||||||
* @author Kristian Rosenvold
|
* @author Kristian Rosenvold
|
||||||
*/
|
*/
|
||||||
public class LifecycleTaskSegmentCalculatorImplTest {
|
class LifecycleTaskSegmentCalculatorImplTest {
|
||||||
@Test
|
@Test
|
||||||
public void testCalculateProjectBuilds() throws Exception {
|
void testCalculateProjectBuilds() throws Exception {
|
||||||
LifecycleTaskSegmentCalculator lifecycleTaskSegmentCalculator = getTaskSegmentCalculator();
|
LifecycleTaskSegmentCalculator lifecycleTaskSegmentCalculator = getTaskSegmentCalculator();
|
||||||
BuildListCalculator buildListCalculator = new BuildListCalculator();
|
BuildListCalculator buildListCalculator = new BuildListCalculator();
|
||||||
final MavenSession session = ProjectDependencyGraphStub.getMavenSession();
|
final MavenSession session = ProjectDependencyGraphStub.getMavenSession();
|
||||||
|
|
|
@ -32,9 +32,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
/**
|
/**
|
||||||
* @author Kristian Rosenvold
|
* @author Kristian Rosenvold
|
||||||
*/
|
*/
|
||||||
public class PhaseRecorderTest {
|
class PhaseRecorderTest {
|
||||||
@Test
|
@Test
|
||||||
public void testObserveExecution() throws Exception {
|
void testObserveExecution() throws Exception {
|
||||||
PhaseRecorder phaseRecorder = new PhaseRecorder(ProjectDependencyGraphStub.A);
|
PhaseRecorder phaseRecorder = new PhaseRecorder(ProjectDependencyGraphStub.A);
|
||||||
MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan();
|
MavenExecutionPlan plan = LifecycleExecutionPlanCalculatorStub.getProjectAExecutionPlan();
|
||||||
final List<MojoExecution> executions = plan.getMojoExecutions();
|
final List<MojoExecution> executions = plan.getMojoExecutions();
|
||||||
|
|
|
@ -30,9 +30,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
/**
|
/**
|
||||||
* @author Kristian Rosenvold
|
* @author Kristian Rosenvold
|
||||||
*/
|
*/
|
||||||
public class ProjectBuildListTest {
|
class ProjectBuildListTest {
|
||||||
@Test
|
@Test
|
||||||
public void testGetByTaskSegment() throws Exception {
|
void testGetByTaskSegment() throws Exception {
|
||||||
final MavenSession session = ProjectDependencyGraphStub.getMavenSession();
|
final MavenSession session = ProjectDependencyGraphStub.getMavenSession();
|
||||||
ProjectBuildList projectBuildList = ProjectDependencyGraphStub.getProjectBuildList(session);
|
ProjectBuildList projectBuildList = ProjectDependencyGraphStub.getProjectBuildList(session);
|
||||||
TaskSegment taskSegment = projectBuildList.get(0).getTaskSegment();
|
TaskSegment taskSegment = projectBuildList.get(0).getTaskSegment();
|
||||||
|
|
|
@ -37,11 +37,11 @@ import static org.mockito.Mockito.verify;
|
||||||
/**
|
/**
|
||||||
* @author Kristian Rosenvold
|
* @author Kristian Rosenvold
|
||||||
*/
|
*/
|
||||||
public class BuilderCommonTest {
|
class BuilderCommonTest {
|
||||||
private Logger logger = mock(Logger.class);
|
private Logger logger = mock(Logger.class);
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveBuildPlan() throws Exception {
|
void testResolveBuildPlan() throws Exception {
|
||||||
MavenSession original = ProjectDependencyGraphStub.getMavenSession();
|
MavenSession original = ProjectDependencyGraphStub.getMavenSession();
|
||||||
|
|
||||||
final TaskSegment taskSegment1 = new TaskSegment(false);
|
final TaskSegment taskSegment1 = new TaskSegment(false);
|
||||||
|
@ -56,7 +56,7 @@ public class BuilderCommonTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDefaultBindingPluginsWarning() throws Exception {
|
void testDefaultBindingPluginsWarning() throws Exception {
|
||||||
MavenSession original = ProjectDependencyGraphStub.getMavenSession();
|
MavenSession original = ProjectDependencyGraphStub.getMavenSession();
|
||||||
|
|
||||||
final TaskSegment taskSegment1 = new TaskSegment(false);
|
final TaskSegment taskSegment1 = new TaskSegment(false);
|
||||||
|
@ -80,13 +80,13 @@ public class BuilderCommonTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testHandleBuildError() throws Exception {}
|
void testHandleBuildError() throws Exception {}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAttachToThread() throws Exception {}
|
void testAttachToThread() throws Exception {}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetKey() throws Exception {}
|
void testGetKey() throws Exception {}
|
||||||
|
|
||||||
public BuilderCommon getBuilderCommon(Logger logger) {
|
public BuilderCommon getBuilderCommon(Logger logger) {
|
||||||
final LifecycleDebugLogger debugLogger = new LifecycleDebugLogger();
|
final LifecycleDebugLogger debugLogger = new LifecycleDebugLogger();
|
||||||
|
|
|
@ -29,10 +29,10 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
public class ConcurrencyDependencyGraphTest {
|
class ConcurrencyDependencyGraphTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGraph() throws Exception {
|
void testGraph() throws Exception {
|
||||||
|
|
||||||
ProjectBuildList projectBuildList =
|
ProjectBuildList projectBuildList =
|
||||||
ProjectDependencyGraphStub.getProjectBuildList(ProjectDependencyGraphStub.getMavenSession());
|
ProjectDependencyGraphStub.getProjectBuildList(ProjectDependencyGraphStub.getMavenSession());
|
||||||
|
|
|
@ -51,7 +51,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
/**
|
/**
|
||||||
* @author Kristian Rosenvold
|
* @author Kristian Rosenvold
|
||||||
*/
|
*/
|
||||||
public class ThreadOutputMuxerTest {
|
class ThreadOutputMuxerTest {
|
||||||
|
|
||||||
final String paid = "Paid";
|
final String paid = "Paid";
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ public class ThreadOutputMuxerTest {
|
||||||
final String full = "Full";
|
final String full = "Full";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSingleThreaded() throws Exception {
|
void testSingleThreaded() throws Exception {
|
||||||
ProjectBuildList src = getProjectBuildList();
|
ProjectBuildList src = getProjectBuildList();
|
||||||
ProjectBuildList projectBuildList = new ProjectBuildList(Arrays.asList(src.get(0), src.get(1), src.get(2)));
|
ProjectBuildList projectBuildList = new ProjectBuildList(Arrays.asList(src.get(0), src.get(1), src.get(2)));
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ public class ThreadOutputMuxerTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMultiThreaded() throws Exception {
|
void testMultiThreaded() throws Exception {
|
||||||
ProjectBuildList projectBuildList = getProjectBuildList();
|
ProjectBuildList projectBuildList = getProjectBuildList();
|
||||||
|
|
||||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||||
|
|
|
@ -31,31 +31,31 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
*
|
*
|
||||||
* @author Kristian Rosenvold
|
* @author Kristian Rosenvold
|
||||||
*/
|
*/
|
||||||
public class ProjectDependencyGraphStubTest {
|
class ProjectDependencyGraphStubTest {
|
||||||
ProjectDependencyGraphStub stub = new ProjectDependencyGraphStub();
|
ProjectDependencyGraphStub stub = new ProjectDependencyGraphStub();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testADependencies() {
|
void testADependencies() {
|
||||||
final List<MavenProject> mavenProjects = stub.getUpstreamProjects(ProjectDependencyGraphStub.A, false);
|
final List<MavenProject> mavenProjects = stub.getUpstreamProjects(ProjectDependencyGraphStub.A, false);
|
||||||
assertEquals(0, mavenProjects.size());
|
assertEquals(0, mavenProjects.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBDependencies() {
|
void testBDependencies() {
|
||||||
final List<MavenProject> bProjects = stub.getUpstreamProjects(ProjectDependencyGraphStub.B, false);
|
final List<MavenProject> bProjects = stub.getUpstreamProjects(ProjectDependencyGraphStub.B, false);
|
||||||
assertEquals(1, bProjects.size());
|
assertEquals(1, bProjects.size());
|
||||||
assertTrue(bProjects.contains(ProjectDependencyGraphStub.A));
|
assertTrue(bProjects.contains(ProjectDependencyGraphStub.A));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCDependencies() {
|
void testCDependencies() {
|
||||||
final List<MavenProject> cProjects = stub.getUpstreamProjects(ProjectDependencyGraphStub.C, false);
|
final List<MavenProject> cProjects = stub.getUpstreamProjects(ProjectDependencyGraphStub.C, false);
|
||||||
assertEquals(1, cProjects.size());
|
assertEquals(1, cProjects.size());
|
||||||
assertTrue(cProjects.contains(ProjectDependencyGraphStub.A));
|
assertTrue(cProjects.contains(ProjectDependencyGraphStub.A));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testXDependencies() {
|
void testXDependencies() {
|
||||||
final List<MavenProject> cProjects = stub.getUpstreamProjects(ProjectDependencyGraphStub.X, false);
|
final List<MavenProject> cProjects = stub.getUpstreamProjects(ProjectDependencyGraphStub.X, false);
|
||||||
assertEquals(2, cProjects.size());
|
assertEquals(2, cProjects.size());
|
||||||
assertTrue(cProjects.contains(ProjectDependencyGraphStub.C));
|
assertTrue(cProjects.contains(ProjectDependencyGraphStub.C));
|
||||||
|
|
|
@ -30,9 +30,9 @@ import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
/**
|
/**
|
||||||
* @author atanasenko
|
* @author atanasenko
|
||||||
*/
|
*/
|
||||||
public class LifecyclePhaseTest {
|
class LifecyclePhaseTest {
|
||||||
@Test
|
@Test
|
||||||
public void testToString() {
|
void testToString() {
|
||||||
LifecyclePhase phase = new LifecyclePhase();
|
LifecyclePhase phase = new LifecyclePhase();
|
||||||
assertEquals("", phase.toString());
|
assertEquals("", phase.toString());
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public class LifecyclePhaseTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSet() {
|
void testSet() {
|
||||||
LifecyclePhase phase = new LifecyclePhase();
|
LifecyclePhase phase = new LifecyclePhase();
|
||||||
assertNull(phase.getMojos());
|
assertNull(phase.getMojos());
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
|
||||||
public class PluginManagerTest extends AbstractCoreMavenComponentTestCase {
|
class PluginManagerTest extends AbstractCoreMavenComponentTestCase {
|
||||||
@Inject
|
@Inject
|
||||||
private DefaultBuildPluginManager pluginManager;
|
private DefaultBuildPluginManager pluginManager;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public class PluginManagerTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPluginLoading() throws Exception {
|
void testPluginLoading() throws Exception {
|
||||||
MavenSession session = createMavenSession(null);
|
MavenSession session = createMavenSession(null);
|
||||||
Plugin plugin = new Plugin();
|
Plugin plugin = new Plugin();
|
||||||
plugin.setGroupId("org.apache.maven.its.plugins");
|
plugin.setGroupId("org.apache.maven.its.plugins");
|
||||||
|
@ -60,7 +60,7 @@ public class PluginManagerTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMojoDescriptorRetrieval() throws Exception {
|
void testMojoDescriptorRetrieval() throws Exception {
|
||||||
MavenSession session = createMavenSession(null);
|
MavenSession session = createMavenSession(null);
|
||||||
String goal = "it";
|
String goal = "it";
|
||||||
Plugin plugin = new Plugin();
|
Plugin plugin = new Plugin();
|
||||||
|
@ -97,7 +97,7 @@ public class PluginManagerTest extends AbstractCoreMavenComponentTestCase {
|
||||||
// the plugin manager provides.
|
// the plugin manager provides.
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testRemoteResourcesPlugin() throws Exception {
|
void testRemoteResourcesPlugin() throws Exception {
|
||||||
// TODO turn an equivalent back on when the RR plugin is released.
|
// TODO turn an equivalent back on when the RR plugin is released.
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -147,7 +147,7 @@ public class PluginManagerTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMojoConfigurationIsMergedCorrectly() throws Exception {}
|
void testMojoConfigurationIsMergedCorrectly() throws Exception {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The case where the user wants to specify an alternate version of the underlying tool. Common case
|
* The case where the user wants to specify an alternate version of the underlying tool. Common case
|
||||||
|
@ -155,28 +155,28 @@ public class PluginManagerTest extends AbstractCoreMavenComponentTestCase {
|
||||||
* to use a specific version. We need to make sure the version that they specify takes precedence.
|
* to use a specific version. We need to make sure the version that they specify takes precedence.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testMojoWhereInternallyStatedDependencyIsOverriddenByProject() throws Exception {}
|
void testMojoWhereInternallyStatedDependencyIsOverriddenByProject() throws Exception {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The case where you have a plugin in the current build that you want to be used on projects in
|
* The case where you have a plugin in the current build that you want to be used on projects in
|
||||||
* the current build.
|
* the current build.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testMojoThatIsPresentInTheCurrentBuild() throws Exception {}
|
void testMojoThatIsPresentInTheCurrentBuild() throws Exception {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the case where the Mojo wants to execute on every project and then do something at the end
|
* This is the case where the Mojo wants to execute on every project and then do something at the end
|
||||||
* with the results of each project.
|
* with the results of each project.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testAggregatorMojo() throws Exception {}
|
void testAggregatorMojo() throws Exception {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the case where a Mojo needs the lifecycle run to a certain phase before it can do
|
* This is the case where a Mojo needs the lifecycle run to a certain phase before it can do
|
||||||
* anything useful.
|
* anything useful.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testMojoThatRequiresExecutionToAGivenPhaseBeforeExecutingItself() throws Exception {}
|
void testMojoThatRequiresExecutionToAGivenPhaseBeforeExecutingItself() throws Exception {}
|
||||||
|
|
||||||
// test that mojo which does not require dependency resolution trigger no downloading of dependencies
|
// test that mojo which does not require dependency resolution trigger no downloading of dependencies
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ public class PluginManagerTest extends AbstractCoreMavenComponentTestCase {
|
||||||
// test a build where projects use different versions of the same plugin
|
// test a build where projects use different versions of the same plugin
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatPluginDependencyThatHasSystemScopeIsResolved() throws Exception {
|
void testThatPluginDependencyThatHasSystemScopeIsResolved() throws Exception {
|
||||||
MavenSession session = createMavenSession(getProject("project-contributing-system-scope-plugin-dep"));
|
MavenSession session = createMavenSession(getProject("project-contributing-system-scope-plugin-dep"));
|
||||||
MavenProject project = session.getCurrentProject();
|
MavenProject project = session.getCurrentProject();
|
||||||
Plugin plugin = project.getPlugin("org.apache.maven.its.plugins:maven-it-plugin");
|
Plugin plugin = project.getPlugin("org.apache.maven.its.plugins:maven-it-plugin");
|
||||||
|
@ -225,7 +225,7 @@ public class PluginManagerTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPluginRealmCache() throws Exception {
|
void testPluginRealmCache() throws Exception {
|
||||||
RepositoryRequest repositoryRequest = new DefaultRepositoryRequest();
|
RepositoryRequest repositoryRequest = new DefaultRepositoryRequest();
|
||||||
repositoryRequest.setLocalRepository(getLocalRepository());
|
repositoryRequest.setLocalRepository(getLocalRepository());
|
||||||
repositoryRequest.setRemoteRepositories(getPluginArtifactRepositories());
|
repositoryRequest.setRemoteRepositories(getPluginArtifactRepositories());
|
||||||
|
@ -264,7 +264,7 @@ public class PluginManagerTest extends AbstractCoreMavenComponentTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBuildExtensionsPluginLoading() throws Exception {
|
void testBuildExtensionsPluginLoading() throws Exception {
|
||||||
RepositoryRequest repositoryRequest = new DefaultRepositoryRequest();
|
RepositoryRequest repositoryRequest = new DefaultRepositoryRequest();
|
||||||
repositoryRequest.setLocalRepository(getLocalRepository());
|
repositoryRequest.setLocalRepository(getLocalRepository());
|
||||||
repositoryRequest.setRemoteRepositories(getPluginArtifactRepositories());
|
repositoryRequest.setRemoteRepositories(getPluginArtifactRepositories());
|
||||||
|
|
|
@ -33,12 +33,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
* @author Robert Scholte
|
* @author Robert Scholte
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class PluginParameterExceptionTest {
|
class PluginParameterExceptionTest {
|
||||||
|
|
||||||
private final String LS = System.lineSeparator();
|
private final String LS = System.lineSeparator();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMissingRequiredStringArrayTypeParameter() {
|
void testMissingRequiredStringArrayTypeParameter() {
|
||||||
MojoDescriptor mojoDescriptor = new MojoDescriptor();
|
MojoDescriptor mojoDescriptor = new MojoDescriptor();
|
||||||
mojoDescriptor.setGoal("goal");
|
mojoDescriptor.setGoal("goal");
|
||||||
PluginDescriptor pluginDescriptor = new PluginDescriptor();
|
PluginDescriptor pluginDescriptor = new PluginDescriptor();
|
||||||
|
@ -70,7 +70,7 @@ public class PluginParameterExceptionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMissingRequiredCollectionTypeParameter() {
|
void testMissingRequiredCollectionTypeParameter() {
|
||||||
MojoDescriptor mojoDescriptor = new MojoDescriptor();
|
MojoDescriptor mojoDescriptor = new MojoDescriptor();
|
||||||
mojoDescriptor.setGoal("goal");
|
mojoDescriptor.setGoal("goal");
|
||||||
PluginDescriptor pluginDescriptor = new PluginDescriptor();
|
PluginDescriptor pluginDescriptor = new PluginDescriptor();
|
||||||
|
@ -102,7 +102,7 @@ public class PluginParameterExceptionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMissingRequiredMapTypeParameter() {
|
void testMissingRequiredMapTypeParameter() {
|
||||||
MojoDescriptor mojoDescriptor = new MojoDescriptor();
|
MojoDescriptor mojoDescriptor = new MojoDescriptor();
|
||||||
mojoDescriptor.setGoal("goal");
|
mojoDescriptor.setGoal("goal");
|
||||||
PluginDescriptor pluginDescriptor = new PluginDescriptor();
|
PluginDescriptor pluginDescriptor = new PluginDescriptor();
|
||||||
|
@ -134,7 +134,7 @@ public class PluginParameterExceptionTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMissingRequiredPropertiesTypeParameter() {
|
void testMissingRequiredPropertiesTypeParameter() {
|
||||||
MojoDescriptor mojoDescriptor = new MojoDescriptor();
|
MojoDescriptor mojoDescriptor = new MojoDescriptor();
|
||||||
mojoDescriptor.setGoal("goal");
|
mojoDescriptor.setGoal("goal");
|
||||||
PluginDescriptor pluginDescriptor = new PluginDescriptor();
|
PluginDescriptor pluginDescriptor = new PluginDescriptor();
|
||||||
|
|
|
@ -58,14 +58,14 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
/**
|
/**
|
||||||
* @author Jason van Zyl
|
* @author Jason van Zyl
|
||||||
*/
|
*/
|
||||||
public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenComponentTestCase {
|
class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenComponentTestCase {
|
||||||
private static final String FS = File.separator;
|
private static final String FS = File.separator;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private RepositorySystem factory;
|
private RepositorySystem factory;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPluginDescriptorExpressionReference() throws Exception {
|
void testPluginDescriptorExpressionReference() throws Exception {
|
||||||
MojoExecution exec = newMojoExecution();
|
MojoExecution exec = newMojoExecution();
|
||||||
|
|
||||||
MavenSession session = newMavenSession();
|
MavenSession session = newMavenSession();
|
||||||
|
@ -81,7 +81,7 @@ public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenCom
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPluginArtifactsExpressionReference() throws Exception {
|
void testPluginArtifactsExpressionReference() throws Exception {
|
||||||
MojoExecution exec = newMojoExecution();
|
MojoExecution exec = newMojoExecution();
|
||||||
|
|
||||||
Artifact depArtifact = createArtifact("group", "artifact", "1");
|
Artifact depArtifact = createArtifact("group", "artifact", "1");
|
||||||
|
@ -105,7 +105,7 @@ public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenCom
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPluginArtifactMapExpressionReference() throws Exception {
|
void testPluginArtifactMapExpressionReference() throws Exception {
|
||||||
MojoExecution exec = newMojoExecution();
|
MojoExecution exec = newMojoExecution();
|
||||||
|
|
||||||
Artifact depArtifact = createArtifact("group", "artifact", "1");
|
Artifact depArtifact = createArtifact("group", "artifact", "1");
|
||||||
|
@ -132,7 +132,7 @@ public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenCom
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPluginArtifactIdExpressionReference() throws Exception {
|
void testPluginArtifactIdExpressionReference() throws Exception {
|
||||||
MojoExecution exec = newMojoExecution();
|
MojoExecution exec = newMojoExecution();
|
||||||
|
|
||||||
MavenSession session = newMavenSession();
|
MavenSession session = newMavenSession();
|
||||||
|
@ -148,7 +148,7 @@ public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenCom
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testValueExtractionWithAPomValueContainingAPath() throws Exception {
|
void testValueExtractionWithAPomValueContainingAPath() throws Exception {
|
||||||
String expected = getTestFile("target/test-classes/target/classes").getCanonicalPath();
|
String expected = getTestFile("target/test-classes/target/classes").getCanonicalPath();
|
||||||
|
|
||||||
Build build = new Build();
|
Build build = new Build();
|
||||||
|
@ -169,7 +169,7 @@ public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenCom
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEscapedVariablePassthrough() throws Exception {
|
void testEscapedVariablePassthrough() throws Exception {
|
||||||
String var = "${var}";
|
String var = "${var}";
|
||||||
|
|
||||||
Model model = new Model();
|
Model model = new Model();
|
||||||
|
@ -185,7 +185,7 @@ public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenCom
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEscapedVariablePassthroughInLargerExpression() throws Exception {
|
void testEscapedVariablePassthroughInLargerExpression() throws Exception {
|
||||||
String var = "${var}";
|
String var = "${var}";
|
||||||
String key = var + " with version: ${project.version}";
|
String key = var + " with version: ${project.version}";
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenCom
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMultipleSubExpressionsInLargerExpression() throws Exception {
|
void testMultipleSubExpressionsInLargerExpression() throws Exception {
|
||||||
String key = "${project.artifactId} with version: ${project.version}";
|
String key = "${project.artifactId} with version: ${project.version}";
|
||||||
|
|
||||||
Model model = new Model();
|
Model model = new Model();
|
||||||
|
@ -219,7 +219,7 @@ public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenCom
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMissingPOMPropertyRefInLargerExpression() throws Exception {
|
void testMissingPOMPropertyRefInLargerExpression() throws Exception {
|
||||||
String expr = "/path/to/someproject-${baseVersion}";
|
String expr = "/path/to/someproject-${baseVersion}";
|
||||||
|
|
||||||
MavenProject project = new MavenProject(new Model());
|
MavenProject project = new MavenProject(new Model());
|
||||||
|
@ -232,7 +232,7 @@ public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenCom
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPOMPropertyExtractionWithMissingProject_WithDotNotation() throws Exception {
|
void testPOMPropertyExtractionWithMissingProject_WithDotNotation() throws Exception {
|
||||||
String key = "m2.name";
|
String key = "m2.name";
|
||||||
String checkValue = "value";
|
String checkValue = "value";
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenCom
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBasedirExtractionWithMissingProject() throws Exception {
|
void testBasedirExtractionWithMissingProject() throws Exception {
|
||||||
ExpressionEvaluator ee = createExpressionEvaluator(null, null, new Properties());
|
ExpressionEvaluator ee = createExpressionEvaluator(null, null, new Properties());
|
||||||
|
|
||||||
Object value = ee.evaluate("${basedir}");
|
Object value = ee.evaluate("${basedir}");
|
||||||
|
@ -261,7 +261,7 @@ public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenCom
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testValueExtractionFromSystemPropertiesWithMissingProject() throws Exception {
|
void testValueExtractionFromSystemPropertiesWithMissingProject() throws Exception {
|
||||||
String sysprop = "PPEET_sysprop1";
|
String sysprop = "PPEET_sysprop1";
|
||||||
|
|
||||||
Properties executionProperties = new Properties();
|
Properties executionProperties = new Properties();
|
||||||
|
@ -278,7 +278,7 @@ public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenCom
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testValueExtractionFromSystemPropertiesWithMissingProject_WithDotNotation() throws Exception {
|
void testValueExtractionFromSystemPropertiesWithMissingProject_WithDotNotation() throws Exception {
|
||||||
String sysprop = "PPEET.sysprop2";
|
String sysprop = "PPEET.sysprop2";
|
||||||
|
|
||||||
Properties executionProperties = new Properties();
|
Properties executionProperties = new Properties();
|
||||||
|
@ -308,7 +308,7 @@ public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenCom
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLocalRepositoryExtraction() throws Exception {
|
void testLocalRepositoryExtraction() throws Exception {
|
||||||
ExpressionEvaluator expressionEvaluator =
|
ExpressionEvaluator expressionEvaluator =
|
||||||
createExpressionEvaluator(createDefaultProject(), null, new Properties());
|
createExpressionEvaluator(createDefaultProject(), null, new Properties());
|
||||||
Object value = expressionEvaluator.evaluate("${localRepository}");
|
Object value = expressionEvaluator.evaluate("${localRepository}");
|
||||||
|
@ -317,7 +317,7 @@ public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenCom
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTwoExpressions() throws Exception {
|
void testTwoExpressions() throws Exception {
|
||||||
Build build = new Build();
|
Build build = new Build();
|
||||||
build.setDirectory("expected-directory");
|
build.setDirectory("expected-directory");
|
||||||
build.setFinalName("expected-finalName");
|
build.setFinalName("expected-finalName");
|
||||||
|
@ -334,7 +334,7 @@ public class PluginParameterExpressionEvaluatorTest extends AbstractCoreMavenCom
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testShouldExtractPluginArtifacts() throws Exception {
|
void testShouldExtractPluginArtifacts() throws Exception {
|
||||||
PluginDescriptor pd = new PluginDescriptor();
|
PluginDescriptor pd = new PluginDescriptor();
|
||||||
|
|
||||||
Artifact artifact = createArtifact("testGroup", "testArtifact", "1.0");
|
Artifact artifact = createArtifact("testGroup", "testArtifact", "1.0");
|
||||||
|
|
|
@ -30,12 +30,12 @@ import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
/**
|
/**
|
||||||
* @author Kristian Rosenvold
|
* @author Kristian Rosenvold
|
||||||
*/
|
*/
|
||||||
public class DefaultLegacySupportTest {
|
class DefaultLegacySupportTest {
|
||||||
final CountDownLatch latch = new CountDownLatch(1);
|
final CountDownLatch latch = new CountDownLatch(1);
|
||||||
final DefaultLegacySupport defaultLegacySupport = new DefaultLegacySupport();
|
final DefaultLegacySupport defaultLegacySupport = new DefaultLegacySupport();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSetSession() throws Exception {
|
void testSetSession() throws Exception {
|
||||||
|
|
||||||
MavenExecutionRequest mavenExecutionRequest = new DefaultMavenExecutionRequest();
|
MavenExecutionRequest mavenExecutionRequest = new DefaultMavenExecutionRequest();
|
||||||
MavenSession m1 = new MavenSession(null, null, mavenExecutionRequest, null);
|
MavenSession m1 = new MavenSession(null, null, mavenExecutionRequest, null);
|
||||||
|
|
|
@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
/**
|
/**
|
||||||
* @author Michael Simacek
|
* @author Michael Simacek
|
||||||
*/
|
*/
|
||||||
public class MavenPluginValidatorTest extends AbstractCoreMavenComponentTestCase {
|
class MavenPluginValidatorTest extends AbstractCoreMavenComponentTestCase {
|
||||||
@Inject
|
@Inject
|
||||||
private MavenPluginValidator mavenPluginValidator;
|
private MavenPluginValidator mavenPluginValidator;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public class MavenPluginValidatorTest extends AbstractCoreMavenComponentTestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testValidate() {
|
void testValidate() {
|
||||||
Artifact plugin = new DefaultArtifact(
|
Artifact plugin = new DefaultArtifact(
|
||||||
"org.apache.maven.its.plugins",
|
"org.apache.maven.its.plugins",
|
||||||
"maven-it-plugin",
|
"maven-it-plugin",
|
||||||
|
@ -64,7 +64,7 @@ public class MavenPluginValidatorTest extends AbstractCoreMavenComponentTestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInvalidGroupId() {
|
void testInvalidGroupId() {
|
||||||
Artifact plugin = new DefaultArtifact(
|
Artifact plugin = new DefaultArtifact(
|
||||||
"org.apache.maven.its.plugins",
|
"org.apache.maven.its.plugins",
|
||||||
"maven-it-plugin",
|
"maven-it-plugin",
|
||||||
|
@ -83,7 +83,7 @@ public class MavenPluginValidatorTest extends AbstractCoreMavenComponentTestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInvalidArtifactId() {
|
void testInvalidArtifactId() {
|
||||||
Artifact plugin = new DefaultArtifact(
|
Artifact plugin = new DefaultArtifact(
|
||||||
"org.apache.maven.its.plugins",
|
"org.apache.maven.its.plugins",
|
||||||
"maven-it-plugin",
|
"maven-it-plugin",
|
||||||
|
@ -102,7 +102,7 @@ public class MavenPluginValidatorTest extends AbstractCoreMavenComponentTestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInvalidVersion() {
|
void testInvalidVersion() {
|
||||||
Artifact plugin = new DefaultArtifact(
|
Artifact plugin = new DefaultArtifact(
|
||||||
"org.apache.maven.its.plugins",
|
"org.apache.maven.its.plugins",
|
||||||
"maven-it-plugin",
|
"maven-it-plugin",
|
||||||
|
|
|
@ -45,7 +45,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
|
||||||
public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase {
|
class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase {
|
||||||
@TempDir
|
@TempDir
|
||||||
File localRepoDir;
|
File localRepoDir;
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase
|
||||||
* @throws Exception in case of issue
|
* @throws Exception in case of issue
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testBuildFromMiddlePom() throws Exception {
|
void testBuildFromMiddlePom() throws Exception {
|
||||||
File f1 = getTestFile("src/test/resources/projects/grandchild-check/child/pom.xml");
|
File f1 = getTestFile("src/test/resources/projects/grandchild-check/child/pom.xml");
|
||||||
File f2 = getTestFile("src/test/resources/projects/grandchild-check/child/grandchild/pom.xml");
|
File f2 = getTestFile("src/test/resources/projects/grandchild-check/child/grandchild/pom.xml");
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase
|
||||||
|
|
||||||
@Disabled("Maven 4 does not allow duplicate plugin declarations")
|
@Disabled("Maven 4 does not allow duplicate plugin declarations")
|
||||||
@Test
|
@Test
|
||||||
public void testDuplicatePluginDefinitionsMerged() throws Exception {
|
void testDuplicatePluginDefinitionsMerged() throws Exception {
|
||||||
File f1 = getTestFile("src/test/resources/projects/duplicate-plugins-merged-pom.xml");
|
File f1 = getTestFile("src/test/resources/projects/duplicate-plugins-merged-pom.xml");
|
||||||
|
|
||||||
MavenProject project = getProject(f1);
|
MavenProject project = getProject(f1);
|
||||||
|
@ -97,7 +97,7 @@ public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFutureModelVersion() throws Exception {
|
void testFutureModelVersion() throws Exception {
|
||||||
File f1 = getTestFile("src/test/resources/projects/future-model-version-pom.xml");
|
File f1 = getTestFile("src/test/resources/projects/future-model-version-pom.xml");
|
||||||
|
|
||||||
ProjectBuildingException e = assertThrows(
|
ProjectBuildingException e = assertThrows(
|
||||||
|
@ -106,7 +106,7 @@ public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPastModelVersion() throws Exception {
|
void testPastModelVersion() throws Exception {
|
||||||
// a Maven 1.x pom will not even
|
// a Maven 1.x pom will not even
|
||||||
// update the resource if we stop supporting modelVersion 4.0.0
|
// update the resource if we stop supporting modelVersion 4.0.0
|
||||||
File f1 = getTestFile("src/test/resources/projects/past-model-version-pom.xml");
|
File f1 = getTestFile("src/test/resources/projects/past-model-version-pom.xml");
|
||||||
|
@ -117,7 +117,7 @@ public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFutureSchemaModelVersion() throws Exception {
|
void testFutureSchemaModelVersion() throws Exception {
|
||||||
File f1 = getTestFile("src/test/resources/projects/future-schema-model-version-pom.xml");
|
File f1 = getTestFile("src/test/resources/projects/future-schema-model-version-pom.xml");
|
||||||
|
|
||||||
ProjectBuildingException e = assertThrows(
|
ProjectBuildingException e = assertThrows(
|
||||||
|
@ -126,7 +126,7 @@ public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBuildStubModelForMissingRemotePom() throws Exception {
|
void testBuildStubModelForMissingRemotePom() throws Exception {
|
||||||
Artifact pom = repositorySystem.createProjectArtifact("org.apache.maven.its", "missing", "0.1");
|
Artifact pom = repositorySystem.createProjectArtifact("org.apache.maven.its", "missing", "0.1");
|
||||||
MavenProject project = getProject(pom, true);
|
MavenProject project = getProject(pom, true);
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPartialResultUponBadDependencyDeclaration() throws Exception {
|
void testPartialResultUponBadDependencyDeclaration() throws Exception {
|
||||||
File pomFile = getTestFile("src/test/resources/projects/bad-dependency.xml");
|
File pomFile = getTestFile("src/test/resources/projects/bad-dependency.xml");
|
||||||
|
|
||||||
ProjectBuildingRequest request = newBuildingRequest();
|
ProjectBuildingRequest request = newBuildingRequest();
|
||||||
|
@ -177,7 +177,7 @@ public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase
|
||||||
* @throws Exception in case of issue
|
* @throws Exception in case of issue
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testBuildValidParentVersionRangeLocally() throws Exception {
|
void testBuildValidParentVersionRangeLocally() throws Exception {
|
||||||
File f1 = getTestFile("src/test/resources/projects/parent-version-range-local-valid/child/pom.xml");
|
File f1 = getTestFile("src/test/resources/projects/parent-version-range-local-valid/child/pom.xml");
|
||||||
|
|
||||||
final MavenProject childProject = getProject(f1);
|
final MavenProject childProject = getProject(f1);
|
||||||
|
@ -196,7 +196,7 @@ public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase
|
||||||
* @throws Exception in case of issue
|
* @throws Exception in case of issue
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testBuildParentVersionRangeLocallyWithoutChildVersion() throws Exception {
|
void testBuildParentVersionRangeLocallyWithoutChildVersion() throws Exception {
|
||||||
File f1 = getTestFile(
|
File f1 = getTestFile(
|
||||||
"src/test/resources/projects/parent-version-range-local-child-without-version/child/pom.xml");
|
"src/test/resources/projects/parent-version-range-local-child-without-version/child/pom.xml");
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase
|
||||||
* @throws Exception in case of issue
|
* @throws Exception in case of issue
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testBuildParentVersionRangeLocallyWithChildProjectVersionExpression() throws Exception {
|
void testBuildParentVersionRangeLocallyWithChildProjectVersionExpression() throws Exception {
|
||||||
File f1 = getTestFile(
|
File f1 = getTestFile(
|
||||||
"src/test/resources/projects/parent-version-range-local-child-project-version-expression/child/pom.xml");
|
"src/test/resources/projects/parent-version-range-local-child-project-version-expression/child/pom.xml");
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase
|
||||||
* @throws Exception in case of issue
|
* @throws Exception in case of issue
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testBuildParentVersionRangeExternally() throws Exception {
|
void testBuildParentVersionRangeExternally() throws Exception {
|
||||||
File f1 = getTestFile("src/test/resources/projects/parent-version-range-external-valid/pom.xml");
|
File f1 = getTestFile("src/test/resources/projects/parent-version-range-external-valid/pom.xml");
|
||||||
|
|
||||||
final MavenProject childProject = this.getProjectFromRemoteRepository(f1);
|
final MavenProject childProject = this.getProjectFromRemoteRepository(f1);
|
||||||
|
@ -281,7 +281,7 @@ public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase
|
||||||
* @throws Exception in case of issue
|
* @throws Exception in case of issue
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testBuildParentVersionRangeExternallyWithoutChildVersion() throws Exception {
|
void testBuildParentVersionRangeExternallyWithoutChildVersion() throws Exception {
|
||||||
File f1 =
|
File f1 =
|
||||||
getTestFile("src/test/resources/projects/parent-version-range-external-child-without-version/pom.xml");
|
getTestFile("src/test/resources/projects/parent-version-range-external-child-without-version/pom.xml");
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase
|
||||||
* @throws Exception in case of issue
|
* @throws Exception in case of issue
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testBuildParentVersionRangeExternallyWithChildProjectVersionExpression() throws Exception {
|
void testBuildParentVersionRangeExternallyWithChildProjectVersionExpression() throws Exception {
|
||||||
File f1 = getTestFile(
|
File f1 = getTestFile(
|
||||||
"src/test/resources/projects/parent-version-range-external-child-project-version-expression/pom.xml");
|
"src/test/resources/projects/parent-version-range-external-child-project-version-expression/pom.xml");
|
||||||
|
|
||||||
|
@ -315,7 +315,7 @@ public class DefaultMavenProjectBuilderTest extends AbstractMavenProjectTestCase
|
||||||
* @throws Exception in case of issue
|
* @throws Exception in case of issue
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void rereadPom_mng7063() throws Exception {
|
void rereadPom_mng7063() throws Exception {
|
||||||
final Path pom = projectRoot.resolve("pom.xml");
|
final Path pom = projectRoot.resolve("pom.xml");
|
||||||
final ProjectBuildingRequest buildingRequest = newBuildingRequest();
|
final ProjectBuildingRequest buildingRequest = newBuildingRequest();
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue