Skip to content

Commit 6b42219

Browse files
committed
Test for BSON byte[]
1 parent 752fe2e commit 6b42219

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/test/org/bson/BSONTest.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
import org.testng.annotations.Test;
3030

31-
import org.bson.types.CodeWScope;
31+
import org.bson.types.*;
3232
import org.bson.io.*;
3333

3434
public class BSONTest extends TestCase {
@@ -118,6 +118,17 @@ public void testCode()
118118
_test( code_object , 53 , "52918d2367533165bfc617df50335cbb" );
119119
}
120120

121+
@Test
122+
public void testBinary()
123+
throws IOException{
124+
byte[] data = new byte[10000];
125+
for(int i=0; i<10000; i++) {
126+
data[i] = 1;
127+
}
128+
BSONObject binary_object = new BasicBSONObject( "bin" , data);
129+
_test( binary_object , 10019 , "682d9a636619b135fa9801ac42c48a10" );
130+
}
131+
121132
@Test
122133
public void testOBBig1(){
123134
BasicOutputBuffer a = new BasicOutputBuffer();

0 commit comments

Comments
 (0)