Search in sources :

Example 16 with TestDownload

use of org.commonjava.maven.galley.testing.core.transport.job.TestDownload in project galley by Commonjava.

the class TestTransport method createDownloadJob.

// Transport implementation...
@Override
public DownloadJob createDownloadJob(final ConcreteResource resource, final Transfer target, final Map<Transfer, Long> transferSizes, final int timeoutSeconds, final EventMetadata eventMetadata) throws TransferException {
    final TestDownload job = downloads.get(resource);
    logger.info("Download for: {} is: {}", resource, job);
    if (job == null) {
        throw new TransferException("No download registered for the endpoint: {}", resource);
    }
    job.setTransfer(target);
    job.setEventMetadata(eventMetadata);
    return job;
}
Also used : TestDownload(org.commonjava.maven.galley.testing.core.transport.job.TestDownload) TransferException(org.commonjava.maven.galley.TransferException)

Aggregations

TestDownload (org.commonjava.maven.galley.testing.core.transport.job.TestDownload)16 ConcreteResource (org.commonjava.maven.galley.model.ConcreteResource)15 Test (org.junit.Test)15 ProjectVersionRef (org.commonjava.maven.atlas.ident.ref.ProjectVersionRef)11 SimpleProjectVersionRef (org.commonjava.maven.atlas.ident.ref.SimpleProjectVersionRef)11 Transfer (org.commonjava.maven.galley.model.Transfer)11 EventMetadata (org.commonjava.maven.galley.event.EventMetadata)8 Location (org.commonjava.maven.galley.model.Location)7 SimpleLocation (org.commonjava.maven.galley.model.SimpleLocation)7 URI (java.net.URI)5 LinkedHashMap (java.util.LinkedHashMap)5 JoinString (org.commonjava.maven.atlas.ident.util.JoinString)5 MavenPomView (org.commonjava.maven.galley.maven.model.view.MavenPomView)5 EProjectDirectRelationships (org.commonjava.maven.atlas.graph.model.EProjectDirectRelationships)3 ProjectRelationship (org.commonjava.maven.atlas.graph.rel.ProjectRelationship)3 PluginView (org.commonjava.maven.galley.maven.model.view.PluginView)3 RemoteRepository (org.commonjava.indy.model.core.RemoteRepository)2 RepositoryLocation (org.commonjava.indy.model.galley.RepositoryLocation)2 PluginDependencyView (org.commonjava.maven.galley.maven.model.view.PluginDependencyView)2 Document (org.w3c.dom.Document)2