Search in sources :

Example 1 with BsonBoolean

use of org.bson.BsonBoolean in project mongo-java-driver by mongodb.

the class CommandResultTest method shouldNotHaveExceptionWhenOkIsTrue.

@Test
public void shouldNotHaveExceptionWhenOkIsTrue() throws UnknownHostException {
    CommandResult commandResult = new CommandResult(new BsonDocument("ok", new BsonBoolean(true)));
    assertNull(commandResult.getException());
}
Also used : BsonDocument(org.bson.BsonDocument) BsonBoolean(org.bson.BsonBoolean) Test(org.junit.Test)

Example 2 with BsonBoolean

use of org.bson.BsonBoolean in project drill by apache.

the class TestBsonRecordReader method testBooleanType.

@Test
public void testBooleanType() throws IOException {
    BsonDocument bsonDoc = new BsonDocument();
    bsonDoc.append("booleanKey", new BsonBoolean(true));
    writer.reset();
    bsonReader.write(writer, new BsonDocumentReader(bsonDoc));
    SingleMapReaderImpl mapReader = (SingleMapReaderImpl) writer.getMapVector().getReader();
    assertTrue(mapReader.reader("booleanKey").readBoolean());
}
Also used : BsonDocument(org.bson.BsonDocument) SingleMapReaderImpl(org.apache.drill.exec.vector.complex.impl.SingleMapReaderImpl) BsonDocumentReader(org.bson.BsonDocumentReader) BsonBoolean(org.bson.BsonBoolean) Test(org.junit.Test)

Aggregations

BsonBoolean (org.bson.BsonBoolean)2 BsonDocument (org.bson.BsonDocument)2 Test (org.junit.Test)2 SingleMapReaderImpl (org.apache.drill.exec.vector.complex.impl.SingleMapReaderImpl)1 BsonDocumentReader (org.bson.BsonDocumentReader)1