Search in sources :

Example 6 with IDEtalkEvent

use of jetbrains.communicator.core.IDEtalkEvent in project intellij-plugins by JetBrains.

the class JabberTransport_ConnectionTest method testAddUser_NotIdeTalk.

public void testAddUser_NotIdeTalk() throws Throwable {
    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());
}
Also used : User(jetbrains.communicator.core.users.User) IDEtalkEvent(jetbrains.communicator.core.IDEtalkEvent) UserEvent(jetbrains.communicator.core.users.UserEvent)

Example 7 with IDEtalkEvent

use of jetbrains.communicator.core.IDEtalkEvent in project intellij-plugins by JetBrains.

the class JabberTransport_ConnectionTest method testAddUser_IdeTalk.

public void testAddUser_IdeTalk() throws Throwable {
    XMPPConnection conn = createLocalConnectionWithJabberUser("fred" + System.nanoTime(), JabberFacadeImpl.IDETALK_RESOURCE);
    addEventListener();
    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());
}
Also used : User(jetbrains.communicator.core.users.User) WaitFor(jetbrains.communicator.util.WaitFor) IDEtalkEvent(jetbrains.communicator.core.IDEtalkEvent) UserEvent(jetbrains.communicator.core.users.UserEvent)

Aggregations

IDEtalkEvent (jetbrains.communicator.core.IDEtalkEvent)7 WaitFor (jetbrains.communicator.util.WaitFor)5 EventVisitor (jetbrains.communicator.core.EventVisitor)3 IDEtalkAdapter (jetbrains.communicator.core.IDEtalkAdapter)3 MessageEvent (jetbrains.communicator.core.transport.MessageEvent)3 TextXmlMessage (jetbrains.communicator.core.transport.TextXmlMessage)2 User (jetbrains.communicator.core.users.User)2 UserEvent (jetbrains.communicator.core.users.UserEvent)2 CodePointerEvent (jetbrains.communicator.core.transport.CodePointerEvent)1 SettingsChanged (jetbrains.communicator.core.users.SettingsChanged)1 CodePointer (jetbrains.communicator.core.vfs.CodePointer)1 VFile (jetbrains.communicator.core.vfs.VFile)1 Message (org.jivesoftware.smack.packet.Message)1