Search in sources :

Example 1 with EventDispatcher

use of jetbrains.buildServer.util.EventDispatcher in project teamcity-torrent-plugin by JetBrains.

the class TorrentTrackerManagerTest method setUp.

@BeforeMethod
public void setUp() throws Exception {
    Mockery m = new Mockery();
    final XmlRpcHandlerManager rpcHandlerManager = m.mock(XmlRpcHandlerManager.class);
    final ExecutorServices executorServices = m.mock(ExecutorServices.class);
    myExecutorService = Executors.newScheduledThreadPool(4);
    final RootUrlHolder rootUrlHolder = m.mock(RootUrlHolder.class);
    m.checking(new Expectations() {

        {
            allowing(rpcHandlerManager).addHandler(with(any(String.class)), with(any(Object.class)));
            allowing(executorServices).getNormalExecutorService();
            will(returnValue(myExecutorService));
            allowing(rootUrlHolder).getRootUrl();
            will(returnValue("http://localhost:8111"));
        }
    });
    myTorrentTrackerManager = new TorrentTrackerManager(new TorrentConfigurator(new ServerPaths(createTempDir().getAbsolutePath()), rootUrlHolder, rpcHandlerManager), executorServices, new EventDispatcher<BuildServerListener>(BuildServerListener.class) {
    }, m.mock(AddressChecker.class));
}
Also used : XmlRpcHandlerManager(jetbrains.buildServer.XmlRpcHandlerManager) Expectations(org.jmock.Expectations) RootUrlHolder(jetbrains.buildServer.RootUrlHolder) EventDispatcher(jetbrains.buildServer.util.EventDispatcher) ExecutorServices(jetbrains.buildServer.serverSide.executors.ExecutorServices) Mockery(org.jmock.Mockery) ServerPaths(jetbrains.buildServer.serverSide.ServerPaths) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

RootUrlHolder (jetbrains.buildServer.RootUrlHolder)1 XmlRpcHandlerManager (jetbrains.buildServer.XmlRpcHandlerManager)1 ServerPaths (jetbrains.buildServer.serverSide.ServerPaths)1 ExecutorServices (jetbrains.buildServer.serverSide.executors.ExecutorServices)1 EventDispatcher (jetbrains.buildServer.util.EventDispatcher)1 Expectations (org.jmock.Expectations)1 Mockery (org.jmock.Mockery)1 BeforeMethod (org.testng.annotations.BeforeMethod)1