package com.zaxxer.hikari;

import java.sql.Connection;
import java.util.Properties;

import org.junit.Assert;
import org.junit.Test;

import com.zaxxer.hikari.hibernate.HikariConnectionProvider;

public class TestHibernate
{
   @Test
   public void testConnectionProvider() throws Exception
   {
      HikariConnectionProvider provider = new HikariConnectionProvider();

      Properties props = new Properties();
      props.load(getClass().getResourceAsStream("/hibernate.properties"));

      provider.configure(props);
      Connection connection = provider.getConnection();
      provider.closeConnection(connection);

      Assert.assertNotNull(provider.unwrap(HikariConnectionProvider.class));
      Assert.assertFalse(provider.supportsAggressiveRelease());
      provider.stop();
   }
}

@@ -79,16 +79,73 @@
 rties;%0A%0A
+import org.hibernate.service.UnknownUnwrapTypeException;%0A
 import o
@@ -812,24 +812,190 @@
 Release());%0A
+%0A      try %7B%0A         provider.unwrap(TestHibernate.class);%0A         Assert.fail(%22Expected exception%22);%0A      %7D%0A      catch (UnknownUnwrapTypeException e) %7B%0A      %7D%0A%0A
       provid

Test unwrap exception for Hibernate