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));
}
Aggregations