Package com.peusoft.ptcollect.core.persistance.domain

Examples of com.peusoft.ptcollect.core.persistance.domain.User


    /**
     * Test method for {@link IConfigurationClientService#getUser()}.
     */
    @Test
    public void testGetUser() {
        User user = configSrv.getUser();
        assertNotNull("User is null.", user);
    }
View Full Code Here


    /**
     * Test method for {@link IConfigurationClientService#login(String, String, boolean)}.
     */
    @Test
    public void testLogin() {
        User user = configSrv.login("test", "testpwd", true);
        assertNotNull("User is null.", user);
    }
View Full Code Here

    @Test
    public final void persistChanges() {
        LOGGER.info("persistChanges startet");

        User user = configSrv.getUser();

        // create data
        List<AbstractDomainObject<?>> to_delete = new ArrayList<AbstractDomainObject<?>>();
        List<AbstractDomainObject<?>> objects = new ArrayList<AbstractDomainObject<?>>();
        Project p = new Project();
View Full Code Here

     */
    @Test
    public final void testLogInUser() {
        LOGGER.info("testLogInUser startet");

        User user = usrSrv.logInUser("test", "testpwd");
        assertNotNull("User is null.", user);

        try {
            usrSrv.logInUser("qretwert", "testpwd");
            fail("User should't already exist.");
View Full Code Here

     */
    @Test
    public final void testLogOutUser() {
        LOGGER.info("testLogOutUser startet");

        User user = usrSrv.logInUser("test", "testpwd");
        assertNotNull("User is null.", user);
        usrSrv.logOutUser(user.getUid());

        LOGGER.info("testLogOutUser finished");
    }
View Full Code Here

     */
    @Test
    public final void testChangePassword() throws Exception {
        LOGGER.info("testChangePassword startet");

        User user = UserServiceExampleData.getUser1();
        try {
            usrSrv.createUser(user);
            user = usrSrv.logInUser(user.getUid(), user.getPassword());
            assertNotNull("User is null.", user);
            usrSrv.changePassword(user, "pwd");
            user = usrSrv.logInUser(user.getUid(), user.getPassword());
            assertNotNull("User is null.", user);
            assertEquals("Wrong password.", "pwd", user.getPassword());
        } catch (Exception e) {
            throw e;
        } finally {
            usrSrv.dropUser(user);
        }
View Full Code Here

     */
    @Test
    public final void testCreateUser() throws Exception {
        LOGGER.info("testCreateUser startet");

        User user = UserServiceExampleData.getUser1();
        try {
            usrSrv.createUser(user);
            user = usrSrv.logInUser(user.getUid(), user.getPassword());
            assertNotNull("User is null.", user);

            try {
                usrSrv.createUser(user);
                fail("User must already exist.");
View Full Code Here

     */
    @Test
    public final void testDropUser() throws Exception {
        LOGGER.info("testDropUser startet");

        User user = UserServiceExampleData.getUser1();
        try {
            usrSrv.createUser(user);
            user = usrSrv.logInUser(user.getUid(), user.getPassword());
            assertNotNull("User is null.", user);

            try {
                usrSrv.createUser(user);
                fail("User must already exist.");
            } catch (PTExceptionWrongUser e) {
                // ok
            }

            usrSrv.dropUser(user);
            try {
                usrSrv.logInUser(user.getUid(), user.getPassword());
                fail("User schuldn't exist.");
            } catch (PTExceptionWrongUser e) {
                // ok
            }
            user = null;
View Full Code Here

     */
    @Test
    public final void testGetRegistratedUsers() {
        LOGGER.info("testGetRegistratedUsers startet");

        User user = UserServiceExampleData.getUser1();
        try {
            usrSrv.createUser(user);
            user = usrSrv.logInUser(user.getUid(), user.getPassword());
            assertNotNull("User is null.", user);

            Collection<User> users = usrSrv.getRegistratedUsers();
            assertEquals("Wrong number of users.", 2, users.size());

View Full Code Here

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("getting user for " + uid);
        }

        User user = null;
        user = userDao.findUser(uid);
        if (user != null) {

            // check password
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("checking password for user " + uid);
            }
            if (!user.getPassword().equals(password)) {
                if (LOGGER.isErrorEnabled()) {
                    LOGGER.error("password is not correct for user " + uid);
                }
                String msg = messageHelper.getErrorMessage(
                        ErrorCode.ERR_WRONG_USER_PASSWORD,
View Full Code Here

TOP

Related Classes of com.peusoft.ptcollect.core.persistance.domain.User

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.