Package com.calclab.emite.xtesting.matchers

Examples of com.calclab.emite.xtesting.matchers.IsPacketLike.matches()


  }

  public boolean hasSent(final XMLPacket packet) {
    final IsPacketLike matcher = new IsPacketLike(packet);
    for (final XMLPacket stanza : sent) {
      if (matcher.matches(stanza, System.out))
        return true;
    }
    return false;
  }
View Full Code Here


  private boolean contains(final HasXML expected, final List<? extends HasXML> list, final StringBuilder buffer) {
    boolean isContained = false;
    final IsPacketLike matcher = new IsPacketLike(expected);
    for (final HasXML packet : list) {
      buffer.append("[").append(packet.toString()).append("]");
      isContained = isContained ? isContained : matcher.matches(packet, System.out);
    }
    return isContained;
  }

}
View Full Code Here

    connection.setSettings(new ConnectionSettings("localhost"));
    connection.connect();
    assertEquals(1, services.requestSentCount());
    final IsPacketLike matcher = IsPacketLike.build("<body to='localhost' " + "content='text/xml; charset=utf-8' xmlns:xmpp='urn:xmpp:xbosh' "
        + " ack='1' hold='1' secure='true' xml:lang='en' " + "xmpp:version='1.0' wait='60' xmlns='http://jabber.org/protocol/httpbind' />");
    assertTrue(matcher.matches(services.getSentPacket(0), System.out));
  }
}
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.