Search in sources :

Example 1 with LocalMessageDispatcherImpl

use of jetbrains.communicator.core.impl.dispatcher.LocalMessageDispatcherImpl in project intellij-plugins by JetBrains.

the class UserTreeTest method setUp.

protected void setUp() throws Exception {
    super.setUp();
    UserModelImpl userModel = new UserModelImpl(getBroadcaster());
    disposeOnTearDown(userModel);
    myLocalMessageDispatcher = new LocalMessageDispatcherImpl(getBroadcaster(), new MockIDEFacade(getClass()), userModel);
    disposeOnTearDown(myLocalMessageDispatcher);
    myUserTree = new UserTree(myLocalMessageDispatcher) {

        public void treeDidChange() {
            super.treeDidChange();
            myTreeChanged = true;
        }

        protected void invokeSendMessageAction() {
            mySendMessageInvoked = true;
        }
    };
    myUser = new MockUser();
    myTreePath = new TreePath(myUser);
    myTreeChanged = false;
    mySendMessageInvoked = false;
}
Also used : TreePath(javax.swing.tree.TreePath) MockIDEFacade(jetbrains.communicator.mock.MockIDEFacade) LocalMessageDispatcherImpl(jetbrains.communicator.core.impl.dispatcher.LocalMessageDispatcherImpl) UserModelImpl(jetbrains.communicator.core.impl.users.UserModelImpl) MockUser(jetbrains.communicator.mock.MockUser)

Example 2 with LocalMessageDispatcherImpl

use of jetbrains.communicator.core.impl.dispatcher.LocalMessageDispatcherImpl in project intellij-plugins by JetBrains.

the class UserListComponentTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    myBroadcaster = getBroadcaster();
    myIdeFacade = new MockIDEFacade(getClass());
    myUserModel = new UserModelImpl(myBroadcaster);
    disposeOnTearDown(myUserModel);
    myLocalMessageDispatcher = new LocalMessageDispatcherImpl(myBroadcaster, myIdeFacade, myUserModel);
    disposeOnTearDown(myLocalMessageDispatcher);
    myUserListComponent = new UserListComponentImpl(myUserModel, myIdeFacade, myLocalMessageDispatcher);
    disposeOnTearDown(myUserListComponent);
    // Emulate the UI change
    getTree().updateUI();
}
Also used : MockIDEFacade(jetbrains.communicator.mock.MockIDEFacade) LocalMessageDispatcherImpl(jetbrains.communicator.core.impl.dispatcher.LocalMessageDispatcherImpl) UserModelImpl(jetbrains.communicator.core.impl.users.UserModelImpl)

Example 3 with LocalMessageDispatcherImpl

use of jetbrains.communicator.core.impl.dispatcher.LocalMessageDispatcherImpl in project intellij-plugins by JetBrains.

the class UsersTreeModel_OnlyOfflineShownTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    myUserModel = TestFactory.createUserListWithUsers(this);
    myTree = new Tree();
    myIDEFacade = new MockIDEFacade(getClass());
    myLocalMessageDispatcher = new LocalMessageDispatcherImpl(getBroadcaster(), myIDEFacade, myUserModel);
    disposeOnTearDown(myLocalMessageDispatcher);
    myUsersTreeModel = new UsersTreeModel(myTree, myUserModel, myLocalMessageDispatcher);
    disposeOnTearDown(myUsersTreeModel);
    myTree.setModel(myUsersTreeModel);
    OptionFlag.OPTION_HIDE_OFFLINE_USERS.change(true);
    getBroadcaster().fireEvent(new SettingsChanged());
}
Also used : SettingsChanged(jetbrains.communicator.core.users.SettingsChanged) MockIDEFacade(jetbrains.communicator.mock.MockIDEFacade) Tree(com.intellij.ui.treeStructure.Tree) LocalMessageDispatcherImpl(jetbrains.communicator.core.impl.dispatcher.LocalMessageDispatcherImpl)

Example 4 with LocalMessageDispatcherImpl

use of jetbrains.communicator.core.impl.dispatcher.LocalMessageDispatcherImpl in project intellij-plugins by JetBrains.

the class MessagesTabTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    myUserMock = mock(User.class);
    myUser = (User) myUserMock.proxy();
    final Mock consoleStub = mock(ConsoleView.class);
    consoleStub.stubs().method(ANYTHING);
    consoleStub.stubs().method("getComponent").will(returnValue(new JLabel()));
    LocalMessageDispatcherImpl localMessageDispatcher = new LocalMessageDispatcherImpl(getBroadcaster(), new MockIDEFacade(getClass()), null);
    disposeOnTearDown(localMessageDispatcher);
    myMessagesTab = new MessagesTab(null, myUser, localMessageDispatcher, true) {

        @Override
        protected ConsoleView createConsoleView(Project project) {
            return (ConsoleView) consoleStub.proxy();
        }
    };
    disposeOnTearDown(myMessagesTab);
}
Also used : Project(com.intellij.openapi.project.Project) User(jetbrains.communicator.core.users.User) ConsoleView(com.intellij.execution.ui.ConsoleView) MockIDEFacade(jetbrains.communicator.mock.MockIDEFacade) LocalMessageDispatcherImpl(jetbrains.communicator.core.impl.dispatcher.LocalMessageDispatcherImpl) Mock(org.jmock.Mock)

Example 5 with LocalMessageDispatcherImpl

use of jetbrains.communicator.core.impl.dispatcher.LocalMessageDispatcherImpl 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)

Aggregations

LocalMessageDispatcherImpl (jetbrains.communicator.core.impl.dispatcher.LocalMessageDispatcherImpl)6 MockIDEFacade (jetbrains.communicator.mock.MockIDEFacade)6 UserModelImpl (jetbrains.communicator.core.impl.users.UserModelImpl)3 Tree (com.intellij.ui.treeStructure.Tree)2 ConsoleView (com.intellij.execution.ui.ConsoleView)1 Project (com.intellij.openapi.project.Project)1 TreePath (javax.swing.tree.TreePath)1 SettingsChanged (jetbrains.communicator.core.users.SettingsChanged)1 User (jetbrains.communicator.core.users.User)1 IDEtalkMessagesWindow (jetbrains.communicator.idea.IDEtalkMessagesWindow)1 MockUser (jetbrains.communicator.mock.MockUser)1 Mock (org.jmock.Mock)1