Package jetbrains.communicator.mock

Examples of jetbrains.communicator.mock.MockUser


  public void testAsyncDispatch_Failure() throws Exception {

    NotifyableMessage mockMessage = new NotifyableMessage(false, myLog);

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

    triggerMessageProcessing(mockMessage);
View Full Code Here


  }

  public void testAddMessagesWhileDispatching() throws Exception {

    NotifyableMessage mockMessage = new NotifyableMessage(true, myLog);
    MockUser user1 = new MockUser("user1", null);
    MockUser user2 = new MockUser("user2", null);
    user1.setOnline(true);
    user2.setOnline(true);

    myDispatcher.sendLater(user1, mockMessage);
    mockMessage.waitUntilDispatchingStarted();
    myDispatcher.sendLater(user2, new MockMessage(true));
View Full Code Here

    super.setUp();

    myIdeFacade = new MockIDEFacade(getClass());
    myDispatcher = createDispatcher();

    myUser = new MockUser("user", null);
    myUser.setOnline(true);
  }
View Full Code Here

    myTree.setModel(new FoundUsersModel(Arrays.asList(users)));
    TreeUtils.expandAll(myTree);
  }

  private User user(String userName, String project) {
    MockUser user = new MockUser(userName, null);
    if (project != null) {
      user.setProjects(new String[]{project});
    }
    return user;
  }
View Full Code Here

    assertNull("Root node - no parent", getRoot(model).getParent());
    assertEquals("No children expected", 0, getRoot(model).getChildCount());
  }

  public void testUserInProject() throws Exception {
    MockUser bob = new MockUser("BobName", null);
    bob.setProjects(new String[]{"bobProject"});

    FoundUsersModel model = createModel(Arrays.asList(new User[]{bob}));
    assertEquals("One project expected", 1, getRoot(model).getChildCount());
    TreeNode projectNode = getRoot(model).getChildAt(0);
    assertEquals("Invalid project node", "bobProject", projectNode.toString());

    assertEquals("One user in group expected", 1, projectNode.getChildCount());
    assertEquals("Invalid user node", bob.getName(), projectNode.getChildAt(0).toString());
  }
View Full Code Here

    assertEquals("One user in group expected", 1, projectNode.getChildCount());
    assertEquals("Invalid user node", bob.getName(), projectNode.getChildAt(0).toString());
  }

  public void test2Users2Projects() throws Exception {
    MockUser bob = new MockUser("bob", null);
    MockUser alice = new MockUser("alice", null);

    bob.setProjects(new String[]{"bobProject"});
    alice.setProjects(new String[]{"aliceProject"});
    FoundUsersModel model = createModel(Arrays.asList(new User[]{bob, alice}));
    assertEquals("Two projects expected", 2, getRoot(model).getChildCount());
    assertEquals("One user per project expected", 1, getRoot(model).getChildAt(0).getChildCount());
    assertEquals("One user per project expected", 1, getRoot(model).getChildAt(1).getChildCount());
  }
View Full Code Here

    assertEquals("One user per project expected", 1, getRoot(model).getChildAt(0).getChildCount());
    assertEquals("One user per project expected", 1, getRoot(model).getChildAt(1).getChildCount());
  }

  public void testUserWithoutProject() throws Exception {
    MockUser bob = new MockUser("BobName", null);

    FoundUsersModel model = createModel(Arrays.asList(new User[]{bob}));
    assertEquals("One (unnamed) project expected", 1, getRoot(model).getChildCount());
    TreeNode projectNode = getRoot(model).getChildAt(0);
    assertEquals("Invalid project node", "<no project>", projectNode.toString());

    assertEquals("One user in group expected", 1, projectNode.getChildCount());
    assertEquals("Invalid user node", bob.getName(), projectNode.getChildAt(0).toString());
  }
View Full Code Here

    assertEquals("One user in group expected", 1, projectNode.getChildCount());
    assertEquals("Invalid user node", bob.getName(), projectNode.getChildAt(0).toString());
  }

  public void testUserIn2Groups() throws Exception {
    MockUser bob = new MockUser("BobName", null);
    bob.setProjects(new String[]{"bobProject", "anotherBobProject"});

    FoundUsersModel model = createModel(Arrays.asList(new User[]{bob}));
    assertEquals("2 projects expected", 2, getRoot(model).getChildCount());
    TreeNode projectNode1 = getRoot(model).getChildAt(0);
    assertEquals("Invalid project node", "anotherBobProject", projectNode1.toString());
View Full Code Here

    assertEquals("One user in group expected", 1, projectNode1.getChildCount());
    assertEquals("One user in group expected", 1, projectNode2.getChildCount());
  }

  public void test2UsersInSameGroup() throws Exception {
    MockUser bob = new MockUser("bob", null);
    MockUser alice = new MockUser("alice", null);

    bob.setProjects(new String[]{"Project"});
    alice.setProjects(new String[]{"Project"});
    FoundUsersModel model = createModel(Arrays.asList(new User[]{bob, alice}));
    assertEquals("One project expected", 1, getRoot(model).getChildCount());
    assertEquals("Two users expected", 2, getRoot(model).getChildAt(0).getChildCount());

    assertEquals("Wrong sorting of users", "alice", getRoot(model).getChildAt(0).getChildAt(0).toString());
View Full Code Here

    super.setUp();

    Pico.getInstance().registerComponentInstance(IDEFacade.class, new MockIDEFacade());

    myViewFilesPanel = new ViewFilesPanel(null, null, null);
    myUser = new MockUser();
  }
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.