3434import java .io .IOException ;
3535import java .util .HashMap ;
3636
37+ import com .rabbitmq .client .AMQP ;
3738import com .rabbitmq .client .Channel ;
3839import com .rabbitmq .client .Connection ;
3940import com .rabbitmq .client .QueueingConsumer ;
@@ -66,6 +67,7 @@ public void testQueueExclusiveForPassiveDeclare() throws Exception {
6667 try {
6768 channel .queueDeclarePassive (q );
6869 } catch (IOException ioe ) {
70+ checkShutdownSignal (AMQP .RESOURCE_LOCKED , ioe );
6971 return ;
7072 }
7173 fail ("Passive queue declaration of an exclusive queue from another connection should fail" );
@@ -77,6 +79,7 @@ public void testQueueExclusiveForDeclare() throws Exception {
7779 try {
7880 channel .queueDeclare (q , false , true , false , noArgs );
7981 } catch (IOException ioe ) {
82+ checkShutdownSignal (AMQP .RESOURCE_LOCKED , ioe );
8083 return ;
8184 }
8285 fail ("Active queue declaration of an exclusive queue from another connection should fail" );
@@ -87,6 +90,7 @@ public void testQueueExclusiveForConsume() throws Exception {
8790 try {
8891 channel .basicConsume (q , c );
8992 } catch (IOException ioe ) {
93+ checkShutdownSignal (AMQP .RESOURCE_LOCKED , ioe );
9094 return ;
9195 }
9296 fail ("Exclusive queue should be locked for basic consume from another connection" );
@@ -96,6 +100,7 @@ public void testQueueExclusiveForPurge() throws Exception {
96100 try {
97101 channel .queuePurge (q );
98102 } catch (IOException ioe ) {
103+ checkShutdownSignal (AMQP .RESOURCE_LOCKED , ioe );
99104 return ;
100105 }
101106 fail ("Exclusive queue should be locked for queue purge from another connection" );
@@ -105,6 +110,7 @@ public void testQueueExclusiveForDelete() throws Exception {
105110 try {
106111 channel .queueDelete (q );
107112 } catch (IOException ioe ) {
113+ checkShutdownSignal (AMQP .RESOURCE_LOCKED , ioe );
108114 return ;
109115 }
110116 fail ("Exclusive queue should be locked for queue delete from another connection" );
@@ -114,6 +120,7 @@ public void testQueueExclusiveForBind() throws Exception {
114120 try {
115121 channel .queueBind (q , "" , "" ); // NB uses default exchange
116122 } catch (IOException ioe ) {
123+ checkShutdownSignal (AMQP .INTERNAL_ERROR , ioe );
117124 return ;
118125 }
119126 fail ("Exclusive queue should be locked for queue bind from another connection" );
@@ -131,6 +138,7 @@ public void testQueueExclusiveForUnbind() throws Exception {
131138 try {
132139 channel .queueUnbind (q , "" , "" );
133140 } catch (IOException ioe ) {
141+ checkShutdownSignal (AMQP .INTERNAL_ERROR , ioe );
134142 return ;
135143 }
136144 fail ("Exclusive queue should be locked for queue unbind from another connection" );
@@ -140,6 +148,7 @@ public void testQueueExclusiveForGet() throws Exception {
140148 try {
141149 channel .basicGet (q , true );
142150 } catch (IOException ioe ) {
151+ checkShutdownSignal (AMQP .RESOURCE_LOCKED , ioe );
143152 return ;
144153 }
145154 fail ("Exclusive queue should be locked for basic get from another connection" );
0 commit comments