Package org.apache.agila.services.user

Examples of org.apache.agila.services.user.UserID


    }

    public void testGetTaskByID() {
        TaskImpl task = new TaskImpl();

        task.setUserID( new UserID( 1 ) );
        task.setTaskDescription( "Task Description" );
        task.setTaskExpirationDate( new Date() );
        task.setSourceTokenID( new TokenID( 1 ) );
        task.setTaskStatus( Task.TASK_INCOMPLETE );
        task.setInstanceID( new InstanceID( 1 ) );
View Full Code Here


        assertEquals( task.getTaskStatus(), retrievedTask.getTaskStatus() );
        assertEquals( task.getInstanceID(), retrievedTask.getInstanceID() );
    }

    public void testGetTasksForUser() {
        List tasks = dao.getTasksForUser( new UserID( 1 ), Task.TASK_INCOMPLETE );
        assertNotNull( "Tasks should not be null", tasks );
        assertTrue( tasks.size() > 0 );
    }
View Full Code Here

        task.setInstanceID( new InstanceID( 1 ) );

        TaskID taskID = dao.insertTask( task );


        boolean answer = dao.lockTaskForUser(taskID, new UserID(1));
        assertTrue("Managed to lock task", answer);

        answer = dao.lockTaskForUser(taskID, new UserID(2));
        assertTrue("Should not be able to lock task", !answer);

        dao.unlockTaskForUser(taskID, new UserID(1));

        answer = dao.lockTaskForUser(taskID, new UserID(2));
        assertTrue("Managed to lock task", answer);
    }
View Full Code Here

        userInfo.setUserName( "James" );
        userInfo.setUserPassword( "Gosling" );
        userInfo.setUserPrincipal( "User Principal" );
        userInfo.setAdmin( true );

        UserID userID = dao.addUser( userInfo );

        assertNotNull( "UserID should not be null", userID );
    }
View Full Code Here

        userInfo.setUserName( "James" );
        userInfo.setUserPassword( "Gosling" );
        userInfo.setUserPrincipal( "User Principal" );
        userInfo.setAdmin( true );

        UserID userID = dao.addUser( userInfo );

        userInfo = dao.getUserInfo( userID );
        assertNotNull( userInfo );
    }
View Full Code Here

        userInfo.setUserName( "James" );
        userInfo.setUserPassword( "Gosling" );
        userInfo.setUserPrincipal( "User Principal" );
        userInfo.setAdmin( true );

        UserID userID = dao.addUser( userInfo );

        UserInfo userFromPrincipal = dao.getUserFromPrincipal( "User Principal" );
        assertNotNull( "UserInfo should not be null", userFromPrincipal );
    }
View Full Code Here

            userInfo.setUserName( "James" );
            userInfo.setUserPassword( "Gosling" );
            userInfo.setUserPrincipal( "User Principal" );
            userInfo.setAdmin( true );

            UserID userID = dao.addUser( userInfo );
        }

        List allUsers = dao.listAllUserInfo();
        assertNotNull( "List of users should not be null", allUsers );
        assertTrue( "List of users should be greater or equal to 10", allUsers.size() >= 10 );
View Full Code Here

        userInfo.setUserName( "James" );
        userInfo.setUserPassword( "Gosling" );
        userInfo.setUserPrincipal( "User Principal" );
        userInfo.setAdmin( true );

        UserID userID = dao.addUser( userInfo );

        // Modify the user info then update db
        userInfo.setUserID( userID );
        userInfo.setUserPassword( "Arnold" );
        userInfo.setUserPrincipal( "Scott McNealy" );
View Full Code Here

    public void testSimple() throws Exception {

        NotificationServiceImpl nsi = new NotificationServiceImpl();

        NotificationID id = nsi.notify(new UserID(1), "test message");

        assertTrue(id != null);
        assertTrue(id.getID() == 1);

        Notification impl =  nsi.getNotification(id);

        assertTrue(impl != null);
        assertTrue(impl instanceof NotificationImpl);
        assertTrue(impl.getMessage().equals("test message"));
        assertTrue(impl.getUserID().equals(new UserID(1)));
        assertTrue(impl.getStatus() == Notification.STATUS_ACTIVE);

        List l = nsi.getNotificationsForUser(new UserID(1));

        assertTrue(l != null);
        assertTrue(l.size() == 1);

    }
View Full Code Here

        } catch (InterruptedException e) {
            e.printStackTrace();
            fail( e.getMessage() );
        }

        List taskList = taskService.getTasksForUser( new UserID( 1 ), Task.TASK_ALL );

        assertNotNull( "There are no tasks to process", taskList );

        for( Iterator iterator = taskList.iterator(); iterator.hasNext(); ) {
            Task task = (Task)iterator.next();
            taskService.setTaskStatus( task.getTaskID(), Task.TASK_COMPLETE );
        }
       
        List taskListAfterUpdate = taskService.getTasksForUser( new UserID( 1 ), Task.TASK_COMPLETE );

        assertEquals( "Updating of task status should not create another task", taskList.size(), taskListAfterUpdate.size() );
       
        for( int i = 0; i < taskList.size(); i++ ) {
            TaskID taskID1 = ((Task)taskList.get( i )).getTaskID();
View Full Code Here

TOP

Related Classes of org.apache.agila.services.user.UserID

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.