Package jetbrains.communicator.core.impl.users

Examples of jetbrains.communicator.core.impl.users.BaseUserImpl


    assertTrue(myIDEFacade.getAndClearLog().startsWith("showMessage"));
  }

  public void testOnlySelfFound() throws Exception {

    final BaseUserImpl self = new MockUser();

    myTransportMock.expects(once()).method("findUsers").will(returnValue(new User[]{self}));
    myTransportMock1.expects(once()).method("findUsers").will(returnValue(new User[]{self}));

    myCommand.execute();
View Full Code Here


    assertTrue(myIDEFacade.getAndClearLog().startsWith("showMessage"));
  }

  public void testOnlyExistingUserFound() throws Exception {

    final BaseUserImpl foundUser = setTeddyUserIsFound();

    myUserModelMock.expects(once()).method("hasUser").with(eq(foundUser)).will(returnValue(true));

    myCommand.execute();
View Full Code Here

    assertTrue(myIDEFacade.getAndClearLog().startsWith("showMessage"));
  }

  public void testUsersFromDifferentTransportsFound() throws Exception {
    final BaseUserImpl teddy = new MockUser("teddy", "");
    final BaseUserImpl sashka = new MockUser("sashka", "");

    myTransportMock.expects(once()).method("findUsers").will(returnValue(new User[]{teddy}));
    myTransportMock1.expects(once()).method("findUsers").will(returnValue(new User[]{sashka}));

    myUserModelMock.expects(once()).method("getGroups").will(returnValue(null));
View Full Code Here

    myCommand.execute();
  }

  public void testNewUserFound_AddNoOne() throws Exception {
    final BaseUserImpl teddy = setTeddyUserIsFound();
    myUserModelMock.expects(once()).method("hasUser").with(eq(teddy)).will(returnValue(false));
    myUserModelMock.expects(once()).method("getGroups").will(returnValue(null));

    myIDEFacade.setReturnedData(new FindUsersCommand.UsersInfo(new User[0], "new group"));
    myCommand.execute();
View Full Code Here

    assertEquals("Group should be set from project name", "projectForTeddy", teddy.getGroup());
  }

  public void testNewUserFound_AddThisUserToModel() throws Exception {
    final BaseUserImpl teddy = setTeddyUserIsFound();
    myUserModelMock.expects(once()).method("hasUser").with(eq(teddy)).will(returnValue(false));
    myUserModelMock.expects(once()).method("getGroups").will(returnValue(null));

    final List<User> userList = new ArrayList<User>();
    userList.add(teddy);

    myIDEFacade.setReturnedData(new FindUsersCommand.UsersInfo(new User[]{teddy}, "new group"));

    myUserModelMock.expects(once()).method("addUser").with(eq(teddy));
    myUserModelMock.expects(once()).method("findUser").with(eq(teddy.getName()), eq(teddy.getTransportCode()))
        .will(returnValue(teddy));

    myCommand.execute();

    assertEquals("User group should be updated", "new group", teddy.getGroup());
  }
View Full Code Here

TOP

Related Classes of jetbrains.communicator.core.impl.users.BaseUserImpl

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.