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

📄 zpserviceimpltest.java

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

import java.util.List;

import junit.framework.TestCase;

import org.HumResManSys.factory.ServiceFactory;
import org.HumResManSys.vo.Ypinfo;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class ZpServiceImplTest extends TestCase {

	public void testSubmitZpResult() {
		try{
			ApplicationContext ac=
				new ClassPathXmlApplicationContext("/applicationContext.xml");
			ServiceFactory z=(ServiceFactory)ac.getBean("ServiceFactory");
			Ypinfo yp = z.getYpService().querySelfYpinfo("谭伟文1");
			z.getZpService().submitZpResult(yp, "批准");//将应聘者谭伟文1的状态改为“批准”
			
		}catch(Exception e ){
			e.printStackTrace();
		}
		
	}
	
	public void testQueryAllYpinfo(){
		try{
		    ApplicationContext ac=
			    new ClassPathXmlApplicationContext("/applicationContext.xml");
		    ServiceFactory z=(ServiceFactory)ac.getBean("ServiceFactory");
		    List list=null;
		    list = z.getZpService().queryAllYpinfo();
		    System.out.println(list.size());//列出全部应聘人员的总数
		    
		}catch(Exception e ){
			e.printStackTrace();
		}
		
	}
	
	
	//简单搜索
	public void testAdvancedSearch(){
		try{
		    ApplicationContext ac=
			   new ClassPathXmlApplicationContext("/applicationContext.xml");
		    ServiceFactory z=(ServiceFactory)ac.getBean("ServiceFactory");
		    List list=null;
		    list =z.getZpService().advancedSearch("谭伟文1");//按应聘者姓名搜索
		       System.out.println(list.size());
		    list =z.getZpService().advancedSearch("北交");//按应聘者学校搜索
		       System.out.println(list.size());
		   list =z.getZpService().advancedSearch("110108");//按应聘者应聘职位搜索
		       System.out.println(list.size());
		   list =z.getZpService().advancedSearch("本科");//按应聘者学历搜索
		       System.out.println(list.size());
		       
		}catch(Exception e ){
			e.printStackTrace();
		}
	}
	
	
	public void testAdvancedSearchByConditions(){
		try{
			ApplicationContext ac=
				new ClassPathXmlApplicationContext("/applicationContext.xml");
			ServiceFactory z=(ServiceFactory)ac.getBean("ServiceFactory");
			Ypinfo yp = z.getYpService().querySelfYpinfo("陈梦蝶1");//有此人时
			List list=null;
			list = z.getZpService().advancedSearchByConditions(yp);
			  System.out.println(list.size());
			Ypinfo yp1 = new Ypinfo();
			yp1.setY_name("张三");//无此人时
			list = z.getZpService().advancedSearchByConditions(yp1);
			  System.out.println(list.size());
			  
		}catch(Exception e ){
			e.printStackTrace();
		}		 
	}

}

⌨️ 快捷键说明

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