Examples of AsciidocMessage


Examples of com.mgreau.wwsmad.websocket.messages.AsciidocMessage

    public void destroy() { }
   
    /* Create a new Message object if the message can be decoded */
    @Override
    public AsciidocMessage decode(String string) throws DecodeException {
        AsciidocMessage msg = null;
        if (willDecode(string)) {
           msg = new AsciidocMessage(messageMap.get("writer"), messageMap.get("source"));
           if (messageMap.get("part") != null)
             msg.setPart(messageMap.get("part"));
            switch (messageMap.get("type")) {
                case "adoc-for-html5":
                    msg.setAction("backendHtml5");
                break;
                case "adoc-for-pdf":
                    msg.setAction("backendPDF");
                break;
                case "adoc-for-dzslides":
                    msg.setAction("backendDzSlides");
                break;
                case "adoc-for-diff":
                    msg.setAdocSourceToMerge(messageMap.get("sourceToMerge"));
                    msg.setAction("diff");
                break;
                case "adoc-for-patch":
                    msg.setPatchToApply(messageMap.get("patch"));
                    msg.setAction("patch");
                break;
            }
        } else {
          logger.severe(string);
            throw new DecodeException(string, "[Message] Can't decode.");
View Full Code Here

Examples of com.mgreau.wwsmad.websocket.messages.AsciidocMessage

  @Test
  public void shouldNotDecodeJSONMessage() {
    assertNotNull(msgDecoder);

    final String JSON = "{\"type\" : \"aadoc\", \"sourrrce\" : \"texttest\", \"writer\": \"max\"}";
    AsciidocMessage adoc = null;

    try {
      adoc = msgDecoder.decode(JSON);
    } catch (Exception e) {
      assertEquals("[Message] Can't decode.", e.getMessage());
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.