Minor bugfix

This commit is contained in:
Alexey Andreev 2015-10-10 12:46:24 +03:00
parent 02d853adf7
commit 36760a2a6e

View File

@ -62,17 +62,17 @@ public class TestRunner {
} }
public void run(TestPlan testPlan) { public void run(TestPlan testPlan) {
initSelenium(); init();
for (TestGroup group : testPlan.getGroups()) { for (TestGroup group : testPlan.getGroups()) {
for (TestCase testCase : group.getTestCases()) { for (TestCase testCase : group.getTestCases()) {
run(testPlan.getRuntimeScript(), testCase); run(testPlan.getRuntimeScript(), testCase);
} }
} }
stopSelenium(); stop();
waitForCompletion(); waitForCompletion();
} }
private void initSelenium() { private void init() {
latch = new CountDownLatch(numThreads); latch = new CountDownLatch(numThreads);
for (int i = 0; i < numThreads; ++i) { for (int i = 0; i < numThreads; ++i) {
new Thread(() -> { new Thread(() -> {
@ -101,7 +101,7 @@ public class TestRunner {
taskQueue.add(runnable); taskQueue.add(runnable);
} }
private void stopSelenium() { private void stop() {
stopped = true; stopped = true;
} }
@ -124,6 +124,7 @@ public class TestRunner {
if (result == null) { if (result == null) {
log.info("Test failed: " + testCase.getTestMethod()); log.info("Test failed: " + testCase.getTestMethod());
localReport.get().add(TestResult.error(ref, null, null)); localReport.get().add(TestResult.error(ref, null, null));
return;
} }
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
ObjectNode resultObject = (ObjectNode) mapper.readTree(result); ObjectNode resultObject = (ObjectNode) mapper.readTree(result);