Package jetbrains.communicator.p2p

Examples of jetbrains.communicator.p2p.MockXmlMessage


    final String[] log = new String[]{""};
    log[0] = "";


    final String comment = "��� mes&&<>sage";
    MockXmlMessage message = new MockXmlMessage("tagName", "myNamespace") {
      @Override
      public boolean needsResponse() {
        return checkResponse;
      }
View Full Code Here


*/
public class P2PNetworkXmlMessageTest extends TestCase {
  public void testProcessResponse() throws Throwable {

    final boolean[] processed = new boolean[1];
    MockXmlMessage xmlMessage = new MockXmlMessage(){
      @Override
      public void processResponse(Element responseElement) {
        assertEquals("fee", responseElement.getName());
        processed[0] = true;
      }
    };
    xmlMessage.setShouldWaitForResponse(true);

    P2PNetworkXmlMessage p2PNetworkXmlMessage = new P2PNetworkXmlMessage("str", xmlMessage);

    p2PNetworkXmlMessage.setResponse("<fee/>");
    p2PNetworkXmlMessage.processResponse();

    assertTrue("Xml Response should be processed", processed[0]);

    processed[0] = false;
    xmlMessage.setShouldWaitForResponse(false);
    p2PNetworkXmlMessage.processResponse();

    assertFalse("Xml Response should not be processed", processed[0]);
  }
View Full Code Here

TOP

Related Classes of jetbrains.communicator.p2p.MockXmlMessage

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.