@Test
public void testCreateSocketFailure() {

    final MockPingListener listener = new MockPingListener();
    final ErrnoException fail = new ErrnoException("socket()", 1);
    new MockPing(null, listener) {
        @Override
        protected FileDescriptor socket(final int inet, final int proto) throws ErrnoException {
            throw fail;
        }
    }.run();
    Assert.assertEquals(fail, listener.exception);
}