Create SQL data source utils class

- Extract logic used in SQLite and MySQL for logging and closing SQL objects
    - Decided to leave buildAuthFromResultSet methods individually as this might be more implementation-specific
- Rename DataSource#close to DataSource#closeConnection to fix conflict with static import
This commit is contained in:
ljacqu
2017-04-18 22:55:39 +02:00
parent 04ca36fe53
commit 07633a89c8
9 changed files with 226 additions and 69 deletions
@@ -78,7 +78,7 @@ public class TaskCloserTest {
verify(bukkitScheduler, times(3)).isCurrentlyRunning(taskIds.capture());
assertThat(taskIds.getAllValues(), contains(ACTIVE_WORKERS_ID[0], ACTIVE_WORKERS_ID[1], ACTIVE_WORKERS_ID[1]));
verify(taskCloser, times(2)).sleep();
verify(dataSource).close();
verify(dataSource).closeConnection();
}
@Test
@@ -97,7 +97,7 @@ public class TaskCloserTest {
verify(bukkitScheduler, times(3)).isQueued(anyInt());
verify(bukkitScheduler, times(61)).isCurrentlyRunning(anyInt());
verify(taskCloser, times(60)).sleep();
verify(dataSource).close();
verify(dataSource).closeConnection();
}
@Test