Skip to content

Commit a7fb4ea

Browse files
committed
exposed BSONRegExp type
1 parent 10770ed commit a7fb4ea

File tree

3 files changed

+68
-16
lines changed

3 files changed

+68
-16
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ connect.ObjectID = core.BSON.ObjectID;
4040
connect.ObjectId = core.BSON.ObjectID;
4141
connect.Symbol = core.BSON.Symbol;
4242
connect.Timestamp = core.BSON.Timestamp;
43+
connect.BSONRegExp = core.BSON.BSONRegExp;
4344
connect.Decimal128 = core.BSON.Decimal128;
4445

4546
// Add connect method

test/functional/ssl_mongoclient_tests.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,3 +1149,65 @@ exports['should correctly connect using SSL to replicaset with requireSSL'] = {
11491149
});
11501150
}
11511151
}
1152+
1153+
// /**
1154+
// * @ignore
1155+
// */
1156+
// exports['should fail due to accessing using ip address'] = {
1157+
// metadata: { requires: { topology: 'ssl' } },
1158+
//
1159+
// // The actual test we wish to run
1160+
// test: function(configuration, test) {
1161+
// var ServerManager = require('mongodb-topology-manager').Server
1162+
// , MongoClient = configuration.require.MongoClient;
1163+
//
1164+
// // All inserted docs
1165+
// var docs = [];
1166+
// var errs = [];
1167+
// var insertDocs = [];
1168+
//
1169+
// // Read the ca
1170+
// var ca = [fs.readFileSync(__dirname + "/ssl/ca.pem")];
1171+
//
1172+
// // Start server
1173+
// var serverManager = new ServerManager('mongod', {
1174+
// journal:null
1175+
// , sslOnNormalPorts: null
1176+
// , sslPEMKeyFile: __dirname + "/ssl/server.pem"
1177+
// // EnsureUp options
1178+
// , dbpath: path.join(path.resolve('db'), f("data-%d", 27019))
1179+
// , bind_ip: 'server'
1180+
// , port: 27019
1181+
// });
1182+
//
1183+
// console.log("=============================== commandLine 0")
1184+
// // console.log(commandLine)
1185+
// serverManager.purge().then(function() {
1186+
// console.log("=============================== commandLine 1")
1187+
// // Start the server
1188+
// serverManager.start().then(function() {
1189+
// setTimeout(function() {
1190+
// console.log("=============================== commandLine 2")
1191+
// // Connect and validate the server certificate
1192+
// // MongoClient.connect("mongodb://127.0.0.1:27019/test?ssl=true&maxPoolSize=1", {
1193+
// // MongoClient.connect("mongodb://foo:bar@ds015564-a0.sjf52.fleet.mongolab.com:15564,ds015564-a1.sjf52.fleet.mongolab.com:15564/test?replicaSet=rs-ds015564&ssl=true", { // MongoClient.connect("mongodb://server:27019/test?ssl=true&maxPoolSize=1", {
1194+
// MongoClient.connect("mongodb://foo:bar@54.161.72.61:15564,54.204.126.162:15564/test?replicaSet=rs-ds015564&ssl=true", {
1195+
// sslValidate:true,
1196+
// // checkServerIdentity:true
1197+
// // , sslCA:ca
1198+
// }, function(err, db) {
1199+
// console.dir(err)
1200+
// test.equal(null, err);
1201+
// test.ok(db != null);
1202+
//
1203+
// db.close();
1204+
//
1205+
// serverManager.stop().then(function() {
1206+
// test.done();
1207+
// });
1208+
// });
1209+
// }, 1000);
1210+
// });
1211+
// });
1212+
// }
1213+
// }

test/runner.js

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ var Runner = require('integra').Runner
44
, Cover = require('integra').Cover
55
, RCover = require('integra').RCover
66
, f = require('util').format
7-
, m = require('mongodb-version-manager')
87
, path = require('path')
98
, NodeVersionFilter = require('./filters/node_version_filter')
109
, MongoDBVersionFilter = require('./filters/mongodb_version_filter')
@@ -101,6 +100,7 @@ var Configuration = function(options) {
101100
manager.discover().then(function(result) {
102101
// Create string representation
103102
var currentVersion = result.version.join('.');
103+
console.log("==== Running against MongodDB " + currentVersion);
104104
// If we have a ReplSetManager and the version is >= 3.4.0
105105
if(semver.satisfies(currentVersion, ">=3.4.0")) {
106106
if(manager instanceof ReplSetManager) {
@@ -141,28 +141,19 @@ var Configuration = function(options) {
141141
},
142142

143143
stop: function(callback) {
144-
// console.log("=================== STOP 0")
145144
if(skipTermination) return callback();
146-
// console.log("=================== STOP 1")
147145
// Stop the servers
148146
manager.stop(9).then(function() {
149-
// console.log("=================== STOP 1")
150147
callback();
151148
});
152149
},
153150

154151
restart: function(options, callback) {
155-
// console.log("------------ restart 0")
156-
// console.log("=================== RESTART 0")
157152
if(typeof options == 'function') callback = options, options = {purge:true, kill:true};
158-
// console.log("=================== RESTART 1")
159153
if(skipTermination) return callback();
160-
// console.log("=================== RESTART 2")
161-
// console.log("------------ restart 1")
162154

163155
// Stop the servers
164156
manager.restart().then(function() {
165-
// console.log("=================== RESTART 3")
166157
callback();
167158
});
168159
},
@@ -255,8 +246,8 @@ var Configuration = function(options) {
255246

256247
// Set up the runner
257248
var runner = new Runner({
258-
// logLevel:'error'
259-
logLevel:'info'
249+
logLevel:'error'
250+
// logLevel:'info'
260251
, runners: 1
261252
, failFast: true
262253
});
@@ -468,15 +459,14 @@ if(argv.t == 'functional') {
468459
return runner.run(Configuration(_config));
469460
}
470461

471-
// console.log("!!!!!!!!!!! RUN 0")
462+
// Get the mongodb-version-manager
463+
var m = require('mongodb-version-manager');
472464
// Kill any running MongoDB processes and
473465
// `install $MONGODB_VERSION` || `use existing installation` || `install stable`
474466
m(function(err){
475-
// console.log("!!!!!!!!!!! RUN 1")
476467
if(err) return console.error(err) && process.exit(1);
477468

478469
m.current(function(err, version){
479-
// console.log("!!!!!!!!!!! RUN 2")
480470
if(err) return console.error(err) && process.exit(1);
481471
console.log('Running tests against MongoDB version `%s`', version);
482472
// Run the configuration
@@ -488,7 +478,6 @@ if(argv.t == 'functional') {
488478
//
489479
// Replicaset configuration
490480
if(argv.e == 'replicaset') {
491-
// console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
492481
// Establish the server version
493482
new ServerManager('mongod').discover().then(function(r) {
494483
// The individual nodes

0 commit comments

Comments
 (0)