org.sahagin.share.runresults.RootFuncRunResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sahagin Show documentation
Show all versions of sahagin Show documentation
Sahagin makes your Selenium script more readable and maintainable.
package org.sahagin.share.runresults;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.sahagin.share.CommonUtils;
import org.sahagin.share.srctree.TestFunction;
import org.sahagin.share.yaml.YamlUtils;
import org.sahagin.share.yaml.YamlConvertException;
import org.sahagin.share.yaml.YamlConvertible;
public class RootFuncRunResult implements YamlConvertible {
private static final String MSG_SRC_TREE_FORMAT_MISMATCH
= "expected formatVersion is \"%s\", but actual is \"%s\"";
private String rootFunctionKey;
private TestFunction rootFunction;
private List runFailures = new ArrayList(16);
private List lineScreenCaptures = new ArrayList(32);
public String getRootFunctionKey() {
return rootFunctionKey;
}
public void setRootFunctionKey(String rootFunctionKey) {
this.rootFunctionKey = rootFunctionKey;
}
public TestFunction getRootFunction() {
return rootFunction;
}
public void setRootFunction(TestFunction rootFunction) {
this.rootFunction = rootFunction;
}
public List getRunFailures() {
return runFailures;
}
public void addRunFailure(RunFailure runFailure) {
this.runFailures.add(runFailure);
}
public List getLineScreenCaptures() {
return lineScreenCaptures;
}
public void addLineScreenCapture(LineScreenCapture lineScreenCapture) {
this.lineScreenCaptures.add(lineScreenCapture);
}
@Override
public Map toYamlObject() {
Map result = new HashMap(4);
result.put("rootFunctionKey", rootFunctionKey);
result.put("runFailures", YamlUtils.toYamlObjectList(runFailures));
result.put("lineScreenCaptures", YamlUtils.toYamlObjectList(lineScreenCaptures));
result.put("formatVersion", CommonUtils.formatVersion());
return result;
}
@Override
public void fromYamlObject(Map yamlObject)
throws YamlConvertException {
rootFunctionKey = YamlUtils.getStrValue(yamlObject, "rootFunctionKey");
List