File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,6 +131,27 @@ public void testArray1(){
131131
132132 }
133133
134+ @ Test
135+ public void testArray2 (){
136+ DBObject x = new BasicDBObject ();
137+ x .put ( "a" , new String []{ "a" , "b" , "c" } );
138+ x .put ( "b" , new int []{ 1 , 2 , 3 } );
139+
140+ BSONObject y = BSON .decode ( BSON .encode ( x ) );
141+
142+ List l = (List )y .get ("a" );
143+ assertEquals ( 3 , l .size () );
144+ assertEquals ( "a" , l .get (0 ) );
145+ assertEquals ( "b" , l .get (1 ) );
146+ assertEquals ( "c" , l .get (2 ) );
147+
148+ l = (List )y .get ("b" );
149+ assertEquals ( 3 , l .size () );
150+ assertEquals ( 1 , l .get (0 ) );
151+ assertEquals ( 2 , l .get (1 ) );
152+ assertEquals ( 3 , l .get (2 ) );
153+ }
154+
134155 @ Test (groups = {"basic" })
135156 public void testObjcetId (){
136157 assertTrue ( (new ObjectId ()).compareTo ( new ObjectId () ) < 0 );
You can’t perform that action at this time.
0 commit comments