public class ImsiBeanTest extends TestCase {
public ImsiBean imsiBean = new imsiBean();
// 본 test Case를 수행하시기 위해서는 MonthlyStatMgtBean 에 있는 conn =
connMgr.getConnection(); 을 주석처리 해야 합니다.
public void setUp() throws Exception {
String db_url = "jdbc:oracle:thin:@100.100.100.100:1521:SID";
String db_user = "USER";
String db_pwd = "PWD";
imsiBean.initConnection(db_url ,db_user, db_pwd);
System.out.println ("codeBean : " +imsiBean );
}
public void testInsertStarEvent () {
System.out.println (" -------- testInsertStarEvent -----------");
boolean returnBol = imsiBean.insertStarEvent(getimsiRec());
System.out.println ("test 001 " + returnBol);
}
public void testSelectStarEvent () {
System.out.println (" -------- testSelectStarEvent -----------");
boolean returnBol = imsiBean.selectStarEvent("");
System.out.println ("test 002 " + returnBol);
}
public imsiRec getimsiRec () {
ImsiRec imsiRec = new ImsiRec();
imsiRec.setCust_name ("고영민");
return imsiRec;
}
}
private Connection conn= null;
public Connection initConnection (String url, String id, String pwd) {
try {
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
conn = DriverManager.getConnection(url, id, pwd);
} catch (Exception e) {
e.printStackTrace();
}
return conn;
}