设为首页 加入收藏

TOP

用例级别存储过程(二)
2014-11-24 07:22:47 来源: 作者: 【 】 浏览:7
Tags:级别 存储 过程
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
首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇SQL Server2012中的Indirect Chec.. 下一篇SQL Server2012中的SequenceNumbe..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·PostgreSQL 索引 - (2025-12-25 22:20:43)
·MySQL Node.js 连接 (2025-12-25 22:20:41)
·SQL 撤销索引、表以 (2025-12-25 22:20:38)
·Linux系统简介 (2025-12-25 21:55:25)
·Linux安装MySQL过程 (2025-12-25 21:55:22)