Package org.apache.jackrabbit.api.security.user

Examples of org.apache.jackrabbit.api.security.user.User.changePassword()


            throw new NotExecutableException();
        }

        User user = getTestUser(superuser);
        try {
            user.changePassword("pw");
            superuser.save();

            Session s = getHelper().getRepository().login(new SimpleCredentials(user.getID(), oldPw.toCharArray()));
            s.logout();
            fail("superuser pw has changed. login must fail.");
View Full Code Here


            s.logout();
            fail("superuser pw has changed. login must fail.");
        } catch (LoginException e) {
            // success
        } finally {
            user.changePassword(oldPw);
            superuser.save();
        }
    }

    @Test
View Full Code Here

        }

        User user = getTestUser(superuser);
        try {
            try {
                user.changePassword("pw", "wrongOldPw");
                superuser.save();
                fail("old password didn't match -> changePassword(String,String) should fail.");
            } catch (RepositoryException e) {
                // success.
            }
View Full Code Here

                fail("old password didn't match -> changePassword(String,String) should fail.");
            } catch (RepositoryException e) {
                // success.
            }

            user.changePassword("pw", oldPw);
            superuser.save();

            // make sure the user can login with the new pw
            Session s = getHelper().getRepository().login(new SimpleCredentials(user.getID(), "pw".toCharArray()));
            s.logout();
View Full Code Here

            // make sure the user can login with the new pw
            Session s = getHelper().getRepository().login(new SimpleCredentials(user.getID(), "pw".toCharArray()));
            s.logout();
        } finally {
            user.changePassword(oldPw);
            superuser.save();
        }
    }

    @Test
View Full Code Here

            throw new NotExecutableException();
        }

        User user = getTestUser(superuser);
        try {
            user.changePassword("pw", oldPw);
            superuser.save();

            Session s = getHelper().getRepository().login(new SimpleCredentials(user.getID(), oldPw.toCharArray()));
            s.logout();
            fail("superuser pw has changed. login must fail.");
View Full Code Here

            s.logout();
            fail("superuser pw has changed. login must fail.");
        } catch (LoginException e) {
            // success
        } finally {
            user.changePassword(oldPw);
            superuser.save();
        }
    }

    @Test
View Full Code Here

            setActions(action);

            String uid = getTestPrincipal().getName();
            u = impl.createUser(uid, buildPassword(uid));

            u.changePassword("pw1");
            assertEquals(1, action.called);

            u.changePassword("pw2", "pw1");
            assertEquals(2, action.called);
        } finally {
View Full Code Here

            u = impl.createUser(uid, buildPassword(uid));

            u.changePassword("pw1");
            assertEquals(1, action.called);

            u.changePassword("pw2", "pw1");
            assertEquals(2, action.called);
        } finally {
            if (u != null) {
                u.remove();
            }
View Full Code Here

            invalid.add("WITHOUTLOWERCASE");
            invalid.add("withoutuppercase");

            for (String pw : invalid) {
                try {
                    u.changePassword(pw);
                    fail("should throw constraint violation");
                } catch (ConstraintViolationException e) {
                    // success
                }
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.