File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -45,12 +45,12 @@ public void testCreateCollection() {
45
45
DBCollection c = _db .createCollection ("foo1" , o1 );
46
46
47
47
DBObject o2 = BasicDBObjectBuilder .start ().add ("capped" , true )
48
- .add ("size " , 100 ).get ();
48
+ .add ("max " , 10 ).get ();
49
49
c = _db .createCollection ("foo2" , o2 );
50
50
for (int i =0 ; i <30 ; i ++) {
51
51
c .insert (new BasicDBObject ("x" , i ));
52
52
}
53
- assertTrue (c .find ().count () < 10 );
53
+ assertTrue (c .find ().count () <= 10 );
54
54
55
55
DBObject o3 = BasicDBObjectBuilder .start ().add ("capped" , true )
56
56
.add ("size" , 1000 ).add ("max" , 2 ).get ();
Original file line number Diff line number Diff line change @@ -220,14 +220,16 @@ public void testBinaryOld()
220
220
bb .put ( "eliot" .getBytes () );
221
221
out .put ( "a" , new Binary ( BSON .B_BINARY , "eliot" .getBytes () ) );
222
222
c .save ( out );
223
-
223
+
224
+ // objects of subtype B_BINARY or B_GENERAL should becomes byte[]
224
225
out = c .findOne ();
225
- Binary blah = (Binary )(out .get ( "a" ) );
226
- assertEquals ( "eliot" , new String ( blah .getData () ) );
226
+ // Binary blah = (Binary)(out.get( "a" ) );
227
+ byte [] bytes = (byte []) out .get ("a" );
228
+ assertEquals ( "eliot" , new String ( bytes ) );
227
229
228
230
out .put ( "a" , new Binary ( (byte )111 , raw ) );
229
231
c .save ( out );
230
- blah = (Binary )c .findOne ().get ( "a" );
232
+ Binary blah = (Binary )c .findOne ().get ( "a" );
231
233
assertEquals ( 111 , blah .getType () );
232
234
assertEquals ( Util .toHex ( raw ) , Util .toHex ( blah .getData () ) );
233
235
}
You can’t perform that action at this time.
0 commit comments