Search in sources :

Example 6 with ArtifactDescriptorRequest

use of org.sonatype.aether.resolution.ArtifactDescriptorRequest in project sonatype-aether by sonatype.

the class IniArtifactDescriptorReaderTest method testLookup.

@Test
public void testLookup() throws ArtifactDescriptorException {
    StubArtifact art = new StubArtifact("gid:aid:ext:ver");
    ArtifactDescriptorRequest request = new ArtifactDescriptorRequest(art, null, "");
    ArtifactDescriptorResult description = reader.readArtifactDescriptor(session, request);
    assertEquals(request, description.getRequest());
    assertEquals(art, description.getArtifact());
    assertEquals(1, description.getRelocations().size());
    Artifact artifact = description.getRelocations().get(0);
    assertEquals("gid", artifact.getGroupId());
    assertEquals("aid", artifact.getArtifactId());
    assertEquals("ver", artifact.getVersion());
    assertEquals("ext", artifact.getExtension());
    assertEquals(1, description.getRepositories().size());
    RemoteRepository repo = description.getRepositories().get(0);
    assertEquals("id", repo.getId());
    assertEquals("type", repo.getContentType());
    assertEquals("protocol://some/url?for=testing", repo.getUrl());
    assertDependencies(description.getDependencies());
    assertDependencies(description.getManagedDependencies());
}
Also used : StubArtifact(org.sonatype.aether.test.util.impl.StubArtifact) RemoteRepository(org.sonatype.aether.repository.RemoteRepository) ArtifactDescriptorResult(org.sonatype.aether.resolution.ArtifactDescriptorResult) ArtifactDescriptorRequest(org.sonatype.aether.resolution.ArtifactDescriptorRequest) StubArtifact(org.sonatype.aether.test.util.impl.StubArtifact) Artifact(org.sonatype.aether.artifact.Artifact) Test(org.junit.Test)

Aggregations

ArtifactDescriptorRequest (org.sonatype.aether.resolution.ArtifactDescriptorRequest)6 RemoteRepository (org.sonatype.aether.repository.RemoteRepository)5 ArtifactDescriptorResult (org.sonatype.aether.resolution.ArtifactDescriptorResult)5 Dependency (org.sonatype.aether.graph.Dependency)4 Test (org.junit.Test)3 Artifact (org.sonatype.aether.artifact.Artifact)3 ArtifactDescriptorException (org.sonatype.aether.resolution.ArtifactDescriptorException)3 ArrayList (java.util.ArrayList)2 RepositorySystemSession (org.sonatype.aether.RepositorySystemSession)2 CollectResult (org.sonatype.aether.collection.CollectResult)2 DependencyManager (org.sonatype.aether.collection.DependencyManager)2 DependencySelector (org.sonatype.aether.collection.DependencySelector)2 DependencyTraverser (org.sonatype.aether.collection.DependencyTraverser)2 VersionRangeRequest (org.sonatype.aether.resolution.VersionRangeRequest)2 VersionRangeResolutionException (org.sonatype.aether.resolution.VersionRangeResolutionException)2 VersionRangeResult (org.sonatype.aether.resolution.VersionRangeResult)2 StubArtifact (org.sonatype.aether.test.util.impl.StubArtifact)2 Version (org.sonatype.aether.version.Version)2 List (java.util.List)1 RepositoryException (org.sonatype.aether.RepositoryException)1