
com.context.TestExecutionContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of AppiumTestDistribution Show documentation
Show all versions of AppiumTestDistribution Show documentation
A tool run Android and iOS test in parallel across devices
package com.context;
import org.apache.log4j.Logger;
import java.util.HashMap;
import java.util.Map;
public class TestExecutionContext {
private final String testName;
private final HashMap testExecutionState;
private final String NOT_SET = "NOT-YET-SET";
private static final Logger LOGGER = Logger.getLogger(
TestExecutionContext.class.getSimpleName());
public TestExecutionContext(String testName) {
SessionContext.addContext(Thread.currentThread().getId(), this);
this.testName = testName;
this.testExecutionState = new HashMap<>();
LOGGER.info(String.format("%s - TestExecution context created", testName));
}
public String getTestName() {
return testName;
}
public void addTestState(String key, Object details) {
testExecutionState.put(key, details);
}
public Object getTestState(String key) {
return testExecutionState.get(key);
}
public String getTestStateAsString(String key) {
return (String) testExecutionState.get(key);
}
public HashMap getAllTestState() {
return testExecutionState;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy