|
@@ -44,7 +44,7 @@ TestCase {
|
|
|
|
|
|
QtObject {
|
|
QtObject {
|
|
id: returnMsg
|
|
id: returnMsg
|
|
- property string ret: serverStream.returnValue.testFieldString
|
|
|
|
|
|
+ property string ret: serverStream.returnValue ? serverStream.returnValue.testFieldString : ""
|
|
}
|
|
}
|
|
|
|
|
|
GrpcStream {
|
|
GrpcStream {
|
|
@@ -56,11 +56,11 @@ TestCase {
|
|
client: TestServiceClient
|
|
client: TestServiceClient
|
|
method: "testMethodServerStream"
|
|
method: "testMethodServerStream"
|
|
argument: stringMsg
|
|
argument: stringMsg
|
|
- onMessageReceived: {
|
|
|
|
|
|
+ onMessageReceived: function(value) {
|
|
++updateCount;
|
|
++updateCount;
|
|
ok = ok && value.testFieldString === ("test_serverStream" + updateCount) && returnMsg.ret == ("test_serverStream" + updateCount)
|
|
ok = ok && value.testFieldString === ("test_serverStream" + updateCount) && returnMsg.ret == ("test_serverStream" + updateCount)
|
|
}
|
|
}
|
|
- onError: {
|
|
|
|
|
|
+ onError: function(status) {
|
|
console.log("Stream error: " + status.code + " " + status.message)
|
|
console.log("Stream error: " + status.code + " " + status.message)
|
|
ok = false;
|
|
ok = false;
|
|
}
|
|
}
|
|
@@ -75,14 +75,14 @@ TestCase {
|
|
client: TestServiceClient
|
|
client: TestServiceClient
|
|
method: "testMethodServerStream"
|
|
method: "testMethodServerStream"
|
|
argument: stringMsg
|
|
argument: stringMsg
|
|
- onMessageReceived: {
|
|
|
|
|
|
+ onMessageReceived: function(value) {
|
|
++updateCount;
|
|
++updateCount;
|
|
ok = ok && value.testFieldString === "test_serverStreamCancel" + updateCount
|
|
ok = ok && value.testFieldString === "test_serverStreamCancel" + updateCount
|
|
if (updateCount === 3) {
|
|
if (updateCount === 3) {
|
|
serverStreamCancel.enabled = false;
|
|
serverStreamCancel.enabled = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- onError: {
|
|
|
|
|
|
+ onError: function(status) {
|
|
console.log("Stream error: " + status.code + " " + status.message)
|
|
console.log("Stream error: " + status.code + " " + status.message)
|
|
ok = false;
|
|
ok = false;
|
|
}
|
|
}
|
|
@@ -98,7 +98,7 @@ TestCase {
|
|
onMessageReceived: {
|
|
onMessageReceived: {
|
|
ok = false;
|
|
ok = false;
|
|
}
|
|
}
|
|
- onError: {
|
|
|
|
|
|
+ onError: function(status) {
|
|
ok = status.code === GrpcStatus.Unimplemented;
|
|
ok = status.code === GrpcStatus.Unimplemented;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -114,11 +114,11 @@ TestCase {
|
|
client: TestServiceClient
|
|
client: TestServiceClient
|
|
method: "testMethodServerStream"
|
|
method: "testMethodServerStream"
|
|
argument: stringMsg
|
|
argument: stringMsg
|
|
- onMessageReceived: {
|
|
|
|
|
|
+ onMessageReceived: function(value) {
|
|
++streamLoader.updateCount;
|
|
++streamLoader.updateCount;
|
|
streamLoader.ok = ok && value.testFieldString === ("test_1loader" + streamLoader.updateCount)
|
|
streamLoader.ok = ok && value.testFieldString === ("test_1loader" + streamLoader.updateCount)
|
|
}
|
|
}
|
|
- onError: {
|
|
|
|
|
|
+ onError: function(status) {
|
|
console.log("Stream error: " + status.code + " " + status.message)
|
|
console.log("Stream error: " + status.code + " " + status.message)
|
|
streamLoader.ok = false;
|
|
streamLoader.ok = false;
|
|
}
|
|
}
|