Examples of Office


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

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

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

    public void testEvaluate() {
        AvailableOfficeSpecification spec = new AvailableOfficeSpecification();
        CompositeSpecification<BaseSpecification, IOffice> composite = new CompositeSpecificationImpl<BaseSpecification, IOffice>(BaseSpecification.class, "isSatisfiedBy");
        PredicateCompositeAdapter adapter = new PredicateCompositeAdapter(composite);
       
        IOffice office1 = new Office();
        IEmployee emp1 = new Employee();
       
        office1.setOfficeId("o1");
        emp1.setMatriculationCode("1");
        office1.addEmployee(emp1);
       
        composite.compose(spec);
        assertTrue(composite.evaluate(office1));
        assertTrue(adapter.evaluate(office1));
    }
View Full Code Here

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

     */
    public void testEvaluate() {
        AvailableOfficeSpecification spec = new AvailableOfficeSpecification();
        PredicateGenericAdapter adapter = new PredicateGenericAdapter(spec, "isSatisfiedBy");
       
        IOffice office1 = new Office();
        IEmployee emp1 = new Employee();
       
        office1.setOfficeId("o1");
        emp1.setMatriculationCode("1");
        office1.addEmployee(emp1);
       
        assertTrue(spec.isSatisfiedBy(office1));
        assertTrue(adapter.evaluate(office1));
    }
View Full Code Here

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

   
    private void internalTestModifyAndIterate(IntroductorSet introductor) {
        int n = 0;
        for (Iterator it = introductor.iterator(); it.hasNext();) {
            EmployeeView v = (EmployeeView) it.next();
            Office o = new Office();
            o.setOfficeId("" + ++n);
            v.setOffice(o);
        }
       
        n = 0;
        for (Iterator it = introductor.iterator(); it.hasNext();) {
View Full Code Here

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

   
    private void internalTestModifyAndIterate(IntroductorCollection introductor) {
        int n = 0;
        for (Iterator it = introductor.iterator(); it.hasNext();) {
            EmployeeView v = (EmployeeView) it.next();
            Office o = new Office();
            o.setOfficeId("" + ++n);
            v.setOffice(o);
        }
       
        n = 0;
        for (Iterator it = introductor.iterator(); it.hasNext();) {
View Full Code Here

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

    /**
     * Test of single specification composition.
     */
    public void testCompose() {
        OfficeIdSpecification spec = new OfficeIdSpecification();
        IOffice office1 = new Office();
       
        office1.setOfficeId("o1");
        assertTrue(this.compositeSpecification.compose(spec).evaluate(office1));
       
        office1.setOfficeId("aaa");
        assertFalse(this.compositeSpecification.compose(spec).evaluate(office1));
    }
View Full Code Here

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

    public void testAnd() {
        OfficeIdSpecification spec1 = new OfficeIdSpecification();
        AvailableOfficeSpecification spec2 = new AvailableOfficeSpecification();
        FullOfficeSpecification spec3 = new FullOfficeSpecification();
       
        IOffice office1 = new Office();
        IEmployee emp1 = new Employee();
       
        office1.setOfficeId("o1");
        emp1.setMatriculationCode("1");
        office1.addEmployee(emp1);
       
        assertTrue(this.compositeSpecification.compose(spec1).and(spec2).andNot(spec3).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 testOr() {
        FullOfficeSpecification spec1 = new FullOfficeSpecification();
        AvailableOfficeSpecification spec2 = new AvailableOfficeSpecification();
       
        IOffice office1 = new Office();
        IEmployee emp1 = new Employee();
       
        office1.setOfficeId("o1");
        emp1.setMatriculationCode("1");
        office1.addEmployee(emp1);
       
        assertTrue(this.compositeSpecification.compose(spec1).or(spec2).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 testAndNot() {
        OfficeIdSpecification spec1 = new OfficeIdSpecification();
        FullOfficeSpecification spec2 = new FullOfficeSpecification();
        AvailableOfficeSpecification spec3 = new AvailableOfficeSpecification();
       
        IOffice office1 = new Office();
        IEmployee emp1 = new Employee();
       
        office1.setOfficeId("o1");
        emp1.setMatriculationCode("1");
        office1.addEmployee(emp1);
       
        assertTrue(this.compositeSpecification.compose(spec1).andNot(spec2).and(spec3).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

   
    private void internalTestModifyAndIterate(IntroductorCollection introductor) {
        int n = 0;
        for (Iterator it = introductor.iterator(); it.hasNext();) {
            EmployeeView v = (EmployeeView) it.next();
            Office o = new Office();
            o.setOfficeId("" + ++n);
            v.setOffice(o);
        }
       
        n = 0;
        for (Iterator it = introductor.iterator(); it.hasNext();) {
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.