Search in sources :

Example 16 with MockIDEFacade

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);
}
Also used : MockIDEFacade(jetbrains.communicator.mock.MockIDEFacade) Tree(com.intellij.ui.treeStructure.Tree) LocalMessageDispatcherImpl(jetbrains.communicator.core.impl.dispatcher.LocalMessageDispatcherImpl)

Example 17 with MockIDEFacade

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();
}
Also used : MockUser(jetbrains.communicator.mock.MockUser) MockIDEFacade(jetbrains.communicator.mock.MockIDEFacade) AsyncMessageDispatcherImpl(jetbrains.communicator.core.impl.dispatcher.AsyncMessageDispatcherImpl) UserModelImpl(jetbrains.communicator.core.impl.users.UserModelImpl)

Example 18 with MockIDEFacade

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());
}
Also used : UserModel(jetbrains.communicator.core.users.UserModel) MockIDEFacade(jetbrains.communicator.mock.MockIDEFacade) Transport(jetbrains.communicator.core.transport.Transport)

Example 19 with MockIDEFacade

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();
}
Also used : MockIDEFacade(jetbrains.communicator.mock.MockIDEFacade)

Example 20 with MockIDEFacade

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);
}
Also used : MockIDEFacade(jetbrains.communicator.mock.MockIDEFacade) LocalMessageDispatcherImpl(jetbrains.communicator.core.impl.dispatcher.LocalMessageDispatcherImpl) UserModelImpl(jetbrains.communicator.core.impl.users.UserModelImpl) IDEtalkMessagesWindow(jetbrains.communicator.idea.IDEtalkMessagesWindow)

Aggregations

MockIDEFacade (jetbrains.communicator.mock.MockIDEFacade)22 UserModelImpl (jetbrains.communicator.core.impl.users.UserModelImpl)8 LocalMessageDispatcherImpl (jetbrains.communicator.core.impl.dispatcher.LocalMessageDispatcherImpl)6 MockUser (jetbrains.communicator.mock.MockUser)5 Tree (com.intellij.ui.treeStructure.Tree)2 AsyncMessageDispatcherImpl (jetbrains.communicator.core.impl.dispatcher.AsyncMessageDispatcherImpl)2 Mock (org.jmock.Mock)2 ConsoleView (com.intellij.execution.ui.ConsoleView)1 Project (com.intellij.openapi.project.Project)1 TreePath (javax.swing.tree.TreePath)1 AsyncMessageDispatcher (jetbrains.communicator.core.dispatcher.AsyncMessageDispatcher)1 Transport (jetbrains.communicator.core.transport.Transport)1 SettingsChanged (jetbrains.communicator.core.users.SettingsChanged)1 User (jetbrains.communicator.core.users.User)1 UserModel (jetbrains.communicator.core.users.UserModel)1 IDEtalkMessagesWindow (jetbrains.communicator.idea.IDEtalkMessagesWindow)1 JabberUI (jetbrains.communicator.jabber.JabberUI)1 MockJabberFacade (jetbrains.communicator.jabber.register.MockJabberFacade)1 TextAcceptor (jetbrains.communicator.util.TextAcceptor)1 WaitFor (jetbrains.communicator.util.WaitFor)1