All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tools.config.SystemConfig Maven / Gradle / Ivy

There is a newer version: 0.2.2
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy