Package com.sparc.knappsack.components.entities

Examples of com.sparc.knappsack.components.entities.SystemNotification


        futureDate.add(Calendar.DATE, 1);

        Calendar anotherFutureDate = Calendar.getInstance();
        anotherFutureDate.add(Calendar.DATE, 4);

        SystemNotification systemNotification1 = createSystemNotification(true, new Date(), futureDate.getTime(), "test message", SystemNotificationType.MAINTENANCE, SystemNotificationSeverity.INFO);
        SystemNotification systemNotification2 = createSystemNotification(true, futureDate.getTime(), anotherFutureDate.getTime(), "test message", SystemNotificationType.MAINTENANCE, SystemNotificationSeverity.INFO);

        List<SystemNotificationModel> models = systemNotificationService.getAllModels(true);
        assertNotNull(models);
        assertEquals(models.size(), 1);
        assertEquals(models.get(0).getId(), systemNotification1.getId());
View Full Code Here


        futureDate.add(Calendar.DATE, 1);

        Calendar anotherFutureDate = Calendar.getInstance();
        anotherFutureDate.add(Calendar.DATE, 4);

        SystemNotification systemNotification1 = createSystemNotification(true, new Date(), futureDate.getTime(), "test message", SystemNotificationType.MAINTENANCE, SystemNotificationSeverity.INFO);
        SystemNotification systemNotification2 = createSystemNotification(true, futureDate.getTime(), anotherFutureDate.getTime(), "test message", SystemNotificationType.MAINTENANCE, SystemNotificationSeverity.INFO);

        List<SystemNotificationModel> models = systemNotificationService.getAllForTypes(false, SystemNotificationType.MAINTENANCE);
        assertNotNull(models);
        assertEquals(models.size(), 2);
        for (SystemNotificationModel model : models) {
View Full Code Here

        Calendar twentyDaysFuture = Calendar.getInstance();
        twentyDaysFuture.setTime(now);
        twentyDaysFuture.add(Calendar.DATE, 20);

        SystemNotification systemNotification1 = createSystemNotification(true, now, tenDaysFuture.getTime(), "test message", SystemNotificationType.MAINTENANCE, SystemNotificationSeverity.INFO);
        SystemNotification systemNotification2 = createSystemNotification(true, fifteenDaysFuture.getTime(), twentyDaysFuture.getTime(), "test message", SystemNotificationType.MAINTENANCE, SystemNotificationSeverity.INFO);

        List<SystemNotificationModel> models = systemNotificationService.getAllForTypes(true, SystemNotificationType.MAINTENANCE);
        assertNotNull(models);
        assertEquals(models.size(), 1);
        assertEquals(models.get(0).getId(), systemNotification1.getId());
View Full Code Here

        assertEquals(models.get(0).getId(), systemNotification1.getId());
        assertEquals(models.get(0).getNotificationType(), systemNotification1.getNotificationType());
    }

    private SystemNotification createSystemNotification(boolean allPages, Date startDate, Date endDate, String message, SystemNotificationType notificationType, SystemNotificationSeverity notificationSeverity) {
        SystemNotification systemNotification = new SystemNotification();
        systemNotification.setAllPages(allPages);
        systemNotification.setStartDate(startDate);
        systemNotification.setEndDate(endDate);
        systemNotification.setMessage(message);
        systemNotification.setNotificationType(notificationType);
        systemNotification.setNotificationSeverity(notificationSeverity);

        systemNotificationService.add(systemNotification);
        assertNotNull(systemNotification.getId());
        assertTrue(systemNotificationService.doesEntityExist(systemNotification.getId()));

        return systemNotification;
    }
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.components.entities.SystemNotification

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.