File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
jetty-core/jetty-io/src/test/java/org/eclipse/jetty/io Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 41
41
42
42
public class ArrayByteBufferPoolTest
43
43
{
44
+ @ Test
45
+ public void testRemoveAndReleaseCompoundPool ()
46
+ {
47
+ int bufferCount = ConcurrentPool .OPTIMAL_MAX_SIZE * 2 ;
48
+ List <RetainableByteBuffer > rbbs = new ArrayList <>();
49
+
50
+ ArrayByteBufferPool pool = new ArrayByteBufferPool ();
51
+ for (int i = 0 ; i < bufferCount ; i ++)
52
+ {
53
+ RetainableByteBuffer rbb = pool .acquire (1 , false );
54
+ rbbs .add (rbb );
55
+ }
56
+ rbbs .forEach (Retainable ::release );
57
+ rbbs .clear ();
58
+
59
+ for (int i = 0 ; i < bufferCount ; i ++)
60
+ {
61
+ RetainableByteBuffer rbb = pool .acquire (1 , false );
62
+ rbbs .add (rbb );
63
+ }
64
+
65
+ rbbs .forEach (pool ::removeAndRelease );
66
+ }
67
+
44
68
@ Test
45
69
public void testDump ()
46
70
{
You can’t perform that action at this time.
0 commit comments