Examples of PDP


Examples of com.sun.xacml.PDP

        assertTrue(result.getStatus().getCode().iterator().next().equals(Status.STATUS_OK));
    }

    public void testDistance1() {

        PDP pdp = TestSupport.getPDP(TestSupport.getGeoXACMLFNFor("scalar", "DistancePolicy.xml"));

        RequestCtx request = null;
        try {
            request = RequestCtx.getInstance(new FileInputStream(TestSupport.getGeoXACMLFNFor(
                    "scalar", "DistanceRequest1.xml")));
        } catch (Exception e) {
            e.printStackTrace();
            Assert.fail(e.getMessage());
        }

        ResponseCtx response = pdp.evaluate(request);
        Result result = (Result) response.getResults().iterator().next();
        assertTrue(result.getDecision() == Result.DECISION_NOT_APPLICABLE);
        assertTrue(result.getStatus().getCode().iterator().next().equals(Status.STATUS_OK));
    }
View Full Code Here

Examples of org.jboss.security.xacml.jaxb.PDP

     */
    private JBossPDP createPDPForInterop() {
        final String policiesPath = getClass().getPackage().getName().replace('.', '/') + "/"
                + XACMLTestUtils.TESTOBJECTS_POLICIES;
        //create XML configuration for the JBossPDP (as a JAXBElement)
        PDP pdp = new PDP();
        final PoliciesType policies = new PoliciesType();
        final PolicySetType policySet = new PolicySetType();
        policySet.setLocation(policiesPath + "/xacml-policySet.xml");
        for (short i = 2; i <= 5; i++) {
            final PolicyType policy = new PolicyType();
            policy.setLocation(policiesPath + "/xacml-policy" + i + ".xml");
            policySet.getPolicy().add(policy);
        }
        policies.getPolicySet().add(policySet);
        pdp.setPolicies(policies);
        final LocatorType locator = new LocatorType();
        locator.setName(JBossPolicySetLocator.class.getName());
        final LocatorsType locators = new LocatorsType();
        locators.getLocator().add(locator);
        pdp.setLocators(locators);
        return new JBossPDP(new JAXBElement<PDP>(new QName("urn:jboss:xacml:2.0", "jbosspdp"), PDP.class, pdp));
    }
View Full Code Here

Examples of org.jboss.security.xacml.jaxb.PDP

        FileUtils.copyInputStreamToFile(
                getClass().getResourceAsStream(
                        XACMLTestUtils.TESTOBJECTS_POLICIES + "/" + XACMLTestUtils.MED_EXAMPLE_POLICY_SET2), policySetFile2);

        //create XML configuration for the PDP
        final PDP pdp = new PDP();
        final PoliciesType policies = new PoliciesType();
        final PolicySetType policySet = new PolicySetType();
        policySet.setLocation(policyDir.toURI().getPath());
        policies.getPolicySet().add(policySet);
        pdp.setPolicies(policies);
        final LocatorType locator = new LocatorType();
        locator.setName(JBossPolicySetLocator.class.getName());
        final LocatorsType locators = new LocatorsType();
        locators.getLocator().add(locator);
        pdp.setLocators(locators);

        return new JBossPDP(new JAXBElement<PDP>(new QName("urn:jboss:xacml:2.0", "jbosspdp"), PDP.class, pdp));
    }
View Full Code Here

Examples of org.jboss.security.xacml.jaxb.PDP

      u.setSchema(schema);

      URL configFile = tcl.getResource("test/config/basicPolicySetConfig.xml");
      JAXBElement<?> j = (JAXBElement<?>) u.unmarshal(configFile);
      assertNotNull("JAXBElement is !null", j);
      PDP pdp = (PDP) j.getValue();
      assertNotNull("PDP is not null", pdp);

      //Validate Policies
      PoliciesType pts = pdp.getPolicies();
      assertNotNull("PoliciesType is not null", pts);
      List<PolicySetType> pst = pts.getPolicySet();
      assertNotNull("PolicySetType is not null", pst);
      assertEquals("1 PolicySet", 1, pst.size());
      PolicySetType psetType = pst.get(0);
      String loc = psetType.getLocation();
      assertTrue("Location of PolicySet is >0", loc.length() > 0);
      assertEquals("PolicyType is null", 0, pts.getPolicy().size());

      //Validate Locators
      LocatorsType lts = pdp.getLocators();
      assertNotNull("LocatorsType != null", lts);
      List<LocatorType> lt = lts.getLocator();
      assertNotNull("LocatorType != null", lt);
      assertEquals("LocatorType != null", 1, lt.size());
   }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.PDP

      // use the default factories from the configuration
      store.useDefaultFactories();

      // get the PDP configuration's and setup the PDP
      pdp = new PDP(store.getDefaultPDPConfig());
   }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.PDP

      attributeModules.add(envAttributeModule);
      attributeModules.add(selectorAttributeModule);
      attributeFinder.setModules(attributeModules);

      // finally, initialize our pdp
      pdp = new PDP(new PDPConfig(attributeFinder, policyFinder, null));
   }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.PDP

      policyFinder.setModules(modules);
   }
  
   public void createInternalPDP()
   {
      pdp = new PDP(new PDPConfig(attributeFinder, policyFinder, null))
   }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.PDP

      // use the default factories from the configuration
      store.useDefaultFactories();

      // get the PDP configuration's and setup the PDP
      pdp = new PDP(store.getDefaultPDPConfig());
   }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.PDP

      attributeModules.add(envAttributeModule);
      attributeModules.add(selectorAttributeModule);
      attributeFinder.setModules(attributeModules);

      // finally, initialize our pdp
      pdp = new PDP(new PDPConfig(attributeFinder, policyFinder, null));
   }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.PDP

   {
      for (int i = firstTest; i <= numberOfTests; i++)
      {
         String[] policyFiles = new String[]
         {getPolicyFile(i)};
         PDP pdp = new PDP(new PDPConfig(XACMLUtil.getAttributeFinder(), XACMLUtil.getPolicyFinder(policyFiles), null));
         assertNotNull("PDP != null", pdp);
         ResponseCtx first = processRequest(pdp, getRequestFile(i));
         assertNotNull("Response != null", first);
         if(debug)
            System.out.println("Test:"+i);
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.