Package org.springmodules.xt.model.notification

Examples of org.springmodules.xt.model.notification.NotificationImpl


       
        office1.setOfficeId("aaa");
        emp1.setMatriculationCode("1");
        office1.addEmployee(emp1);
       
        Notification notification = new NotificationImpl();
       
        assertFalse(this.compositeSpecification.compose(spec1).withMessage(new MessageImpl("wrong.office.id", Message.Type.ERROR, "Wrong Office Id"), false)
                                                                       .and(spec2).withMessage(new MessageImpl("office.unavailable", Message.Type.ERROR, "Office Not Available"), false)
                                                                       .evaluate(office1, notification));
                                                   
        assertTrue(notification.hasMessages(Message.Type.ERROR));
        assertFalse(notification.hasMessages(Message.Type.WARNING));
        assertFalse(notification.hasMessages(Message.Type.INFO));
        assertTrue(notification.getMessages(Message.Type.ERROR).length == 1);
        assertEquals("wrong.office.id", notification.getMessages(Message.Type.ERROR)[0].getCode());
        assertEquals("Wrong Office Id",notification.getMessages(Message.Type.ERROR)[0].getDefaultMessage());
    }
View Full Code Here


       
        office1.setOfficeId("aaa");
        emp1.setMatriculationCode("1");
        office1.addEmployee(emp1);
       
        Notification notification = new NotificationImpl();
       
        assertFalse(this.compositeSpecification.compose(spec1).withMessage(new MessageImpl("wrong.office.id", Message.Type.WARNING, "Wrong Office Id"), false)
                                                                       .and(spec2).withMessage(new MessageImpl("office.unavailable", Message.Type.WARNING, "Office Not Available"), false)
                                                                       .evaluate(office1, notification));
                                                   
        assertFalse(notification.hasMessages(Message.Type.ERROR));
        assertTrue(notification.hasMessages(Message.Type.WARNING));
        assertFalse(notification.hasMessages(Message.Type.INFO));
        assertTrue(notification.getMessages(Message.Type.WARNING).length == 1);
        assertEquals("wrong.office.id", notification.getMessages(Message.Type.WARNING)[0].getCode());
        assertEquals("Wrong Office Id", notification.getMessages(Message.Type.WARNING)[0].getDefaultMessage());
    }
View Full Code Here

       
        office1.setOfficeId("o1");
        emp1.setMatriculationCode("1");
        office1.addEmployee(emp1);
       
        Notification notification = new NotificationImpl();
       
        assertTrue(this.compositeSpecification.compose(spec1).withMessage(new MessageImpl("good.office.id", Message.Type.INFO, "Good Office Id"), true)
                                                                       .and(spec2).withMessage(new MessageImpl("office.available", Message.Type.INFO, "Office Available"), true)
                                                                       .evaluate(office1, notification));
                                                   
        assertFalse(notification.hasMessages(Message.Type.ERROR));
        assertFalse(notification.hasMessages(Message.Type.WARNING));
        assertTrue(notification.hasMessages(Message.Type.INFO));
        assertTrue(notification.getMessages(Message.Type.INFO).length == 2);
    }
View Full Code Here

        }
        return copy;
    }
   
    private void internalAddOffice(IOffice o) {
        Notification n = new NotificationImpl();
        if (this.officeSpecification.evaluate(o, n) == false) {
            BusinessException ex = DomainUtils.notificationErrorsToBusinessException(n);
            throw ex;
        }
        else {
View Full Code Here

TOP

Related Classes of org.springmodules.xt.model.notification.NotificationImpl

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.