关于项目自动化测试架构的改良计划 - 读取原始xml文件
发表于:2025-12-01 作者:千家信息网编辑
千家信息网最后更新 2025年12月01日,按照我们的架构,第一步是读取原始的xml文件到一个xml字符串中:/** * *@author cwang58 *@created date: Jun 10, 2013 */public class
千家信息网最后更新 2025年12月01日关于项目自动化测试架构的改良计划 - 读取原始xml文件
按照我们的架构,第一步是读取原始的xml文件到一个xml字符串中:
/** * *@author cwang58 *@created date: Jun 10, 2013 */public class XMLReader { private static final String LINE_SEPARATOR=System.getProperty("line.separator"); private static String userDir = System.getProperty("user.dir"); private static final String fileSeparator=System.getProperty("file.separator"); private static final String dataFileName="test_suite.xml"; /** * build the data file path which depends on the platform * @param projectName * @return */ public static String buildDataFilePath (String projectName){ return userDir+fileSeparator+"src" +fileSeparator+"test" +fileSeparator+"resources" +fileSeparator+projectName +fileSeparator+"data" +fileSeparator+dataFileName; } /** * read the file content then store contant into a string * @param source the file source name * @return * @throws IOException */ public static String readContentFromFile(String source) throws IOException{ File file = new File(source); // open a file reader to read the file content FileInputStream fis = null; InputStreamReader isr = null; BufferedReader reader = null; try { fis = new FileInputStream(file); isr = new InputStreamReader(fis, "utf-8"); reader = new BufferedReader(isr); StringBuffer bufferedFileContent = new StringBuffer(); String line = null; while ((line = reader.readLine()) != null) { bufferedFileContent.append(line).append(LINE_SEPARATOR); } return bufferedFileContent.toString(); } catch (FileNotFoundException ex) { ex.printStackTrace(); return null; } finally { if(reader!=null) reader.close(); if(isr!=null) isr.close(); if(fis!=null) fis.close(); } }代码很简单,就是一个基于文件流的操作,不再自己讲解。这个步骤对于架构图的第一步。
文件
架构
原始
代码
字符
字符串
就是
步骤
utf-8
项目
测试
自动化
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
阿里云服务器一年价格20T价格
阿里云的服务器怎么用
hp服务器内存编号
域服务器能管理多少台
ACCESS数据库学习励志
不必了解程序与数据库的构造
指戈网络技术
千万节点网络安全
达梦数据库like
php服务器端开发
数据库测试验收细则
江苏营销软件开发
赣榆县天气预报软件开发
一点一滴互联网科技
咸阳软件开发方案
我的世界服务器管理手册
学生成绩数据库查看索引名称
学计算机网络技术烧钱吗
海宁网络安全宣传视频
网络安全班会背景图
2017数据库使用排名
安徽省天使网络技术有限公司
imc保护网络安全的组件
联想软件开发工作怎么样
奉化区高科技刀片服务器售后服务
广东四平网络安全
超星阅读软件开发
移动网络安全怎么防范
数据库怎么拼
深圳小肆网络技术有限公司