3535import java .util .HashMap ;
3636import java .util .Map ;
3737
38+ import com .rabbitmq .client .AMQP ;
3839import com .rabbitmq .client .test .BrokerTestCase ;
3940
4041public class QueueLease extends BrokerTestCase {
@@ -78,6 +79,7 @@ public void testExpireMustBeLong() throws IOException {
7879 args );
7980 fail ("server accepted x-expires not of type long" );
8081 } catch (IOException e ) {
82+ checkShutdownSignal (AMQP .PRECONDITION_FAILED , e );
8183 }
8284 }
8385
@@ -90,6 +92,7 @@ public void testExpireMustBeGtZero() throws IOException {
9092 args );
9193 fail ("server accepted x-expires of zero ms." );
9294 } catch (IOException e ) {
95+ checkShutdownSignal (AMQP .PRECONDITION_FAILED , e );
9396 }
9497 }
9598
@@ -102,6 +105,7 @@ public void testExpireMustBePositive() throws IOException {
102105 args );
103106 fail ("server accepted negative x-expires." );
104107 } catch (IOException e ) {
108+ checkShutdownSignal (AMQP .PRECONDITION_FAILED , e );
105109 }
106110 }
107111
@@ -123,6 +127,7 @@ public void testQueueRedeclareEquivalence() throws IOException {
123127 false , args2 );
124128 fail ("Able to redeclare queue with mismatching expire flags." );
125129 } catch (IOException e ) {
130+ checkShutdownSignal (AMQP .NOT_ALLOWED , e );
126131 }
127132 }
128133
@@ -151,7 +156,9 @@ void verifyQueueExpires(String name, boolean expire) throws IOException,
151156 fail ("Queue should have been expired by now." );
152157 }
153158 } catch (IOException e ) {
154- if (!expire ) {
159+ if (expire ) {
160+ checkShutdownSignal (AMQP .NOT_FOUND , e );
161+ } else {
155162 fail ("Queue without expire flag deleted." );
156163 }
157164 }
0 commit comments