Package org.apache.wookie.proxy

Examples of org.apache.wookie.proxy.Policy


    Policy policy = new Policy("* nohost: ALLOW");
  }

  @Test(expected = PolicyFormatException.class)
  public void createPolicyFromInvalidUriString3() throws PolicyFormatException{
    Policy policy = new Policy("* test:test@http://x.y.z ALLOW");
  }
View Full Code Here


    Policy policy = new Policy("* test:test@http://x.y.z ALLOW");
  }

  @Test(expected = PolicyFormatException.class)
  public void createPolicyFromInvalidUriString4() throws PolicyFormatException{
    Policy policy = new Policy("* http://test@www.apache.org ALLOW");
  }
View Full Code Here

    Policy policy = new Policy("* http://test@www.apache.org ALLOW");
  }
  @Test
  public void checkInvalid() throws URISyntaxException{
    Policy policy = new Policy();
    assertEquals(0,policy.allows(new URI("http://test.apache.org")))
  }
View Full Code Here

    assertEquals(0,policy.allows(new URI("http://test.apache.org")))
  }

  @Test
  public void checkInvalid2() throws URISyntaxException, PolicyFormatException{
    Policy policy = new Policy("* http://test.apache.org ALLOW");
    assertEquals(0,policy.allows(new URI("ftp://test.apache.org")))
  }
View Full Code Here

    assertEquals(0,policy.allows(new URI("ftp://test.apache.org")))
  }
 
  @Test
  public void equalsTest() throws PolicyFormatException{
    Policy policy = new Policy("* http://test.apache.org ALLOW");
    Policy policy2 = new Policy("* http://test.apache.org ALLOW");
    assertEquals(policy,policy2);
    assertTrue(policy.equals(policy2));
   
  }
View Full Code Here

   
  }

  @Test
  public void unequalTest() throws PolicyFormatException{
    Policy policy = new Policy("* http://test.apache.org ALLOW");
    Object policy2 = new String("* http://test.apache.org ALLOW");
    assertFalse(policy.equals(policy2));
  }
View Full Code Here

      //
      // Create access policies for each access request in the widget model
      //
      for(IAccess access:model.getAccessList()){
        Policy policy = new Policy();
        policy.setOrigin(access.getOrigin());
        policy.setScope(widget.getIdentifier());
        policy.setDirective("DENY");
        if (grantAccessRequests){
          policy.setDirective("ALLOW");
          _logger.info("access policy granted for "+widget.getLocalName("en")+" to access "+policy.getOrigin());
        }
        Policies.getInstance().addPolicy(policy);
      }
    } catch (ConfigurationException e) {
      _logger.error("problem with policies configuration", e);
View Full Code Here

    try {

      //
      // Obtain a policy from the resource identifier
      //
      Policy policy;
      policy = new Policy(resourceId);
     
      //
      // Policy doesn't exist so return 404
      //
      if (!Policies.getInstance().exists(policy)){
View Full Code Here

public class PolicyTest {
 
 
  @Test
  public void createPolicy() throws PolicyFormatException{
    Policy policy = new Policy();
    policy.setScope("*");
    policy.setOrigin("*");
    policy.setDirective("ALLOW");
  }
View Full Code Here

    policy.setDirective("ALLOW");
  }
 
  @Test
  public void createPolicyFromString() throws PolicyFormatException{
    Policy policy = new Policy("* http://localhost ALLOW");
  }
View Full Code Here

TOP

Related Classes of org.apache.wookie.proxy.Policy

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.