@@ -65,21 +65,36 @@ public void testDoesNotExpireOthers() throws IOException,
6565 verifyQueueExpires (TEST_NORMAL_QUEUE , false );
6666 }
6767
68- /**
69- * Verify that the server throws an error if the type of x-expires is not
70- * int.
71- */
72- public void testExpireMustBeInt () throws IOException {
68+ public void testExpireMayBeByte () throws IOException {
69+ Map <String , Object > args = new HashMap <String , Object >();
70+ args .put ("x-expires" , (byte )100 );
71+
72+ try {
73+ channel .queueDeclare ("expiresMayBeByte" , false , true , false , args );
74+ } catch (IOException e ) {
75+ fail ("server did not accept x-expires of type byte" );
76+ }
77+ }
78+
79+ public void testExpireMayBeShort () throws IOException {
80+ Map <String , Object > args = new HashMap <String , Object >();
81+ args .put ("x-expires" , (short )100 );
82+
83+ try {
84+ channel .queueDeclare ("expiresMayBeShort" , false , true , false , args );
85+ } catch (IOException e ) {
86+ fail ("server did not accept x-expires of type short" );
87+ }
88+ }
89+
90+ public void testExpireMayBeLong () throws IOException {
7391 Map <String , Object > args = new HashMap <String , Object >();
7492 args .put ("x-expires" , 100L );
7593
7694 try {
77- channel
78- .queueDeclare ("expiresMustBeLong" , false , false , false ,
79- args );
80- fail ("server accepted x-expires not of type int" );
95+ channel .queueDeclare ("expiresMayBeLong" , false , true , false , args );
8196 } catch (IOException e ) {
82- checkShutdownSignal ( AMQP . PRECONDITION_FAILED , e );
97+ fail ( "server did not accept x-expires of type long" );
8398 }
8499 }
85100
0 commit comments