Examples of CMBPolicy


Examples of com.comcast.cmb.common.model.CMBPolicy

   
    @Test
    public void testCMBStatement() {
     
        try {
          CMBPolicy policy = new CMBPolicy();
 
          policy.addStatement(CMBPolicy.SERVICE.CQS, "unittest1", "Allow", Arrays.asList("1234567", "345678", "6789"), Arrays.asList("SendMessage", "GetQueueUrl"), "arn:cmb:cqs:ccp:331770435817:MyQueue123456789", null);
          policy.addStatement(CMBPolicy.SERVICE.CQS, "unittest2", "Allow", Arrays.asList("1234567"), Arrays.asList("DeleteMessage", "GetQueueUrl"), "arn:cmb:cqs:ccp:331770435817:MyQueue123456789", null);
          policy.addStatement(CMBPolicy.SERVICE.CQS, "unittest3", "Allow", Arrays.asList("1234567"), Arrays.asList("GetQueueUrl"), "arn:cmb:cqs:ccp:331770435817:MyQueue123456789", null);
          policy.addStatement(CMBPolicy.SERVICE.CQS, "unittest4", "Allow", Arrays.asList("1234567", "345678", "6789"), Arrays.asList("ReceiveMessage"), "arn:cmb:cqs:ccp:331770435817:MyQueue123456789", null);
         
          String policyStr = policy.toString();
         
          CMBPolicy policy2;
   
          policy2 = new CMBPolicy(policyStr);
      List<CMBStatement> stmtList = policy2.getStatements();

          assertTrue("Is there 4 permissions: ", stmtList.size() == 4);
          int i = 1;

          for (CMBStatement stmt : stmtList) {
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.