test_class.declarator: mockPool = createNiceMock(BoneCP.class)
test_class.modifier: private
test_class.original_string: private BoneCP mockPool = createNiceMock(BoneCP.class);
test_class.type: BoneCP
test_class.var_name: mockPool
test_class.declarator: mockLogger
test_class.modifier: private
test_class.original_string: private Logger mockLogger;
test_class.type: Logger
test_class.var_name: mockLogger
test_class.declarator: mockConfig
test_class.modifier: private
test_class.original_string: private BoneCPConfig mockConfig;
test_class.type: BoneCPConfig
test_class.var_name: mockConfig
test_class.declarator: testClass
test_class.modifier: private
test_class.original_string: private ConnectionPartition testClass;
test_class.type: ConnectionPartition
test_class.var_name: testClass
test_class.file: bonecp/src/test/java/com/jolbox/bonecp/TestConnectionPartition.java
test_class.identifier: TestConnectionPartition
test_case.body: @Test
  	public void testUpdateCreatedConnectionsWithException() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
  	
  		// Test #2: Same test but fake an exception 
  		ReentrantReadWriteLock mockLock = createNiceMock(ReentrantReadWriteLock.class);
  		WriteLock mockWriteLock = createNiceMock(WriteLock.class);
  
  		Field field = testClass.getClass().getDeclaredField("statsLock");
  		field.setAccessible(true);
  		ReentrantReadWriteLock oldLock = (ReentrantReadWriteLock) field.get(testClass);
  		field.set(testClass, mockLock);
  		expect(mockLock.writeLock()).andThrow(new RuntimeException()).once().andReturn(mockWriteLock).once();
  		mockWriteLock.lock();
  		expectLastCall().once();
  		replay(mockLock, mockWriteLock);
  
  		try{
  			testClass.updateCreatedConnections(5);
  			fail("Should have thrown an exception");
  		} catch (Throwable t){
  			//do nothing
  		}
  		verify(mockLock);
  		field.set(testClass, oldLock);
  
  	}
