use of org.commonjava.maven.galley.cache.testutil.TestFileEventManager in project galley by Commonjava.
the class PartyLineCacheProviderTest method setup.
@Before
public void setup() throws Exception {
final PathGenerator pathgen = new HashedLocationPathGenerator();
final FileEventManager events = new TestFileEventManager();
final TransferDecorator decorator = new TestTransferDecorator();
provider = new PartyLineCacheProvider(temp.newFolder(), pathgen, events, decorator);
}
use of org.commonjava.maven.galley.cache.testutil.TestFileEventManager in project galley by Commonjava.
the class GridFileSystemCacheProviderTest method setup.
@Before
public void setup() throws Exception {
final PathGenerator pathgen = new HashedLocationPathGenerator();
final FileEventManager events = new TestFileEventManager();
final TransferDecorator decorator = new TestTransferDecorator();
Cache<String, byte[]> data = CACHE_MANAGER.getCache(name.getMethodName() + "-data");
Cache<String, GridFile.Metadata> metadata = CACHE_MANAGER.getCache(name.getMethodName() + "-metadata");
final GridFilesystem fs = new GridFilesystem(data, metadata);
provider = new GridFileSystemCacheProvider(pathgen, events, decorator, fs);
}
use of org.commonjava.maven.galley.cache.testutil.TestFileEventManager in project galley by Commonjava.
the class CacheProviderTCK method lockThenWriteViaTransferSucceedsInSameThread.
@Test
public void lockThenWriteViaTransferSucceedsInSameThread() throws Exception {
final Location loc = new SimpleLocation("http://foo.com");
final String path = "my/path.txt";
final ConcreteResource res = new ConcreteResource(loc, path);
final CacheProvider cache = getCacheProvider();
cache.lockWrite(res);
final Transfer txfr = new Transfer(res, cache, new TestFileEventManager(), new TestTransferDecorator());
OutputStream out = null;
try {
out = txfr.openOutputStream(TransferOperation.UPLOAD);
IOUtils.write("this is a test", out);
} finally {
IOUtils.closeQuietly(out);
}
}
Aggregations