Package com.comcast.cns.model

Examples of com.comcast.cns.model.CNSThrottlePolicy


              "\"cookie\":\"cookie\"" +
           "}";
    
     try {
       JSONObject json = new JSONObject(jsonStr);
       CNSThrottlePolicy tp = new CNSThrottlePolicy();
       assertTrue(tp.getMaxReceivesPerSecond() == null);
       //TODO test;
       tp.update(json);
       assertTrue(tp.getMaxReceivesPerSecond() == 5);
      
       json = new JSONObject(jsonStr2);
       tp.update(json);
       assertTrue(tp.getMaxReceivesPerSecond() == null);
      
       json = new JSONObject(jsonStr3);
       tp.update(json);
       assertTrue(tp.getMaxReceivesPerSecond() == null);
      
      
       json = new JSONObject(jsonStr4);
        boolean exceptionOccured = false;
        try {
          tp.update(json);
        } catch (Exception e) {
          if(e instanceof CNSModelConstructionException) {
            assertTrue(true);
            exceptionOccured = true;
            logger.debug(((CNSModelConstructionException) e).getErrormessage());
          } else {
            assertFalse(true);
          }
        }
        assertTrue(exceptionOccured);
        exceptionOccured = false;
       
      json = new JSONObject(jsonStr5);
        try {
           tp.update(json);
        } catch (Exception e) {
          if(e instanceof CNSModelConstructionException) {
            assertTrue(true);
            exceptionOccured = true;
            logger.debug(((CNSModelConstructionException) e).getErrormessage());
View Full Code Here

TOP

Related Classes of com.comcast.cns.model.CNSThrottlePolicy

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.