Search in sources :

Example 1 with GearmanJobResult

use of org.gearman.client.GearmanJobResult in project sakuli by ConSol.

the class NagiosExceptionBuilderTest method testBuildTransferException.

@Test
public void testBuildTransferException() throws Exception {
    GearmanJobResult result = mock(GearmanJobResult.class);
    when(result.getExceptions()).thenReturn("exceptions".getBytes());
    when(result.getWarnings()).thenReturn("warnings".getBytes());
    SakuliForwarderException sakuliForwarderException = NagiosExceptionBuilder.buildTransferException("localhost", 4370, result);
    assertEquals(sakuliForwarderException.getMessage(), "something went wrong during the transfer of the results to the gearman forwarder 'localhost:'4370':\n" + "EXCEPTIONS:\n" + "exceptions\n" + "WARNINGS:\n" + "warnings\n");
}
Also used : SakuliForwarderException(org.sakuli.exceptions.SakuliForwarderException) GearmanJobResult(org.gearman.client.GearmanJobResult) Test(org.testng.annotations.Test)

Aggregations

GearmanJobResult (org.gearman.client.GearmanJobResult)1 SakuliForwarderException (org.sakuli.exceptions.SakuliForwarderException)1 Test (org.testng.annotations.Test)1