function checkRecursively(map1, map2) {
if (typeof map1 !== 'function' && typeof map2 !== 'function') {
if (!map1 || typeof map1 !== 'object') {
- equals(map1, map2);
+ equal(map1, map2);
} else {
for (var key in map1) {
checkRecursively(map1[key], map2[key]);
module("Base Types");
test("Void", function() {
- equals(client.testVoid(), undefined);
+ equal(client.testVoid(), undefined);
});
test("String", function() {
- equals(client.testString(stringTest), stringTest);
+ equal(client.testString(stringTest), stringTest);
var specialCharacters = 'quote: \" backslash:' +
' forwardslash-escaped: \/ ' +
' backspace: \b formfeed: \f newline: \n return: \r tab: ' +
' now-all-of-them-together: "\\\/\b\n\r\t' +
' now-a-bunch-of-junk: !@#$%&()(&%$#{}{}<><><';
- equals(client.testString(specialCharacters),specialCharacters);
+ equal(client.testString(specialCharacters),specialCharacters);
});
test("Double", function() {
- equals(client.testDouble(3.14), 3.14);
+ equal(client.testDouble(3.14), 3.14);
});
test("Byte", function() {
- equals(client.testByte(0x01), 0x01);
+ equal(client.testByte(0x01), 0x01);
});
test("I32", function() {
- equals(client.testI32(Math.pow(2,30)), Math.pow(2,30));
+ equal(client.testI32(Math.pow(2,30)), Math.pow(2,30));
});
test("I64", function() {
- equals(client.testI64(Math.pow(2,60)), Math.pow(2,60));
+ equal(client.testI64(Math.pow(2,60)), Math.pow(2,60));
});
var structTestOutput = client.testStruct(structTestInput);
- equals(structTestOutput.string_thing, structTestInput.string_thing);
- equals(structTestOutput.byte_thing, structTestInput.byte_thing);
- equals(structTestOutput.i32_thing, structTestInput.i32_thing);
- equals(structTestOutput.i64_thing, structTestInput.i64_thing);
+ equal(structTestOutput.string_thing, structTestInput.string_thing);
+ equal(structTestOutput.byte_thing, structTestInput.byte_thing);
+ equal(structTestOutput.i32_thing, structTestInput.i32_thing);
+ equal(structTestOutput.i64_thing, structTestInput.i64_thing);
- equals(JSON.stringify(structTestOutput), JSON.stringify(structTestInput));
+ equal(JSON.stringify(structTestOutput), JSON.stringify(structTestInput));
});
test("Nest", function() {
var nestTestOutput = client.testNest(nestTestInput);
- equals(nestTestOutput.byte_thing, nestTestInput.byte_thing);
- equals(nestTestOutput.struct_thing.string_thing, nestTestInput.struct_thing.string_thing);
- equals(nestTestOutput.struct_thing.byte_thing, nestTestInput.struct_thing.byte_thing);
- equals(nestTestOutput.struct_thing.i32_thing, nestTestInput.struct_thing.i32_thing);
- equals(nestTestOutput.struct_thing.i64_thing, nestTestInput.struct_thing.i64_thing);
- equals(nestTestOutput.i32_thing, nestTestInput.i32_thing);
+ equal(nestTestOutput.byte_thing, nestTestInput.byte_thing);
+ equal(nestTestOutput.struct_thing.string_thing, nestTestInput.struct_thing.string_thing);
+ equal(nestTestOutput.struct_thing.byte_thing, nestTestInput.struct_thing.byte_thing);
+ equal(nestTestOutput.struct_thing.i32_thing, nestTestInput.struct_thing.i32_thing);
+ equal(nestTestOutput.struct_thing.i64_thing, nestTestInput.struct_thing.i64_thing);
+ equal(nestTestOutput.i32_thing, nestTestInput.i32_thing);
- equals(JSON.stringify(nestTestOutput), JSON.stringify(nestTestInput));
+ equal(JSON.stringify(nestTestOutput), JSON.stringify(nestTestInput));
});
test("Map", function() {
var mapTestOutput = client.testMap(mapTestInput);
for (var key in mapTestOutput) {
- equals(mapTestOutput[key], mapTestInput[key]);
+ equal(mapTestOutput[key], mapTestInput[key]);
}
});
var mapTestOutput = client.testStringMap(mapTestInput);
for (var key in mapTestOutput) {
- equals(mapTestOutput[key], mapTestInput[key]);
+ equal(mapTestOutput[key], mapTestInput[key]);
}
});
});
test("Enum", function() {
- equals(client.testEnum(ThriftTest.Numberz.ONE), ThriftTest.Numberz.ONE);
+ equal(client.testEnum(ThriftTest.Numberz.ONE), ThriftTest.Numberz.ONE);
});
test("TypeDef", function() {
- equals(client.testTypedef(69), 69);
+ equal(client.testTypedef(69), 69);
});
for (var key in mapMapTestOutput) {
for (var key2 in mapMapTestOutput[key]) {
- equals(mapMapTestOutput[key][key2], mapMapTestExpectedResult[key][key2]);
+ equal(mapMapTestOutput[key][key2], mapMapTestExpectedResult[key][key2]);
}
}
try{
client.testException("Xception");
}catch(e){
- equals(e.errorCode, 1001);
- equals(e.message, "Xception");
+ equal(e.errorCode, 1001);
+ equal(e.message, "Xception");
}
});
- test("no Exception", function() {
+ test("no Exception", 0, function() {
try{
client.testException("no Exception");
}catch(e){
client.testException("ApplicationException");
} catch(e) {
ok(true); //@HACK: ignore faulty java server response for exceptions
- //equals(e.message, "ApplicationException");
+ //equal(e.message, "ApplicationException");
}
});
},
"2":{ "6":{ "userMap":null, "xtructs":null } }
};
- var res = client.testInsanity("");
+ var res = client.testInsanity(new ThriftTest.Insanity());
ok(res, JSON.stringify(res));
ok(insanity, JSON.stringify(insanity));
dataType: "text",
success: function(res){
transport.setRecvBuffer( res );
- equals(client.recv_testI32(), Math.pow(-2,31));
+ equal(client.recv_testI32(), Math.pow(-2,31));
},
error: function() { ok(false); },
complete: function() {
dataType: "text",
success: function(res){
transport.setRecvBuffer( res );
- equals(client.recv_testI64(), Math.pow(-2,61));
+ equal(client.recv_testI64(), Math.pow(-2,61));
},
error: function() { ok(false); },
complete: function() {
QUnit.stop();
client.testDouble(3.14159265, function(result) {
- equals(result, 3.14159265);
+ equal(result, 3.14159265);
QUnit.start();
});
});
QUnit.stop();
client.testByte(0x01, function(result) {
- equals(result, 0x01);
+ equal(result, 0x01);
QUnit.start();
});
});
QUnit.stop();
client.testI32(Math.pow(2,30), function(result) {
- equals(result, Math.pow(2,30));
+ equal(result, Math.pow(2,30));
QUnit.start();
});
QUnit.stop();
var jqxhr = client.testI32(Math.pow(-2,31), function(result) {
- equals(result, Math.pow(-2,31));
+ equal(result, Math.pow(-2,31));
});
jqxhr.success(function(result) {
- equals(result, Math.pow(-2,31));
+ equal(result, Math.pow(-2,31));
QUnit.start();
});
});
QUnit.stop();
client.testI64(Math.pow(2,60), function(result) {
- equals(result, Math.pow(2,60));
+ equal(result, Math.pow(2,60));
QUnit.start();
});
QUnit.stop();
client.testI64(Math.pow(-2,61), function(result) {
- equals(result, Math.pow(-2,61));
+ equal(result, Math.pow(-2,61));
})
.error( function(e) { ok(false); } )
.success(function(result) {
- equals(result, Math.pow(-2,61));
+ equal(result, Math.pow(-2,61));
})
.complete(function() {
ok(true);
QUnit.start();
})
.error(function(e){
- equals(e.errorCode, 1001);
- equals(e.message, "Xception");
+ equal(e.errorCode, 1001);
+ equal(e.message, "Xception");
QUnit.start();
});
});