Package org.apache.agila.services.user

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


public class NotificationServiceImplTestCase extends TestCase{

    private NotificationServiceImpl notificationService;

    public void testCreateNew() {
        Notification notification = notificationService.createNew( new UserID( 1 ), "Hello World" );
       
        assertNotNull( "Notification should not be null.", notification );
        assertEquals( "UserID should be 1.", new UserID( 1 ), notification.getUserID() );
        assertEquals( "Message should be Hello World", "Hello World", notification.getMessage() );
        assertEquals( "Notification should be inserted into notification queue.", 1, notificationService.getForUserID( new UserID( 1 ) ).size() );
    }
View Full Code Here


    }

    public void testGet() {
        populateNotification();

        List notifications = notificationService.getForUserID( new UserID( 1 ) );
        for( Iterator iterator = notifications.iterator(); iterator.hasNext(); ) {
            Notification notification = (Notification) iterator.next();

            assertNotNull( "Notification should not be null", notification );
        }
View Full Code Here

    }

    public void testGetForUserID() {
        populateNotification();
       
        List notification1 = notificationService.getForUserID( new UserID( 1 ) );
        List notification2 = notificationService.getForUserID( new UserID( 1 ) );
       
        assertEquals( "Multiple calls to notification should produce the same result. Given that no modifications are made.", notification1, notification2 );
    }
View Full Code Here

        NotificationServiceImpl nsi = new NotificationServiceImpl();

        /*
         *  make up a user id and see if something bad happens
         */
        List l = nsi.getForUserID(new UserID(1));

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

        nsi.get(new NotificationID(3));
View Full Code Here

        nsi.get(new NotificationID(3));
    }

    private void populateNotification() {
        for( int i = 0; i < 10; i++ ) {
            notificationService.createNew( new UserID( 1 ), "Hello World " + i );
        }
    }
View Full Code Here

    public void testEmpty() throws Exception {

        TaskServiceImpl tsi = new TaskServiceImpl();

        List l = tsi.getTasksForUser(new UserID(1), Task.TASK_ALL);

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

    }
View Full Code Here

public class UserServiceImplTestCase extends TestCase {

    private UserServiceImpl userService;

    public void testInternalAddUser() {
        UserID userID = userService.internalAddUser(
                new UserInfo( "Principal1", "Chris", "Chris", true));
        assertNotNull( "UserID should not be null", userID );
    }
View Full Code Here

                new UserInfo( "Principal1", "Chris", "Chris", true));
        assertNotNull( "UserID should not be null", userID );
    }

    public void testInternalSaveUser() {
        UserID userID = userService.internalAddUser(
                new UserInfo( "Principal2", "Chris", "Chris", true));

        UserInfo userInfoToSave = new UserInfo("Principal2", "Lim", "Lim", false);
        userInfoToSave.setUserID( userID );
        userService.internalSaveUser( userInfoToSave );
View Full Code Here

    }

    public void testInsertTask() {
        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

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

        task.setTaskID( new TaskID( 1 ) );
        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 ) );

        TaskID taskID = dao.insertTask( task );
        task.setTaskID( taskID );
        task.setUserID( new UserID( 2 ) );
        task.setTaskDescription( "Task Description 2" );
        task.setSourceTokenID( new TokenID( 2 ) );
        task.setTaskStatus( Task.TASK_COMPLETE );
        task.setInstanceID( new InstanceID( 2 ) );
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.