use of org.commonjava.maven.galley.model.TransferBatch in project galley by Commonjava.
the class AbstractTransferManagerTest method batchRetrieve_returnEmptyResultIfVirtualResourceIsEmpty.
/**
* Addresses Issue #27 (https://github.com/Commonjava/galley/issues/27). Batches with virtual resources
* that contain zero concrete resources should count down the latch when they return immediately, but
* instead are causing the countdown latch that watches the batch of transfers to hang.
*/
@Test(timeout = 2000)
public void batchRetrieve_returnEmptyResultIfVirtualResourceIsEmpty() throws Exception {
final VirtualResource vr = new VirtualResource(Collections.<Location>emptyList(), "/path/to/nowhere");
final TransferBatch batch = getTransferManagerImpl().batchRetrieve(new TransferBatch(Collections.<Resource>singleton(vr)), new EventMetadata());
assertThat(batch, notNullValue());
assertThat(batch.getErrors().isEmpty(), equalTo(true));
assertThat(batch.getTransfers().isEmpty(), equalTo(true));
}
use of org.commonjava.maven.galley.model.TransferBatch in project galley by Commonjava.
the class TransferManagerImpl method retrieveAll.
/* (non-Javadoc)
* @see org.commonjava.maven.galley.TransferManager#retrieveAll(java.util.List, java.lang.String)
*/
@Override
public List<Transfer> retrieveAll(final VirtualResource virt, final EventMetadata eventMetadata) throws TransferException {
TransferBatch batch = new TransferBatch(Collections.singleton(virt));
batch = batchRetrieveAll(batch, eventMetadata);
return new ArrayList<Transfer>(batch.getTransfers().values());
}
Aggregations