parent
846dabb1ad
commit
4e44764db4
BIN
Result/测试用例.xlsx
BIN
Result/测试用例.xlsx
Binary file not shown.
|
@ -9,7 +9,7 @@ import org.dom4j.DocumentException;
|
|||
import org.dom4j.Element;
|
||||
import org.dom4j.io.SAXReader;
|
||||
|
||||
import pres.auxiliary.work.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.old.testcase.templet.ZentaoTemplet;
|
||||
|
||||
/**
|
||||
* 该类用于通过读取生成的case文件来自动编写测试用例及selenium脚本(未做)
|
||||
|
|
|
@ -1,233 +0,0 @@
|
|||
package pres.auxiliary.work.n.testcase.file;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import pres.auxiliary.work.n.testcase.templet.LabelType;
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>JiraTestCaseWrite.java</p>
|
||||
* <p><b>用途:</b>用于对上传jira测试用例模板,通过该类构造的用例文件,在使用测试用例
|
||||
* 模板类写入用例时可以不用指定相应的字段关系。该类中包含部分个性的方法,以方便编写
|
||||
* 测试用例</p>
|
||||
* <p><b>编码时间:</b>2020年4月3日下午4:23:05</p>
|
||||
* <p><b>修改时间:</b>2020年4月3日下午4:23:05</p>
|
||||
* @author 彭宇琦
|
||||
* @version Ver1.0
|
||||
* @since JDK 12
|
||||
*
|
||||
*/
|
||||
public class JiraTestCaseWrite extends TestCaseWrite {
|
||||
/**
|
||||
* 通过测试文件模板xml配置文件和测试用例文件来构造WriteTestCase类。当配置文件中
|
||||
* 只存在一个sheet标签时,则直接获取其对应sheet下所有column标签的id属性;若存在
|
||||
* 多个sheet标签时,则读取第一个sheet标签,如需切换sheet标签,则可调用{@link #switchSheet(String)} 方法。
|
||||
*
|
||||
* @param configFile 测试文件模板xml配置文件类对象
|
||||
* @param caseFile 测试用例文件类对象
|
||||
* @throws IncorrectFileException 文件格式或路径不正确时抛出的异常
|
||||
*/
|
||||
public JiraTestCaseWrite(File configFile, File caseFile) {
|
||||
super(configFile, caseFile);
|
||||
|
||||
//TODO 添加与测试用例模板的关联,若测试用例模板字段有所改变,则在此改变关联字段
|
||||
relevanceCase(JiraFieldIdType.STEP.getName(), LabelType.STEP.getName());
|
||||
relevanceCase(JiraFieldIdType.EXCEPT.getName(), LabelType.EXCEPT.getName());
|
||||
relevanceCase(JiraFieldIdType.PRECONDITION.getName(), LabelType.PRECONDITION.getName());
|
||||
relevanceCase(JiraFieldIdType.PRIORITY.getName(), LabelType.RANK.getName());
|
||||
relevanceCase(JiraFieldIdType.TITLE.getName(), LabelType.TITLE.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于写入标题信息,由于标题唯一且不换行,故重复调用该方法时将覆盖原写入的内容。
|
||||
* 写入的内容可以使用替换符,具体规则可以参见{@link #addContent(String, String...)}
|
||||
* @param title 标题
|
||||
* @return 类本身
|
||||
*/
|
||||
public JiraTestCaseWrite addTitle(String title) {
|
||||
//清除原有的内容
|
||||
clearContent(JiraFieldIdType.TITLE.getName());
|
||||
//重新将标题数据写入到用例中
|
||||
addContent(JiraFieldIdType.TITLE.getName(), title);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于写入步骤信息
|
||||
* @param stpes 步骤
|
||||
* @return 类本身
|
||||
*/
|
||||
public JiraTestCaseWrite addStep(String... steps) {
|
||||
//写入步骤信息
|
||||
addContent(JiraFieldIdType.STEP.getName(), steps);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于写入预期信息
|
||||
* @param stpes 预期
|
||||
* @return 类本身
|
||||
*/
|
||||
public JiraTestCaseWrite addExcept(String... excepts) {
|
||||
//写入预期信息
|
||||
addContent(JiraFieldIdType.EXCEPT.getName(), excepts);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 由于步骤与预期是对应的,故可使用该方法写入一条步骤与预期信息
|
||||
* @param step 步骤
|
||||
* @param except 预期
|
||||
* @return 类本身
|
||||
*/
|
||||
public JiraTestCaseWrite addStepAndExcept(String step, String except) {
|
||||
//写入步骤信息
|
||||
addContent(JiraFieldIdType.STEP.getName(), step);
|
||||
//写入预期信息
|
||||
addContent(JiraFieldIdType.EXCEPT.getName(), except);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于根据数据有效性顺序选择相应的模块信息,重复调用该方法时将覆盖原写入的内容。
|
||||
* @param index 模块对应的数据有效性选项
|
||||
* @return 类本身
|
||||
*/
|
||||
public JiraTestCaseWrite addFolder(int index) {
|
||||
//清除原有的内容
|
||||
clearContent(JiraFieldIdType.FOLDER.getName());
|
||||
//由于传入的本身为数字,故可直接将数字转换成字符串后传入到addContent中
|
||||
addContent(JiraFieldIdType.FOLDER.getName(), String.valueOf(index));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据关键词,匹配相应的模块信息,若未传入信息,则不写入信息,若能匹配信息,则会有以下三种情况:
|
||||
* <ol>
|
||||
* <li>匹配一个结果,则直接存入结果</li>
|
||||
* <li>匹配多个结果,则存入第一个命中的结果</li>
|
||||
* <li>无匹配结果,则以“key1/key2/key3/.../keyN/”的形式拼接字符串</li>
|
||||
* </ol>
|
||||
* 重复调用该方法时将覆盖原写入的内容。
|
||||
* @param keys 关键词组
|
||||
* @return 类本身
|
||||
*/
|
||||
public JiraTestCaseWrite addFolder(String... keys) {
|
||||
//清除原有的内容
|
||||
clearContent(JiraFieldIdType.FOLDER.getName());
|
||||
|
||||
//若未传入关键词,则不填写信息
|
||||
if (keys == null) {
|
||||
return this;
|
||||
}
|
||||
|
||||
//获取数据有效性
|
||||
ArrayList<String> dataList = fieldMap.get(JiraFieldIdType.FOLDER.getName()).matchDataValidation(keys);
|
||||
//存储最终得到的模块信息
|
||||
StringBuilder dataText = new StringBuilder();
|
||||
|
||||
//匹配模块信息,分为三种情况:
|
||||
//1.命中一个结果,则直接存入结果
|
||||
//2.命中多个结果,则存入第一个命中的结果
|
||||
//3.未命中结果,则以“key1/key2/key3/.../keyN/”的形式拼接字符串
|
||||
|
||||
if (dataList.size() >= 1) {
|
||||
dataText.append(dataList.get(0));
|
||||
} else {
|
||||
Arrays.stream(keys).forEach(text -> {
|
||||
//拼接关键词
|
||||
dataText.append("/" + text);
|
||||
});
|
||||
}
|
||||
|
||||
//写入得到的关键词
|
||||
addContent(JiraFieldIdType.FOLDER.getName(), String.valueOf(dataText.toString()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>JiraTestCaseWrite.java</p>
|
||||
* <p><b>用途:</b>用于枚举出jira用例文件模板xml文件中所有字段</p>
|
||||
* <p><b>编码时间:</b>2020年4月3日下午4:04:30</p>
|
||||
* <p><b>修改时间:</b>2020年4月3日下午4:04:30</p>
|
||||
* @author 彭宇琦
|
||||
* @version Ver1.0
|
||||
* @since JDK 12
|
||||
*
|
||||
*/
|
||||
enum JiraFieldIdType {
|
||||
/**
|
||||
* 标题(Name)
|
||||
*/
|
||||
TITLE("标题"),
|
||||
/**
|
||||
* 目的(Objective)
|
||||
*/
|
||||
OBJECTIVE("目的"),
|
||||
/**
|
||||
* 前置条件(Precondition)
|
||||
*/
|
||||
PRECONDITION("前置条件"),
|
||||
/**
|
||||
* 步骤(Test Script (Step-by-Step) - Step)
|
||||
*/
|
||||
STEP("步骤"),
|
||||
/**
|
||||
* 预期(Test Script (Step-by-Step) - Expected Result)
|
||||
*/
|
||||
EXCEPT("预期"),
|
||||
/**
|
||||
* 模块(Folder)
|
||||
*/
|
||||
FOLDER("模块"),
|
||||
/**
|
||||
* 状态(Status)
|
||||
*/
|
||||
STATUS("状态"),
|
||||
/**
|
||||
* 优先级(Priority)
|
||||
*/
|
||||
PRIORITY("优先级"),
|
||||
/**
|
||||
* 项目(Component)
|
||||
*/
|
||||
COMPONENT("项目"),
|
||||
/**
|
||||
* 设计者(Owner)
|
||||
*/
|
||||
OWNER("设计者"),
|
||||
/**
|
||||
* 关联需求(Coverage (Issues))
|
||||
*/
|
||||
ISSUES("关联需求"),
|
||||
/**
|
||||
* 关键用例
|
||||
*/
|
||||
CASE_KEY("关键用例"),
|
||||
;
|
||||
//用于存储枚举的名称
|
||||
private String name = "";
|
||||
|
||||
/**
|
||||
* 初始化枚举值
|
||||
* @param value 枚举值
|
||||
*/
|
||||
private JiraFieldIdType(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于返回枚举中存储的内容,即jira用例文件模板中的字段ID
|
||||
* @return 枚举值
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.change;
|
||||
package pres.auxiliary.work.old.testcase.change;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
@ -12,7 +12,7 @@ import org.apache.poi.ss.usermodel.CellType;
|
|||
import org.apache.poi.xssf.usermodel.XSSFCell;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import pres.auxiliary.work.testcase.exception.IncorrectCaseFileException;
|
||||
import pres.auxiliary.work.old.testcase.exception.IncorrectCaseFileException;
|
||||
|
||||
public abstract class CaseAttribute {
|
||||
// 用于指向测试用例文件
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.change;
|
||||
package pres.auxiliary.work.old.testcase.change;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
|
@ -1,8 +1,8 @@
|
|||
package pres.auxiliary.work.testcase.change;
|
||||
package pres.auxiliary.work.old.testcase.change;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import pres.auxiliary.work.testcase.exception.IncorrectCaseFileException;
|
||||
import pres.auxiliary.work.old.testcase.exception.IncorrectCaseFileException;
|
||||
|
||||
public abstract class ChangeCase {
|
||||
//用于指向测试用例文件
|
|
@ -0,0 +1,5 @@
|
|||
package pres.auxiliary.work.old.testcase.change;
|
||||
|
||||
public class Expectation {
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.change;
|
||||
package pres.auxiliary.work.old.testcase.change;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.change;
|
||||
package pres.auxiliary.work.old.testcase.change;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package pres.auxiliary.work.old.testcase.change;
|
||||
|
||||
public class Precondition {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package pres.auxiliary.work.old.testcase.change;
|
||||
|
||||
public class Step {
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.change;
|
||||
package pres.auxiliary.work.old.testcase.change;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
@ -14,7 +14,7 @@ import org.apache.poi.xssf.usermodel.XSSFRow;
|
|||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import pres.auxiliary.work.testcase.writecase.Case;
|
||||
import pres.auxiliary.work.old.testcase.writecase.Case;
|
||||
|
||||
/**
|
||||
* 该类提供标记测试用例文件中最后一条测试用例的一些方法,包括添加注释、改变整行字体颜色和改变某一步骤的字体颜色
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.change;
|
||||
package pres.auxiliary.work.old.testcase.change;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -6,7 +6,7 @@ import java.io.IOException;
|
|||
import org.apache.poi.xssf.usermodel.XSSFRow;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import pres.auxiliary.work.testcase.exception.ExistentContentException;
|
||||
import pres.auxiliary.work.old.testcase.exception.ExistentContentException;
|
||||
|
||||
/**
|
||||
* 该类用于编写测试用例的标题
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.change;
|
||||
package pres.auxiliary.work.old.testcase.change;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.change;
|
||||
package pres.auxiliary.work.old.testcase.change;
|
||||
|
||||
public abstract class WriteCaseScript extends WriteCase {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.change;
|
||||
package pres.auxiliary.work.old.testcase.change;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -10,12 +10,12 @@ import org.dom4j.DocumentException;
|
|||
import org.dom4j.Element;
|
||||
|
||||
import pres.auxiliary.selenium.xml.IncorrectXmlPathException;
|
||||
import pres.auxiliary.work.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.testcase.writecase.AddInformation;
|
||||
import pres.auxiliary.work.testcase.writecase.BrowseList;
|
||||
import pres.auxiliary.work.testcase.writecase.FileType;
|
||||
import pres.auxiliary.work.testcase.writecase.InputType;
|
||||
import pres.auxiliary.work.testcase.writecase.PhoneType;
|
||||
import pres.auxiliary.work.old.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.old.testcase.writecase.AddInformation;
|
||||
import pres.auxiliary.work.old.testcase.writecase.BrowseList;
|
||||
import pres.auxiliary.work.old.testcase.writecase.FileType;
|
||||
import pres.auxiliary.work.old.testcase.writecase.InputType;
|
||||
import pres.auxiliary.work.old.testcase.writecase.PhoneType;
|
||||
|
||||
/**
|
||||
* 该类用于通过XML文件结构来生成测试用例
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.exception;
|
||||
package pres.auxiliary.work.old.testcase.exception;
|
||||
|
||||
/**
|
||||
* 该异常在所填写的单元格中有信息存在且不允许被覆盖是抛出的异常
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.exception;
|
||||
package pres.auxiliary.work.old.testcase.exception;
|
||||
|
||||
/**
|
||||
* 该异常在新增用例信息不全时抛出
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.exception;
|
||||
package pres.auxiliary.work.old.testcase.exception;
|
||||
|
||||
/**
|
||||
* 在定义的测试用例文件有误时抛出的异常
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.exception;
|
||||
package pres.auxiliary.work.old.testcase.exception;
|
||||
|
||||
public class ModuleDataNotFoundException extends RuntimeException {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.exception;
|
||||
package pres.auxiliary.work.old.testcase.exception;
|
||||
|
||||
/**
|
||||
* 该异常在指定的单元格对象无效抛出的异常
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.exception;
|
||||
package pres.auxiliary.work.old.testcase.exception;
|
||||
|
||||
/**
|
||||
* 该异常在未指定excel文件时抛出
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.templet;
|
||||
package pres.auxiliary.work.old.testcase.templet;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.templet;
|
||||
package pres.auxiliary.work.old.testcase.templet;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
|
@ -1,11 +1,11 @@
|
|||
package pres.auxiliary.work.testcase.writecase;
|
||||
package pres.auxiliary.work.old.testcase.writecase;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import pres.auxiliary.work.testcase.change.Tab;
|
||||
import pres.auxiliary.work.testcase.exception.IncompleteInformationException;
|
||||
import pres.auxiliary.work.old.testcase.change.Tab;
|
||||
import pres.auxiliary.work.old.testcase.exception.IncompleteInformationException;
|
||||
|
||||
/**
|
||||
* 该类用于生成预设的新增信息相关的测试用例
|
|
@ -1,9 +1,9 @@
|
|||
package pres.auxiliary.work.testcase.writecase;
|
||||
package pres.auxiliary.work.old.testcase.writecase;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import pres.auxiliary.work.testcase.change.Tab;
|
||||
import pres.auxiliary.work.old.testcase.change.Tab;
|
||||
|
||||
/**
|
||||
* 该类用于生成预设的浏览列表相关的测试用例
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.writecase;
|
||||
package pres.auxiliary.work.old.testcase.writecase;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
@ -23,10 +23,10 @@ import org.dom4j.Element;
|
|||
import org.dom4j.io.SAXReader;
|
||||
|
||||
import pres.auxiliary.directory.exception.UndefinedDirectoryException;
|
||||
import pres.auxiliary.work.testcase.change.CaseTab;
|
||||
import pres.auxiliary.work.testcase.change.Tab;
|
||||
import pres.auxiliary.work.testcase.templet.ZentaoExcel;
|
||||
import pres.auxiliary.work.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.old.testcase.change.CaseTab;
|
||||
import pres.auxiliary.work.old.testcase.change.Tab;
|
||||
import pres.auxiliary.work.old.testcase.templet.ZentaoExcel;
|
||||
import pres.auxiliary.work.old.testcase.templet.ZentaoTemplet;
|
||||
|
||||
/**
|
||||
* 该类定义了所有预设用例都包含的基本信息<br/>
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.writecase;
|
||||
package pres.auxiliary.work.old.testcase.writecase;
|
||||
|
||||
/**
|
||||
* 该类定义了常见的文件格式,用于添加上传文件时的文件格式限定
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.writecase;
|
||||
package pres.auxiliary.work.old.testcase.writecase;
|
||||
|
||||
/**
|
||||
* 该类定义了在添加测试用例时的一些输入限定
|
|
@ -1,9 +1,9 @@
|
|||
package pres.auxiliary.work.testcase.writecase;
|
||||
package pres.auxiliary.work.old.testcase.writecase;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import pres.auxiliary.work.testcase.change.Tab;
|
||||
import pres.auxiliary.work.old.testcase.change.Tab;
|
||||
|
||||
public class Map extends Case {
|
||||
/**
|
|
@ -1,10 +1,10 @@
|
|||
package pres.auxiliary.work.testcase.writecase;
|
||||
package pres.auxiliary.work.old.testcase.writecase;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import pres.auxiliary.work.testcase.change.CaseTab;
|
||||
import pres.auxiliary.work.testcase.change.Tab;
|
||||
import pres.auxiliary.work.old.testcase.change.CaseTab;
|
||||
import pres.auxiliary.work.old.testcase.change.Tab;
|
||||
|
||||
/**
|
||||
* 该类用于简单的编写一条测试用例
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.writecase;
|
||||
package pres.auxiliary.work.old.testcase.writecase;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.writecase;
|
||||
package pres.auxiliary.work.old.testcase.writecase;
|
||||
|
||||
/**
|
||||
* 该枚举定义了固定电话与移动电话类型,用于添加针对号码类型的测试用例
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase.writecase;
|
||||
package pres.auxiliary.work.old.testcase.writecase;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
|
@ -1,9 +1,9 @@
|
|||
package pres.auxiliary.work.testcase.writecase;
|
||||
package pres.auxiliary.work.old.testcase.writecase;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import pres.auxiliary.work.testcase.change.Tab;
|
||||
import pres.auxiliary.work.old.testcase.change.Tab;
|
||||
|
||||
/**
|
||||
* FileName: Username.java
|
|
@ -1,9 +1,9 @@
|
|||
package pres.auxiliary.work.testcase.writecase;
|
||||
package pres.auxiliary.work.old.testcase.writecase;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import pres.auxiliary.work.testcase.change.Tab;
|
||||
import pres.auxiliary.work.old.testcase.change.Tab;
|
||||
|
||||
/**
|
||||
* FileName: Video.java
|
|
@ -1,5 +0,0 @@
|
|||
package pres.auxiliary.work.testcase.change;
|
||||
|
||||
public class Expectation {
|
||||
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package pres.auxiliary.work.testcase.change;
|
||||
|
||||
public class Precondition {
|
||||
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package pres.auxiliary.work.testcase.change;
|
||||
|
||||
public class Step {
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.n.testcase.file;
|
||||
package pres.auxiliary.work.testcase.file;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
@ -33,12 +33,12 @@ import org.dom4j.Element;
|
|||
import org.dom4j.io.SAXReader;
|
||||
|
||||
import pres.auxiliary.tool.readfile.ListFileRead;
|
||||
import pres.auxiliary.work.n.testcase.templet.Case;
|
||||
import pres.auxiliary.work.n.testcase.templet.LabelNotFoundException;
|
||||
import pres.auxiliary.work.testcase.templet.Case;
|
||||
import pres.auxiliary.work.testcase.templet.LabelNotFoundException;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* <b>文件名:</b>WriteTestCase.java
|
||||
* <b>文件名:</b>AbstractTestCaseWrite.java
|
||||
* </p>
|
||||
* <p>
|
||||
* <b>用途:</b>用于向测试用例文件中添加用例,该工具类支持词语替换方法,但需要使用“#”符号对词语进行标记
|
||||
|
@ -55,7 +55,7 @@ import pres.auxiliary.work.n.testcase.templet.LabelNotFoundException;
|
|||
* @since JDK 12
|
||||
*
|
||||
*/
|
||||
public class TestCaseWrite {
|
||||
public abstract class AbstractTestCaseWrite<T extends AbstractTestCaseWrite<T>> {
|
||||
/**
|
||||
* 用于指向用例的XSSFWorkbook对象
|
||||
*/
|
||||
|
@ -107,7 +107,7 @@ public class TestCaseWrite {
|
|||
private Document caseXml;
|
||||
|
||||
/**
|
||||
* 通过测试文件模板xml配置文件和测试用例文件来构造WriteTestCase类。当配置文件中
|
||||
* 通过测试文件模板xml配置文件和测试用例文件来构造AbstractTestCaseWrite类。当配置文件中
|
||||
* 只存在一个sheet标签时,则直接获取其对应sheet下所有column标签的id属性;若存在
|
||||
* 多个sheet标签时,则读取第一个sheet标签,如需切换sheet标签,则可调用{@link #switchSheet(String)} 方法。
|
||||
*
|
||||
|
@ -115,7 +115,7 @@ public class TestCaseWrite {
|
|||
* @param caseFile 测试用例文件类对象
|
||||
* @throws IncorrectFileException 文件格式或路径不正确时抛出的异常
|
||||
*/
|
||||
public TestCaseWrite(File configFile, File caseFile) {
|
||||
public AbstractTestCaseWrite(File configFile, File caseFile) {
|
||||
// 判断传入的configurationFile是否为一个文件类对象,若非文件类对象,则抛出异常
|
||||
try {
|
||||
configXml = new SAXReader().read(configFile);
|
||||
|
@ -223,7 +223,7 @@ public class TestCaseWrite {
|
|||
* @return 类本身,以方便链式编码
|
||||
* @throws LabelNotFoundException 当在sheet标签中查不到相应的单元格id不存在时抛出的异常
|
||||
*/
|
||||
public TestCaseWrite addContent(String field, String... contents) {
|
||||
public T addContent(String field, String... contents) {
|
||||
return insertContent(field, fieldMap.get(field).content.size(), contents);
|
||||
}
|
||||
|
||||
|
@ -234,7 +234,8 @@ public class TestCaseWrite {
|
|||
* @return 类本身,以方便链式编码
|
||||
* @throws LabelNotFoundException 当在sheet标签中查不到相应的单元格id不存在时抛出的异常
|
||||
*/
|
||||
public TestCaseWrite removeContent(String field, int...indexs) {
|
||||
@SuppressWarnings("unchecked")
|
||||
public T removeContent(String field, int...indexs) {
|
||||
// 判断字段是否存在,若不存在,则抛出异常
|
||||
if (!fieldMap.containsKey(field)) {
|
||||
throw new LabelNotFoundException("当前sheet不存在的标签id:" + field);
|
||||
|
@ -248,7 +249,7 @@ public class TestCaseWrite {
|
|||
}
|
||||
});
|
||||
|
||||
return this;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -267,7 +268,8 @@ public class TestCaseWrite {
|
|||
* @return 类本身,以方便链式编码
|
||||
* @throws LabelNotFoundException 当在sheet标签中查不到相应的单元格id不存在时抛出的异常
|
||||
*/
|
||||
public TestCaseWrite insertContent(String field, int index, String... contents) {
|
||||
@SuppressWarnings("unchecked")
|
||||
public T insertContent(String field, int index, String... contents) {
|
||||
// 判断字段是否存在,若不存在,则抛出异常
|
||||
if (!fieldMap.containsKey(field)) {
|
||||
throw new LabelNotFoundException("当前sheet不存在的标签id:" + field);
|
||||
|
@ -275,12 +277,12 @@ public class TestCaseWrite {
|
|||
|
||||
//若未传值或传入null,则直接结束
|
||||
if (contents == null || contents.length == 0) {
|
||||
return this;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
//若传入的下标大于相应的最大段落数时,则直接结束
|
||||
if (index > fieldMap.get(field).content.size()) {
|
||||
return this;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
if (fieldMap.get(field).datas.size() != 0) {
|
||||
|
@ -296,7 +298,7 @@ public class TestCaseWrite {
|
|||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
return this;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -311,7 +313,8 @@ public class TestCaseWrite {
|
|||
* @return 类本身,以方便链式编码
|
||||
* @throws LabelNotFoundException 当在sheet标签中查不到相应的单元格id不存在时抛出的异常
|
||||
*/
|
||||
public TestCaseWrite replaceContent(String field, int index, String... contents) {
|
||||
@SuppressWarnings("unchecked")
|
||||
public T replaceContent(String field, int index, String... contents) {
|
||||
// 判断字段是否存在,若不存在,则抛出异常
|
||||
if (!fieldMap.containsKey(field)) {
|
||||
throw new LabelNotFoundException("当前sheet不存在的标签id:" + field);
|
||||
|
@ -319,12 +322,12 @@ public class TestCaseWrite {
|
|||
|
||||
//若未传值或传入null,则直接结束
|
||||
if (contents == null || contents.length == 0) {
|
||||
return this;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
//若传入的下标大于相应的最大段落数时,则直接结束
|
||||
if (index >= fieldMap.get(field).content.size()) {
|
||||
return this;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
//移除相应的段落
|
||||
|
@ -332,7 +335,7 @@ public class TestCaseWrite {
|
|||
//在原位置上插入相应的内容
|
||||
insertContent(field, index, contents);
|
||||
|
||||
return this;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -341,7 +344,8 @@ public class TestCaseWrite {
|
|||
* @return 类本身,以方便链式编码
|
||||
* @throws LabelNotFoundException 当在sheet标签中查不到相应的单元格id不存在时抛出的异常
|
||||
*/
|
||||
public TestCaseWrite clearContent(String field) {
|
||||
@SuppressWarnings("unchecked")
|
||||
public T clearContent(String field) {
|
||||
// 判断字段是否存在,若不存在,则抛出异常
|
||||
if (!fieldMap.containsKey(field)) {
|
||||
throw new LabelNotFoundException("当前sheet不存在的标签id:" + field);
|
||||
|
@ -349,7 +353,7 @@ public class TestCaseWrite {
|
|||
|
||||
fieldMap.get(field).content.clear();
|
||||
|
||||
return this;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -358,7 +362,8 @@ public class TestCaseWrite {
|
|||
* @param testCase 测试用例生成方法
|
||||
* @return 类本身
|
||||
*/
|
||||
public TestCaseWrite addCase(Case testCase) {
|
||||
@SuppressWarnings("unchecked")
|
||||
public T addCase(Case testCase) {
|
||||
// 获取用例内容
|
||||
HashMap<String, ArrayList<String>> labelMap = testCase.getFieldTextMap();
|
||||
|
||||
|
@ -367,7 +372,7 @@ public class TestCaseWrite {
|
|||
addContent(field, labelMap.get(label).toArray(new String[] {}));
|
||||
});
|
||||
|
||||
return this;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -810,10 +815,17 @@ public class TestCaseWrite {
|
|||
|
||||
// 查找所有的内容,并将特殊词语进行替换
|
||||
for (int i = 0; i < contents.length; i++) {
|
||||
// 若需要添加序号,则先获取当前列表中的字段个数,以便于继续编号
|
||||
contents[i] = field.getDataValidation(contents[i]);
|
||||
try {
|
||||
//转换内容为
|
||||
int index = Integer.valueOf(contents[i]);
|
||||
// 若需要添加序号,则先获取当前列表中的字段个数,以便于继续编号
|
||||
contents[i] = field.getDataValidation(index);
|
||||
}catch (NumberFormatException e) {
|
||||
//若传入的内容无法转换,则继续循环
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return contents;
|
||||
}
|
||||
|
||||
|
@ -1030,25 +1042,6 @@ public class TestCaseWrite {
|
|||
}
|
||||
textElement.addAttribute("colors", String.valueOf(color.getColorsValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于对步骤和预期同时进行标记,使用该方法前需要调用{@link TestCaseWrite#setPresupposeField(FieldType, String)}
|
||||
* 方法对字段的步骤({@link FieldType#STEP}枚举值)和预期({@link FieldType#EXPECT}枚举值)进行标记。
|
||||
* 若步骤和预期中一项未添加时,则只标记存在的文本;若均不存在,则不进行标记。下标从0开始计算,若下标小于0时,
|
||||
* 则标记第一段;若下标大于最大段落数时,则编辑最后一段。
|
||||
*
|
||||
* @param stepIndex 步骤或预期下标 colors {@link MarkColorsType}类枚举
|
||||
* @param colors {@link MarkColorsType}类枚举
|
||||
* @return 类本身
|
||||
*/
|
||||
public CaseMark markStepAndExcept(int stepIndex, MarkColorsType colors) {
|
||||
// 标记步骤
|
||||
changeTextColor(FieldType.STEP.getValue(), stepIndex, colors);
|
||||
// 标记预期
|
||||
changeTextColor(FieldType.EXPECT.getValue(), stepIndex, colors);
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1102,14 +1095,6 @@ public class TestCaseWrite {
|
|||
*/
|
||||
public ArrayList<String> datas = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 用于构造Field
|
||||
*
|
||||
* @param id 字段id
|
||||
* @param align 单元格对齐方式
|
||||
* @param index 字段在单元格中的位置
|
||||
* @param datas 字段是否存在数据有效性
|
||||
*/
|
||||
/**
|
||||
* 用于构造Field
|
||||
*
|
||||
|
@ -1180,25 +1165,21 @@ public class TestCaseWrite {
|
|||
* @param indexText 下标字符串
|
||||
* @return 数据有效性中对应的数据,无法转换则返回传入的字符串
|
||||
*/
|
||||
public String getDataValidation(String indexText) {
|
||||
public String getDataValidation(int index) {
|
||||
//若数据有效性字段内容为空,则直接返回传入的值
|
||||
if (datas.size() == 0) {
|
||||
return indexText;
|
||||
return "";
|
||||
}
|
||||
|
||||
//若存在数据有效性,则将传入的数值字符串进行转换,若无法转换为数字,则直接返回所填字段
|
||||
try {
|
||||
int index = Integer.valueOf(indexText) - 1;
|
||||
//再次判断转换的数字是否符合要求,若小于0,则返回第一个数据,若大于集合长度,则返回最后一个数据
|
||||
if (index < 0) {
|
||||
return datas.get(0);
|
||||
} else if (index > datas.size()) {
|
||||
return datas.get(datas.size() - 1);
|
||||
} else {
|
||||
return datas.get(index);
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
return indexText;
|
||||
index = index - 1;
|
||||
//再次判断转换的数字是否符合要求,若小于0,则返回第一个数据,若大于集合长度,则返回最后一个数据
|
||||
if (index < 0) {
|
||||
return datas.get(0);
|
||||
} else if (index >= datas.size()) {
|
||||
return datas.get(datas.size() - 1);
|
||||
} else {
|
||||
return datas.get(index);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1229,7 +1210,7 @@ public class TestCaseWrite {
|
|||
|
||||
// 判断数据有效性sheet页是否存在,若不存在,则结束
|
||||
XSSFSheet dataSheet;
|
||||
if ((dataSheet = xw.getSheet(TestCaseTemplet.DATA_SHEET_NAME)) == null) {
|
||||
if ((dataSheet = xw.getSheet(CreateCaseFile.DATA_SHEET_NAME)) == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1241,7 +1222,7 @@ public class TestCaseWrite {
|
|||
}
|
||||
|
||||
// 拼接当前数据在数据有效性页中的名称(sheetName来自外层类)
|
||||
String dataCellTitle = sheetName + TestCaseTemplet.SIGN + id;
|
||||
String dataCellTitle = sheetName + CreateCaseFile.SIGN + id;
|
||||
// 遍历第一行相应的单元格,查看是否存在与sheetName相同的
|
||||
int cellindex = 0;
|
||||
for (; cellindex < xr.getLastCellNum(); cellindex++) {
|
||||
|
@ -1263,7 +1244,7 @@ public class TestCaseWrite {
|
|||
}
|
||||
|
||||
// 数据有效性公式约束拼接
|
||||
String dataConstraint = "=" + TestCaseTemplet.DATA_SHEET_NAME + "!$" + ((char) (65 + cellindex)) + "$2:$"
|
||||
String dataConstraint = "=" + CreateCaseFile.DATA_SHEET_NAME + "!$" + ((char) (65 + cellindex)) + "$2:$"
|
||||
+ ((char) (65 + cellindex)) + "$" + String.valueOf(rowNum + 1);
|
||||
|
||||
// 创建公式约束
|
|
@ -0,0 +1,27 @@
|
|||
package pres.auxiliary.work.testcase.file;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>BasicTestCaseWrite.java</p>
|
||||
* <p><b>用途:</b>在无相应的测试用例文件类时,可使用本类,对自定义的一个测试用例模板进行编辑</p>
|
||||
* <p><b>编码时间:</b>2020年4月5日 下午6:51:54</p>
|
||||
* <p><b>修改时间:</b>2020年4月5日 下午6:51:54</p>
|
||||
* @author 彭宇琦
|
||||
* @version Ver1.0
|
||||
* @since JDK 12
|
||||
*/
|
||||
public class BasicTestCaseWrite extends AbstractTestCaseWrite<BasicTestCaseWrite> {
|
||||
/**
|
||||
* 通过测试文件模板xml配置文件和测试用例文件来构造AbstractTestCaseWrite类。当配置文件中
|
||||
* 只存在一个sheet标签时,则直接获取其对应sheet下所有column标签的id属性;若存在
|
||||
* 多个sheet标签时,则读取第一个sheet标签,如需切换sheet标签,则可调用{@link #switchSheet(String)} 方法。
|
||||
*
|
||||
* @param configFile 测试文件模板xml配置文件类对象
|
||||
* @param caseFile 测试用例文件类对象
|
||||
* @throws IncorrectFileException 文件格式或路径不正确时抛出的异常
|
||||
*/
|
||||
public BasicTestCaseWrite(File configFile, File caseFile) {
|
||||
super(configFile, caseFile);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,160 @@
|
|||
package pres.auxiliary.work.testcase.file;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>CommonTestCaseWrite.java</p>
|
||||
* <p><b>用途:</b>用于</p>
|
||||
* <p><b>编码时间:</b>2020年4月5日 下午2:22:20</p>
|
||||
* <p><b>修改时间:</b>2020年4月5日 下午2:22:20</p>
|
||||
* @author 彭宇琦
|
||||
* @version Ver1.0
|
||||
* @since JDK 12
|
||||
*/
|
||||
public abstract class CommonTestCaseWrite<T extends CommonTestCaseWrite<T>> extends AbstractTestCaseWrite<CommonTestCaseWrite<T>> {
|
||||
/**
|
||||
* 通过测试文件模板xml配置文件和测试用例文件来构造JiraTestCaseWrite类。当配置文件中
|
||||
* 只存在一个sheet标签时,则直接获取其对应sheet下所有column标签的id属性;若存在
|
||||
* 多个sheet标签时,则读取第一个sheet标签,如需切换sheet标签,则可调用{@link #switchSheet(String)} 方法。
|
||||
*
|
||||
* @param configFile 测试文件模板xml配置文件类对象
|
||||
* @param caseFile 测试用例文件类对象
|
||||
* @throws IncorrectFileException 文件格式或路径不正确时抛出的异常
|
||||
*/
|
||||
public CommonTestCaseWrite(File configFile, File caseFile) {
|
||||
super(configFile, caseFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于写入标题信息
|
||||
* @param title 标题
|
||||
* @return 类本身
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T addTitle(String title) {
|
||||
//清除标题原有的内容
|
||||
clearContent(getTitleName());
|
||||
//写入标题
|
||||
return (T) addContent(getTitleName(), title);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于写入步骤信息
|
||||
* @param steps 步骤
|
||||
* @return 类本身
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T addStep(String... steps) {
|
||||
//写入步骤信息
|
||||
addContent(getStepName(), steps);
|
||||
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于写入预期信息
|
||||
* @param stpes 预期
|
||||
* @return 类本身
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T addExcept(String... excepts) {
|
||||
//写入预期信息
|
||||
addContent(getExceptName(), excepts);
|
||||
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 由于步骤与预期是对应的,故可使用该方法写入一条步骤与预期信息
|
||||
* @param step 步骤
|
||||
* @param except 预期
|
||||
* @return 类本身
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T addStepAndExcept(String step, String except) {
|
||||
//写入步骤信息
|
||||
addContent(getStepName(), step);
|
||||
//写入预期信息
|
||||
addContent(getExceptName(), except);
|
||||
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据关键词,匹配相应的模块信息,若未传入信息,则不写入信息,若能匹配信息,则会有以下三种情况:
|
||||
* <ol>
|
||||
* <li>匹配一个结果,则直接存入结果</li>
|
||||
* <li>匹配多个结果,则以“key1/key2/key3/.../keyN/”的形式拼接字符串</li>
|
||||
* <li>无匹配结果,则以“key1/key2/key3/.../keyN/”的形式拼接字符串</li>
|
||||
* </ol>
|
||||
* 重复调用该方法时将覆盖原写入的内容。
|
||||
* @param keys 关键词组
|
||||
* @return 类本身
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T addModule(String... keys) {
|
||||
//清除原有的内容
|
||||
clearContent(getModuleName());
|
||||
|
||||
//若未传入关键词,则不填写信息
|
||||
if (keys == null) {
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
//若只有一个关键词,并且能转换成数字的情况下,则无需做任何处理,直接调用addContent方法
|
||||
if (keys.length == 1) {
|
||||
try {
|
||||
Integer.valueOf(keys[0]);
|
||||
return (T) addContent(getModuleName(), keys);
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
}
|
||||
|
||||
//若关键词不止一个,则对关键词进行匹配(调用匹配方法)
|
||||
//匹配模块信息,分为两种情况:
|
||||
//1.命中一个结果,则直接存入结果
|
||||
//2.命中多个结果或未命中结果,则以“/key1/key2/key3/.../keyN”的形式拼接字符串
|
||||
//获取数据有效性
|
||||
ArrayList<String> dataList = fieldMap.get(getModuleName()).matchDataValidation(keys);
|
||||
//存储最终得到的模块信息
|
||||
StringBuilder dataText = new StringBuilder();
|
||||
if (dataList.size() == 1) {
|
||||
dataText.append(dataList.get(0));
|
||||
} else {
|
||||
Arrays.stream(keys).forEach(text -> {
|
||||
//拼接关键词
|
||||
dataText.append("/" + text);
|
||||
});
|
||||
}
|
||||
|
||||
//写入得到的关键词
|
||||
addContent(getModuleName(), String.valueOf(dataText.toString()));
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于返回步骤在xml文件中的id,在{@link #addStep(String...)}中使用
|
||||
* @return 步骤在xml文件中的id
|
||||
*/
|
||||
abstract String getStepName();
|
||||
|
||||
/**
|
||||
* 用于返回预期在xml文件中的id,在{@link #addExcept(String...)}中使用
|
||||
* @return 预期在xml文件中的id
|
||||
*/
|
||||
abstract String getExceptName();
|
||||
|
||||
/**
|
||||
* 用于返回指向模块在xml文件中的id,在{@link #addModule(String...)}中使用
|
||||
* @return 模块在xml文件中的id
|
||||
*/
|
||||
abstract String getModuleName();
|
||||
|
||||
/**
|
||||
* 用于返回指向标题在xml文件中的id,在{@link #addModule(String...)}中使用
|
||||
* @return 标题在xml文件中的id
|
||||
*/
|
||||
abstract String getTitleName();
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.n.testcase.file;
|
||||
package pres.auxiliary.work.testcase.file;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
@ -21,11 +21,11 @@ import org.dom4j.Element;
|
|||
import org.dom4j.io.SAXReader;
|
||||
|
||||
import pres.auxiliary.tool.readfile.ListFileRead;
|
||||
import pres.auxiliary.work.n.testcase.templet.LabelNotFoundException;
|
||||
import pres.auxiliary.work.testcase.templet.LabelNotFoundException;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* <b>文件名:</b>TestCaseTemplet.java
|
||||
* <b>文件名:</b>CreateCaseFile.java
|
||||
* </p>
|
||||
* <p>
|
||||
* <b>用途:</b>用于根据测试用例模板xml配置文件来生成测试用例模板文件
|
||||
|
@ -42,7 +42,7 @@ import pres.auxiliary.work.n.testcase.templet.LabelNotFoundException;
|
|||
* @since JDK 12
|
||||
*
|
||||
*/
|
||||
public class TestCaseTemplet {
|
||||
public class CreateCaseFile {
|
||||
/**
|
||||
* 用于对数据有效性在文件中标题的sheet与id之间的分隔符
|
||||
*/
|
||||
|
@ -76,7 +76,7 @@ public class TestCaseTemplet {
|
|||
* @throws DocumentException 当xml配置文件错误时抛出
|
||||
* @throws IncorrectFileException 文件格式或路径不正确时抛出的异常
|
||||
*/
|
||||
public TestCaseTemplet(File configurationFile, File templetFile) throws DocumentException {
|
||||
public CreateCaseFile(File configurationFile, File templetFile) throws DocumentException {
|
||||
// 判断传入的configurationFile是否为一个文件类对象,若非文件类对象,则抛出异常(isFile()方法包含判断文件是否存在)
|
||||
// 再判断文件是否包含文件路径是否包含“.xml”
|
||||
if (configurationFile.isFile() && configurationFile.getAbsolutePath().indexOf(".xml") > -1) {
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.n.testcase.file;
|
||||
package pres.auxiliary.work.testcase.file;
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>FieidType.java</p>
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.n.testcase.file;
|
||||
package pres.auxiliary.work.testcase.file;
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>IncorrectFileException.java</p>
|
|
@ -0,0 +1,139 @@
|
|||
package pres.auxiliary.work.testcase.file;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import pres.auxiliary.work.testcase.templet.LabelType;
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>JiraTestCaseWrite.java</p>
|
||||
* <p><b>用途:</b>用于对上传jira测试用例模板,通过该类构造的用例文件,在使用测试用例
|
||||
* 模板类写入用例时可以不用指定相应的字段关系。该类中包含部分个性的方法,以方便编写
|
||||
* 测试用例</p>
|
||||
* <p><b>编码时间:</b>2020年4月3日下午4:23:05</p>
|
||||
* <p><b>修改时间:</b>2020年4月3日下午4:23:05</p>
|
||||
* @author 彭宇琦
|
||||
* @version Ver1.0
|
||||
* @since JDK 12
|
||||
*
|
||||
*/
|
||||
public class JiraTestCaseWrite extends CommonTestCaseWrite<JiraTestCaseWrite> {
|
||||
/**
|
||||
* 通过测试文件模板xml配置文件和测试用例文件来构造JiraTestCaseWrite类。当配置文件中
|
||||
* 只存在一个sheet标签时,则直接获取其对应sheet下所有column标签的id属性;若存在
|
||||
* 多个sheet标签时,则读取第一个sheet标签,如需切换sheet标签,则可调用{@link #switchSheet(String)} 方法。
|
||||
*
|
||||
* @param configFile 测试文件模板xml配置文件类对象
|
||||
* @param caseFile 测试用例文件类对象
|
||||
* @throws IncorrectFileException 文件格式或路径不正确时抛出的异常
|
||||
*/
|
||||
public JiraTestCaseWrite(File configFile, File caseFile) {
|
||||
super(configFile, caseFile);
|
||||
|
||||
//TODO 添加与测试用例模板的关联,若测试用例模板字段有所改变,则在此改变关联字段
|
||||
relevanceCase(JiraFieldIdType.STEP.getName(), LabelType.STEP.getName());
|
||||
relevanceCase(JiraFieldIdType.EXCEPT.getName(), LabelType.EXCEPT.getName());
|
||||
relevanceCase(JiraFieldIdType.PRECONDITION.getName(), LabelType.PRECONDITION.getName());
|
||||
relevanceCase(JiraFieldIdType.PRIORITY.getName(), LabelType.RANK.getName());
|
||||
relevanceCase(JiraFieldIdType.TITLE.getName(), LabelType.TITLE.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
String getStepName() {
|
||||
return JiraFieldIdType.STEP.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
String getExceptName() {
|
||||
return JiraFieldIdType.EXCEPT.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
String getModuleName() {
|
||||
return JiraFieldIdType.FOLDER.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
String getTitleName() {
|
||||
return JiraFieldIdType.TITLE.getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>JiraTestCaseWrite.java</p>
|
||||
* <p><b>用途:</b>用于枚举出jira用例文件模板xml文件中所有字段</p>
|
||||
* <p><b>编码时间:</b>2020年4月3日下午4:04:30</p>
|
||||
* <p><b>修改时间:</b>2020年4月3日下午4:04:30</p>
|
||||
* @author 彭宇琦
|
||||
* @version Ver1.0
|
||||
* @since JDK 12
|
||||
*
|
||||
*/
|
||||
enum JiraFieldIdType {
|
||||
/**
|
||||
* 标题(Name)
|
||||
*/
|
||||
TITLE("标题"),
|
||||
/**
|
||||
* 目的(Objective)
|
||||
*/
|
||||
OBJECTIVE("目的"),
|
||||
/**
|
||||
* 前置条件(Precondition)
|
||||
*/
|
||||
PRECONDITION("前置条件"),
|
||||
/**
|
||||
* 步骤(Test Script (Step-by-Step) - Step)
|
||||
*/
|
||||
STEP("步骤"),
|
||||
/**
|
||||
* 预期(Test Script (Step-by-Step) - Expected Result)
|
||||
*/
|
||||
EXCEPT("预期"),
|
||||
/**
|
||||
* 模块(Folder)
|
||||
*/
|
||||
FOLDER("模块"),
|
||||
/**
|
||||
* 状态(Status)
|
||||
*/
|
||||
STATUS("状态"),
|
||||
/**
|
||||
* 优先级(Priority)
|
||||
*/
|
||||
PRIORITY("优先级"),
|
||||
/**
|
||||
* 项目(Component)
|
||||
*/
|
||||
COMPONENT("项目"),
|
||||
/**
|
||||
* 设计者(Owner)
|
||||
*/
|
||||
OWNER("设计者"),
|
||||
/**
|
||||
* 关联需求(Coverage (Issues))
|
||||
*/
|
||||
ISSUES("关联需求"),
|
||||
/**
|
||||
* 关键用例
|
||||
*/
|
||||
CASE_KEY("关键用例"),
|
||||
;
|
||||
//用于存储枚举的名称
|
||||
private String name = "";
|
||||
|
||||
/**
|
||||
* 初始化枚举值
|
||||
* @param value 枚举值
|
||||
*/
|
||||
private JiraFieldIdType(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于返回枚举中存储的内容,即jira用例文件模板中的字段ID
|
||||
* @return 枚举值
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.n.testcase.file;
|
||||
package pres.auxiliary.work.testcase.file;
|
||||
|
||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.n.testcase.templet;
|
||||
package pres.auxiliary.work.testcase.templet;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
@ -11,7 +11,7 @@ import org.dom4j.DocumentException;
|
|||
import org.dom4j.Element;
|
||||
import org.dom4j.io.SAXReader;
|
||||
|
||||
import pres.auxiliary.work.n.testcase.file.IncorrectFileException;
|
||||
import pres.auxiliary.work.testcase.file.IncorrectFileException;
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>AbstractCase.java</p>
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.n.testcase.templet;
|
||||
package pres.auxiliary.work.testcase.templet;
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>CaseContentException.java</p>
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.n.testcase.templet;
|
||||
package pres.auxiliary.work.testcase.templet;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.n.testcase.templet;
|
||||
package pres.auxiliary.work.testcase.templet;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.n.testcase.templet;
|
||||
package pres.auxiliary.work.testcase.templet;
|
||||
|
||||
public class LabelNotFoundException extends RuntimeException {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.n.testcase.templet;
|
||||
package pres.auxiliary.work.testcase.templet;
|
||||
|
||||
/**
|
||||
* <p><b>文件名:</b>LabelType.java</p>
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.n.testcase.templet;
|
||||
package pres.auxiliary.work.testcase.templet;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
|
@ -21,7 +21,7 @@ import javax.swing.border.EmptyBorder;
|
|||
import javax.swing.filechooser.FileNameExtensionFilter;
|
||||
|
||||
import pres.auxiliary.directory.exception.IncorrectDirectoryException;
|
||||
import pres.auxiliary.work.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.old.testcase.templet.ZentaoTemplet;
|
||||
|
||||
public class WriteCaseMainFrame extends JFrame {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
@ -7,13 +7,13 @@ import org.junit.AfterClass;
|
|||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import pres.auxiliary.work.testcase.change.Tab;
|
||||
import pres.auxiliary.work.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.testcase.writecase.AddInformation;
|
||||
import pres.auxiliary.work.testcase.writecase.FileType;
|
||||
import pres.auxiliary.work.testcase.writecase.InputType;
|
||||
import pres.auxiliary.work.testcase.writecase.PhoneType;
|
||||
import pres.auxiliary.work.testcase.writecase.PresetCase;
|
||||
import pres.auxiliary.work.old.testcase.change.Tab;
|
||||
import pres.auxiliary.work.old.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.old.testcase.writecase.AddInformation;
|
||||
import pres.auxiliary.work.old.testcase.writecase.FileType;
|
||||
import pres.auxiliary.work.old.testcase.writecase.InputType;
|
||||
import pres.auxiliary.work.old.testcase.writecase.PhoneType;
|
||||
import pres.auxiliary.work.old.testcase.writecase.PresetCase;
|
||||
|
||||
public class TestAddInformation {
|
||||
static PresetCase pc;
|
||||
|
|
|
@ -7,9 +7,9 @@ import org.junit.AfterClass;
|
|||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import pres.auxiliary.work.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.testcase.writecase.BrowseList;
|
||||
import pres.auxiliary.work.testcase.writecase.PresetCase;
|
||||
import pres.auxiliary.work.old.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.old.testcase.writecase.BrowseList;
|
||||
import pres.auxiliary.work.old.testcase.writecase.PresetCase;
|
||||
|
||||
public class TestBrowseList {
|
||||
static PresetCase pc;
|
||||
|
|
|
@ -7,9 +7,9 @@ import org.junit.AfterClass;
|
|||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import pres.auxiliary.work.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.testcase.writecase.Map;
|
||||
import pres.auxiliary.work.testcase.writecase.PresetCase;
|
||||
import pres.auxiliary.work.old.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.old.testcase.writecase.Map;
|
||||
import pres.auxiliary.work.old.testcase.writecase.PresetCase;
|
||||
|
||||
public class TestMap {
|
||||
static PresetCase pc;
|
||||
|
|
|
@ -7,9 +7,9 @@ import org.junit.AfterClass;
|
|||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import pres.auxiliary.work.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.testcase.writecase.PresetCase;
|
||||
import pres.auxiliary.work.testcase.writecase.Username;
|
||||
import pres.auxiliary.work.old.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.old.testcase.writecase.PresetCase;
|
||||
import pres.auxiliary.work.old.testcase.writecase.Username;
|
||||
|
||||
public class TestUsername {
|
||||
static PresetCase pc;
|
||||
|
|
|
@ -7,9 +7,9 @@ import org.junit.AfterClass;
|
|||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import pres.auxiliary.work.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.testcase.writecase.PresetCase;
|
||||
import pres.auxiliary.work.testcase.writecase.Video;
|
||||
import pres.auxiliary.work.old.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.old.testcase.writecase.PresetCase;
|
||||
import pres.auxiliary.work.old.testcase.writecase.Video;
|
||||
|
||||
public class TestVideo {
|
||||
static PresetCase pc;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase;
|
||||
package pres.auxiliary.work.testcase.file;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -11,13 +11,12 @@ import org.testng.annotations.BeforeClass;
|
|||
import org.testng.annotations.BeforeMethod;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import pres.auxiliary.work.n.testcase.file.FieldType;
|
||||
import pres.auxiliary.work.n.testcase.file.MarkColorsType;
|
||||
import pres.auxiliary.work.n.testcase.file.TestCaseTemplet;
|
||||
import pres.auxiliary.work.n.testcase.file.TestCaseWrite;
|
||||
import pres.auxiliary.work.n.testcase.file.TestCaseWrite.CaseMark;
|
||||
import pres.auxiliary.work.n.testcase.templet.InformationCase;
|
||||
import pres.auxiliary.work.n.testcase.templet.LabelType;
|
||||
import pres.auxiliary.work.testcase.file.MarkColorsType;
|
||||
import pres.auxiliary.work.testcase.file.CreateCaseFile;
|
||||
import pres.auxiliary.work.testcase.file.AbstractTestCaseWrite;
|
||||
import pres.auxiliary.work.testcase.file.AbstractTestCaseWrite.CaseMark;
|
||||
import pres.auxiliary.work.testcase.templet.InformationCase;
|
||||
import pres.auxiliary.work.testcase.templet.LabelType;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -38,8 +37,8 @@ import pres.auxiliary.work.n.testcase.templet.LabelType;
|
|||
* @since JDK 12
|
||||
*
|
||||
*/
|
||||
public class WriteTestCaseTest {
|
||||
TestCaseWrite wtc;
|
||||
public class BasicTestCaseWriteTest {
|
||||
BasicTestCaseWrite wtc;
|
||||
|
||||
/**
|
||||
* 配置文件类对象
|
||||
|
@ -52,11 +51,11 @@ public class WriteTestCaseTest {
|
|||
|
||||
@BeforeClass
|
||||
public void createTemplet() throws DocumentException, IOException {
|
||||
TestCaseTemplet temp = new TestCaseTemplet(conFile, tempFile);
|
||||
CreateCaseFile temp = new CreateCaseFile(conFile, tempFile);
|
||||
temp.setCoverFile(true);
|
||||
temp.create();
|
||||
|
||||
wtc = new TestCaseWrite(conFile, tempFile);
|
||||
wtc = new BasicTestCaseWrite(conFile, tempFile);
|
||||
|
||||
wtc.relevanceCase("步骤", LabelType.STEP.getName());
|
||||
wtc.relevanceCase("预期", LabelType.EXCEPT.getName());
|
||||
|
@ -96,7 +95,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#addContent(String, String)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#addContent(String, String)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addContentTest_NotDataValidetion() {
|
||||
|
@ -104,7 +103,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#addContent(String, String)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#addContent(String, String)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addContentTest_hasDataValidetion() {
|
||||
|
@ -112,7 +111,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#addCase(pres.auxiliary.work.n.testcase.Case)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#addCase(pres.auxiliary.work.n.testcase.Case)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addCaseTest() {
|
||||
|
@ -128,7 +127,7 @@ public class WriteTestCaseTest {
|
|||
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#setReplactWord(String, String)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#setReplactWord(String, String)}方法
|
||||
*/
|
||||
@Test
|
||||
public void setReplactWordTest() {
|
||||
|
@ -146,7 +145,7 @@ public class WriteTestCaseTest {
|
|||
*/
|
||||
@Test
|
||||
public void markFieldTest() {
|
||||
CaseMark cm = wtc.end().fieldComment("步骤", "步骤标记").fieldComment(FieldType.EXPECT.getValue(), "预期标记");
|
||||
CaseMark cm = wtc.end().fieldComment("步骤", "步骤标记").fieldComment("预期", "预期标记");
|
||||
cm.fieldComment("目的", "目的标记");
|
||||
}
|
||||
|
||||
|
@ -155,7 +154,7 @@ public class WriteTestCaseTest {
|
|||
*/
|
||||
@Test
|
||||
public void fieldBackgroundTest() {
|
||||
CaseMark cm = wtc.end().changeFieldBackground("步骤", MarkColorsType.BLUE).changeFieldBackground(FieldType.EXPECT.getValue(),
|
||||
CaseMark cm = wtc.end().changeFieldBackground("步骤", MarkColorsType.BLUE).changeFieldBackground("预期",
|
||||
MarkColorsType.RED);
|
||||
cm.changeFieldBackground("目的", MarkColorsType.GREEN);
|
||||
}
|
||||
|
@ -176,25 +175,17 @@ public class WriteTestCaseTest {
|
|||
wtc.end().changeTextColor("目的", 0, MarkColorsType.YELLOW);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试{@link CaseMark#markStepAndExcept(int, MarkColorsType)}方法
|
||||
*/
|
||||
@Test
|
||||
public void markStepAndExceptTest() {
|
||||
wtc.end().markStepAndExcept(2, MarkColorsType.RED);
|
||||
}
|
||||
|
||||
/**
|
||||
* 综合测试标记方法
|
||||
*/
|
||||
@Test
|
||||
public void markTest() {
|
||||
wtc.end().markStepAndExcept(2, MarkColorsType.RED).fieldComment("目的", "目的标记").changeFieldBackground("设计者",
|
||||
wtc.end().fieldComment("目的", "目的标记").changeFieldBackground("设计者",
|
||||
MarkColorsType.YELLOW);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#removeContent(String, int...)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#removeContent(String, int...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void removeContentTest_1() {
|
||||
|
@ -203,7 +194,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#removeContent(String, int...)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#removeContent(String, int...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void removeContentTest_2() {
|
||||
|
@ -211,7 +202,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#removeContent(String, int...)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#removeContent(String, int...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void removeContentTest_3() {
|
||||
|
@ -220,7 +211,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#insertContent(String, int, String...)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#insertContent(String, int, String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void insertContentTest_1() {
|
||||
|
@ -229,7 +220,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#insertContent(String, int, String...)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#insertContent(String, int, String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void insertContentTest_2() {
|
||||
|
@ -237,7 +228,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#insertContent(String, int, String...)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#insertContent(String, int, String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void insertContentTest_3() {
|
||||
|
@ -246,7 +237,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#insertContent(String, int, String...)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#insertContent(String, int, String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void insertContentTest_4() {
|
||||
|
@ -255,7 +246,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#insertContent(String, int, String...)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#insertContent(String, int, String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void insertContentTest_5() {
|
||||
|
@ -264,7 +255,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#replaceContent(String, int, String...)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#replaceContent(String, int, String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void replaceContentTest_1() {
|
||||
|
@ -273,7 +264,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#replaceContent(String, int, String...)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#replaceContent(String, int, String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void replaceContentTest_2() {
|
||||
|
@ -281,7 +272,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#replaceContent(String, int, String...)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#replaceContent(String, int, String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void replaceContentTest_3() {
|
||||
|
@ -290,7 +281,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#replaceContent(String, int, String...)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#replaceContent(String, int, String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void replaceContentTest_4() {
|
||||
|
@ -299,7 +290,7 @@ public class WriteTestCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseWrite#replaceContent(String, int, String...)}方法
|
||||
* 测试{@link AbstractTestCaseWrite#replaceContent(String, int, String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void replaceContentTest_5() {
|
|
@ -0,0 +1,169 @@
|
|||
package pres.auxiliary.work.testcase.file;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.dom4j.DocumentException;
|
||||
import org.testng.annotations.AfterClass;
|
||||
import org.testng.annotations.AfterMethod;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.BeforeMethod;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import pres.auxiliary.work.testcase.file.JiraTestCaseWrite.JiraFieldIdType;
|
||||
import pres.auxiliary.work.testcase.templet.DataListCase;
|
||||
|
||||
public class JiraTestCaseWriteTest {
|
||||
JiraTestCaseWrite wtc;
|
||||
|
||||
/**
|
||||
* 配置文件类对象
|
||||
*/
|
||||
File conFile = new File("ConfigurationFiles/CaseConfigurationFile/FileTemplet/JiraCaseFileTemplet/jira测试用例导入模板.xml");
|
||||
/**
|
||||
* 模板文件类对象
|
||||
*/
|
||||
File tempFile = new File("Result/测试用例.xlsx");
|
||||
|
||||
@BeforeClass
|
||||
public void createTemplet() throws DocumentException, IOException {
|
||||
CreateCaseFile temp = new CreateCaseFile(conFile, tempFile);
|
||||
temp.setCoverFile(true);
|
||||
temp.create();
|
||||
|
||||
wtc = new JiraTestCaseWrite(conFile, tempFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开文件夹
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@AfterClass
|
||||
public void openFolder() throws IOException {
|
||||
wtc.writeFile();
|
||||
System.out.println("-".repeat(20));
|
||||
java.awt.Desktop.getDesktop().open(tempFile.getParentFile());
|
||||
java.awt.Desktop.getDesktop().open(tempFile);
|
||||
}
|
||||
|
||||
@BeforeMethod
|
||||
public void addContent(Method method) {
|
||||
System.out.println("=======正在运行:" + method.getName() + "=======");
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束一条用例的编写
|
||||
*/
|
||||
@AfterMethod
|
||||
public void endCase() {
|
||||
wtc.end();
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试{@link JiraTestCaseWrite#addStep(String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addStepTest() {
|
||||
wtc.addStep("步骤1", "步骤2");
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试{@link JiraTestCaseWrite#addExcept(String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addExceptTest() {
|
||||
wtc.addExcept("预期1", "预期2");
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试{@link JiraTestCaseWrite#addStepAndExcept(String, String)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addStepAndExceptTest() {
|
||||
wtc.addStepAndExcept("合并步骤1", "合并预期1").addStepAndExcept("合并步骤2", "合并预期2");
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试{@link JiraTestCaseWrite#addTitle(String)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addTitleTest() {
|
||||
wtc.addTitle("标题1").addTitle("标题2");
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试{@link JiraTestCaseWrite#addModule(String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addModuleTest_NotString() {
|
||||
wtc.addModule();
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试{@link JiraTestCaseWrite#addModule(String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addModuleTest_NumberString() {
|
||||
wtc.addModule("1");
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试{@link JiraTestCaseWrite#addModule(String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addModuleTest_TextString() {
|
||||
wtc.addModule("标段合并管理");
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试{@link JiraTestCaseWrite#addModule(String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addModuleTest_SearchString() {
|
||||
wtc.addModule("运营", "标段现场管理");
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试{@link JiraTestCaseWrite#addModule(String...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addModuleTest_NoetSearchString() {
|
||||
wtc.addModule("企业", "合并");
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试添加一条预设的测试用例
|
||||
* @throws IOException
|
||||
*/
|
||||
@Test
|
||||
public void addCaseTest() throws IOException {
|
||||
DataListCase dlc = new DataListCase(new File("ConfigurationFiles/CaseConfigurationFile/CaseTemplet/BrowseList.xml"));
|
||||
dlc.setReplaceWord(DataListCase.DATA_NAME, "用户");
|
||||
wtc.addCase(dlc.appBrowseListCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* 综合测试
|
||||
*/
|
||||
@Test
|
||||
public void synthesizeTest() {
|
||||
wtc.addTitle("测试一个标题")
|
||||
.addModule("企业", "标段现场")
|
||||
.addStep("步骤1", "步骤2")
|
||||
.addExcept("预期1", "预期2")
|
||||
.addStepAndExcept("步骤3", "预期3")
|
||||
.addContent(JiraFieldIdType.CASE_KEY.getName(), "1")
|
||||
.addContent(JiraFieldIdType.COMPONENT.getName(), "4")
|
||||
.addContent(JiraFieldIdType.ISSUES.getName(), "4")
|
||||
.addContent(JiraFieldIdType.OBJECTIVE.getName(), "目的")
|
||||
.addContent(JiraFieldIdType.OWNER.getName(), "彭宇琦")
|
||||
.addContent(JiraFieldIdType.PRECONDITION.getName(), "前置1", "前置2")
|
||||
.addContent(JiraFieldIdType.PRIORITY.getName(), "1")
|
||||
.addContent(JiraFieldIdType.STATUS.getName(), "3")
|
||||
.end()
|
||||
.changeTextColor(JiraFieldIdType.STEP.getName(), 0, MarkColorsType.GREEN)
|
||||
.fieldComment(JiraFieldIdType.FOLDER.getName(), "模块标记");
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase;
|
||||
package pres.auxiliary.work.testcase.file;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -9,14 +9,14 @@ import org.testng.annotations.BeforeClass;
|
|||
import org.testng.annotations.BeforeMethod;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import pres.auxiliary.work.n.testcase.file.IncorrectFileException;
|
||||
import pres.auxiliary.work.n.testcase.file.TestCaseTemplet;
|
||||
import pres.auxiliary.work.testcase.file.IncorrectFileException;
|
||||
import pres.auxiliary.work.testcase.file.CreateCaseFile;
|
||||
|
||||
public class TestCaseTempletTest {
|
||||
/**
|
||||
* 类对象
|
||||
*/
|
||||
TestCaseTemplet temp;
|
||||
CreateCaseFile temp;
|
||||
|
||||
/**
|
||||
* 模板文件类对象
|
||||
|
@ -33,7 +33,7 @@ public class TestCaseTempletTest {
|
|||
*/
|
||||
@BeforeClass
|
||||
public void newTestCaseTemplet() throws DocumentException {
|
||||
temp = new TestCaseTemplet(conFile, tempFile);
|
||||
temp = new CreateCaseFile(conFile, tempFile);
|
||||
temp.setCoverFile(true);
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class TestCaseTempletTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link TestCaseTemplet#create()}以及{@link TestCaseTemplet#setCoverFile(boolean)} <br>
|
||||
* 测试{@link CreateCaseFile#create()}以及{@link CreateCaseFile#setCoverFile(boolean)} <br>
|
||||
* 断言将抛出IncorrectFileException异常
|
||||
* @throws IOException
|
||||
*/
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase;
|
||||
package pres.auxiliary.work.testcase.templet;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
@ -7,10 +7,8 @@ import org.testng.annotations.AfterMethod;
|
|||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import pres.auxiliary.work.n.testcase.file.TestCaseTemplet;
|
||||
import pres.auxiliary.work.n.testcase.file.TestCaseWrite;
|
||||
import pres.auxiliary.work.n.testcase.templet.DataListCase;
|
||||
import pres.auxiliary.work.n.testcase.templet.LabelType;
|
||||
import pres.auxiliary.work.testcase.file.BasicTestCaseWrite;
|
||||
import pres.auxiliary.work.testcase.file.CreateCaseFile;
|
||||
|
||||
public class DataListCaseTest {
|
||||
/**
|
||||
|
@ -20,7 +18,7 @@ public class DataListCaseTest {
|
|||
/**
|
||||
* 指向测试用例文件字段配置文件
|
||||
*/
|
||||
File templetXml = new File("ConfigurationFiles/CaseConfigurationFile/FileTemplet/jira测试用例导入模板.xml");
|
||||
File templetXml = new File("ConfigurationFiles/CaseConfigurationFile/FileTemplet/JiraCaseFileTemplet/jira测试用例导入模板.xml");
|
||||
/**
|
||||
* 指向与InformationCase使用到的预设测试用例配置文件
|
||||
*/
|
||||
|
@ -30,18 +28,18 @@ public class DataListCaseTest {
|
|||
/**
|
||||
* 用于写入用例到文件中
|
||||
*/
|
||||
TestCaseWrite tcw;
|
||||
BasicTestCaseWrite tcw;
|
||||
|
||||
@BeforeClass
|
||||
public void start() throws Exception {
|
||||
TestCaseTemplet tct = new TestCaseTemplet(templetXml, testCaseFile);
|
||||
CreateCaseFile tct = new CreateCaseFile(templetXml, testCaseFile);
|
||||
//为方便演示,则允许覆盖用例文件
|
||||
tct.setCoverFile(true);
|
||||
//生成用例文件
|
||||
tct.create();
|
||||
|
||||
//初始化
|
||||
tcw = new TestCaseWrite(templetXml, testCaseFile);
|
||||
tcw = new BasicTestCaseWrite(templetXml, testCaseFile);
|
||||
|
||||
dc.setReplaceWord(DataListCase.DATA_NAME, "用户");
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase;
|
||||
package pres.auxiliary.work.testcase.templet;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
@ -6,11 +6,11 @@ import org.testng.annotations.AfterMethod;
|
|||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import pres.auxiliary.work.n.testcase.templet.CaseContentException;
|
||||
import pres.auxiliary.work.n.testcase.templet.InformationCase;
|
||||
import pres.auxiliary.work.n.testcase.templet.InformationCase.FileRuleType;
|
||||
import pres.auxiliary.work.n.testcase.templet.InformationCase.InputRuleType;
|
||||
import pres.auxiliary.work.n.testcase.templet.InformationCase.UploadFileType;
|
||||
import pres.auxiliary.work.testcase.templet.CaseContentException;
|
||||
import pres.auxiliary.work.testcase.templet.InformationCase;
|
||||
import pres.auxiliary.work.testcase.templet.InformationCase.FileRuleType;
|
||||
import pres.auxiliary.work.testcase.templet.InformationCase.InputRuleType;
|
||||
import pres.auxiliary.work.testcase.templet.InformationCase.UploadFileType;
|
||||
|
||||
public class InformationCaseTest {
|
||||
InformationCase ic = new InformationCase(new File("ConfigurationFiles/CaseConfigurationFile/CaseTemplet/AddInformation.xml"));
|
||||
|
@ -180,7 +180,7 @@ public class InformationCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link InformationCase#addPhoneCase(String, boolean, boolean, boolean, pres.auxiliary.work.n.testcase.templet.InformationCase.PhoneType...)}方法
|
||||
* 测试{@link InformationCase#addPhoneCase(String, boolean, boolean, boolean, pres.auxiliary.work.testcase.templet.InformationCase.PhoneType...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addPhoneCaseTest_Fixed() {
|
||||
|
@ -188,7 +188,7 @@ public class InformationCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link InformationCase#addPhoneCase(String, boolean, boolean, boolean, pres.auxiliary.work.n.testcase.templet.InformationCase.PhoneType...)}方法
|
||||
* 测试{@link InformationCase#addPhoneCase(String, boolean, boolean, boolean, pres.auxiliary.work.testcase.templet.InformationCase.PhoneType...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addPhoneCaseTest_Moble() {
|
||||
|
@ -196,7 +196,7 @@ public class InformationCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link InformationCase#addPhoneCase(String, boolean, boolean, boolean, pres.auxiliary.work.n.testcase.templet.InformationCase.PhoneType...)}方法
|
||||
* 测试{@link InformationCase#addPhoneCase(String, boolean, boolean, boolean, pres.auxiliary.work.testcase.templet.InformationCase.PhoneType...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addPhoneCaseTest_All() {
|
||||
|
@ -284,7 +284,7 @@ public class InformationCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link InformationCase#addUploadFileCase(String, boolean, boolean, boolean, int, int, int, pres.auxiliary.work.n.testcase.templet.InformationCase.UploadFileType, pres.auxiliary.work.n.testcase.templet.InformationCase.FileRuleType...)}方法
|
||||
* 测试{@link InformationCase#addUploadFileCase(String, boolean, boolean, boolean, int, int, int, pres.auxiliary.work.testcase.templet.InformationCase.UploadFileType, pres.auxiliary.work.testcase.templet.InformationCase.FileRuleType...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addUploadFileCaseTest_1() {
|
||||
|
@ -292,7 +292,7 @@ public class InformationCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link InformationCase#addUploadFileCase(String, boolean, boolean, boolean, int, int, int, pres.auxiliary.work.n.testcase.templet.InformationCase.UploadFileType, pres.auxiliary.work.n.testcase.templet.InformationCase.FileRuleType...)}方法
|
||||
* 测试{@link InformationCase#addUploadFileCase(String, boolean, boolean, boolean, int, int, int, pres.auxiliary.work.testcase.templet.InformationCase.UploadFileType, pres.auxiliary.work.testcase.templet.InformationCase.FileRuleType...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addUploadFileCaseTest_2() {
|
||||
|
@ -300,7 +300,7 @@ public class InformationCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link InformationCase#addUploadFileCase(String, boolean, boolean, boolean, int, int, int, pres.auxiliary.work.n.testcase.templet.InformationCase.UploadFileType, pres.auxiliary.work.n.testcase.templet.InformationCase.FileRuleType...)}方法
|
||||
* 测试{@link InformationCase#addUploadFileCase(String, boolean, boolean, boolean, int, int, int, pres.auxiliary.work.testcase.templet.InformationCase.UploadFileType, pres.auxiliary.work.testcase.templet.InformationCase.FileRuleType...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addUploadFileCaseTest_3() {
|
||||
|
@ -308,7 +308,7 @@ public class InformationCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link InformationCase#addUploadFileCase(String, boolean, boolean, boolean, int, int, int, pres.auxiliary.work.n.testcase.templet.InformationCase.UploadFileType, pres.auxiliary.work.n.testcase.templet.InformationCase.FileRuleType...)}方法
|
||||
* 测试{@link InformationCase#addUploadFileCase(String, boolean, boolean, boolean, int, int, int, pres.auxiliary.work.testcase.templet.InformationCase.UploadFileType, pres.auxiliary.work.testcase.templet.InformationCase.FileRuleType...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addUploadFileCaseTest_4() {
|
||||
|
@ -316,7 +316,7 @@ public class InformationCaseTest {
|
|||
}
|
||||
|
||||
/**
|
||||
* 测试{@link InformationCase#addUploadFileCase(String, boolean, boolean, boolean, int, int, int, pres.auxiliary.work.n.testcase.templet.InformationCase.UploadFileType, pres.auxiliary.work.n.testcase.templet.InformationCase.FileRuleType...)}方法
|
||||
* 测试{@link InformationCase#addUploadFileCase(String, boolean, boolean, boolean, int, int, int, pres.auxiliary.work.testcase.templet.InformationCase.UploadFileType, pres.auxiliary.work.testcase.templet.InformationCase.FileRuleType...)}方法
|
||||
*/
|
||||
@Test
|
||||
public void addUploadFileCaseTest_5() {
|
|
@ -1,4 +1,4 @@
|
|||
package pres.auxiliary.work.testcase;
|
||||
package pres.auxiliary.work.testcase.templet;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -10,12 +10,10 @@ import org.testng.annotations.BeforeGroups;
|
|||
import org.testng.annotations.BeforeTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import pres.auxiliary.work.n.testcase.file.MarkColorsType;
|
||||
import pres.auxiliary.work.n.testcase.file.TestCaseTemplet;
|
||||
import pres.auxiliary.work.n.testcase.file.TestCaseWrite;
|
||||
import pres.auxiliary.work.n.testcase.templet.InformationCase;
|
||||
import pres.auxiliary.work.n.testcase.templet.LabelType;
|
||||
import pres.auxiliary.work.n.testcase.templet.InformationCase.InputRuleType;
|
||||
import pres.auxiliary.work.testcase.file.BasicTestCaseWrite;
|
||||
import pres.auxiliary.work.testcase.file.CreateCaseFile;
|
||||
import pres.auxiliary.work.testcase.file.MarkColorsType;
|
||||
import pres.auxiliary.work.testcase.templet.InformationCase.InputRuleType;
|
||||
|
||||
public class ProgramWriteTestCaseDemo {
|
||||
/**
|
||||
|
@ -34,7 +32,7 @@ public class ProgramWriteTestCaseDemo {
|
|||
/**
|
||||
* 用于写入用例到文件中
|
||||
*/
|
||||
TestCaseWrite tcw;
|
||||
BasicTestCaseWrite tcw;
|
||||
/**
|
||||
* 用于使用信息类相关的测试用例模板
|
||||
*/
|
||||
|
@ -47,14 +45,14 @@ public class ProgramWriteTestCaseDemo {
|
|||
*/
|
||||
@BeforeTest
|
||||
public void createCaseFile() throws IOException, DocumentException {
|
||||
TestCaseTemplet tct = new TestCaseTemplet(templetXml, testCaseFile);
|
||||
CreateCaseFile tct = new CreateCaseFile(templetXml, testCaseFile);
|
||||
//为方便演示,则允许覆盖用例文件
|
||||
tct.setCoverFile(true);
|
||||
//生成用例文件
|
||||
tct.create();
|
||||
|
||||
//初始化
|
||||
tcw = new TestCaseWrite(templetXml, testCaseFile);
|
||||
tcw = new BasicTestCaseWrite(templetXml, testCaseFile);
|
||||
ic = new InformationCase(informationCase);
|
||||
|
||||
|
Binary file not shown.
|
@ -1,7 +1,7 @@
|
|||
package test.javase;
|
||||
|
||||
import pres.auxiliary.work.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.testcase.writecase.PresetCase;
|
||||
import pres.auxiliary.work.old.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.old.testcase.writecase.PresetCase;
|
||||
|
||||
public class Test123 {
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
|
|
@ -3,9 +3,9 @@ package test.javase;
|
|||
import java.io.IOException;
|
||||
import java.lang.reflect.Parameter;
|
||||
|
||||
import pres.auxiliary.work.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.testcase.writecase.InputType;
|
||||
import pres.auxiliary.work.testcase.writecase.PresetCase;
|
||||
import pres.auxiliary.work.old.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.old.testcase.writecase.InputType;
|
||||
import pres.auxiliary.work.old.testcase.writecase.PresetCase;
|
||||
|
||||
public class TestAddCase {
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
|
|
@ -4,9 +4,9 @@ import java.io.IOException;
|
|||
|
||||
import pres.auxiliary.tool.randomstring.RandomString;
|
||||
import pres.auxiliary.tool.randomstring.StringMode;
|
||||
import pres.auxiliary.work.testcase.change.Tab;
|
||||
import pres.auxiliary.work.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.testcase.writecase.AddInformation;
|
||||
import pres.auxiliary.work.old.testcase.change.Tab;
|
||||
import pres.auxiliary.work.old.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.old.testcase.writecase.AddInformation;
|
||||
|
||||
public class TestCase2 {
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
|
|
@ -5,9 +5,9 @@ import java.io.IOException;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import pres.auxiliary.work.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.testcase.writecase.PresetCase;
|
||||
import pres.auxiliary.work.testcase.writecase.Username;
|
||||
import pres.auxiliary.work.old.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.old.testcase.writecase.PresetCase;
|
||||
import pres.auxiliary.work.old.testcase.writecase.Username;
|
||||
|
||||
/**
|
||||
* FileName: TestCase3.java
|
||||
|
|
|
@ -3,7 +3,7 @@ package test.javase;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import pres.auxiliary.work.testcase.templet.ZentaoTemplet;
|
||||
import pres.auxiliary.work.old.testcase.templet.ZentaoTemplet;
|
||||
|
||||
/**
|
||||
* FileName: TestDisposeCaseFile.java
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package test.javase;
|
||||
|
||||
import pres.auxiliary.work.testcase.writecase.InputType;
|
||||
import pres.auxiliary.work.old.testcase.writecase.InputType;
|
||||
|
||||
public class TestEn {
|
||||
public static void main(String[] args) {
|
||||
|
|
|
@ -2,7 +2,7 @@ package test.javase;
|
|||
|
||||
import java.io.File;
|
||||
|
||||
import pres.auxiliary.work.testcase.change.WriteTestCase;
|
||||
import pres.auxiliary.work.old.testcase.change.WriteTestCase;
|
||||
|
||||
public class testWriteTestCase {
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
|
Loading…
Reference in New Issue