Examples of RequestCtx


Examples of org.jboss.security.xacml.sunxacml.ctx.RequestCtx

      actionSet.add(actionAttr);

      //Create the environment set
      Set environSet = new HashSet();

      RequestCtx request = new RequestCtx(subjectSet, resourceSet, actionSet, environSet);
      assertNotNull("XACML Request != null", request);

      //Log the request for viewing
      if (DEBUG)
         XACMLUtil.logRequest(request);

      //Test the request contents
      Set subjects = request.getSubjects();
      assertTrue("We have one subject?", subjects.size() == 1);
      Subject subj = (Subject) (subjects.iterator().next());
      assertNotNull("Subject != null", subj);
      assertEquals("Attributes in subject match", subjectAttr, (Attribute) (subj.getAttributes().iterator().next()));

      //Test the resource attributes
      Set resources = request.getResource();
      assertTrue("# of resources = 1", resources.size() == 1);
      assertEquals("Attributes in resources match", resourceAttr, (Attribute) (resources.iterator().next()));

      //Test the action attributes
      Set actions = request.getAction();
      assertTrue("# of actions = 1", actions.size() == 1);
      assertEquals("Attributes in actions match", actionAttr, (Attribute) (actions.iterator().next()));
   }
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.