dTxt(String txtPath) {
String content = " ";
try {
InputStream is = new FileInputStream( new File(txtPath) );
BufferedReader buffReader = new BufferedReader(new InputStreamReader(is,"utf-8"));
content = buffReader.readLine();
String line;
try
{
while ((line = buffReader.readLine()) != null)
{
if (line.equals(""))
continue;
else
content += line + "\r\n";
}
} catch (IOException e) {
e.printStackTrace();
System.out.println("Error reading file");
}
buffReader.close();
is.close();
} catch (FileNotFoundException e) {
System.out.println("file is not exist,can't read...");
} catch (IOException e) {
e.printStackTrace();
}
return content;
}
public static void save(Document document,String fileName)
{
try
{
FileOutputStream mOutputStream = new FileOutputStream(fileName);
OutputFormat fmt = new OutputFormat(document.asXML());
fmt.setTrimText(true);
fmt.setPadText(true);
fmt.setIndent(true);
fmt.setIndentSize(0);
fmt.setNewlines(true);
fmt.setEncoding("utf-8");
XMLWriter writer = new XMLWriter( mOutputStream, fmt );
writer.write(document);
mOutputStream.flush();
mOutputStream.close();
}catch (IOException e)
{
e.printStackTrace();
}
catch( Exception e )
{
e.printStackTrace();
}
}
@SuppressWarnings("deprecation")
private String getTDTValue(String tdt){
Connection con = null;
Statement state = null;
String tdtKey=null;
Session session = HibernateSessionFactory.getSession();
try {
con = session.connection();
con.setAutoCommit(true);
session.beginTransaction();
//根据TDT获取对应的Value
String sq="select dict_value from e3_dict_table where dict_describe='" + tdt + "' and dict_type_id = 'FEATURE_TDT'" ;
state = con.createStatement();
ResultSet result = state.executeQuery(sq);
while(result.next()){
tdtKey=result.getString("DICT_VALUE");
}
con.commit();
} catch (Exception e) {
e.printStackTrace();
}finally{
try {
if(state != null)
state.close();
if(con != null)
HibernateSessionFactory.closeSession();
} catch (Exception e) {
e.printStackTrace();
}
}
return tdtKey;
}
}--算出自动化用例(%)
set @AUTOMATIC_EXAMPLE_SCALE = convert(decimal(10,2),@AUTOMATIC/convert(decimal(10,2),@EXAMPLE_TOTAL))
end
else
begin
set @ZERO_LEVEL_SCALE = 0
set @ONE_LEVEL_SCALE = 0
set @TWO_LEVEL_SCALE = 0
set @THREE_LEVEL_SCALE = 0