Package org.springmodules.xt.test.domain

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


    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


        assertXpathEvaluatesTo("value", "/option/@value", rendering);
        assertXpathEvaluatesTo("content", "/option", rendering);
    }
   
    public void testRenderPart2() throws Exception {
        Employee emp = new Employee();
       
        emp.setMatriculationCode("123");
        emp.setSurname("Bossa");
       
        Option option = new Option(emp, "matriculationCode", "surname");
       
        String rendering = option.render();
        System.out.println(rendering);
View Full Code Here

        assertXpathEvaluatesTo("123", "/option/@value", rendering);
        assertXpathEvaluatesTo("Bossa", "/option", rendering);
    }
   
    public void testRenderPart3() throws Exception {
        Employee emp = new Employee();
       
        // Matriculation code and surname are null:
        Option option = new Option(emp, "matriculationCode", "surname");
        String rendering = option.render();
       
View Full Code Here

    public TableTest(String testName) {
        super(testName);
    }

    public void testRender() throws Exception {
        Employee emp1 = new Employee();
        Employee emp2 = new Employee();
        emp1.setMatriculationCode("123");
        emp1.setFirstname("Sergio");
        emp1.setSurname("Bossa");
        emp2.setMatriculationCode("456");
        emp2.setFirstname("George");
        emp2.setSurname("Orwell");
       
        TableHeader header = new TableHeader(new String[]{"matriculationCode", "firstname", "surname"});
       
        TableRow tableRow1 = new TableRow(emp1, new String[]{"matriculationCode", "firstname", "surname"}, null);
        TableRow tableRow2 = new TableRow(emp2, new String[]{"matriculationCode", "firstname", "surname"}, null);
View Full Code Here

        super(testName);
    }
   
    protected void setUp() throws Exception {
        target = new HashSet();
        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(IntroductorSet 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

        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

    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

        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

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

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.