Search in sources :

Example 1 with TestResult

use of net.sf.sahi.report.TestResult in project sakuli by ConSol.

the class RhinoAspectTest method verifySahiReport.

private void verifySahiReport(ResultType resultTyp, int initialListSize) {
    if (resultTyp != null) {
        Report sahiReport2 = BeanLoader.loadBaseActionLoader().getSahiReport();
        int newLisSize = sahiReport2.getListResult().size();
        assertEquals(newLisSize, initialListSize + 1);
        TestResult testResult = sahiReport2.getListResult().get(newLisSize - 1);
        assertNotNull(testResult);
        SakuliExceptionHandler sakuliExceptionHandler = BeanLoader.loadBean(SakuliExceptionHandler.class);
        if (resultTyp.equals(ResultType.ERROR) || resultTyp.equals(ResultType.FAILURE)) {
            verify(sakuliExceptionHandler).handleException(any(LogResult.class));
        } else {
            verify(sakuliExceptionHandler, never()).handleException(any(LogResult.class));
        }
    }
}
Also used : Report(net.sf.sahi.report.Report) SakuliExceptionHandler(org.sakuli.exceptions.SakuliExceptionHandler) LogResult(org.sakuli.datamodel.actions.LogResult) TestResult(net.sf.sahi.report.TestResult) JoinPoint(org.aspectj.lang.JoinPoint)

Aggregations

Report (net.sf.sahi.report.Report)1 TestResult (net.sf.sahi.report.TestResult)1 JoinPoint (org.aspectj.lang.JoinPoint)1 LogResult (org.sakuli.datamodel.actions.LogResult)1 SakuliExceptionHandler (org.sakuli.exceptions.SakuliExceptionHandler)1