Examples of XmppURI


Examples of com.calclab.emite.core.XmppURI

  public void shouldAcceptInvitations() {
    final RoomChatChangedTestHandler chatCreatedHandler = new RoomChatChangedTestHandler(ChangeType.created);
    manager.addRoomChatChangedHandler(chatCreatedHandler);

    final String reason = "theReason";
    final XmppURI invitor = uri("friend@host/resource");
    final XmppURI roomURI = uri("room@room.service");
    manager.acceptRoomInvitation(new RoomInvitation(invitor, roomURI, reason));
    assertTrue(chatCreatedHandler.isCalledOnce());
    final RoomChat room = chatCreatedHandler.getLastChat();
    assertEquals("room@room.service/self", room.getURI().toString());
  }
View Full Code Here

Examples of com.calclab.emite.core.XmppURI

  public void shouldPreserveInvitationProperties() {
    final RoomChatChangedTestHandler chatCreatedHandler = new RoomChatChangedTestHandler(ChangeType.created);
    manager.addRoomChatChangedHandler(chatCreatedHandler);

    final String reason = "theReason";
    final XmppURI invitor = uri("friend@host/resource");
    final XmppURI roomURI = uri("room@room.service");
    final ChatProperties properties = new ChatProperties(roomURI);
    final String testDataKey = "TEST_KEY";
    final String testDataValue = "TEST_VALUE";
    properties.setData(testDataKey, testDataValue);
    manager.acceptRoomInvitation(new RoomInvitation(invitor, roomURI, reason, properties));
View Full Code Here

Examples of com.calclab.emite.core.XmppURI

    session.login(uri("user@local"), "anything");
  }

  @Test
  public void shouldApproveSubscriptionRequestsAndAddItemToTheRosterIfNotThere() {
    final XmppURI otherEntityJID = XmppURI.jid("other@domain");
    when(roster.getItemByJID(eq(otherEntityJID))).thenReturn(null);

    manager.approveSubscriptionRequest(otherEntityJID, "nick");
    verify(roster).requestAddItem(eq(otherEntityJID), eq("nick"));
    session.verifySent("<presence type='subscribed' to='other@domain' />");
View Full Code Here

Examples of com.calclab.emite.core.XmppURI

    setRosterItems(session, newItem("one@domain"), newItem("two@domain"));
    assertEquals(2, roster.getItems().size());
  }

  private RosterItem newItem(final String jid) {
    final XmppURI uri = XmppURI.uri(jid);
    return new RosterItem(uri, SubscriptionState.both, uri.getNode(), null);
  }
View Full Code Here

Examples of com.calclab.emite.core.XmppURI

    super("PLAIN", credentials);
  }

  @Override
  public final byte[] getInitialResponse() {
    final XmppURI uri = credentials.getURI();
    return (uri.toString() + Ascii.NUL + uri.getNode() + Ascii.NUL + credentials.getPassword()).getBytes();
  }
View Full Code Here

Examples of com.calclab.emite.core.XmppURI

public class XmppURITest {

  @Test
  public void checkUriEqualsNoResourceOtherWithoutNode() {
    final XmppURI uri = uri("test@localhost/resource1");
    final XmppURI uri2 = uri("localhost/resource2");
    assertFalse(uri.equalsNoResource(uri2));
  }
View Full Code Here

Examples of com.calclab.emite.core.XmppURI

    assertFalse(uri.equalsNoResource(uri2));
  }

  @Test
  public void checkUriEqualsNoResourceWithoutNode() {
    final XmppURI uri = uri("localhost/resource1");
    final XmppURI uri2 = uri("localhost/resource2");
    assertTrue(uri.equalsNoResource(uri2));
  }
View Full Code Here

Examples of com.calclab.emite.core.XmppURI

    assertTrue(uri.equalsNoResource(uri2));
  }

  @Test
  public void checkUriEqualsNoResourceWithoutNodeOtherWithNode() {
    final XmppURI uri = uri("localhost/resource1");
    final XmppURI uri2 = uri("test@localhost/resource2");
    assertFalse(uri.equalsNoResource(uri2));
  }
View Full Code Here

Examples of com.calclab.emite.core.XmppURI

    assertFalse(uri.equalsNoResource(uri2));
  }

  @Test
  public void checkUriEqualsNoResourceWithoutResource() {
    final XmppURI uri = uri("localhost");
    final XmppURI uri2 = uri("localhost");
    assertTrue(uri.equalsNoResource(uri2));
  }
View Full Code Here

Examples of com.calclab.emite.core.XmppURI

    assertTrue(uri.equalsNoResource(uri2));
  }

  @Test
  public void checkUriFormat() {
    final XmppURI uri = uri("xmpp:test@example/res");
    assertEquals("test", uri.getNode());
    assertEquals("example", uri.getHost());
    assertEquals("res", uri.getResource());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.