File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
test/src/com/rabbitmq/client/test/functional Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 3636import junit .framework .TestCase ;
3737
3838import com .rabbitmq .client .Channel ;
39+ import com .rabbitmq .client .Command ;
3940import com .rabbitmq .client .Connection ;
4041import com .rabbitmq .client .ConnectionFactory ;
42+ import com .rabbitmq .client .ShutdownSignalException ;
43+
44+ import com .rabbitmq .client .AMQP ;
4145
4246public class BrokerTestCase extends TestCase
4347{
@@ -120,4 +124,17 @@ public void closeChannel()
120124 }
121125 }
122126
127+ public void checkShutdownSignal (int expectedCode , IOException ioe ) {
128+ ShutdownSignalException sse = (ShutdownSignalException ) ioe .getCause ();
129+ Command closeCommand = (Command ) sse .getReason ();
130+ channel = null ;
131+ if (sse .isHardError ()) {
132+ connection = null ;
133+ AMQP .Connection .Close closeMethod = (AMQP .Connection .Close ) closeCommand .getMethod ();
134+ assertEquals (expectedCode , closeMethod .getReplyCode ());
135+ } else {
136+ AMQP .Channel .Close closeMethod = (AMQP .Channel .Close ) closeCommand .getMethod ();
137+ assertEquals (expectedCode , closeMethod .getReplyCode ());
138+ }
139+ }
123140}
You can’t perform that action at this time.
0 commit comments