20
20
21
21
import com .rabbitmq .client .*;
22
22
import java .io .IOException ;
23
+ import java .util .Arrays ;
23
24
import java .util .concurrent .CountDownLatch ;
24
25
import java .util .concurrent .TimeoutException ;
25
26
import java .util .concurrent .atomic .AtomicReference ;
26
- import org .junit .jupiter .params .ParameterizedTest ;
27
- import org .junit .jupiter .params .provider .CsvSource ;
27
+ import org .junit .Test ;
28
+ import org .junit .runner .RunWith ;
29
+ import org .junit .runners .Parameterized ;
28
30
31
+ @ RunWith (Parameterized .class )
29
32
public class MaxInboundMessageSizeTest extends BrokerTestCase {
30
33
34
+ @ Parameterized .Parameter (value = 0 )
35
+ public int maxMessageSize ;
36
+ @ Parameterized .Parameter (value = 1 )
37
+ public int frameMax ;
38
+ @ Parameterized .Parameter (value = 2 )
39
+ public boolean basicGet ;
40
+
41
+ @ Parameterized .Parameters
42
+ public static Iterable <Object []> data () {
43
+ return Arrays .asList (
44
+ new Object [][] {
45
+ {20000 , 5000 , true },
46
+ {20000 , 100000 , true },
47
+ {20000 , 5000 , false },
48
+ {20000 , 100000 , false }
49
+ });
50
+ }
51
+
31
52
String q ;
32
53
33
54
private static void safeClose (Connection c ) {
@@ -45,14 +66,8 @@ protected void createResources() throws IOException, TimeoutException {
45
66
super .createResources ();
46
67
}
47
68
48
- @ CsvSource ({
49
- "20000,5000,true" ,
50
- "20000,100000,true" ,
51
- "20000,5000,false" ,
52
- "20000,100000,false" ,
53
- })
54
- @ ParameterizedTest
55
- void maxInboundMessageSizeMustBeEnforced (int maxMessageSize , int frameMax , boolean basicGet )
69
+ @ Test
70
+ public void maxInboundMessageSizeMustBeEnforced ()
56
71
throws Exception {
57
72
ConnectionFactory cf = newConnectionFactory ();
58
73
cf .setMaxInboundMessageBodySize (maxMessageSize );
@@ -94,4 +109,4 @@ protected void releaseResources() throws IOException {
94
109
deleteQueue (q );
95
110
super .releaseResources ();
96
111
}
97
- }
112
+ }
0 commit comments