test_class.declarator: mockConnection
test_class.modifier: private
test_class.original_string: private ConnectionHandle mockConnection;
test_class.type: ConnectionHandle
test_class.var_name: mockConnection
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: mockThread
test_class.modifier: private
test_class.original_string: private Thread mockThread;
test_class.type: Thread
test_class.var_name: mockThread
test_class.declarator: testClass
test_class.modifier: private
test_class.original_string: private CloseThreadMonitor testClass;
test_class.type: CloseThreadMonitor
test_class.var_name: testClass
test_class.file: bonecp/src/test/java/com/jolbox/bonecp/TestCloseThreadMonitor.java
test_class.identifier: TestCloseThreadMonitor
test_case.body: @Test
  	public void testConnectionInterrupted() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, InterruptedException{
  		
  		expect(mockConnection.isClosed()).andThrow(new RuntimeException()).once();
  		replay(mockConnection, mockLogger);
  		testClass.run();
  		verify(mockConnection, mockLogger);
  	}
test_case.class_method_signature: TestCloseThreadMonitor.testConnectionInterrupted()
test_case.full_signature: @Test public void testConnectionInterrupted()
test_case.identifier: testConnectionInterrupted
test_case.invocations: once andThrow expect isClosed replay run verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testConnectionInterrupted()
focal_class.declarator: connectionHandle
focal_class.modifier: private
focal_class.original_string: private ConnectionHandle connectionHandle;
focal_class.type: ConnectionHandle
focal_class.var_name: connectionHandle
focal_class.declarator: stackTrace
focal_class.modifier: private
focal_class.original_string: private String stackTrace;
focal_class.type: String
focal_class.var_name: stackTrace
focal_class.declarator: threadToMonitor
focal_class.modifier: private
focal_class.original_string: private Thread threadToMonitor;
focal_class.type: Thread
focal_class.var_name: threadToMonitor
focal_class.declarator: closeConnectionWatchTimeout
focal_class.modifier: private
focal_class.original_string: private long closeConnectionWatchTimeout;
focal_class.type: long
focal_class.var_name: closeConnectionWatchTimeout
focal_class.declarator: logger = LoggerFactory.getLogger(CloseThreadMonitor.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(CloseThreadMonitor.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.file: bonecp/src/main/java/com/jolbox/bonecp/CloseThreadMonitor.java
focal_class.identifier: CloseThreadMonitor
focal_class.interfaces: implements Runnable
focal_class.class_method_signature: CloseThreadMonitor.CloseThreadMonitor(Thread threadToMonitor, ConnectionHandle connectionHandle, String stackTrace, long closeConnectionWatchTimeout)
focal_class.full_signature: public  CloseThreadMonitor(Thread threadToMonitor, ConnectionHandle connectionHandle, String stackTrace, long closeConnectionWatchTimeout)
focal_class.identifier: CloseThreadMonitor
focal_class.modifiers: public
focal_class.parameters: (Thread threadToMonitor, ConnectionHandle connectionHandle, String stackTrace, long closeConnectionWatchTimeout)
focal_class.signature:  CloseThreadMonitor(Thread threadToMonitor, ConnectionHandle connectionHandle, String stackTrace, long closeConnectionWatchTimeout)
focal_class.class_method_signature: CloseThreadMonitor.run()
focal_class.full_signature: public void run()
focal_class.identifier: run
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void run()
focal_method.body: public void run() {
  		try {
  			this.connectionHandle.setThreadWatch(Thread.currentThread());
  			// wait for the thread we're monitoring to die off.
  			this.threadToMonitor.join(this.closeConnectionWatchTimeout);
  			if (!this.connectionHandle.isClosed() 
  					&& this.threadToMonitor.equals(this.connectionHandle.getThreadUsingConnection())
  				){
  				logger.error(this.stackTrace);
  			}
  		} catch (Exception e) {
  			// just kill off this thread
  			if (this.connectionHandle != null){ // safety
  				this.connectionHandle.setThreadWatch(null);
  			}
  		} 
  	}
focal_method.class_method_signature: CloseThreadMonitor.run()
focal_method.full_signature: public void run()
focal_method.identifier: run
focal_method.invocations: setThreadWatch currentThread join isClosed equals getThreadUsingConnection error setThreadWatch
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void run()