Package gabriel.components.io

Examples of gabriel.components.io.FileMethodStore


    // First we setup some components which manage access
    // checking for us. We use versions that use files
    // to store mappings
    AclStore aclStore = new FileAclStore();
    MethodStore methodStore = new FileMethodStore();

    AccessManager manager = new AccessManagerImpl(aclStore);
    MethodAccessManager methodAccessManager = new MethodAccessManagerImpl(manager, methodStore);

    // The we setup our aop to wrap objects
View Full Code Here


  protected void setUp() throws Exception {
    super.setUp();
  }

  public void testParsePermissionsAndMethods() {
    FileMethodStore store = new FileMethodStore();
    String source = "PM1 { M1 M2 \n" +
        "                  M3 }" +
        "            PM2 { M1 }";

    Map methodMap = store.parse(new StringReader(source));

    assertTrue("PM1 contains M1", ((Set) methodMap.get("M1")).contains(new Permission("PM1")));
    assertTrue("PM1 contains M2", ((Set) methodMap.get("M2")).contains(new Permission("PM1")));
    assertTrue("PM1 contains M3", ((Set) methodMap.get("M3")).contains(new Permission("PM1")));
    assertTrue("PM2 contains M1", ((Set) methodMap.get("M1")).contains(new Permission("PM2")));
View Full Code Here

    assertTrue("PM1 contains M3", ((Set) methodMap.get("M3")).contains(new Permission("PM1")));
    assertTrue("PM2 contains M1", ((Set) methodMap.get("M1")).contains(new Permission("PM2")));
  }

  public void testHandleEmptyMethodBlocks() {
    FileMethodStore store = new FileMethodStore();
    String source = "PM1 { } PM2 { M2 }";

    Map methodMap = store.parse(new StringReader(source));
    assertTrue("PM2 contains M2", ((Set) methodMap.get("M2")).contains(new Permission("PM2")));
}
View Full Code Here

TOP

Related Classes of gabriel.components.io.FileMethodStore

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.