Package com.calclab.emite.xtesting.handlers

Examples of com.calclab.emite.xtesting.handlers.RoomSubjectChangedTestHandler


    assertEquals(message, handler.getLastMessage());
  }

  @Test
  public void shouldFireListenersWhenSubjectChange() {
    final RoomSubjectChangedTestHandler handler = new RoomSubjectChangedTestHandler();
    room.addRoomSubjectChangedHandler(handler);

    final XmppURI occupantURI = uri("someone@domain/res");
    final Message subject = new Message(null, uri("room@domain"), occupantURI);
    subject.setSubject("the subject");
    eventBus.fireEvent(new MessageReceivedEvent(subject));
    assertEquals(1, handler.getCalledTimes());

    assertEquals(occupantURI, handler.getLastEvent().getOccupantUri());
    assertEquals("the subject", handler.getLastEvent().getSubject());
  }
View Full Code Here


        + "' ><subject>Some subject</subject></message></body>");
  }

  @Test
  public void shouldHandleRoomSubjectChangeEvents() {
    final RoomSubjectChangedTestHandler handler = new RoomSubjectChangedTestHandler();
    room.addRoomSubjectChangedHandler(handler);
    final Message subject = new Message(null, roomUri, occupantUri);
    subject.setSubject("The subject");
    eventBus.fireEventFromSource(new MessageReceivedEvent(subject), room);
    assertEquals(1, handler.getCalledTimes());
    assertEquals("The subject", handler.getLastEvent().getSubject());
  }
View Full Code Here

TOP

Related Classes of com.calclab.emite.xtesting.handlers.RoomSubjectChangedTestHandler

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.