Package jetbrains.communicator.mock

Examples of jetbrains.communicator.mock.MockUser


    assertFalse("Two users are selected", myCommand.isEnabled());
  }

  public void testExecute_NoInformation() throws Exception {
    final ProjectsData projectsData = new ProjectsData();
    MockUser mockUser = new MockUser("user", null) {
      @Override
      public ProjectsData getProjectsData(IDEFacade ideFacade) {
        return projectsData;
      }
    };

    mockUser.setOnline(true);
    myMockUserListComponent.setSelectedNodes(new User[]{mockUser});
    myFacadeMock.expects(once()).method("showMessage");

    myCommand.execute();
  }
View Full Code Here


  public void testExecute_WithInformation() throws Exception {
    final ProjectsData projectsData = new ProjectsData();

    projectsData.addNonProjectFile(VFile.create("a path"));

    MockUser mockUser = new MockUser("user", null) {
      @Override
      public ProjectsData getProjectsData(IDEFacade ideFacade) {
        return projectsData;
      }
    };

    mockUser.setOnline(true);
    myMockUserListComponent.setSelectedNodes(new User[]{mockUser});
    myFacadeMock.expects(once()).method("showUserFiles").with(eq(mockUser), eq(projectsData));

    myCommand.execute();
  }
View Full Code Here

  }

  public void testIsOnlineNotConnected() throws Throwable {
    assertFalse("Not online - return false", UserImpl.create("fake", myTransport.getName()).isOnline());
    assertEquals("Not online - offline icon expected", "/ideTalk/offline.png", myTransport.getIcon(
      myTransport.getUserPresence(new MockUser())));
  }
View Full Code Here

    getTree().updateUI(); // Emulate the UI change
  }

  public void testGetSelectedNodes() throws Exception {
    myUserModel.addGroup("a group");
    MockUser user = new MockUser("user", "group");
    myUserModel.addUser(user);

    JTree jTree = getTree();
    jTree.expandRow(1);
View Full Code Here

    return myUserListComponent.getTree();
  }

  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());
  }
View Full Code Here

    assertEquals("User group should be expanded to show incoming message icon",
        2, getTree().getRowCount());
  }

  public void testSaveLoadTreeState() throws Exception {
    myUserModel.addUser(new MockUser("user1", "group"));
    myUserModel.addUser(new MockUser("user2", "group"));
    myUserModel.addGroup("daaa");
    myUserModel.addUser(new MockUser("user3", "zzzz"));
    TreeUtils.collapseAll(getTree());
    getTree().expandRow(1);
    assertEquals("Sanity check", 5, getTree().getRowCount());

    myUserListComponent.saveState();
View Full Code Here

    myTree.expandRow(1);

    assertEquals("All expanded, root node is hidden", 8, myTree.getRowCount());

    // rename user aaa
    MockUser mockUser = ((MockUser) myUserModel.getUsers("group1")[1]);
    mockUser.setOnline(true);
    getBroadcaster().fireEvent(new UserEvent.Online(mockUser));

    assertEquals("Nodes expansion should be preserved", 8, myTree.getRowCount());

    assertEquals("Online user should go to the top", "ccc", getUserForRow(myTree, 2).getDisplayName());
View Full Code Here

      protected void invokeSendMessageAction() {
        mySendMessageInvoked = true;
      }
    };

    myUser = new MockUser();
    myTreePath = new TreePath(myUser);

    myTreeChanged = false;
    mySendMessageInvoked = false;
  }
View Full Code Here

  @Override
  protected void setUp() throws Exception {
    super.setUp();

    myIdeFacade = new MockIDEFacade(getClass());
    myUser = new MockUser("user", null);
    myUser.setOnline(true);

    myDispatcher = new AsyncMessageDispatcherImpl(getBroadcaster(), myIdeFacade);

    new WaitFor(1000) {
View Full Code Here

  public void testAsyncDispatch_Success() throws Exception {

    NotifyableMessage mockMessage = new NotifyableMessage(true, myLog);

    myDispatcher.sendLater(new MockUser(), mockMessage);
    myLog[0] += "Returned";
    mockMessage.waitUntilDispatchingStarted();

    triggerMessageProcessing(mockMessage);
View Full Code Here

TOP

Related Classes of jetbrains.communicator.mock.MockUser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.