Examples of EmployeeFactory


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

        assertEquals("value", factory.getValue());
    }

    public void testGenerate() {
        DynamicFactoryGenerator<EmployeeFactory, Employee> generator = new DynamicFactoryGenerator(EmployeeFactory.class, Employee.class);
        EmployeeFactory factory = generator.generate();
       
        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());
View Full Code Here

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

        assertNull(emp.getPassword());
    }
   
    public void testGenerateFailsBecauseOfNoSuchConstructor() {
        DynamicFactoryGenerator<EmployeeFactory, Employee> generator = new DynamicFactoryGenerator(EmployeeFactory.class, Employee.class);
        EmployeeFactory factory = generator.generate();
       
        factory.setNickname("SB");
        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.EmployeeFactory

        }
    }
   
    public void testUnsupportedMethod() {
        DynamicFactoryGenerator<EmployeeFactory, Employee> generator = new DynamicFactoryGenerator(EmployeeFactory.class, Employee.class);
        EmployeeFactory factory = generator.generate();
       
        try {
            factory.setUnsupportedProperty("unsupported");
            fail("Unsupported method!");
        }
        catch(Exception ex) {
            ex.printStackTrace();
        }
View Full Code Here

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

        super(testName);
    }
   
    public void testSettersAndGetters() {
        DynamicFactoryGenerator<EmployeeFactory, Employee> generator = new DynamicFactoryGenerator(EmployeeFactory.class, Employee.class);
        EmployeeFactory factory = generator.generate();
       
        factory.setNickname("SB");
        factory.setMatriculationCode("111");
        factory.setFirstname("Sergio");
        factory.setSurname("Bossa");
        factory.setValue("value");
       
        assertEquals("SB", factory.getNickname());
        assertEquals("111", factory.getMatriculationCode());
        assertEquals("Sergio", factory.getFirstname());
        assertEquals("Bossa", factory.getSurname());
        assertEquals("value", factory.getValue());
    }
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.