Search in sources :

Example 46 with MockUser

use of jetbrains.communicator.mock.MockUser in project intellij-plugins by JetBrains.

the class AsyncMessageDispatcherTest method testAsyncDispatch_Failure.

public void testAsyncDispatch_Failure() throws Exception {
    NotifyableMessage mockMessage = new NotifyableMessage(false, myLog);
    myDispatcher.sendLater(new MockUser(), mockMessage);
    myLog[0] += "Returned";
    mockMessage.waitUntilDispatchingStarted();
    triggerMessageProcessing(mockMessage);
    assertEquals("Should return from method call and than process the message", "ReturnedProcessed", myLog[0]);
    assertEquals("Messages should not be delivered", 1, myDispatcher.getUsersWithMessages().length);
}
Also used : MockUser(jetbrains.communicator.mock.MockUser)

Example 47 with MockUser

use of jetbrains.communicator.mock.MockUser in project intellij-plugins by JetBrains.

the class AsyncMessageDispatcherTest method testAsyncDispatch_Success.

public void testAsyncDispatch_Success() throws Exception {
    NotifyableMessage mockMessage = new NotifyableMessage(true, myLog);
    myDispatcher.sendLater(new MockUser(), mockMessage);
    myLog[0] += "Returned";
    mockMessage.waitUntilDispatchingStarted();
    triggerMessageProcessing(mockMessage);
    assertEquals("Should return from method call and than process the message", "ReturnedProcessed", myLog[0]);
    assertEquals("Messages should be delivered", 0, myDispatcher.getUsersWithMessages().length);
}
Also used : MockUser(jetbrains.communicator.mock.MockUser)

Example 48 with MockUser

use of jetbrains.communicator.mock.MockUser in project intellij-plugins by JetBrains.

the class OpenFileActionTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    myIdeFacadeMock = mock(IDEFacade.class);
    Pico.getInstance().registerComponentInstance(IDEFacade.class, myIdeFacadeMock.proxy());
    myViewFilesPanel = new ViewFilesPanel(null, null, (IDEFacade) myIdeFacadeMock.proxy());
    myUser = new MockUser();
    ProjectsData projectsData = new ProjectsData();
    myVFile = VFile.create("build.xml");
    projectsData.setProjectFiles("ideTalk", new VFile[] { myVFile, VFile.create("log4j.xml") });
    projectsData.addNonProjectFile(VFile.create("non-projectFile"));
    myViewFilesPanel.refreshData(myUser, projectsData);
    myOpenFileAction = new OpenFileAction(myViewFilesPanel.getTree(), (IDEFacade) myIdeFacadeMock.proxy());
}
Also used : ProjectsData(jetbrains.communicator.core.vfs.ProjectsData) IDEFacade(jetbrains.communicator.ide.IDEFacade) MockUser(jetbrains.communicator.mock.MockUser)

Example 49 with MockUser

use of jetbrains.communicator.mock.MockUser in project intellij-plugins by JetBrains.

the class ViewFilesTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    Pico.getInstance().registerComponentInstance(IDEFacade.class, new MockIDEFacade());
    myViewFilesPanel = new ViewFilesPanel(null, null, null);
    myUser = new MockUser();
}
Also used : MockIDEFacade(jetbrains.communicator.mock.MockIDEFacade) MockUser(jetbrains.communicator.mock.MockUser)

Example 50 with MockUser

use of jetbrains.communicator.mock.MockUser in project intellij-plugins by JetBrains.

the class UserListComponentTest method testExpandGroupNodeOnUserAdd.

public void testExpandGroupNodeOnUserAdd() throws Exception {
    myUserModel.addGroup("a group");
    myUserModel.addUser(new MockUser("user", "a group"));
    assertEquals("User group should be expanded", 2, getTree().getRowCount());
}
Also used : MockUser(jetbrains.communicator.mock.MockUser)

Aggregations

MockUser (jetbrains.communicator.mock.MockUser)55 User (jetbrains.communicator.core.users.User)13 VFile (jetbrains.communicator.core.vfs.VFile)5 IDEFacade (jetbrains.communicator.ide.IDEFacade)5 MockIDEFacade (jetbrains.communicator.mock.MockIDEFacade)4 AddOnlineUserP2PCommand (jetbrains.communicator.p2p.commands.AddOnlineUserP2PCommand)4 TreeNode (javax.swing.tree.TreeNode)3 CodePointer (jetbrains.communicator.core.vfs.CodePointer)3 ProjectsData (jetbrains.communicator.core.vfs.ProjectsData)3 EventBroadcaster (jetbrains.communicator.core.EventBroadcaster)2 BaseUserImpl (jetbrains.communicator.core.impl.users.BaseUserImpl)2 UserModelImpl (jetbrains.communicator.core.impl.users.UserModelImpl)2 UserEvent (jetbrains.communicator.core.users.UserEvent)2 WaitFor (jetbrains.communicator.util.WaitFor)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Vector (java.util.Vector)1 TreePath (javax.swing.tree.TreePath)1 LocalMessageDispatcherImpl (jetbrains.communicator.core.impl.dispatcher.LocalMessageDispatcherImpl)1 MockMessage (jetbrains.communicator.mock.MockMessage)1