Skip to content

Commit

Permalink
update: change package name to team.xutest; add MINIFEST; update READ…
Browse files Browse the repository at this point in the history
…ME.md
  • Loading branch information
ityoung committed Apr 15, 2018
1 parent 8283195 commit 9d0eda3
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 18 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,31 @@

## 依赖:

- fastjson
- ~~fastjson~~(已合并到jar包中)

- testng

## 使用方法:

1. 复制 `com.xutest` 到你的项目中;
1. 下载 `x-uTestngSDK.jar`;

2. 在你的 `testng.xml` 文件中按照 `src/com/testng.xml` 的格式添加监听器
2. 在你的测试项目中添加该 jar 包;

3. 在你的 `testng.xml` 文件中按照 **jar包**`testng.xml` 的格式添加监听器

**注意: listener标签需要添加在suite标签下内, test标签之前**

```
<listeners>
<listener class-name="com.xutest.XListener" />
<listener class-name="team.xutest.XListener" />
</listeners>
```

3. 修改 `xutest.properties` 配置文件中的信息为你搭建的 xutest系统 中的信息;
4. 复制 **jar包**`xutest.properties` 配置文件到你的 **src** 路径下;

5. 修改配置文件中的信息为你搭建的 xutest系统 中的信息;

4.`testng.xml` 为入口运行你的测试用例.
6.`testng.xml` 为入口运行你的测试用例.

## 已做工作:

Expand All @@ -36,9 +40,11 @@

4. 提取配置文件到 `xutest.properties` 中, 通过 `PropertiesReader` 类读取配置信息 (18-04-15)

5. 打成jar包方便开源引用 (18-04-15)

## TODOs:

1. 更好的引用方式 (jar包)
~~1. 更好的引用方式 (jar包)~~

~~2. 提取配置文件~~

Expand Down
3 changes: 3 additions & 0 deletions src/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path: fastjson-1.2.47.jar

4 changes: 2 additions & 2 deletions src/com/xutest/Connect.java → src/team/xutest/Connect.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.xutest;
package team.xutest;


import java.io.BufferedReader;
import java.io.DataOutputStream;
Expand All @@ -11,7 +12,6 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import com.xutest.PropertiesReader;

public class Connect {
// 与 x-utest 建立连接
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package com.xutest;
package team.xutest;


import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;

public class PropertiesReader {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.xutest;
package team.xutest;


import org.testng.TestListenerAdapter;
import org.testng.ITestResult;
import org.testng.ITestContext;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONArray;
import com.xutest.Connect;

import java.io.IOException;

Expand Down
4 changes: 2 additions & 2 deletions src/testng.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<suite name="suite1" >
<!-- 添加XListener监听器,XListener类在com.x-utest.XListener中 -->
<listeners>
<listener class-name="com.xutest.XListener" />
<listener class-name="team.xutest.XListener" />
</listeners>
<test name="test">
<classes >
<class name="com.test.TestDemo" />
<class name="team.test.TestDemo" />
</classes>
</test>
</suite>

0 comments on commit 9d0eda3

Please sign in to comment.