Examples of Office


Examples of org.springmodules.xt.test.domain.Office

     * Test of "or not" logical operator.
     */
    public void testOrNot() {
        FullOfficeSpecification spec1 = new FullOfficeSpecification();
       
        IOffice office1 = new Office();
        IEmployee emp1 = new Employee();
       
        office1.setOfficeId("o1");
        emp1.setMatriculationCode("1");
        office1.addEmployee(emp1);
       
        assertTrue(this.compositeSpecification.compose(spec1).orNot(spec1).evaluate(office1));
       
        // Test also composition with another CompositeSpecificationImpl ...
        CompositeSpecificationImpl<BaseSpecification, IOffice> composite2 = new CompositeSpecificationImpl<BaseSpecification, IOffice>(BaseSpecification.class, "isSatisfiedBy");
View Full Code Here

Examples of org.springmodules.xt.test.domain.Office

     */
    public void testWithErrorMessage() {
        OfficeIdSpecification spec1 = new OfficeIdSpecification();
        AvailableOfficeSpecification spec2 = new AvailableOfficeSpecification();
       
        IOffice office1 = new Office();
        IEmployee emp1 = new Employee();
       
        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)
View Full Code Here

Examples of org.springmodules.xt.test.domain.Office

     */
    public void testWithWarningMessage() {
        OfficeIdSpecification spec1 = new OfficeIdSpecification();
        AvailableOfficeSpecification spec2 = new AvailableOfficeSpecification();
       
        IOffice office1 = new Office();
        IEmployee emp1 = new Employee();
       
        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)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.