import junit.framework.*; import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext;
public class EmployeeBusinessServiceImplTest extends TestCase { private IEmployeeBusinessService empBusiness; private Map salaryMap; List expResult;
protected void setUp() throws Exception { initSpringFramework(); initSalaryMap(); initExpectedResult(); } private void initExpectedResult() { expResult = new ArrayList(); Map tempMap = new HashMap(); tempMap.put("EMP_NO",new Integer(1)); tempMap.put("EMP_NAME","John"); tempMap.put("SALARY",new Double(46.11)); expResult.add(tempMap); } private void initSalaryMap() { salaryMap = new HashMap(); salaryMap.put("MIN_SALARY","1"); salaryMap.put("MAX_SALARY","50"); } private void initSpringFramework() { ApplicationContext ac = new FileSystemXmlApplicationContext ("C:/SpringConfig/Spring-Config.xml"); empBusiness = (IEmployeeBusinessService)ac.getBean("EMP_BUSINESS"); } protected void tearDown() throws Exception { }
/** * Test of getEmployeesWithinSalaryRange method, * of class * com.bea.dev2dev.business.EmployeeBusinessServiceImpl. */ public void testGetEmployeesWithinSalaryRange() { List result = empBusiness.getEmployeesWithinSalaryRange (salaryMap);
复制本页网址和标题,发送给你QQ/Msn的好友一起分享
上一篇:实战角度比较EJB2和EJB3的异同
下一篇:实战角度比较EJB2和EJB3的架构异同