Search in sources :

Example 6 with SakuliForwarderRuntimeException

use of org.sakuli.exceptions.SakuliForwarderRuntimeException 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());
    SakuliForwarderRuntimeException 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 : SakuliForwarderRuntimeException(org.sakuli.exceptions.SakuliForwarderRuntimeException) GearmanJobResult(org.gearman.client.GearmanJobResult) Test(org.testng.annotations.Test)

Aggregations

SakuliForwarderRuntimeException (org.sakuli.exceptions.SakuliForwarderRuntimeException)6 SakuliForwarderCheckedException (org.sakuli.exceptions.SakuliForwarderCheckedException)2 Test (org.testng.annotations.Test)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Response (javax.ws.rs.core.Response)1 GearmanJobResult (org.gearman.client.GearmanJobResult)1 GearmanJobServerConnection (org.gearman.common.GearmanJobServerConnection)1 TestCase (org.sakuli.datamodel.TestCase)1 TestCaseStep (org.sakuli.datamodel.TestCaseStep)1 SakuliForwarderException (org.sakuli.exceptions.SakuliForwarderException)1 DaoTestCase (org.sakuli.services.forwarder.database.dao.DaoTestCase)1 DaoTestCaseStep (org.sakuli.services.forwarder.database.dao.DaoTestCaseStep)1 NagiosCheckResult (org.sakuli.services.forwarder.gearman.model.NagiosCheckResult)1 Icinga2Request (org.sakuli.services.forwarder.icinga2.model.Icinga2Request)1 Icinga2Result (org.sakuli.services.forwarder.icinga2.model.Icinga2Result)1