@Test
  public void testAccessToStyle() throws Exception {
    CatalogFilterAccessManager mgr = setupAccessManager();

    SecureCatalogImpl sc = new SecureCatalogImpl(catalog, mgr) {};
    assertEquals(2, sc.getStyles().size());

    WorkspaceInfo ws = sc.getWorkspaceByName("topp");
    LocalWorkspace.set(ws);
    assertEquals(2, sc.getStyles().size());
    LocalWorkspace.remove();

    ws = sc.getWorkspaceByName("nurc");
    LocalWorkspace.set(ws);
    assertEquals(1, sc.getStyles().size());
  }
  @Test
  public void testAccessToLayer() throws Exception {
    CatalogFilterAccessManager mgr = setupAccessManager();

    SecureCatalogImpl sc = new SecureCatalogImpl(catalog, mgr) {};
    assertNotNull(sc.getLayerByName("topp:states"));

    WorkspaceInfo ws = sc.getWorkspaceByName("nurc");
    LocalWorkspace.set(ws);
    assertNull(sc.getWorkspaceByName("topp"));
    assertNull(sc.getResourceByName("topp:states", ResourceInfo.class));
    assertNull(sc.getLayerByName("topp:states"));
  }
 @After
 public void tearDown() throws Exception {
   LocalWorkspace.remove();
 }