Package org.springmodules.xt.test.domain

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


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


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

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

        super(testName);
    }
   
    protected void setUp() throws Exception {
        target = new LinkedList();
        Employee emp1 = new Employee();
        Employee emp2 = new Employee();
       
        emp1.setMatriculationCode("1");
        emp2.setMatriculationCode("2");
       
        target.add(emp1);
        target.add(emp2);
    }
View Full Code Here

   
    private void internalTestAddAndRemove(IntroductorList introductor) {
        assertEquals(2, target.size());
        assertEquals(2, introductor.size());
       
        Employee emp3 = new Employee();
        emp3.setMatriculationCode("3");
       
        // Add and remove from introductor ....
       
        introductor.add(emp3);
       
View Full Code Here

    }
   
    private void internalTestAddRemoveAndGet(IntroductorList introductor) {
        // Add a new employee:
       
        Employee emp3 = new Employee();
        emp3.setMatriculationCode("3");
       
        introductor.add(emp3);
       
        assertEquals(3, introductor.size());
        // Test that the new employee is equal to the added employee using matriculation codes ...
        assertTrue(emp3.getMatriculationCode().equals(((EmployeeView) introductor.get(2)).getMatriculationCode()));
        // Because testing using equals() would fail, due to how Spring AOP works when intercepting the equals() method:
        assertFalse(introductor.get(2).equals(emp3));
        // However, PLEASE NOTE that the two objects are actually equals!
       
        // Remove the employee previously added:
       
        introductor.remove(2);
       
        assertEquals(introductor.size(), 2);
       
        // Add again a new employee:
       
        Employee emp33 = new Employee();
        emp33.setMatriculationCode("33");
       
        introductor.add(emp33);
       
        assertEquals(3, introductor.size());
        // Test that the new employee is equal to the added employee using matriculation codes ...
        assertTrue(emp33.getMatriculationCode().equals(((EmployeeView) introductor.get(2)).getMatriculationCode()));
        // Because testing using equals() would fail, due to how Spring AOP works when intercepting the equals() method:
        assertFalse(introductor.get(2).equals(emp3));
        // However, PLEASE NOTE that the two objects are actually equals!
    }
View Full Code Here

        super(testName);
    }
   
    protected void setUp() throws Exception {
        target = new LinkedList();
        Employee emp1 = new Employee();
        Employee emp2 = new Employee();
       
        emp1.setMatriculationCode("1");
        emp2.setMatriculationCode("2");
       
        target.add(emp1);
        target.add(emp2);
    }
View Full Code Here

   
    private void internalTestAddAndRemove(IntroductorCollection introductor) {
        assertEquals(2, target.size());
        assertEquals(2, introductor.size());
       
        Employee emp3 = new Employee();
        emp3.setMatriculationCode("3");
       
        // Add and remove from introductor ....
       
        introductor.add(emp3);
       
View Full Code Here

TOP

Related Classes of org.springmodules.xt.test.domain.Employee

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.