Package com.tcs.hrr.junit

Source Code of com.tcs.hrr.junit.RequirementDAOTest

package com.tcs.hrr.junit;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import com.tcs.hrr.dao.RequirementDAO;
import com.tcs.hrr.dao.UserDAO;
import com.tcs.hrr.domain.Requirement;
import com.tcs.hrr.domain.User;
import com.tcs.hrr.service.impl.RequirementManagerImpl;

public class RequirementDAOTest {


  private static ApplicationContext ctx = null;
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    System.out.println("Before setUpBeforeClass");
    //ctx = new ClassPathXmlApplicationContext("applicationContext-dao.xml");
    ctx =new FileSystemXmlApplicationContext("D:\\development\\workspace\\HRR\\WebContent\\WEB-INF\\conf\\spring\\applicationContext-dao.xml");//
    System.out.println("After setUpBeforeClass");
  }

  @Test
  public void testSave() {
    RequirementDAO rd = (RequirementDAO)ctx.getBean("requirementDao");
    Requirement re = new Requirement() ;
    re.setRequestId("3008806");
    re.setRequirementId("3123296");
    re.setIou("GE1-Parent");
    re.setCustomerGroup("Group Client - GE");
    re.setCustomer("GE ENERGY");
    re.setLocation("Onsite");
    rd.save(re);
    System.out.println("testSave getRequirementHrrId="+re.getRequirementHrrId());
  }

  @Test
  public void testDelete() {
    System.out.println("testDelete");
  }

  @Test
  public void testFindById() {
    UserDAO ud = (UserDAO)ctx.getBean("userDaO");
    User t_User = (User)ud.findById(1);
    System.out.println("testFindById : "+t_User.getName()+"/"+t_User.getPassword());
  }
 
}
TOP

Related Classes of com.tcs.hrr.junit.RequirementDAOTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.