use of de.ipk_gatersleben.bit.bi.bridge.brapicomp.testing.config.Item in project IPK-BrAPI-Validator by plantbreeding.
the class TestFolderRunner method runTestsFromCall.
public TestFolderReport runTestsFromCall(List<String> doneTests) {
TestFolderReport tcr = new TestFolderReport(this.baseUrl);
tcr.setName(this.folder.getName());
tcr.setDescription(this.folder.getDescription());
List<String> inCalls = new ArrayList<String>();
JsonNode calls = storage.getVariable("callResult");
if (calls != null && calls.isArray()) {
ObjectMapper mapper = new ObjectMapper();
for (JsonNode call : calls) {
inCalls.add("/" + mapper.convertValue(call.get("call"), String.class));
}
}
LinkedHashMap<String, Object> folderTests = new LinkedHashMap<String, Object>();
List<Item> itemList = this.folder.getItem();
itemList.forEach(item -> {
if (inCalls.contains(item.getEndpoint())) {
if (storage.getKeys().containsAll(item.getRequires())) {
TestItemRunner tir = new TestItemRunner(item, storage);
TestItemReport tiReport = tir.runTests();
tcr.addTestReport(tiReport);
doneTests.add(item.getName());
folderTests.put(item.getName(), tiReport);
} else {
folderTests.put(item.getName(), "missingReqs");
}
} else {
folderTests.put(item.getName(), "skipped");
}
});
tcr.setTestsShort(folderTests);
return tcr;
}
use of de.ipk_gatersleben.bit.bi.bridge.brapicomp.testing.config.Item in project IPK-BrAPI-Validator by plantbreeding.
the class TestFolderRunner method runTests.
/**
* Runs the tests specified in the Folder config
* @param doneTests
*
* @return Test report.
*/
public TestFolderReport runTests(List<String> doneTests) {
TestFolderReport tcr = new TestFolderReport(this.baseUrl);
tcr.setName(this.folder.getName());
tcr.setDescription(this.folder.getDescription());
List<Item> itemList = this.folder.getItem();
LinkedHashMap<String, Object> folderTests = new LinkedHashMap<String, Object>();
itemList.forEach(item -> {
TestItemRunner tir = new TestItemRunner(item, storage);
TestItemReport tiReport = tir.runTests();
tcr.addTestReport(tiReport);
doneTests.add(item.getName());
folderTests.put(item.getName(), tiReport);
});
tcr.setTestsShort(folderTests);
return tcr;
}
Aggregations