Examples of IEmployee


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

        super(testName);
    }
   
    protected void setUp() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest();
        IEmployee target = new Employee();
       
        this.errors = new BindException(target, "command");
        this.errors.addError(new ObjectError("command", new String[]{"ErrorCode1"}, null, "Default Message 1"));
       
        this.submitEvent = new AjaxSubmitEventImpl("submitEvent", request);
View Full Code Here

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

        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.IEmployee

    public DynamicImplementorIntroductorTest(String testName) {
        super(testName);
    }
   
    public void testIntroduceInterfacesPart1() {
        IEmployee implementor = mock(IEmployee.class);
        IManager target = mock(IManager.class);
        DynamicImplementorIntroductor introductor  = new DynamicImplementorIntroductor(implementor);
        Object introduced = introductor.introduceInterfaces(target, new Class[]{IEmployee.class});
       
        assertTrue(introduced instanceof  IEmployee);
        assertTrue(introduced instanceof IManager);
       
        final IManager manager = (IManager) introduced;
        manager.getManagedEmployees();
        super.checking(new Expectations(){{
          oneOf(manager).getManagedEmployees();
        }});
       
        final IEmployee employee = (IEmployee) introduced;
        super.checking(new Expectations(){{
          oneOf(employee).getFirstname();
        }});
        employee.getFirstname();
        super.verify();
    }
View Full Code Here

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

    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.IEmployee

        factory.setNickname("SB");
        factory.setMatriculationCode("111");
        factory.setFirstname("Sergio");
        factory.setSurname("Bossa");
       
        IEmployee emp = factory.make();
       
        assertTrue(emp instanceof Employee);
        assertEquals("SB", emp.getNickname());
        assertEquals("111", emp.getMatriculationCode());
        assertEquals("Sergio", emp.getFirstname());
        assertEquals("Bossa", emp.getSurname());
        assertNull(emp.getPassword());
    }
View Full Code Here

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

        factory.setFirstname("Sergio");
        factory.setSurname("Bossa");
        // We don't set matriculation code ...
       
        try {
            IEmployee emp = factory.make();
            fail("Construction should fail!");
        }
        catch(Exception ex) {
            ex.printStackTrace();
        }
View Full Code Here

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

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

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

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

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

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

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

     */
    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 ...
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.