use of jetbrains.communicator.mock.MockIDEFacade in project intellij-plugins by JetBrains.
the class UsersTreeModelTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
myUserModel = TestFactory.createUserListWithUsers(this);
myTree = new Tree();
myLocalMessageDispatcher = new LocalMessageDispatcherImpl(getBroadcaster(), new MockIDEFacade(getClass()), myUserModel);
disposeOnTearDown(myLocalMessageDispatcher);
myUsersTreeModel = new UsersTreeModel(myTree, myUserModel, myLocalMessageDispatcher);
disposeOnTearDown(myUsersTreeModel);
myTree.setModel(myUsersTreeModel);
}
use of jetbrains.communicator.mock.MockIDEFacade in project intellij-plugins by JetBrains.
the class P2PTransportTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
myUserModel = new UserModelImpl(getBroadcaster());
disposeOnTearDown(myUserModel);
myIdeFacade = new MockIDEFacade(getClass());
myIdeFacade.setReturnedProjects(new String[] { PROJECT_NAME });
myDispatcher = new AsyncMessageDispatcherImpl(getBroadcaster(), myIdeFacade);
disposeOnTearDown(myDispatcher);
myTransport = new P2PTransport(myDispatcher, myUserModel, WAIT_USER_RESPONSES_TIMEOUT) {
@Override
protected void sendUserAddedCallback(User user) {
super.sendUserAddedCallback(user);
myLog += "sendUserAddedCallback" + user;
}
};
Pico.getInstance().registerComponentInstance(myTransport);
myLog = "";
myProjectLevelContainer = Pico.getInstance().makeChildContainer();
}
use of jetbrains.communicator.mock.MockIDEFacade in project intellij-plugins by JetBrains.
the class FindUsersCommandTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
myUserModelMock = mock(UserModel.class);
myTransportMock = mock(Transport.class);
myTransportMock1 = mock(Transport.class);
myIDEFacade = new MockIDEFacade();
myUserModelMock.stubs().method("getBroadcaster").will(returnValue(getBroadcaster()));
myCommand = new FindUsersCommand((UserModel) myUserModelMock.proxy(), new Transport[] { (Transport) myTransportMock.proxy(), (Transport) myTransportMock1.proxy() }, myIDEFacade);
assertTrue(myCommand.isEnabled());
assertNotNull(myCommand.getName());
}
use of jetbrains.communicator.mock.MockIDEFacade in project intellij-plugins by JetBrains.
the class SendMessageCommandTest method doTest.
private void doTest(final String message, final User[] users) throws UnknownHostException {
MockIDEFacade ideFacade = new MockIDEFacade() {
@Override
public void invokeSendMessage(User[] availableUsers, User[] defaultRecipients, String message1, SendMessageInvoker runOnOK) {
runOnOK.doSendMessage(users, message);
}
};
myCommand = new SendMessageCommand(myUserModel, myMockUserListComponent, ideFacade);
myCommand.execute();
}
use of jetbrains.communicator.mock.MockIDEFacade in project intellij-plugins by JetBrains.
the class EventsProcessorTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
myUserModel = new UserModelImpl(getBroadcaster());
disposeOnTearDown(myUserModel);
myMock = mock(IDEtalkMessagesWindow.class);
LocalMessageDispatcherImpl localMessageDispatcher = new LocalMessageDispatcherImpl(getBroadcaster(), new MockIDEFacade(getClass()), myUserModel);
disposeOnTearDown(localMessageDispatcher);
EventsProcessor processor = new EventsProcessor((IDEtalkMessagesWindow) myMock.proxy(), myUserModel, localMessageDispatcher, null);
disposeOnTearDown(processor);
}
Aggregations