diff --git a/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/RepositorySystemTest.java b/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/RepositorySystemTest.java index c2a679ed71..dc2f187489 100644 --- a/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/RepositorySystemTest.java +++ b/maven-aether-provider/src/test/java/org/apache/maven/repository/internal/RepositorySystemTest.java @@ -65,12 +65,12 @@ public class RepositorySystemTest Artifact artifact = new DefaultArtifact( artifactCoords ); CollectRequest collectRequest = new CollectRequest(); - collectRequest.setRoot( new Dependency( artifact, "" ) ); + collectRequest.setRoot( new Dependency( artifact, null ) ); collectRequest.addRepository( newTestRepository() ); CollectResult collectResult = system.collectDependencies( session, collectRequest ); - assertEquals( 1, collectResult.getRoot().getChildren().size() ); + assertEquals( 2, collectResult.getRoot().getChildren().size() ); Dependency dep = collectResult.getRoot().getChildren().get( 0 ).getDependency(); assertEquals( "compile", dep.getScope() ); assertFalse( dep.isOptional() ); @@ -89,6 +89,25 @@ public class RepositorySystemTest assertEquals( "true", depArtifact.getProperty( "constitutesBuildPath", null ) ); assertEquals( "false", depArtifact.getProperty( "includesDependencies", null ) ); assertEquals( 4, depArtifact.getProperties().size() ); + + dep = collectResult.getRoot().getChildren().get( 1 ).getDependency(); + assertEquals( "compile", dep.getScope() ); + assertFalse( dep.isOptional() ); + assertEquals( 0, dep.getExclusions().size() ); + depArtifact = dep.getArtifact(); + assertEquals( "ut.simple", depArtifact.getGroupId() ); + assertEquals( "dependency", depArtifact.getArtifactId() ); + assertEquals( "1.0", depArtifact.getVersion() ); + assertEquals( "1.0", depArtifact.getBaseVersion() ); + assertNull( depArtifact.getFile() ); + assertFalse( depArtifact.isSnapshot() ); + assertEquals( "sources", depArtifact.getClassifier() ); + assertEquals( "jar", depArtifact.getExtension() ); + assertEquals( "java", depArtifact.getProperty( "language", null ) ); + assertEquals( "jar", depArtifact.getProperty( "type", null ) ); // shouldn't it be java-sources given the classifier? + assertEquals( "true", depArtifact.getProperty( "constitutesBuildPath", null ) ); // shouldn't it be false given the classifier? + assertEquals( "false", depArtifact.getProperty( "includesDependencies", null ) ); + assertEquals( 4, depArtifact.getProperties().size() ); } public static RepositorySystemSession newMavenRepositorySystemSession( RepositorySystem system ) diff --git a/maven-aether-provider/src/test/resources/repo/ut/simple/artifact/1.0/artifact-1.0.pom b/maven-aether-provider/src/test/resources/repo/ut/simple/artifact/1.0/artifact-1.0.pom index 72cba879d9..f8b72af51c 100644 --- a/maven-aether-provider/src/test/resources/repo/ut/simple/artifact/1.0/artifact-1.0.pom +++ b/maven-aether-provider/src/test/resources/repo/ut/simple/artifact/1.0/artifact-1.0.pom @@ -38,5 +38,11 @@ ut.simple dependency + + ut.simple + dependency + 1.0 + sources + \ No newline at end of file diff --git a/maven-aether-provider/src/test/resources/repo/ut/simple/dependency/1.0/dependency-1.0-sources.jar b/maven-aether-provider/src/test/resources/repo/ut/simple/dependency/1.0/dependency-1.0-sources.jar new file mode 100644 index 0000000000..e69de29bb2