@Test
public void testCreateSessionFails() throws Exception {

  when(connection.createSession(true, Session.SESSION_TRANSACTED))
    .thenThrow(new JMSException(""));
  try {
    create();
    fail("Expected exception: org.apache.flume.FlumeException");
  } catch (FlumeException e) {
    verify(connection).close();
  }
}