Permalink
Browse files

Update long tests

  • Loading branch information...
1 parent 1f6d647 commit 81767eb9f2b85f5785b9b28981eeddfb703424e8 @pofallon committed Aug 20, 2012
Showing with 57 additions and 23 deletions.
  1. +44 −16 longtest/storage-blob.js
  2. +5 −7 longtest/storage-queue.js
  3. +8 −0 longtest/storage-table.js
View
@@ -19,20 +19,26 @@ module.exports = testCase({
setUp: function (callback) {
- this.containerName = "longblob";
+ this.containerPrefix = "longblob";
+ this.containerCount = 5050;
+ this.containerName = "longblob1";
callback();
},
- createContainer: function (test) {
- var theContainer = this.containerName;
- storage.createContainer(theContainer, function(err,container) {
- test.equals(err,null);
- test.notEqual(container,null);
- if (!container) { container = {}; }
- test.equals(container.name,theContainer);
- test.done();
- });
+ createContainers: function (test) {
+ var completedCount = 0;
+ var theCount = this.containerCount;
+ var theContainer = this.containerPrefix;
+ for (var i = 1; i <= theCount; i++) {
+ storage.createContainer(theContainer+i, function(err,container) {
+ test.equals(err,null);
+ test.notEqual(container,null);
+ if (++completedCount === theCount) {
+ test.done();
+ }
+ });
+ };
},
createdContainerInList: function (test) {
@@ -44,6 +50,29 @@ module.exports = testCase({
});
},
+ containerCountEvent: function (test) {
+ var theCount = this.containerCount;
+ storage.listContainers('longblob').on('end', function(count) {
+ test.equals(count,theCount);
+ test.done();
+ });
+ },
+
+ containerLimitNoContinuation: function (test) {
+ storage.listContainers({limit: 10}).on('end', function(count) {
+ test.equals(count,10);
+ test.done();
+ });
+ },
+
+ containerLimitFollowContinuation: function (test) {
+ var theCount = this.containerCount-1;
+ storage.listContainers({limit: theCount}).on('end', function(count) {
+ test.equals(count,theCount);
+ test.done();
+ });
+ },
+
blobPutLargeStream: function(test) {
var c = storage.container(this.containerName);
@@ -64,12 +93,11 @@ module.exports = testCase({
},
- removeContainer: function (test) {
- storage.removeContainer(this.containerName, function(err) {
- test.equals(err,null);
- storage.removeContainer('barblob', function(err) {
- test.done();
- });
+ removeContainers: function (test) {
+ storage.listContainers(this.containerPrefix).on('data', function(c) {
+ storage.removeContainer(c);
+ }).on('end', function() {
+ test.done();
});
},
View
@@ -48,15 +48,13 @@ module.exports = testCase({
queuePolling: function(test) {
var queue = storage.queue(this.queueName);
- queue.on('message', function(m) {
+ queue.on('message', function(m, done) {
+ test.equals(m,'Queue Poll Message');
+ done();
queue.poll(false);
- test.equals(m.messagetext,'Queue Poll Message');
- queue.del(m.messageid, m.popreceipt, function(err) {
- test.equals(err,null);
- test.done();
- });
+ test.done();
});
- queue.poll(10000); // Every 10 sec.
+ queue.poll(1000); // Every 1 sec.
queue.put('Queue Poll Message', function(err) {
test.equals(err,null);
});
@@ -64,6 +64,14 @@ module.exports = testCase({
}
},
+ // rowsWithLimit: function(test) {
+ // var limitCount = 5;
+ // t.rows({limit: limitCount}).on('end', function(count) {
+ // test.equals(limitCount, count);
+ // test.done();
+ // });
+ // },
+
removeTable: function (test) {
storage.removeTable(this.tableName, function(err) {
test.equals(err,null);

0 comments on commit 81767eb

Please sign in to comment.