@Test public void testGetRestrictionAsString() throws RepositoryException { final JackrabbitAccessControlEntry ace = mock(JackrabbitAccessControlEntry.class); final AceWrapper wrapper = new AceWrapper(ace, "/content"); assertNull(wrapper.getRestrictionAsString(PrivilegeConstants.JCR_READ)); final Value val = mock(Value.class); when(val.getString()).thenReturn(null); when(ace.getRestriction(PrivilegeConstants.JCR_READ)).thenReturn(val); assertNull(wrapper.getRestrictionAsString(PrivilegeConstants.JCR_READ)); when(val.getString()).thenReturn(""); assertEquals("", wrapper.getRestrictionAsString(PrivilegeConstants.JCR_READ)); when(val.getString()).thenReturn("/jcr:*"); assertEquals("/jcr:*", wrapper.getRestrictionAsString(PrivilegeConstants.JCR_READ)); }
public String getRestrictionAsString(String name) throws RepositoryException { final Value val = this.ace.getRestriction(name); if (val != null) { return this.ace.getRestriction(name) .getString(); } return null; }
AceWrapper implements JackrabbitAccessControlEntry { public String getRestrictionAsString(String name) throws RepositoryException { final Value val = this.ace.getRestriction(name); if (val != null) { return this.ace.getRestriction(name) .getString(); } return null; } }
AceWrapper implements JackrabbitAccessControlEntry { public String getRestrictionAsString(String name) throws RepositoryException { final Value val = this.ace.getRestriction(name); if (val != null) { return this.ace.getRestriction(name) .getString(); } return null; } AceWrapper(JackrabbitAccessControlEntry ace, String jcrPath); }
AceWrapper implements JackrabbitAccessControlEntry { public String getRestrictionAsString(String name) throws RepositoryException { final Value val = this.ace.getRestriction(name); if (val != null) { return this.ace.getRestriction(name) .getString(); } return null; } AceWrapper(JackrabbitAccessControlEntry ace, String jcrPath); String getJcrPath(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); String getRestrictionAsString(String name); String getPrivilegesString(); @Override Principal getPrincipal(); @Override Privilege[] getPrivileges(); @Override boolean isAllow(); @Override String[] getRestrictionNames(); @Override Value getRestriction(String restrictionName); @Override Value[] getRestrictions(String restrictionName); }
AceWrapper implements JackrabbitAccessControlEntry { public String getRestrictionAsString(String name) throws RepositoryException { final Value val = this.ace.getRestriction(name); if (val != null) { return this.ace.getRestriction(name) .getString(); } return null; } AceWrapper(JackrabbitAccessControlEntry ace, String jcrPath); String getJcrPath(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); String getRestrictionAsString(String name); String getPrivilegesString(); @Override Principal getPrincipal(); @Override Privilege[] getPrivileges(); @Override boolean isAllow(); @Override String[] getRestrictionNames(); @Override Value getRestriction(String restrictionName); @Override Value[] getRestrictions(String restrictionName);  }