Refine search
@Test public void changeUUID() throws Exception { try { Tree userTree = root.getTree(userPath); userTree.setProperty(JcrConstants.JCR_UUID, UUID.randomUUID().toString()); root.commit(); fail("changing jcr:uuid should fail if it the uuid valid is invalid"); } catch (CommitFailedException e) { // expected } finally { root.refresh(); } }
@Test public void testGetProperties() throws Exception { setupPermission("/a", testPrincipal, false, PrivilegeConstants.REP_READ_PROPERTIES); testRoot.refresh(); Tree a = testRoot.getTree("/a"); Iterable<? extends PropertyState> props = a.getProperties(); assertFalse(props.iterator().hasNext()); } }
@Test public void changeAuthorizableId() throws Exception { try { Tree userTree = root.getTree(userPath); userTree.setProperty(REP_AUTHORIZABLE_ID, "modified"); root.commit(); fail("changing the authorizable id should fail"); } catch (CommitFailedException e) { // expected } finally { root.refresh(); } }
@Test public void testIdConflict() throws RepositoryException, CommitFailedException { // EXERCISE: fix this test without changing the ID-parameter of the 2 create-calls. User conflictUser = getUserManager(root).createUser(testUser.getID(), null); root.refresh(); Group conflictGroup = getUserManager(root).createGroup(testUser.getID()); root.refresh(); }
@Test public void changePrincipalName() throws Exception { try { Tree userTree = root.getTree(userPath); userTree.setProperty(REP_PRINCIPAL_NAME, "another"); root.commit(); fail("changing the principal name should fail"); } catch (CommitFailedException e) { // expected } finally { root.refresh(); } }
@Test public void changePasswordToPlainText() throws Exception { try { Tree userTree = root.getTree(userPath); userTree.setProperty(REP_PASSWORD, "plaintext"); root.commit(); fail("storing a plaintext password should fail"); } catch (CommitFailedException e) { // expected } finally { root.refresh(); } }