FileDocCategorySizeDatePackage
TestDataProvider.javaAPI DocApache Struts 2.0.9 Apps4125Mon Jul 23 13:43:26 BST 2007org.apache.struts2.showcase.application

TestDataProvider

public class TestDataProvider extends Object implements Serializable, org.springframework.beans.factory.InitializingBean
TestDataProvider.

Fields Summary
private static final long
serialVersionUID
private static final Logger
log
public static final String[]
POSITIONS
public static final String[]
LEVELS
private static final org.apache.struts2.showcase.model.Skill[]
TEST_SKILLS
public static final org.apache.struts2.showcase.model.Employee[]
TEST_EMPLOYEES
private org.apache.struts2.showcase.dao.SkillDao
skillDao
private org.apache.struts2.showcase.dao.EmployeeDao
employeeDao
Constructors Summary
Methods Summary
protected voidaddTestData()

        addTestSkills();
        addTestEmployees();
    
protected voidaddTestEmployees()

        try {
            for (int i = 0, j = TEST_EMPLOYEES.length; i < j; i++) {
                employeeDao.merge(TEST_EMPLOYEES[i]);
            }
            if (log.isInfoEnabled()) {
                log.info("TestDataProvider - [addTestEmployees]: Added test employee data.");
            }
        } catch (StorageException e) {
            log.error("TestDataProvider - [addTestEmployees]: Exception catched: " + e.getMessage());
        }
    
protected voidaddTestSkills()

        try {
            for (int i = 0, j = TEST_SKILLS.length; i < j; i++) {
                skillDao.merge(TEST_SKILLS[i]);
            }
            if (log.isInfoEnabled()) {
                log.info("TestDataProvider - [addTestSkills]: Added test skill data.");
            }
        } catch (StorageException e) {
            log.error("TestDataProvider - [addTestSkills]: Exception catched: " + e.getMessage());
        }
    
public voidafterPropertiesSet()

        addTestData();
    
public voidsetEmployeeDao(org.apache.struts2.showcase.dao.EmployeeDao employeeDao)

        this.employeeDao = employeeDao;
    
public voidsetSkillDao(org.apache.struts2.showcase.dao.SkillDao skillDao)


        
        this.skillDao = skillDao;