Package org.apache.agila.services.notification

Examples of org.apache.agila.services.notification.Notification


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

        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

TOP

Related Classes of org.apache.agila.services.notification.Notification

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.