Package org.apache.neethi

Examples of org.apache.neethi.PolicyComponent


            buf.append(" (");
            buf.append(pc);
            buf.append(")");
            nl(buf);
            if (pc instanceof PolicyContainingAssertion) {
                PolicyComponent nested = ((PolicyContainingAssertion)pc).getPolicy();
                level++;
                printPolicyComponent(nested, buf, level);
                level--;               
            }
        } else {
View Full Code Here


        data.setNumber(2);
        QName qn = new QName("http://cxf.apache.org/test/assertions/foo", "FooType");
        assertion.setName(qn);
        assertion.setData(data);
       
        PolicyComponent pc = new Policy();
        assertTrue(!assertion.equal(pc));
        pc = new All();
        assertTrue(!assertion.equal(pc));
        pc = new ExactlyOne();
        assertTrue(!assertion.equal(pc));
View Full Code Here

        JaxbAssertion<?> normalised = (JaxbAssertion<?>)assertion.normalize();
        assertTrue(normalised.equal(assertion));      
        assertSame(assertion.getData(), normalised.getData());
       
        assertion.setOptional(true);       
        PolicyComponent pc = assertion.normalize();
        assertEquals(Constants.TYPE_POLICY, pc.getType());
        Policy p = (Policy)pc;
        Iterator<List<Assertion>> alternatives = p.getAlternatives();

        int total = 0;
        for (int i = 0; i < 2; i++) {
View Full Code Here

      for (Iterator policyElements = attachmentElement
          .getChildrenWithName(new QName(
              DeploymentConstants.POLICY_NS_URI,
              DeploymentConstants.TAG_POLICY)); policyElements
          .hasNext();) {
        PolicyComponent policy = PolicyUtil
            .getPolicyFromOMElement((OMElement) policyElements
                .next());
        policyComponents.add(policy);
      }

      // process <wsp:PolicyReference> elements ..
      for (Iterator policyRefElements = attachmentElement
          .getChildrenWithName(new QName(
              DeploymentConstants.POLICY_NS_URI,
              DeploymentConstants.TAG_POLICY_REF)); policyRefElements
          .hasNext();) {
        PolicyComponent policyRef = PolicyUtil
            .getPolicyReferenceFromOMElement((OMElement) policyRefElements
                .next());
        policyComponents.add(policyRef);
      }
View Full Code Here

        if (arg1.size() != arg2.size()) {
            return false;
        }

        Iterator iterator = arg1.iterator();
        PolicyComponent assertion1;

        while (iterator.hasNext()) {
            assertion1 = (PolicyComponent) iterator.next();

            Iterator iterator2 = arg2.iterator();
            boolean match = false;
            PolicyComponent assertion2;

            while (iterator2.hasNext()) {
                assertion2 = (PolicyComponent) iterator2.next();
                if (compare(assertion1, assertion2)) {
                    match = true;
View Full Code Here

    public void testBuildNonNested() throws Exception {
        String resource = "resources/compact1.xml";
        InputStream is = NestedPrimitiveAssertionTest.class.getResourceAsStream(resource);
        Policy policy = builder.getPolicy(is);
        assertEquals(1, policy.getPolicyComponents().size());
        PolicyComponent pc = policy.getFirstPolicyComponent();
        assertTrue(pc instanceof NestedPrimitiveAssertion);
        NestedPrimitiveAssertion npc = (NestedPrimitiveAssertion)pc;
        assertEquals(TEST_NAME1, npc.getName());
        Policy nested = npc.getNested();
        assertTrue(nested.isEmpty());
View Full Code Here

    public void testBuildNested() throws Exception {
        String resource = "resources/compact3.xml";
        InputStream is = NestedPrimitiveAssertionTest.class.getResourceAsStream(resource);
        Policy policy = builder.getPolicy(is);
        assertEquals(1, policy.getPolicyComponents().size());
        PolicyComponent pc = policy.getFirstPolicyComponent();
        assertTrue(pc instanceof NestedPrimitiveAssertion);
        NestedPrimitiveAssertion npc = (NestedPrimitiveAssertion)pc;
        assertEquals(TEST_NAME1, npc.getName());
        Policy nested = npc.getNested();
        assertEquals(2, nested.getPolicyComponents().size());
View Full Code Here

    public void testBuildNonNested() throws Exception {
        String resource = "resources/compact1.xml";
        InputStream is = NestedPrimitiveAssertionTest.class.getResourceAsStream(resource);
        Policy policy = builder.getPolicy(is);
        assertEquals(1, policy.getPolicyComponents().size());
        PolicyComponent pc = policy.getFirstPolicyComponent();
        assertTrue(pc instanceof NestedPrimitiveAssertion);
        NestedPrimitiveAssertion npc = (NestedPrimitiveAssertion)pc;
        assertEquals(TEST_NAME1, npc.getName());
        Policy nested = npc.getNested();
        assertTrue(nested.isEmpty());
View Full Code Here

    public void testBuildNested() throws Exception {
        String resource = "resources/compact3.xml";
        InputStream is = NestedPrimitiveAssertionTest.class.getResourceAsStream(resource);
        Policy policy = builder.getPolicy(is);
        assertEquals(1, policy.getPolicyComponents().size());
        PolicyComponent pc = policy.getFirstPolicyComponent();
        assertTrue(pc instanceof NestedPrimitiveAssertion);
        NestedPrimitiveAssertion npc = (NestedPrimitiveAssertion)pc;
        assertEquals(TEST_NAME1, npc.getName());
        Policy nested = npc.getNested();
        assertEquals(2, nested.getPolicyComponents().size());
View Full Code Here

            for (Iterator policyElements = attachmentElement
                    .getChildrenWithName(new QName(
                            DeploymentConstants.POLICY_NS_URI,
                            DeploymentConstants.TAG_POLICY)); policyElements
                    .hasNext();) {
                PolicyComponent policy = PolicyUtil
                        .getPolicyFromOMElement((OMElement)policyElements
                                .next());
                policyComponents.add(policy);
            }

            // process <wsp:PolicyReference> elements ..
            for (Iterator policyRefElements = attachmentElement
                    .getChildrenWithName(new QName(
                            DeploymentConstants.POLICY_NS_URI,
                            DeploymentConstants.TAG_POLICY_REF)); policyRefElements
                    .hasNext();) {
                PolicyComponent policyRef = PolicyUtil
                        .getPolicyReferenceFromOMElement((OMElement)policyRefElements
                                .next());
                policyComponents.add(policyRef);
            }
View Full Code Here

TOP

Related Classes of org.apache.neethi.PolicyComponent

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.