Package com.comcast.cns.model

Examples of com.comcast.cns.model.CNSMessage.checkIsValid()


   
      cnsMessage.setUserId(topic.getUserId());
      cnsMessage.setTopicArn(topicArn);
      cnsMessage.setMessageType(CNSMessageType.Notification);
     
      cnsMessage.checkIsValid();
     
      CNSTopicAttributes topicAttributes = CNSCache.getTopicAttributes(topicArn);
      List<String> receiptHandles = new ArrayList<String>();
     
      boolean success = true;
View Full Code Here


    msg.generateMessageId();
        msg.setTimestamp(new Date());
    msg.setUserId("test");

    try {
      msg.checkIsValid();
      fail("Should have thrown an invalid message exception");
    } catch(Exception e) {
    }

    msg.setMessage("test message");
View Full Code Here

    }

    msg.setMessage("test message");

    try {
      msg.checkIsValid();
      fail("Should have thrown and invalid message expection");
    } catch(Exception e) {
    }

    msg.setTopicArn("test-topic-arn");
View Full Code Here

    }

    msg.setTopicArn("test-topic-arn");
   
    try {
      msg.checkIsValid();           
    } catch (Exception e) {
      fail("Should NOT have thrown and invalid message expection: " + e.getMessage());
    }
   
    if (!msg.equals(msg)) {
View Full Code Here

    msg.setMessage("test message");

    msg.setMessageStructure(CNSMessageStructure.json);
   
    try {
      msg.checkIsValid();
      fail("Should have thrown expection since message is not JSON");
    } catch (Exception e) {
     
    }
View Full Code Here

    }

    msg.setMessage("{\"bogus\":\"val\"}");
   
    try {
      msg.checkIsValid();
      fail("Should have thrown expection since message is not JSON");
    } catch (Exception e) {
    }

    msg.setMessage("{\"email\"}:\"val\"}");
View Full Code Here

    }

    msg.setMessage("{\"email\"}:\"val\"}");

    try {
      msg.checkIsValid();
      fail("Should have thrown expection since message default is not specified");
    } catch (Exception e) {
    }

    msg.setMessage("{\"default\":\"send please\",\"email-json\":\"send in json\",\"email\":\"send in email\"}");
View Full Code Here

    }

    msg.setMessage("{\"default\":\"send please\",\"email-json\":\"send in json\",\"email\":\"send in email\"}");
   
    try {
      msg.checkIsValid();           
    } catch(Exception e){
      fail("Should NOT have thrown expection: " + e.getMessage());
    }
   
    log.info(msg);
View Full Code Here

    }
   
    msg.setSubject(sb.toString());
   
    try {
      msg.checkIsValid();
      fail("Should have thrown expection since message subject is too long");
    } catch(Exception e) {
    }
  }
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.