@@ -47,33 +47,38 @@ public class Tables extends BrokerTestCase
4747
4848 public void testTypes () throws IOException {
4949
50- AMQP .Queue .DeclareOk ok = channel .queueDeclare ();
51- String q = ok .getQueue ();
52-
53- Map <String , Object > headers = new HashMap <String , Object >();
50+ Map <String , Object > table = new HashMap <String , Object >();
5451 Map <String , Object > subTable = new HashMap <String , Object >();
5552 subTable .put ("key" , 1 );
56- headers .put ("S" , LongStringHelper .asLongString ("string" ));
57- headers .put ("I" , new Integer (1 ));
58- headers .put ("D" , new BigDecimal ("1.1" ));
59- headers .put ("T" , new java .util .Date (1000000 ));
60- headers .put ("F" , subTable );
61- headers .put ("b" , (byte )1 );
62- headers .put ("d" , 1.1d );
63- headers .put ("f" , 1.1f );
64- headers .put ("l" , 1L );
65- headers .put ("s" , (short )1 );
66- headers .put ("t" , true );
67- headers .put ("x" , "byte" .getBytes ());
68- headers .put ("V" , null );
69- BasicProperties props = new BasicProperties (null , null , headers , null ,
53+ table .put ("S" , LongStringHelper .asLongString ("string" ));
54+ table .put ("I" , new Integer (1 ));
55+ table .put ("D" , new BigDecimal ("1.1" ));
56+ table .put ("T" , new java .util .Date (1000000 ));
57+ table .put ("F" , subTable );
58+ table .put ("b" , (byte )1 );
59+ table .put ("d" , 1.1d );
60+ table .put ("f" , 1.1f );
61+ table .put ("l" , 1L );
62+ table .put ("s" , (short )1 );
63+ table .put ("t" , true );
64+ table .put ("x" , "byte" .getBytes ());
65+ table .put ("V" , null );
66+
67+ //roundtrip of content headers
68+ AMQP .Queue .DeclareOk ok = channel .queueDeclare ();
69+ String q = ok .getQueue ();
70+ BasicProperties props = new BasicProperties (null , null , table , null ,
7071 null , null , null , null ,
7172 null , null , null , null ,
7273 null , null );
73-
7474 channel .basicPublish ("" , q , props , "" .getBytes ());
7575 BasicProperties rProps = channel .basicGet (q , true ).getProps ();
7676 assertMapsEqual (props .headers , rProps .headers );
77+
78+ //sending as part of method arguments - we are relying on
79+ //exchange.declare ignoring the arguments table.
80+ channel .exchangeDeclare ("x" , "direct" , false , false , false , table );
81+ channel .exchangeDelete ("x" );
7782 }
7883
7984 private static void assertMapsEqual (Map <String , Object > a ,
0 commit comments