⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kqleaveactiontest.java

📁 人力资源管理系统
💻 JAVA
字号:
package org.HumResManSys.action;

import java.io.File;

import javax.servlet.http.HttpSession;

import org.HumResManSys.service.EmployeeService;
import org.HumResManSys.vo.Employee;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import servletunit.struts.MockStrutsTestCase;

public class KQLeaveActionTest extends MockStrutsTestCase{

	@Before
	public void setUp() throws Exception {
		super.setUp();
		this.setContextDirectory(new File("WebRoot"));
	}

	@Test
	public void testSubmitQJ() {
		//fail("Not yet implemented");
		setRequestPathInfo("/KQLeaveAction");
		addRequestParameter("method","submitQJ");
		addRequestParameter("start_date","08,07,01");
		addRequestParameter("end_date","08,07,02");
		addRequestParameter("reason","go home");
		ApplicationContext ac=
			new ClassPathXmlApplicationContext("/applicationContext.xml");
		EmployeeService z=(EmployeeService)ac.getBean("EmployeeService");
		Employee e=z.showSelfInfos("赵玉兰");
		
		HttpSession session=this.getSession();
		session.setAttribute("oneEmpInfo", e);
		//
		actionPerform();
		verifyForward("jump");
	}
	

	@Test
	public void testDisplayQJ() {
		//fail("Not yet implemented");
		setRequestPathInfo("/KQLeaveAction");
		addRequestParameter("method","displayQJ");
		ApplicationContext ac=
			new ClassPathXmlApplicationContext("/applicationContext.xml");
		EmployeeService z=(EmployeeService)ac.getBean("EmployeeService");
		Employee e=z.showSelfInfos("赵玉兰");
		
		HttpSession session=this.getSession();
		session.setAttribute("allQJInfo", e);
		actionPerform();
		verifyForward("QJadmin");
		
	}

	@Test
	public void testDisplayAllQJ() {
		//fail("Not yet implemented");
		setRequestPathInfo("/KQLeaveAction");
		addRequestParameter("method","displayAllQJ");
		addRequestParameter("id","1");
		actionPerform();
		verifyForward("QJadminDetail");
	}

	@Test
	public void testUpdateQJtoOk() {
		//fail("Not yet implemented");
		setRequestPathInfo("/KQLeaveAction");
		addRequestParameter("method","updateQJtoOk");
		addRequestParameter("id","1");
		actionPerform();
		verifyForward("jump");
	}

	@Test
	public void testUpdateQJtoNot() {
		//fail("Not yet implemented");
		setRequestPathInfo("/KQLeaveAction");
		addRequestParameter("method","updateQJtoNot");
		addRequestParameter("id","1");
		actionPerform();
		verifyForward("QJadminDetailSuccess");
	}

	@Test
	public void testDisplayQJForUser() {
		//fail("Not yet implemented");
		setRequestPathInfo("/KQLeaveAction");
		addRequestParameter("method","displayQJForUser");
		ApplicationContext ac=
			new ClassPathXmlApplicationContext("/applicationContext.xml");
		EmployeeService z=(EmployeeService)ac.getBean("EmployeeService");
		Employee e=z.showSelfInfos("王春来");
		
		HttpSession session=this.getSession();
		session.setAttribute("oneEmpInfo", e);

		actionPerform();
		verifyForward("KQ");
		
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -