Package com.calclab.emite.xtesting.handlers

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


    manager = new PrivateStorageManagerImpl(session);
  }

  @Test
  public void shouldStore() {
    final PrivateStorageResponseTestHandler handler = new PrivateStorageResponseTestHandler();
    manager.store(XMLBuilder.fromXML(data), handler);
    session.verifyIQSent(storeData);
    session.answerSuccess(new IQ(XMLBuilder.fromXML(storeResponse)));
    assertTrue("handler called " + handler.getCalledTimes() + " times", handler.isCalledOnce());
  }
View Full Code Here


    assertTrue("handler called " + handler.getCalledTimes() + " times", handler.isCalledOnce());
  }

  @Test
  public void shoulGet() {
    final PrivateStorageResponseTestHandler handler = new PrivateStorageResponseTestHandler();
    manager.retrieve(XMLBuilder.create("exodus", "exodus:prefs"), handler);
    session.verifyIQSent(retriveData);
    session.answerSuccess(new IQ(XMLBuilder.fromXML(retrieveResponse)));
    assertTrue(handler.isCalledOnce());
    assertEquals("Hamlet", handler.getLastEvent().getResponseIQ().getChild("query", "jabber:iq:private").getFirstChild("exodus").getChildText("defaultnick"));
  }
View Full Code Here

TOP

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

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.