Package jetbrains.communicator.core.users

Examples of jetbrains.communicator.core.users.User


    };
    return user;
  }

  public void testSendNothingWhenNoMessage() throws Exception {
    final User user = createUser();
    doTest("   \n", new User[]{user});
    assertEquals("Nothing to send", "", myLog);
  }
View Full Code Here


    assertGroup(UserModel.DEFAULT_GROUP, "  ");
    assertGroup("foo", " foo  ");
  }

  public void testNoTransport() throws Exception {
    User user = UserImpl.create("user", "ddd");
    assertFalse(user.isOnline());
  }
View Full Code Here

    addEventListener();
    addUserFred();

    IDEtalkEvent event = checkEvent(false);
    assertTrue(event.toString(), event instanceof UserEvent.Added);
    User user = ((UserEvent.Added) event).getUser();
    assertEquals("Jabber user expected", "Jabber", user.getTransportCode());
    assertEquals("Should add Jabber user", FRED, user.getName());
    assertEquals("Wrong group", "aGroup", user.getGroup());

    assertFalse(user.hasIDEtalkClient());
  }
View Full Code Here

    assertEquals("No events expected when user is not in model", 0, myEvents.size());
    assertEquals("Group should be changed", "anotherGroup", myUser.getGroup());

    myUserModel.addUser(myUser);
    myEvents.clear();
    User userCopy = UserImpl.create("someUser", MockTransport.NAME);
    userCopy.setGroup("alexandria", myUserModel);

    assertEquals("Group should be changed", "alexandria", userCopy.getGroup());
    assertEquals("Group should be changed for user in Model", "alexandria", myUser.getGroup());
    verifyUpdateEvent("group", "anotherGroup", "alexandria");
  }
View Full Code Here

    assertEquals("No events expected when user is not in model", 0, myEvents.size());
    assertEquals("Display name should be changed", "anotherName", myUser.getDisplayName());

    myUserModel.addUser(myUser);
    myEvents.clear();
    User userCopy = UserImpl.create("someUser", MockTransport.NAME);
    userCopy.setDisplayName("jonny", myUserModel);

    assertEquals("Display name should be changed", "jonny", userCopy.getDisplayName());
    assertEquals("Display name should be changed for user in Model", "jonny", myUser.getDisplayName());
    verifyUpdateEvent("displayName", "anotherName", "jonny");
  }
View Full Code Here

    final String fred = getUser(conn);
    addUser(fred);

    IDEtalkEvent event = checkEvent(false);
    assertTrue(event.toString(), event instanceof UserEvent.Added);
    User user = ((UserEvent.Added) event).getUser();
    assertEquals("Jabber user expected", "Jabber", user.getTransportCode());
    assertEquals("Should add Jabber user", fred, user.getName());
    assertEquals("Wrong group", "aGroup", user.getGroup());

    new WaitFor(TIMEOUT) {
      @Override
      protected boolean condition() {
        return myFacade.getConnection().getRoster().getPresence(fred) != null;
      }
    };
    assertTrue("User with IDEtalk resource", user.hasIDEtalkClient());
  }
View Full Code Here

    assertEquals("Empty name - no events", 0, myEvents.size());
    assertEquals("Empty name - not changed", "someUser", myUser.getDisplayName());
  }

  public void testSetCanAccess_AnotherUser() throws Throwable {
    User sameUser = UserImpl.create(myUser.getName(), myUser.getTransportCode());

    sameUser.setCanAccessMyFiles(true, myUserModel);
    assertFalse("No change expected", myUser.canAccessMyFiles());

    myUserModel.addUser(myUser);

    sameUser.setCanAccessMyFiles(true, myUserModel);
    assertTrue("Change expected for user in model", myUser.canAccessMyFiles());
  }
View Full Code Here

  public void testLocalChanges_UpdateRoster() throws Throwable {
    addEventListener();
    addUserFred();

    User user = myUserModel.getAllUsers()[0];
    final Roster roster = myFacade.getConnection().getRoster();

    // Change group:
    user.setGroup("someOtherGroup", myUserModel);
    new WaitFor(TIMEOUT) {
      @Override
      protected boolean condition() {
        return roster.getGroupCount() == 1 && roster.getGroup("someOtherGroup") != null;
      }
    };

    assertEquals("One group expected", 1, roster.getGroupCount());
    RosterGroup group = roster.getGroup("someOtherGroup");
    assertNotNull(group);
    assertEquals(1, group.getEntryCount());
    assertNotNull(group.getEntry(FRED));

    // Change Display name:
    user.setDisplayName("Some new name", myUserModel);
    new WaitFor(TIMEOUT) {
      @Override
      protected boolean condition() {
        return "Some new name".equals(roster.getEntry(FRED).getName());
      }
View Full Code Here

  UserConverter(UserModel userModel) {
    myUserModel = userModel;
  }

  public String toString(Object obj) {
    User user = ((User) obj);
    return user.getTransportCode() + ':' + user.getName();
  }
View Full Code Here

    testCommandStateChanges(user1, user2);
  }

  public void testMultipleSelection_WithGroup() throws Exception {
    User user1 = myUserModel.createUser("user1", MockTransport.NAME);
    User user2 = myUserModel.createUser("user2", MockTransport.NAME);
    myUserModel.addUser(user1);
    myUserModel.addUser(user2);
    user1.setGroup("grp", myUserModel);

    myUserListComponent.stubs().method("getSelectedNodes")
View Full Code Here

TOP

Related Classes of jetbrains.communicator.core.users.User

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.