Skip to content

Commit 3795417

Browse files
authored
interop-testing: use Activity.RESULT_OK (-1) instead of 0
1 parent c71e291 commit 3795417

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

android-interop-testing/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ $ adb shell am instrument -w -e server_host <hostname or ip address> -e server_p
4545

4646
If the test passed successfully, it will output:
4747
```
48-
INSTRUMENTATION_RESULT: grpc test result=Succeed!!!
49-
INSTRUMENTATION_CODE: 0
48+
INSTRUMENTATION_RESULT: grpc test result=Success!
49+
INSTRUMENTATION_CODE: -1
5050
```
5151
otherwise, output something like:
5252
```
5353
INSTRUMENTATION_RESULT: grpc test result=Failed... : <exception stacktrace if applicable>
54-
INSTRUMENTATION_CODE: 1
54+
INSTRUMENTATION_CODE: 0
5555
```

android-interop-testing/app/src/main/java/io/grpc/android/integrationtest/InteropTester.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
* Implementation of the integration tests, as an AsyncTask.
6161
*/
6262
final class InteropTester extends AsyncTask<Void, Void, String> {
63-
static final String SUCCESS_MESSAGE = "Succeed!!!";
63+
static final String SUCCESS_MESSAGE = "Success!";
6464
static final String LOG_TAG = "GrpcTest";
6565

6666
private ManagedChannel channel;

android-interop-testing/app/src/main/java/io/grpc/android/integrationtest/TesterInstrumentation.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package io.grpc.android.integrationtest;
1818

19+
import android.app.Activity;
1920
import android.app.Instrumentation;
2021
import android.os.Bundle;
2122
import android.util.Log;
@@ -88,17 +89,17 @@ public void onPostTest(String result) {
8889
Bundle bundle = new Bundle();
8990
bundle.putString("grpc test result", result);
9091
if (InteropTester.SUCCESS_MESSAGE.equals(result)) {
91-
finish(0, bundle);
92+
finish(Activity.RESULT_OK, bundle);
9293
} else {
93-
finish(1, bundle);
94+
finish(Activity.RESULT_CANCELED, bundle);
9495
}
9596
}
9697
},
9798
useGet).execute();
9899
} catch (Throwable t) {
99100
Bundle bundle = new Bundle();
100101
bundle.putString("Exception encountered", t.toString());
101-
finish(1, bundle);
102+
finish(Activity.RESULT_CANCELED, bundle);
102103
}
103104
}
104105
}

0 commit comments

Comments
 (0)