Skip to content

Commit 03b29cd

Browse files
committed
Use JUnit 5 method visibility convention
1 parent b1b939a commit 03b29cd

38 files changed

+358
-356
lines changed

src/test/java/org/apache/commons/pool3/AbstractTestKeyedObjectPool.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public void tearDown() {
235235
}
236236

237237
@Test
238-
public void testBaseAddObject() {
238+
void testBaseAddObject() {
239239
try {
240240
pool = makeEmptyPool(3);
241241
} catch (final UnsupportedOperationException uoe) {
@@ -271,7 +271,7 @@ public void testBaseAddObject() {
271271
}
272272

273273
@Test
274-
public void testBaseBorrow() {
274+
void testBaseBorrow() {
275275
try {
276276
pool = makeEmptyPool(3);
277277
} catch (final UnsupportedOperationException uoe) {
@@ -289,7 +289,7 @@ public void testBaseBorrow() {
289289
}
290290

291291
@Test
292-
public void testBaseBorrowReturn() {
292+
void testBaseBorrowReturn() {
293293
try {
294294
pool = makeEmptyPool(3);
295295
} catch (final UnsupportedOperationException uoe) {
@@ -328,7 +328,7 @@ public void testBaseBorrowReturn() {
328328
}
329329

330330
@Test
331-
public void testBaseClear() {
331+
void testBaseClear() {
332332
try {
333333
pool = makeEmptyPool(3);
334334
} catch (final UnsupportedOperationException uoe) {
@@ -354,7 +354,7 @@ public void testBaseClear() {
354354
}
355355

356356
@Test
357-
public void testBaseInvalidateObject() {
357+
void testBaseInvalidateObject() {
358358
try {
359359
pool = makeEmptyPool(3);
360360
} catch (final UnsupportedOperationException uoe) {
@@ -377,7 +377,7 @@ public void testBaseInvalidateObject() {
377377
}
378378

379379
@Test
380-
public void testBaseNumActiveNumIdle() {
380+
void testBaseNumActiveNumIdle() {
381381
try {
382382
pool = makeEmptyPool(3);
383383
} catch (final UnsupportedOperationException uoe) {
@@ -406,7 +406,7 @@ public void testBaseNumActiveNumIdle() {
406406
}
407407

408408
@Test
409-
public void testBaseNumActiveNumIdle2() {
409+
void testBaseNumActiveNumIdle2() {
410410
try {
411411
pool = makeEmptyPool(6);
412412
} catch (final UnsupportedOperationException uoe) {
@@ -465,7 +465,7 @@ public void testBaseNumActiveNumIdle2() {
465465
}
466466

467467
@Test
468-
public void testClosedPoolBehavior() {
468+
void testClosedPoolBehavior() {
469469
final KeyedObjectPool<Object, Object, RuntimeException> pool;
470470
try {
471471
pool = makeEmptyPool(new TestFactory());
@@ -498,7 +498,7 @@ public void testClosedPoolBehavior() {
498498
}
499499

500500
@Test
501-
public void testKPOFAddObjectUsage() {
501+
void testKPOFAddObjectUsage() {
502502
final FailingKeyedPooledObjectFactory factory = new FailingKeyedPooledObjectFactory();
503503
final KeyedObjectPool<Object, Object, PrivateException> pool;
504504
try {
@@ -536,7 +536,7 @@ public void testKPOFAddObjectUsage() {
536536
}
537537

538538
@Test
539-
public void testKPOFBorrowObjectUsages() {
539+
void testKPOFBorrowObjectUsages() {
540540
final FailingKeyedPooledObjectFactory factory = new FailingKeyedPooledObjectFactory();
541541
final KeyedObjectPool<Object, Object, PrivateException> pool;
542542
try {
@@ -607,7 +607,7 @@ public void testKPOFBorrowObjectUsages() {
607607
}
608608

609609
@Test
610-
public void testKPOFClearUsages() {
610+
void testKPOFClearUsages() {
611611
final FailingKeyedPooledObjectFactory factory = new FailingKeyedPooledObjectFactory();
612612
final KeyedObjectPool<Object, Object, PrivateException> pool;
613613
try {
@@ -630,7 +630,7 @@ public void testKPOFClearUsages() {
630630
}
631631

632632
@Test
633-
public void testKPOFCloseUsages() {
633+
void testKPOFCloseUsages() {
634634
final FailingKeyedPooledObjectFactory factory = new FailingKeyedPooledObjectFactory();
635635
final KeyedObjectPool<Object, Object, PrivateException> pool;
636636
try {
@@ -653,7 +653,7 @@ public void testKPOFCloseUsages() {
653653
}
654654

655655
@Test
656-
public void testKPOFInvalidateObjectUsages() throws InterruptedException {
656+
void testKPOFInvalidateObjectUsages() throws InterruptedException {
657657
final FailingKeyedPooledObjectFactory factory = new FailingKeyedPooledObjectFactory();
658658
final KeyedObjectPool<Object, Object, PrivateException> pool;
659659
try {
@@ -686,7 +686,7 @@ public void testKPOFInvalidateObjectUsages() throws InterruptedException {
686686
}
687687

688688
@Test
689-
public void testKPOFReturnObjectUsages() {
689+
void testKPOFReturnObjectUsages() {
690690
final FailingKeyedPooledObjectFactory factory = new FailingKeyedPooledObjectFactory();
691691
final KeyedObjectPool<Object, Object, PrivateException> pool;
692692
try {
@@ -744,7 +744,7 @@ public void testKPOFReturnObjectUsages() {
744744
}
745745

746746
@Test
747-
public void testToString() {
747+
void testToString() {
748748
final FailingKeyedPooledObjectFactory factory = new FailingKeyedPooledObjectFactory();
749749
try (KeyedObjectPool<Object, Object, PrivateException> pool = makeEmptyPool(factory)) {
750750
pool.toString();

src/test/java/org/apache/commons/pool3/AbstractTestObjectPool.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private static void reset(final ObjectPool<Object, ?> pool, final MethodCallPool
7070
protected abstract <E extends Exception> ObjectPool<Object, E> makeEmptyPool(PooledObjectFactory<Object, E> factory) throws UnsupportedOperationException;
7171

7272
@Test
73-
public void testClosedPoolBehavior() throws Exception {
73+
void testClosedPoolBehavior() throws Exception {
7474
final ObjectPool<Object, PrivateException> pool;
7575
try {
7676
pool = makeEmptyPool(new MethodCallPoolableObjectFactory());
@@ -112,7 +112,7 @@ public void testClosedPoolBehavior() throws Exception {
112112
}
113113

114114
@Test
115-
public void testPOFAddObjectUsage() throws Exception {
115+
void testPOFAddObjectUsage() throws Exception {
116116
final MethodCallPoolableObjectFactory factory = new MethodCallPoolableObjectFactory();
117117
final ObjectPool<Object, PrivateException> pool;
118118
try {
@@ -163,7 +163,7 @@ public void testPOFAddObjectUsage() throws Exception {
163163
}
164164

165165
@Test
166-
public void testPOFBorrowObjectUsages() throws Exception {
166+
void testPOFBorrowObjectUsages() throws Exception {
167167
final MethodCallPoolableObjectFactory factory = new MethodCallPoolableObjectFactory();
168168
final ObjectPool<Object, PrivateException> pool;
169169
try {
@@ -233,7 +233,7 @@ public void testPOFBorrowObjectUsages() throws Exception {
233233
}
234234

235235
@Test
236-
public void testPOFClearUsages() throws Exception {
236+
void testPOFClearUsages() throws Exception {
237237
final MethodCallPoolableObjectFactory factory = new MethodCallPoolableObjectFactory();
238238
final ObjectPool<Object, PrivateException> pool;
239239
try {
@@ -256,7 +256,7 @@ public void testPOFClearUsages() throws Exception {
256256
}
257257

258258
@Test
259-
public void testPOFCloseUsages() throws Exception {
259+
void testPOFCloseUsages() throws Exception {
260260
final MethodCallPoolableObjectFactory factory = new MethodCallPoolableObjectFactory();
261261
ObjectPool<Object, PrivateException> pool;
262262
try {
@@ -283,7 +283,7 @@ public void testPOFCloseUsages() throws Exception {
283283
}
284284

285285
@Test
286-
public void testPOFInvalidateObjectUsages() throws Exception {
286+
void testPOFInvalidateObjectUsages() throws Exception {
287287
final MethodCallPoolableObjectFactory factory = new MethodCallPoolableObjectFactory();
288288
final ObjectPool<Object, PrivateException> pool;
289289
try {
@@ -316,7 +316,7 @@ public void testPOFInvalidateObjectUsages() throws Exception {
316316
}
317317

318318
@Test
319-
public void testPOFReturnObjectUsages() throws Exception {
319+
void testPOFReturnObjectUsages() throws Exception {
320320
final MethodCallPoolableObjectFactory factory = new MethodCallPoolableObjectFactory();
321321
final ObjectPool<Object, PrivateException> pool;
322322
try {
@@ -376,7 +376,7 @@ public void testPOFReturnObjectUsages() throws Exception {
376376
}
377377

378378
@Test
379-
public void testToString() {
379+
void testToString() {
380380
final ObjectPool<Object, PrivateException> pool;
381381
try {
382382
pool = makeEmptyPool(new MethodCallPoolableObjectFactory());

src/test/java/org/apache/commons/pool3/PoolTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import org.junit.jupiter.api.Test;
3030

3131
@Disabled
32-
public class PoolTest {
32+
class PoolTest {
3333

3434
private static final class Foo {
3535
}
@@ -72,7 +72,7 @@ public boolean validateObject(final PooledObject<Foo> pooledObject) {
7272
private static final Duration EVICTION_DURATION = Duration.ofMillis(100);
7373

7474
@Test
75-
public void testPool() {
75+
void testPool() {
7676
final GenericObjectPoolConfig<Foo> poolConfig = new GenericObjectPoolConfig<>();
7777
poolConfig.setTestWhileIdle(true /* testWhileIdle */);
7878
final PooledFooFactory pooledFooFactory = new PooledFooFactory();

src/test/java/org/apache/commons/pool3/TestBaseKeyedPooledObjectFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/**
2525
*/
26-
public class TestBaseKeyedPooledObjectFactory {
26+
class TestBaseKeyedPooledObjectFactory {
2727

2828
private static final class TestFactory extends BaseKeyedPooledObjectFactory<Object, Object, RuntimeException> {
2929
@Override
@@ -38,7 +38,7 @@ public PooledObject<Object> wrap(final Object value) {
3838
}
3939

4040
@Test
41-
public void testDefaultMethods() {
41+
void testDefaultMethods() {
4242
final KeyedPooledObjectFactory<Object, Object, RuntimeException> factory = new TestFactory();
4343

4444
factory.activateObject("key", null); // a no-op

src/test/java/org/apache/commons/pool3/TestBaseObjectPool.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ protected <E extends Exception> ObjectPool<Object, E> makeEmptyPool(final Pooled
9292
}
9393

9494
@Test
95-
public void testBaseAddObject() {
95+
void testBaseAddObject() {
9696
try {
9797
pool = makeEmptyPool(3);
9898
} catch (final UnsupportedOperationException e) {
@@ -119,7 +119,7 @@ public void testBaseAddObject() {
119119
}
120120

121121
@Test
122-
public void testBaseBorrow() {
122+
void testBaseBorrow() {
123123
try {
124124
pool = makeEmptyPool(3);
125125
} catch (final UnsupportedOperationException e) {
@@ -132,7 +132,7 @@ public void testBaseBorrow() {
132132
}
133133

134134
@Test
135-
public void testBaseBorrowReturn() {
135+
void testBaseBorrowReturn() {
136136
try {
137137
pool = makeEmptyPool(3);
138138
} catch (final UnsupportedOperationException e) {
@@ -171,7 +171,7 @@ public void testBaseBorrowReturn() {
171171
}
172172

173173
@Test
174-
public void testBaseClear() {
174+
void testBaseClear() {
175175
try {
176176
pool = makeEmptyPool(3);
177177
} catch (final UnsupportedOperationException e) {
@@ -196,7 +196,7 @@ public void testBaseClear() {
196196
}
197197

198198
@Test
199-
public void testBaseClosePool() {
199+
void testBaseClosePool() {
200200
try {
201201
pool = makeEmptyPool(3);
202202
} catch (final UnsupportedOperationException e) {
@@ -210,7 +210,7 @@ public void testBaseClosePool() {
210210
}
211211

212212
@Test
213-
public void testBaseInvalidateObject() {
213+
void testBaseInvalidateObject() {
214214
try {
215215
pool = makeEmptyPool(3);
216216
} catch (final UnsupportedOperationException e) {
@@ -232,7 +232,7 @@ public void testBaseInvalidateObject() {
232232
}
233233

234234
@Test
235-
public void testBaseNumActiveNumIdle() {
235+
void testBaseNumActiveNumIdle() {
236236
try {
237237
pool = makeEmptyPool(3);
238238
} catch (final UnsupportedOperationException e) {
@@ -256,7 +256,7 @@ public void testBaseNumActiveNumIdle() {
256256
}
257257

258258
@Test
259-
public void testClose() {
259+
void testClose() {
260260
@SuppressWarnings("resource")
261261
final ObjectPool<Object, RuntimeException> pool = new TestObjectPool();
262262

@@ -265,7 +265,7 @@ public void testClose() {
265265
}
266266

267267
@Test
268-
public void testUnsupportedOperations() {
268+
void testUnsupportedOperations() {
269269
if (!getClass().equals(TestBaseObjectPool.class)) {
270270
return; // skip redundant tests
271271
}

src/test/java/org/apache/commons/pool3/TestBasePoolableObjectFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
/**
2828
*/
29-
public class TestBasePoolableObjectFactory {
29+
class TestBasePoolableObjectFactory {
3030

3131
private static final class TestFactory extends BasePooledObjectFactory<AtomicInteger, RuntimeException> {
3232
@Override
@@ -48,7 +48,7 @@ public PooledObject<AtomicInteger> wrap(final AtomicInteger value) {
4848
}
4949

5050
@Test
51-
public void testDefaultMethods() {
51+
void testDefaultMethods() {
5252
final PooledObjectFactory<AtomicInteger, RuntimeException> factory = new TestFactory();
5353

5454
factory.activateObject(null); // a no-op
@@ -64,7 +64,7 @@ public void testDefaultMethods() {
6464
* @throws RuntimeException May occur in some failure modes
6565
*/
6666
@Test
67-
public void testDestroyModes() {
67+
void testDestroyModes() {
6868
final PooledObjectFactory<AtomicInteger, RuntimeException> factory = new TestFactory();
6969
final PooledObject<AtomicInteger> pooledObj = factory.makeObject();
7070
final AtomicInteger obj = pooledObj.getObject();

0 commit comments

Comments
 (0)