test_case.class_method_signature: TestConnectionPartition.testUpdateCreatedConnectionsWithException()
test_case.full_signature: @Test public void testUpdateCreatedConnectionsWithException()
test_case.identifier: testUpdateCreatedConnectionsWithException
test_case.invocations: createNiceMock createNiceMock getDeclaredField getClass setAccessible get set once andReturn once andThrow expect writeLock lock once expectLastCall replay updateCreatedConnections fail verify set
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUpdateCreatedConnectionsWithException()
focal_class.declarator: serialVersionUID = -7864443421028454573L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = -7864443421028454573L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: logger = LoggerFactory.getLogger(ConnectionPartition.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(ConnectionPartition.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: freeConnections
focal_class.modifier: private
focal_class.original_string: private BlockingQueue<ConnectionHandle> freeConnections;
focal_class.type: BlockingQueue<ConnectionHandle>
focal_class.var_name: freeConnections
focal_class.declarator: acquireIncrement
focal_class.modifier: private final
focal_class.original_string: private final int acquireIncrement;
focal_class.type: int
focal_class.var_name: acquireIncrement
focal_class.declarator: minConnections
focal_class.modifier: private final
focal_class.original_string: private final int minConnections;
focal_class.type: int
focal_class.var_name: minConnections
focal_class.declarator: maxConnections
focal_class.modifier: private final
focal_class.original_string: private final int maxConnections;
focal_class.type: int
focal_class.var_name: maxConnections
focal_class.declarator: statsLock = new ReentrantReadWriteLock()
focal_class.modifier: protected
focal_class.original_string: protected ReentrantReadWriteLock statsLock = new ReentrantReadWriteLock();
focal_class.type: ReentrantReadWriteLock
focal_class.var_name: statsLock
focal_class.declarator: createdConnections=0
focal_class.modifier: private
focal_class.original_string: private int createdConnections=0;
focal_class.type: int
focal_class.var_name: createdConnections
focal_class.declarator: url
focal_class.modifier: private final
focal_class.original_string: private final String url;
focal_class.type: String
focal_class.var_name: url
focal_class.declarator: username
focal_class.modifier: private final
focal_class.original_string: private final String username;
focal_class.type: String
focal_class.var_name: username
focal_class.declarator: password
focal_class.modifier: private final
focal_class.original_string: private final String password;
focal_class.type: String
focal_class.var_name: password
focal_class.declarator: unableToCreateMoreTransactions=false
focal_class.modifier: private volatile
focal_class.original_string: private volatile boolean unableToCreateMoreTransactions=false;
focal_class.type: boolean
focal_class.var_name: unableToCreateMoreTransactions
focal_class.declarator: disableTracking
focal_class.modifier: private
focal_class.original_string: private boolean disableTracking;
focal_class.type: boolean
focal_class.var_name: disableTracking
focal_class.declarator: poolWatchThreadSignalQueue = new ArrayBlockingQueue<Object>(1)
focal_class.modifier: private
focal_class.original_string: private BlockingQueue<Object> poolWatchThreadSignalQueue = new ArrayBlockingQueue<Object>(1);
focal_class.type: BlockingQueue<Object>
focal_class.var_name: poolWatchThreadSignalQueue
focal_class.declarator: queryExecuteTimeLimitInNanoSeconds
focal_class.modifier: private
focal_class.original_string: private long queryExecuteTimeLimitInNanoSeconds;
focal_class.type: long
focal_class.var_name: queryExecuteTimeLimitInNanoSeconds
focal_class.declarator: poolName
focal_class.modifier: private
focal_class.original_string: private String poolName;
focal_class.type: String
focal_class.var_name: poolName
focal_class.declarator: pool
focal_class.modifier: protected
focal_class.original_string: protected BoneCP pool;
focal_class.type: BoneCP
focal_class.var_name: pool
focal_class.file: bonecp/src/main/java/com/jolbox/bonecp/ConnectionPartition.java
focal_class.identifier: ConnectionPartition
focal_class.interfaces: implements Serializable
focal_class.class_method_signature: ConnectionPartition.getPoolWatchThreadSignalQueue()
focal_class.full_signature: protected BlockingQueue<Object> getPoolWatchThreadSignalQueue()
focal_class.identifier: getPoolWatchThreadSignalQueue
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: BlockingQueue<Object>
focal_class.signature: BlockingQueue<Object> getPoolWatchThreadSignalQueue()
focal_class.class_method_signature: ConnectionPartition.updateCreatedConnections(int increment)
focal_class.full_signature: protected void updateCreatedConnections(int increment)
focal_class.identifier: updateCreatedConnections
focal_class.modifiers: protected
focal_class.parameters: (int increment)
focal_class.return: void
focal_class.signature: void updateCreatedConnections(int increment)
focal_class.class_method_signature: ConnectionPartition.addFreeConnection(ConnectionHandle connectionHandle)
focal_class.full_signature: protected void addFreeConnection(ConnectionHandle connectionHandle)
focal_class.identifier: addFreeConnection
focal_class.modifiers: protected
focal_class.parameters: (ConnectionHandle connectionHandle)
focal_class.return: void
focal_class.signature: void addFreeConnection(ConnectionHandle connectionHandle)
focal_class.class_method_signature: ConnectionPartition.trackConnectionFinalizer(ConnectionHandle connectionHandle)
focal_class.full_signature: protected void trackConnectionFinalizer(ConnectionHandle connectionHandle)
focal_class.identifier: trackConnectionFinalizer
focal_class.modifiers: protected
focal_class.parameters: (ConnectionHandle connectionHandle)
focal_class.return: void
focal_class.signature: void trackConnectionFinalizer(ConnectionHandle connectionHandle)
focal_class.class_method_signature: ConnectionPartition.getFreeConnections()
focal_class.full_signature: protected BlockingQueue<ConnectionHandle> getFreeConnections()
focal_class.identifier: getFreeConnections
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: BlockingQueue<ConnectionHandle>
focal_class.signature: BlockingQueue<ConnectionHandle> getFreeConnections()
focal_class.class_method_signature: ConnectionPartition.setFreeConnections(BlockingQueue<ConnectionHandle> freeConnections)
focal_class.full_signature: protected void setFreeConnections(BlockingQueue<ConnectionHandle> freeConnections)
focal_class.identifier: setFreeConnections
focal_class.modifiers: protected
focal_class.parameters: (BlockingQueue<ConnectionHandle> freeConnections)
focal_class.return: void
focal_class.signature: void setFreeConnections(BlockingQueue<ConnectionHandle> freeConnections)
focal_class.class_method_signature: ConnectionPartition.ConnectionPartition(BoneCP pool)
focal_class.full_signature: public  ConnectionPartition(BoneCP pool)
focal_class.identifier: ConnectionPartition
focal_class.modifiers: public
focal_class.parameters: (BoneCP pool)
focal_class.signature:  ConnectionPartition(BoneCP pool)
focal_class.class_method_signature: ConnectionPartition.getAcquireIncrement()
focal_class.full_signature: protected int getAcquireIncrement()
focal_class.identifier: getAcquireIncrement
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getAcquireIncrement()
focal_class.class_method_signature: ConnectionPartition.getMinConnections()
focal_class.full_signature: protected int getMinConnections()
focal_class.identifier: getMinConnections
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getMinConnections()
focal_class.class_method_signature: ConnectionPartition.getMaxConnections()
focal_class.full_signature: protected int getMaxConnections()
focal_class.identifier: getMaxConnections
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getMaxConnections()
focal_class.class_method_signature: ConnectionPartition.getCreatedConnections()
focal_class.full_signature: protected int getCreatedConnections()
focal_class.identifier: getCreatedConnections
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getCreatedConnections()
focal_class.class_method_signature: ConnectionPartition.getUrl()
focal_class.full_signature: protected String getUrl()
focal_class.identifier: getUrl
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getUrl()
focal_class.class_method_signature: ConnectionPartition.getUsername()
focal_class.full_signature: protected String getUsername()
focal_class.identifier: getUsername
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getUsername()
focal_class.class_method_signature: ConnectionPartition.getPassword()
focal_class.full_signature: protected String getPassword()
focal_class.identifier: getPassword
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getPassword()
focal_class.class_method_signature: ConnectionPartition.isUnableToCreateMoreTransactions()
focal_class.full_signature: protected boolean isUnableToCreateMoreTransactions()
focal_class.identifier: isUnableToCreateMoreTransactions
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isUnableToCreateMoreTransactions()
focal_class.class_method_signature: ConnectionPartition.setUnableToCreateMoreTransactions(boolean unableToCreateMoreTransactions)
focal_class.full_signature: protected void setUnableToCreateMoreTransactions(boolean unableToCreateMoreTransactions)
focal_class.identifier: setUnableToCreateMoreTransactions
focal_class.modifiers: protected
focal_class.parameters: (boolean unableToCreateMoreTransactions)
focal_class.return: void
focal_class.signature: void setUnableToCreateMoreTransactions(boolean unableToCreateMoreTransactions)
focal_class.class_method_signature: ConnectionPartition.getAvailableConnections()
focal_class.full_signature: protected int getAvailableConnections()
focal_class.identifier: getAvailableConnections
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getAvailableConnections()
focal_class.class_method_signature: ConnectionPartition.getRemainingCapacity()
focal_class.full_signature: public int getRemainingCapacity()
focal_class.identifier: getRemainingCapacity
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getRemainingCapacity()
focal_class.class_method_signature: ConnectionPartition.getQueryExecuteTimeLimitinNanoSeconds()
focal_class.full_signature: protected long getQueryExecuteTimeLimitinNanoSeconds()
focal_class.identifier: getQueryExecuteTimeLimitinNanoSeconds
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getQueryExecuteTimeLimitinNanoSeconds()
focal_class.class_method_signature: ConnectionPartition.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: protected void updateCreatedConnections(int increment) {
  
  		try{
  			this.statsLock.writeLock().lock();
  			this.createdConnections+=increment;
  	//		assert this.createdConnections >= 0 : "Created connections < 0!";
  			
  		} finally { 
  			this.statsLock.writeLock().unlock();
  		}
  	}
focal_method.class_method_signature: ConnectionPartition.updateCreatedConnections(int increment)
focal_method.full_signature: protected void updateCreatedConnections(int increment)
focal_method.identifier: updateCreatedConnections
focal_method.invocations: lock writeLock unlock writeLock
focal_method.modifiers: protected
focal_method.parameters: (int increment)
focal_method.return: void
focal_method.signature: void updateCreatedConnections(int increment)