Skip to content

Commit ca4d36d

Browse files
committed
Refactored the tests
1 parent 1a93266 commit ca4d36d

13 files changed

+3558
-3270
lines changed

test/runners/standalone_runner.js

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -79,41 +79,41 @@ module.exports = function(configurations) {
7979
// The list of files to execute
8080
.add("functional_tests",
8181
[
82-
// '/test/tests/functional/mongo_reply_parser_tests.js'
83-
// , '/test/tests/functional/connection_pool_tests.js'
84-
// , '/test/tests/functional/gridstore/readstream_tests.js'
85-
// , '/test/tests/functional/gridstore/grid_tests.js'
86-
// , '/test/tests/functional/gridstore/gridstore_direct_streaming_tests.js'
87-
// , '/test/tests/functional/gridstore/gridstore_tests.js'
88-
// , '/test/tests/functional/gridstore/gridstore_stream_tests.js'
89-
// , '/test/tests/functional/gridstore/gridstore_file_tests.js'
90-
// , '/test/tests/functional/util_tests.js'
91-
// , '/test/tests/functional/multiple_db_tests.js'
92-
// , '/test/tests/functional/logging_tests.js'
93-
// , '/test/tests/functional/custom_pk_tests.js'
94-
// , '/test/tests/functional/geo_tests.js'
95-
// , '/test/tests/functional/write_preferences_tests.js'
96-
// , '/test/tests/functional/remove_tests.js'
97-
// , '/test/tests/functional/unicode_tests.js'
98-
// , '/test/tests/functional/raw_tests.js'
82+
'/test/tests/functional/mongo_reply_parser_tests.js'
83+
, '/test/tests/functional/connection_pool_tests.js'
84+
, '/test/tests/functional/gridstore/readstream_tests.js'
85+
, '/test/tests/functional/gridstore/grid_tests.js'
86+
, '/test/tests/functional/gridstore/gridstore_direct_streaming_tests.js'
87+
, '/test/tests/functional/gridstore/gridstore_tests.js'
88+
, '/test/tests/functional/gridstore/gridstore_stream_tests.js'
89+
, '/test/tests/functional/gridstore/gridstore_file_tests.js'
90+
, '/test/tests/functional/util_tests.js'
91+
, '/test/tests/functional/multiple_db_tests.js'
92+
, '/test/tests/functional/logging_tests.js'
93+
, '/test/tests/functional/custom_pk_tests.js'
94+
, '/test/tests/functional/geo_tests.js'
95+
, '/test/tests/functional/write_preferences_tests.js'
96+
, '/test/tests/functional/remove_tests.js'
97+
, '/test/tests/functional/unicode_tests.js'
98+
, '/test/tests/functional/raw_tests.js'
9999
, '/test/tests/functional/mapreduce_tests.js'
100-
// , '/test/tests/functional/cursorstream_tests.js'
101-
// , '/test/tests/functional/index_tests.js'
102-
// , '/test/tests/functional/cursor_tests.js'
103-
// , '/test/tests/functional/find_tests.js'
104-
// , '/test/tests/functional/insert_tests.js'
105-
// , '/test/tests/functional/admin_mode_tests.js'
106-
// , '/test/tests/functional/aggregation_tests.js'
107-
// , '/test/tests/functional/exception_tests.js'
108-
// , '/test/tests/functional/error_tests.js'
109-
// , '/test/tests/functional/command_generation_tests.js'
110-
// , '/test/tests/functional/uri_tests.js'
111-
// , '/test/tests/functional/url_parser_tests.js'
112-
// , '/test/tests/functional/objectid_tests.js'
113-
// , '/test/tests/functional/connection_tests.js'
114-
// , '/test/tests/functional/collection_tests.js'
115-
// , '/test/tests/functional/db_tests.js'
116-
// , '/test/tests/functional/read_preferences_tests.js'
100+
, '/test/tests/functional/cursorstream_tests.js'
101+
, '/test/tests/functional/index_tests.js'
102+
, '/test/tests/functional/cursor_tests.js'
103+
, '/test/tests/functional/find_tests.js'
104+
, '/test/tests/functional/insert_tests.js'
105+
, '/test/tests/functional/admin_mode_tests.js'
106+
, '/test/tests/functional/aggregation_tests.js'
107+
, '/test/tests/functional/exception_tests.js'
108+
, '/test/tests/functional/error_tests.js'
109+
, '/test/tests/functional/command_generation_tests.js'
110+
, '/test/tests/functional/uri_tests.js'
111+
, '/test/tests/functional/url_parser_tests.js'
112+
, '/test/tests/functional/objectid_tests.js'
113+
, '/test/tests/functional/connection_tests.js'
114+
, '/test/tests/functional/collection_tests.js'
115+
, '/test/tests/functional/db_tests.js'
116+
, '/test/tests/functional/read_preferences_tests.js'
117117
]
118118
);
119119

test/tests/functional/aggregation_tests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ exports.shouldCorrectlyFailAndReturnError = {
215215
}}
216216
, function(err, result) {
217217
test.ok(err != null);
218+
db.close();
218219
test.done();
219220
});
220221
});

test/tests/functional/gridstore/grid_tests.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,17 @@ exports.shouldPutAndGetFileCorrectlyToGridUsingObjectId = function(configuration
149149
exports.shouldFailToPutFileDueToDataObjectNotBeingBuffer = function(configuration, test) {
150150
var Grid = configuration.getMongoPackage().Grid
151151
, ObjectID = configuration.getMongoPackage().ObjectID;
152-
var client = configuration.db();
153-
154-
var grid = new Grid(client, 'fs');
155-
var originalData = 'Hello world';
156-
// Write data to grid
157-
grid.put(originalData, {}, function(err, result) {
158-
test.ok(err != null);
159-
test.done();
160-
})
152+
var db = configuration.newDbInstance({w:1}, {poolSize:1});
153+
db.open(function(err, db) {
154+
var grid = new Grid(db, 'fs');
155+
var originalData = 'Hello world';
156+
// Write data to grid
157+
grid.put(originalData, {}, function(err, result) {
158+
test.ok(err != null);
159+
db.close();
160+
test.done();
161+
});
162+
});
161163
}
162164

163165
/**

0 commit comments

Comments
 (0)