Package org.springmodules.xt.model.notification

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


        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));
View Full Code Here


        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));
View Full Code Here

        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));
View Full Code Here

    }
   
    private void setRules() {
        OfficeIdSpecification idSpecification = new OfficeIdSpecification();
        FullOfficeSpecification fullOfficeSpecification = new FullOfficeSpecification();
        Message wrongIdMessage = new MessageImpl(OfficeErrorCodes.WRONG_ID, Message.Type.ERROR, "officeId" ,"Wrong office id");
        Message fullOfficeMessage = new MessageImpl(OfficeErrorCodes.FULL, Message.Type.ERROR, "employees", "Too many employees");
       
        this.officeSpecification.compose(idSpecification).withMessage(wrongIdMessage, false)
                                           .andNot(fullOfficeSpecification).withMessage(fullOfficeMessage, true);
    }
View Full Code Here

TOP

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

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.