You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.2 KiB
31 lines
1.2 KiB
require('./harness').run(); |
|
var testName = __filename.replace(__dirname+'/','').replace('.js',''); |
|
|
|
connection.addListener('ready', function () { |
|
puts("connected to " + connection.serverProperties.product); |
|
var callbacksCalled = 0; |
|
|
|
connection.exchange('node.'+testName+'.exchange', {type: 'topic'}, function(exchange) { |
|
connection.queue( 'node.'+testName+'.queue', { durable: false, autoDelete : true }, function (queue) { |
|
puts("Queue ready"); |
|
|
|
// main test for callback |
|
queue.bind(exchange, 'node.'+testName+'.topic.bindCallback.outer', function(q) { |
|
puts("First queue bind callback called"); |
|
callbacksCalled++; |
|
q.bind(exchange, 'node.'+testName+'.topic.bindCallback.inner', function() { |
|
puts("Second queue bind callback called"); |
|
callbacksCalled++; |
|
}); |
|
}); |
|
|
|
setTimeout(function() { |
|
assert.ok(callbacksCalled == 2, "Callback was not called"); |
|
puts("Cascaded queue bind callback succeeded"); |
|
queue.destroy(); |
|
connection.destroy(); |
|
},2000); |
|
}); |
|
}); |
|
}); |
|
|
|
|