@Test(expected = TransportException.class) public void testExceptionEscalation() throws TransportException, InterruptedException { DummyTransporter mockDummyTransporter = mock(DummyTransporter.class); DummyTransporterFactory tfactory = new DummyTransporterFactory(); tfactory.transporter = mockDummyTransporter; doThrow(new TransportException("expected exception in test")).when(mockDummyTransporter) .sendBatch(any(DummyTransportBuffer.class)); IpcSenderService ipc = new IpcSenderService(tfactory); ipc.add(mock(InternalEvent.class)); /* * Expect shutdown to throw a TransportException when a child thread also throws as * TransportException */ ipc.flush(); }
this.getIpcService().add(ievent); } catch (TransportException e) { logger.warn("error adding event", e);
this.getIpcService().add(ievent); } catch (TransportException e) { logger.warn("error adding event", e);
ie.setPartitions(new LinkedHashMap(0)); sent.add(ie); ipc.add(ie);
ipc.add(mock(InternalEvent.class));
ipc.add(mock(InternalEvent.class));