This would make more sense:
// get the gateway
var gateway = Service.LogService.gateway;
var outgoingMsg;
queue.call('Step 1: open the gateway', function() {
// register the LogService for logging
gateway.registerService("LogService", Diagnostics.LogProvider);
// Open the gateway
gateway.onOpen(null);
// Register gateway ready handler
Gateway.GatewayProvider.registerReadyHandler(isReady);
function isReady() {
console.log("Gateway status: Ready!");
sendMessage();
};
function sendMessage() {
// Prepare and send message
var msg = JSON.parse('{"service":"TestService"}');
console.log("Prepared message before send to gateway: " + JSON.stringify(msg));
// send the message and get the manipulated message back
outgoingMsg = gateway.sendRequest(msg);
// Test manipulation to see what will happen on assert error
outgoingMsg.callbackIdx = undefined;
console.log("Manipulated message after send to gateway: " + JSON.stringify(outgoingMsg));
}
});
queue.call('Step 1: send the request', function() {
// Expect that callbackIdx is not undefined
assertNotUndefined("CallbackIdx Check", outgoingMsg.callbackIdx);
});
};
Am Donnerstag, 21. März 2013 11:51:49 UTC+1 schrieb Vitali S.: