use of jetbrains.buildServer.agent.impl.CurrentBuildTrackerImpl in project teamcity-torrent-plugin by JetBrains.
the class AgentTorrentsManagerTest method setUp.
@BeforeMethod
public void setUp() throws Exception {
super.setUp();
EventDispatcher<AgentLifeCycleListener> dispatcher = EventDispatcher.create(AgentLifeCycleListener.class);
BuildAgentConfiguration agentConfiguration = myAgentConfigurationFixture.setUp();
final TorrentConfiguration trackerConfiguration = new FakeTorrentConfiguration();
Mockery m = new Mockery();
final LeechSettings leechSettings = m.mock(LeechSettings.class);
final SeedSettings seedingSettings = m.mock(SeedSettings.class);
final ArtifactCacheProvider cacheProvider = m.mock(ArtifactCacheProvider.class);
m.checking(new Expectations() {
{
allowing(cacheProvider).addListener(with(any(TorrentArtifactCacheListener.class)));
allowing(leechSettings).isDownloadEnabled();
will(returnValue(true));
allowing(seedingSettings).isSeedingEnabled();
will(returnValue(true));
}
});
final ArtifactsWatcher artifactsWatcher = m.mock(ArtifactsWatcher.class);
AgentTorrentsSeeder seeder = new AgentTorrentsSeeder(agentConfiguration, trackerConfiguration);
TorrentFilesFactoryImpl tff = new TorrentFilesFactoryImpl(agentConfiguration, trackerConfiguration, new FakeAgentIdleTasks(), seeder);
myTorrentsDownloadStatistic = new TorrentsDownloadStatistic();
myTorrentsManager = new AgentTorrentsManager(dispatcher, cacheProvider, new CurrentBuildTrackerImpl(dispatcher), trackerConfiguration, seeder, tff, artifactsWatcher, myTorrentsDownloadStatistic, leechSettings, agentConfiguration, seedingSettings);
}
Aggregations