Hi all,
can any body give me idea...I have a
java class with me which I want to do
unit test.On that class there is a method which takes input parameter as a result set...I am unable to find the way how to test it.Here I am giving the code for that method
public void setBlobList(OracleResultSet results,
String labelname)
throws SQLException,FileNotFoundException,IOException{
Properties props = archiveFolderPath("logrole.properties");
//For Windows
File file = new File(props.getProperty("archivefolder")+"\\"+labelname);
//For Linux
//File file = new File(props.getProperty("archivefolder")+"/"+labelname);
file.mkdirs();
while(results.next()) {
String docid=""+results.getInt("docid");
oracle.sql.BLOB blb = (oracle.sql.BLOB)results.getBLOB("doccontent");
InputStream io = blb.getBinaryStream();
byte[] data = new byte[blb.getBufferSize()];
io.read(data);
io.close();
//For Windows
File f=new File(props.getProperty("archivefolder")+"\\"+labelname+"\\"+results.getInt("docid")+"_"+results.getString("filename"));
//For Linux
//File f=new File(props.getProperty("archivefolder")+"/"+labelname+"/"+results.getInt("docid")+"_"+results.getString("filename"));
FileOutputStream fo=new FileOutputStream(f);
fo.write(data);
fo.close();
VTLArchiveBlob document = new VTLArchiveBlob(docid,f);
// add to document list
documentList.add(document);
}
}
welcome for suggestions
usha