test_class.declarator: mockPool
test_class.modifier: private static
test_class.original_string: private static BoneCP mockPool;
test_class.type: BoneCP
test_class.var_name: mockPool
test_class.declarator: mockConnection
test_class.modifier: private static
test_class.original_string: private static ConnectionHandle mockConnection;
test_class.type: ConnectionHandle
test_class.var_name: mockConnection
test_class.declarator: mockProperties
test_class.modifier: private static
test_class.original_string: private static Properties mockProperties;
test_class.type: Properties
test_class.var_name: mockProperties
test_class.declarator: testClass
test_class.modifier: private static
test_class.original_string: private static BoneCPConnectionProvider testClass;
test_class.type: BoneCPConnectionProvider
test_class.var_name: testClass
test_class.declarator: URL = "jdbc:mock"
test_class.modifier: private static
test_class.original_string: private static String URL = "jdbc:mock";
test_class.type: String
test_class.var_name: URL
test_class.declarator: USERNAME = "sa"
test_class.modifier: private static
test_class.original_string: private static String USERNAME = "sa";
test_class.type: String
test_class.var_name: USERNAME
test_class.declarator: PASSWORD = ""
test_class.modifier: private static
test_class.original_string: private static String PASSWORD = "";
test_class.type: String
test_class.var_name: PASSWORD
test_class.declarator: DRIVER = "com.jolbox.bonecp.MockJDBCDriver"
test_class.modifier: private static
test_class.original_string: private static String DRIVER = "com.jolbox.bonecp.MockJDBCDriver";
test_class.type: String
test_class.var_name: DRIVER
test_class.declarator: TEST_QUERY = "SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS"
test_class.modifier: public static final
test_class.original_string: public static final String TEST_QUERY = "SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS";
test_class.type: String
test_class.var_name: TEST_QUERY
test_class.declarator: driver
test_class.modifier: private
test_class.original_string: private MockJDBCDriver driver;
test_class.type: MockJDBCDriver
test_class.var_name: driver
test_class.file: bonecp-hbnprovider/src/test/java/com/jolbox/bonecp/provider/TestBoneCPConnectionProvider.java
test_class.identifier: TestBoneCPConnectionProvider
test_case.body: @Test
  	public void testGetConnection() throws SQLException, SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
  
  		Field field = testClass.getClass().getDeclaredField("autocommit");
  		field.setAccessible(true);
  		field.set(testClass, true);
  
  
  		field = testClass.getClass().getDeclaredField("isolation");
  		field.setAccessible(true);
  		field.set(testClass, 8);
  
  
  		expect(mockPool.getConnection()).andReturn(mockConnection).once();
  		expect(mockConnection.getAutoCommit()).andReturn(false).once();
  		expect(mockConnection.getTransactionIsolation()).andReturn(0).once();
  		mockConnection.setTransactionIsolation(8);
  		expectLastCall().once();
  		replay(mockPool, mockConnection);
  		testClass.getConnection();
  		verify(mockPool, mockConnection);
  
  	}
