String createMessage(TestResult testResult) { if (testResult.hasActual() && testResult.hasExpected()) { return String.format("[%s] expected [%s]", testResult.getActual(), testResult.getExpected()); } else if ((testResult.hasActual() || testResult.hasExpected()) && testResult.hasMessage()) { return String.format( "[%s] %s", testResult.hasActual() ? testResult.getActual() : testResult.getExpected(), testResult.getMessage()); } return testResult.getMessage(); }
public TestRun(TestResult testResult) { this.testIdentifikator = testResult.getTest().getIdentifikator(); this.site = testResult.getSite().getName(); this.timeRun = new Date(); this.resultEnum = testResult.getResultEnum(); this.message = testResult.getMessage(); }