use of jetbrains.buildServer.torrent.TorrentConfiguration in project teamcity-torrent-plugin by JetBrains.
the class TorrentsSeederTest method setUp.
@BeforeMethod
@Override
protected void setUp() throws Exception {
super.setUp();
myTracker = new Tracker(6969);
myTracker.start(false);
Mockery m = new Mockery();
myExecutorService = m.mock(ScheduledExecutorService.class);
final TorrentConfiguration torrentConfiguration = m.mock(TorrentConfiguration.class);
m.checking(new Expectations() {
{
allowing(torrentConfiguration).getWorkerPoolSize();
will(returnValue(10));
allowing(torrentConfiguration).getPieceHashingPoolSize();
will(returnValue(4));
allowing(myExecutorService).submit(with(any(Runnable.class)));
allowing(myExecutorService).scheduleWithFixedDelay(with(any(Runnable.class)), with(any(Long.class)), with(any(Long.class)), with(any(TimeUnit.class)));
allowing(myExecutorService).shutdownNow();
}
});
myDirectorySeeder = new TorrentsSeeder(createTempDir(), 100, null, myExecutorService, torrentConfiguration);
myDirectorySeeder.start(new InetAddress[] { InetAddress.getLocalHost() }, myTracker.getAnnounceURI(), 3);
}
Aggregations