Package com.twitter.hbc.twitter4j.message

Examples of com.twitter.hbc.twitter4j.message.DisconnectMessage


  @Test
  public void testParseDisconnectMessage() throws JSONException {
    JSONObject json = new JSONObject(disconnectMessage);
    assertFalse(JSONObjectParser.hasSitestreamUser(json));
    assertFalse(JSONObjectParser.hasSitestreamMessage(json));
    DisconnectMessage message = JSONObjectParser.parseDisconnectMessage(json);
    assertEquals(message.getDisconnectCode(), 5);
    assertEquals(message.getStreamName(), "somestreamname123");
    assertEquals(message.getDisconnectReason(), "reason for disconnection");
  }
View Full Code Here


  public static DisconnectMessage parseDisconnectMessage(JSONObject message) throws JSONException {
    JSONObject json = message.getJSONObject("disconnect");
    int code = json.getInt("code");
    String streamName = json.getString("stream_name");
    String reason = json.getString("reason");
    return new DisconnectMessage(code, streamName, reason);
  }
View Full Code Here

TOP

Related Classes of com.twitter.hbc.twitter4j.message.DisconnectMessage

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.