package kcg.faics.fa.serviceImpl;

import static org.junit.Assert.*;

import java.util.HashMap;
import java.util.List;

import javax.annotation.Resource;

import kcg.faics.fa.service.EduService;
import kcg.faics.fa.vo.EduSearchVO;
import kcg.faics.fa.vo.EduVO;

import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

/**
 * 교육현황 테스트 클래스.
 * 
 * @author kimnomin
 *
 */
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(locations = { "classpath:/spring/context-*.xml" })
public class EduServiceImplTest {

	/**
	 * 교육현황 서비스.
	 */
	@Resource(name = "eduService")
	private EduService eduService;
	
	/**
	 * insert Test Case.
	 * 
	 * @throws Exception 기본 예외 처리
	 */
	@Test
	@Ignore
	public void insertTest() throws Exception {
		EduVO vo = new EduVO();
		vo.setName("테스트");
		vo.setStdate("2017-01-01");
		vo.setEddate("2017-01-10");
		vo.setEduCourse("E02");
		vo.setEduPlace("P03"); // 국가정보원 
		vo.setPlace1("PS08"); // 완도해양경비안전서
		vo.setPlace2("203"); // 마량파출소
		vo.setBirth("2000-05-05");
		vo.setPosition("104"); // 경사
		vo.setSdate("2015-01-01");
		vo.setJobtype("05"); // 항공
		vo.setPdate("2016-01-01");
		vo.setScholarship("03"); // 대졸
		vo.setAdate("2016-05-05");
		vo.setComment("비고 테스트");
		vo.setWriter("admin");
		
		HashMap<String, Object> result = eduService.insert(vo, null);
	}
	
	/**
	 * selectList Test Case.
	 * 
	 * @throws Exception 기본 예외 처리
	 */
	@Test
	@Ignore
	public void selectListTest() throws Exception {
		EduSearchVO searchVO = new EduSearchVO();
		List<EduVO> eduList = eduService.selectList(searchVO);
	}
	
	/**
	 * select Test Case.
	 * 
	 * @throws Exception 기본 예외 처리
	 */
	@Test
	public void selectTest() throws Exception {
		EduVO vo = new EduVO();
		vo.setIdx(1);
		EduVO resultVO = eduService.select(vo);
	}
}
