arjuna.lib.config.ConfigContainer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of arjuna-java Show documentation
Show all versions of arjuna-java Show documentation
Arjuna-Java is the client implementation in Java for development of test automation using Arjuna. It uses TestNG as the test engine. With minor tweaks, it can be used with any other test engine or custom test automation implementations. Arjuna is a Python based test automation framework developed by Rahul Verma (www.rahulverma.net)
The newest version!
package arjuna.lib.config;
import java.util.Map;
import arjuna.lib.state.ArjunaSingleton;
import arjuna.lib.value.StringKeyValueMap;
import arjuna.tpi.enums.ArjunaOption;
public class ConfigContainer {
private ArjunaOptionMap arjunaOptions = new ArjunaOptionMap();
private StringKeyValueMap userOptions = new StringKeyValueMap();
public ArjunaOptionMap getArjunaOptions() {
return this.arjunaOptions;
}
public StringKeyValueMap getUserOptions() {
return this.userOptions;
}
public void setArjunaOption(ArjunaOption option, Object value) throws Exception {
arjunaOptions.addObject(option, value);
}
public void setUserOption(String option, Object obj) throws Exception {
userOptions.addObject(ArjunaSingleton.INSTANCE.normalizeUserOption(option), obj);
}
public void setOption(String option, Object obj) throws Exception {
String normalizedOption = ArjunaSingleton.INSTANCE.normalizeUserOption(option);
try {
ArjunaOption sOption = ArjunaOption.valueOf(normalizedOption);
this.arjunaOptions.addObject(sOption, obj);
} catch (Exception e) {
userOptions.addObject(option, obj);
}
}
public void setOptions(Map options) throws Exception {
for(String option: options.keySet()) {
this.setOption(option, options.get(option));
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy