qa.justtestlah.testdata.TestDataParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of justtestlah-core Show documentation
Show all versions of justtestlah-core Show documentation
JustTestLah! is a JAVA test framework targeting projects that support multiple platforms, in particular Web, Android and iOS. It follows a BDD approach and allows testing against all platforms using the same feature files. JustTestLah's main aim is to make the configuration and the actual test code as easy as possible.
package qa.justtestlah.testdata;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.tuple.Pair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Component;
import org.yaml.snakeyaml.Yaml;
/** Parses the test data from the YAML file into a corresponding Java object. */
@Component
public class TestDataParser {
private static final Logger LOG = LoggerFactory.getLogger(TestDataParser.class);
private Yaml yamlParser;
private TestDataObjectRegistry registry;
@Autowired
public void setYamlParser(Yaml yamlParser) {
this.yamlParser = yamlParser;
}
@Autowired
public void setTestDataObjectRegistry(TestDataObjectRegistry registry) {
this.registry = registry;
}
/**
* Parse locators from file.
*
* @param resource the resource to parse the locators from
* @return {@link Pair} the mapped Java object and the name of the entity (derived from the
* filename)
*/
public Pair
© 2015 - 2024 Weber Informatics LLC | Privacy Policy