Search in sources :

Example 1 with CurrentBuildTrackerImpl

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);
}
Also used : Expectations(org.jmock.Expectations) AgentLifeCycleListener(jetbrains.buildServer.agent.AgentLifeCycleListener) ArtifactsWatcher(jetbrains.buildServer.agent.artifacts.ArtifactsWatcher) Mockery(org.jmock.Mockery) CurrentBuildTrackerImpl(jetbrains.buildServer.agent.impl.CurrentBuildTrackerImpl) SeedSettings(jetbrains.buildServer.torrent.settings.SeedSettings) LeechSettings(jetbrains.buildServer.torrent.settings.LeechSettings) TorrentsDownloadStatistic(jetbrains.buildServer.torrent.util.TorrentsDownloadStatistic) BuildAgentConfiguration(jetbrains.buildServer.agent.BuildAgentConfiguration) ArtifactCacheProvider(jetbrains.buildServer.artifacts.ArtifactCacheProvider) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

AgentLifeCycleListener (jetbrains.buildServer.agent.AgentLifeCycleListener)1 BuildAgentConfiguration (jetbrains.buildServer.agent.BuildAgentConfiguration)1 ArtifactsWatcher (jetbrains.buildServer.agent.artifacts.ArtifactsWatcher)1 CurrentBuildTrackerImpl (jetbrains.buildServer.agent.impl.CurrentBuildTrackerImpl)1 ArtifactCacheProvider (jetbrains.buildServer.artifacts.ArtifactCacheProvider)1 LeechSettings (jetbrains.buildServer.torrent.settings.LeechSettings)1 SeedSettings (jetbrains.buildServer.torrent.settings.SeedSettings)1 TorrentsDownloadStatistic (jetbrains.buildServer.torrent.util.TorrentsDownloadStatistic)1 Expectations (org.jmock.Expectations)1 Mockery (org.jmock.Mockery)1 BeforeMethod (org.testng.annotations.BeforeMethod)1