tools.config.SystemConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-autotest-tool Show documentation
Show all versions of java-autotest-tool Show documentation
This is an integration of autotest tools
package tools.config;
/**
* Created by zhengyu06 on 2017/9/12
*/
import org.testng.Reporter;
import java.util.ResourceBundle;
public class SystemConfig {
private static String configFile = "";//默认的全局配置文件地址。
public static String getConfigInfomation(String itemIndex) {
try {
ResourceBundle resource = ResourceBundle.getBundle(configFile);
return resource.getString(itemIndex);
} catch (Exception e) {
return "";
}
}
//改变全局配置文件地址。
public static void setConfigLocation(String path){
configFile = path;
Reporter.log("全局配置文件地址为:"+configFile,true);
}
}