/**
 * 
 */
package com.trs.example.check;

import java.util.HashMap;

import com.trs.TRSWCMBaseTest;
import com.trs.infra.util.CMyException;
import com.trs.webframework.controler.JSPRequestProcessor;

/**
 * @author caohui
 * 
 */
public class EmployerSerrviceProviderTest extends TRSWCMBaseTest {
    private static org.apache.log4j.Logger logger = org.apache.log4j.Logger
            .getLogger(EmployerSerrviceProviderTest.class);

    /**
     * @param name
     */
    public EmployerSerrviceProviderTest(String name) {
        super(name);
    }

    /**
     * Test method for
     * {@link com.trs.example.check.EmployerSerrviceProvider#delete(com.trs.webframework.context.MethodContext)}
     * .
     */
    public void testDelete() {
        fail("Not yet implemented");
    }

    /**
     * Test method for
     * {@link com.trs.example.check.EmployerSerrviceProvider#query(com.trs.webframework.context.MethodContext)}
     * .
     */
    public void testQuery() {
        try {
            
        } catch (Exception ex) {
            logger.error("测试[testQuery]出现异常！", ex);
            fail("测试[testQuery]出现异常！\n" + CMyException.getStackTraceText(ex));
        }
        fail("Not yet implemented");
    }

    /**
     * Test method for
     * {@link com.trs.example.check.EmployerSerrviceProvider#save(com.trs.webframework.context.MethodContext)}
     * .
     */
    public void testSave() {
        /**
         * 测试新增
         */
        try {
            // 1 构造测试数据
            HashMap hParameters = new HashMap();
            hParameters.put("EName", "张三");
            hParameters.put("Email", "zs@trs.com.cn");
            hParameters.put("Department", "产品二部");
            hParameters.put("JoinDate", "2011-01-01");

            // 2 调用服务
            JSPRequestProcessor oProcessor = new JSPRequestProcessor();
            Object result = oProcessor.excute("wcm6_employer", "save",
                    hParameters);
            int nNewId = ((Integer) result).intValue();

            // 3 验证返回值是否符合预期
            assertTrue("没有保存成功？", nNewId > 0);

        } catch (Exception ex) {
            logger.error("测试[testSave]出现异常！", ex);
            fail("测试[testSave]出现异常！\n" + CMyException.getStackTraceText(ex));
        }
    }

    /**
     * Test method for
     * {@link com.trs.example.check.EmployerSerrviceProvider#findById(com.trs.webframework.context.MethodContext)}
     * .
     */
    public void testFindById() {
        fail("Not yet implemented");
    }

    /**
     * Test method for
     * {@link com.trs.example.check.EmployerSerrviceProvider#findByIds(com.trs.webframework.context.MethodContext)}
     * .
     */
    public void testFindByIds() {
        fail("Not yet implemented");
    }

}