test_case.class_method_signature: TestBoneCPConnectionProvider.testGetConnection()
test_case.full_signature: @Test public void testGetConnection()
test_case.identifier: testGetConnection
test_case.invocations: getDeclaredField getClass setAccessible set getDeclaredField getClass setAccessible set once andReturn expect getConnection once andReturn expect getAutoCommit once andReturn expect getTransactionIsolation setTransactionIsolation once expectLastCall replay getConnection verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetConnection()
focal_class.declarator: serialVersionUID = -5236029951415598543L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = -5236029951415598543L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: CONFIG_CONNECTION_DRIVER_CLASS = "hibernate.connection.driver_class"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String CONFIG_CONNECTION_DRIVER_CLASS = "hibernate.connection.driver_class";
focal_class.type: String
focal_class.var_name: CONFIG_CONNECTION_DRIVER_CLASS
focal_class.declarator: CONFIG_CONNECTION_PASSWORD = "hibernate.connection.password"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String CONFIG_CONNECTION_PASSWORD = "hibernate.connection.password";
focal_class.type: String
focal_class.var_name: CONFIG_CONNECTION_PASSWORD
focal_class.declarator: CONFIG_CONNECTION_USERNAME = "hibernate.connection.username"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String CONFIG_CONNECTION_USERNAME = "hibernate.connection.username";
focal_class.type: String
focal_class.var_name: CONFIG_CONNECTION_USERNAME
focal_class.declarator: CONFIG_CONNECTION_URL = "hibernate.connection.url"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String CONFIG_CONNECTION_URL = "hibernate.connection.url";
focal_class.type: String
focal_class.var_name: CONFIG_CONNECTION_URL
focal_class.declarator: CONFIG_CONNECTION_DRIVER_CLASS_ALTERNATE = "javax.persistence.jdbc.driver"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String CONFIG_CONNECTION_DRIVER_CLASS_ALTERNATE = "javax.persistence.jdbc.driver";
focal_class.type: String
focal_class.var_name: CONFIG_CONNECTION_DRIVER_CLASS_ALTERNATE
focal_class.declarator: CONFIG_CONNECTION_PASSWORD_ALTERNATE = "javax.persistence.jdbc.password"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String CONFIG_CONNECTION_PASSWORD_ALTERNATE = "javax.persistence.jdbc.password";
focal_class.type: String
focal_class.var_name: CONFIG_CONNECTION_PASSWORD_ALTERNATE
focal_class.declarator: CONFIG_CONNECTION_USERNAME_ALTERNATE = "javax.persistence.jdbc.user"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String CONFIG_CONNECTION_USERNAME_ALTERNATE = "javax.persistence.jdbc.user";
focal_class.type: String
focal_class.var_name: CONFIG_CONNECTION_USERNAME_ALTERNATE
focal_class.declarator: CONFIG_CONNECTION_URL_ALTERNATE = "javax.persistence.jdbc.url"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String CONFIG_CONNECTION_URL_ALTERNATE = "javax.persistence.jdbc.url";
focal_class.type: String
focal_class.var_name: CONFIG_CONNECTION_URL_ALTERNATE
focal_class.declarator: pool
focal_class.modifier: private
focal_class.original_string: private BoneCP pool;
focal_class.type: BoneCP
focal_class.var_name: pool
focal_class.declarator: isolation
focal_class.modifier: private
focal_class.original_string: private Integer isolation;
focal_class.type: Integer
focal_class.var_name: isolation
focal_class.declarator: autocommit
focal_class.modifier: private
focal_class.original_string: private boolean autocommit;
focal_class.type: boolean
focal_class.var_name: autocommit
focal_class.declarator: classLoader
focal_class.modifier: private
focal_class.original_string: private ClassLoader classLoader;
focal_class.type: ClassLoader
focal_class.var_name: classLoader
focal_class.declarator: config
focal_class.modifier: private
focal_class.original_string: private BoneCPConfig config;
focal_class.type: BoneCPConfig
focal_class.var_name: config
focal_class.declarator: logger = LoggerFactory.getLogger(BoneCPConnectionProvider.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(BoneCPConnectionProvider.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.file: bonecp-hbnprovider/src/main/java/com/jolbox/bonecp/provider/BoneCPConnectionProvider.java
focal_class.identifier: BoneCPConnectionProvider
focal_class.interfaces: implements ConnectionProvider,Configurable,Stoppable
focal_class.class_method_signature: BoneCPConnectionProvider.closeConnection(Connection conn)
focal_class.full_signature: public void closeConnection(Connection conn)
focal_class.identifier: closeConnection
focal_class.modifiers: public
focal_class.parameters: (Connection conn)
focal_class.return: void
focal_class.signature: void closeConnection(Connection conn)
focal_class.class_method_signature: BoneCPConnectionProvider.configure(Properties props)
focal_class.full_signature: public void configure(Properties props)
focal_class.identifier: configure
focal_class.modifiers: public
focal_class.parameters: (Properties props)
focal_class.return: void
focal_class.signature: void configure(Properties props)
focal_class.class_method_signature: BoneCPConnectionProvider.loadClass(String clazz)
focal_class.full_signature: protected Class<?> loadClass(String clazz)
focal_class.identifier: loadClass
focal_class.modifiers: protected
focal_class.parameters: (String clazz)
focal_class.return: Class<?>
focal_class.signature: Class<?> loadClass(String clazz)
focal_class.class_method_signature: BoneCPConnectionProvider.createPool(BoneCPConfig config)
focal_class.full_signature: protected BoneCP createPool(BoneCPConfig config)
focal_class.identifier: createPool
focal_class.modifiers: protected
focal_class.parameters: (BoneCPConfig config)
focal_class.return: BoneCP
focal_class.signature: BoneCP createPool(BoneCPConfig config)
focal_class.class_method_signature: BoneCPConnectionProvider.getConnection()
focal_class.full_signature: public Connection getConnection()
focal_class.identifier: getConnection
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Connection
focal_class.signature: Connection getConnection()
focal_class.class_method_signature: BoneCPConnectionProvider.supportsAggressiveRelease()
focal_class.full_signature: public boolean supportsAggressiveRelease()
focal_class.identifier: supportsAggressiveRelease
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean supportsAggressiveRelease()
focal_class.class_method_signature: BoneCPConnectionProvider.getConfig()
focal_class.full_signature: protected BoneCPConfig getConfig()
focal_class.identifier: getConfig
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: BoneCPConfig
focal_class.signature: BoneCPConfig getConfig()
focal_class.class_method_signature: BoneCPConnectionProvider.getClassLoader()
focal_class.full_signature: public ClassLoader getClassLoader()
focal_class.identifier: getClassLoader
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: ClassLoader
focal_class.signature: ClassLoader getClassLoader()
focal_class.class_method_signature: BoneCPConnectionProvider.setClassLoader(ClassLoader classLoader)
focal_class.full_signature: public void setClassLoader(ClassLoader classLoader)
focal_class.identifier: setClassLoader
focal_class.modifiers: public
focal_class.parameters: (ClassLoader classLoader)
focal_class.return: void
focal_class.signature: void setClassLoader(ClassLoader classLoader)
focal_class.class_method_signature: BoneCPConnectionProvider.isUnwrappableAs(Class unwrapType)
focal_class.full_signature: @Override @SuppressWarnings("rawtypes") public boolean isUnwrappableAs(Class unwrapType)
focal_class.identifier: isUnwrappableAs
focal_class.modifiers: @Override @SuppressWarnings("rawtypes") public
focal_class.parameters: (Class unwrapType)
focal_class.return: boolean
focal_class.signature: boolean isUnwrappableAs(Class unwrapType)
focal_class.class_method_signature: BoneCPConnectionProvider.unwrap(Class<T> unwrapType)
focal_class.full_signature: @SuppressWarnings("unchecked") @Override public T unwrap(Class<T> unwrapType)
focal_class.identifier: unwrap
focal_class.modifiers: @SuppressWarnings("unchecked") @Override public
focal_class.parameters: (Class<T> unwrapType)
focal_class.return: T
focal_class.signature: T unwrap(Class<T> unwrapType)
focal_class.class_method_signature: BoneCPConnectionProvider.mapToProperties(Map<String, String> map)
focal_class.full_signature: private Properties mapToProperties(Map<String, String> map)
focal_class.identifier: mapToProperties
focal_class.modifiers: private
focal_class.parameters: (Map<String, String> map)
focal_class.return: Properties
focal_class.signature: Properties mapToProperties(Map<String, String> map)
focal_class.class_method_signature: BoneCPConnectionProvider.configure(Map configurationValues)
focal_class.full_signature: @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public void configure(Map configurationValues)
focal_class.identifier: configure
focal_class.modifiers: @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public
focal_class.parameters: (Map configurationValues)
focal_class.return: void
focal_class.signature: void configure(Map configurationValues)
focal_class.class_method_signature: BoneCPConnectionProvider.stop()
focal_class.full_signature: @Override public void stop()
focal_class.identifier: stop
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void stop()
focal_class.class_method_signature: BoneCPConnectionProvider.close()
focal_class.full_signature: public void close()
focal_class.identifier: close
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_method.body: public Connection getConnection() throws SQLException {
  		Connection connection = this.pool.getConnection();
  
  		// set the Transaction Isolation if defined
  		try {
  			// set the Transaction Isolation if defined
  			if ((this.isolation != null) && (connection.getTransactionIsolation() != this.isolation.intValue())) {
  				connection.setTransactionIsolation (this.isolation.intValue());
  			}
  
  			// toggle autoCommit to false if set
  			if ( connection.getAutoCommit() != this.autocommit ){
  				connection.setAutoCommit(this.autocommit);
  			}
  
  			return connection;
  		} catch (SQLException e){
  			try {
  				connection.close();
  			} catch (Exception e2) {
  				logger.warn("Setting connection properties failed and closing this connection failed again", e);
  			}
  
  			throw e;
  		}
  	}
focal_method.class_method_signature: BoneCPConnectionProvider.getConnection()
focal_method.full_signature: public Connection getConnection()
focal_method.identifier: getConnection
focal_method.invocations: getConnection getTransactionIsolation intValue setTransactionIsolation intValue getAutoCommit setAutoCommit close warn
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Connection
focal_method.signature: Connection getConnection()