forked from grpc/grpc-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
So far, it is built separately from the other gRpc components.
- Loading branch information
Xudong Ma
committed
Jun 26, 2015
1 parent
a479c91
commit f88779e
Showing
22 changed files
with
2,392 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
build | ||
gradle.properties | ||
.gradle | ||
local.properties | ||
|
||
# IntelliJ IDEA | ||
.idea | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
gRPC Android test App | ||
======================= | ||
|
||
Implements gRPC integration tests in an Android App. | ||
|
||
TODO(madongfly) integrate this App into the gRPC-Java build system. | ||
|
||
In order to build this app, you need a local.properties file under this directory which specifies | ||
the location of your android sdk: | ||
``` | ||
sdk.dir=/somepath/somepath/sdk | ||
``` | ||
|
||
Connect your Android device or start the emulator: | ||
``` | ||
$ ./start-emulator.sh <AVD name> & ./wait-for-emulator.sh | ||
``` | ||
|
||
Manually test | ||
------------- | ||
|
||
Install the App by: | ||
``` | ||
$ ../gradlew installDebug | ||
``` | ||
Then manually test it with the UI. | ||
|
||
|
||
Commandline test | ||
---------------- | ||
|
||
Run the test with arguments: | ||
``` | ||
$ adb shell am instrument -w -e server_host <hostname or ip address> -e server_port 8030 -e server_host_override foo.test.google.fr -e use_tls true -e use_test_ca true -e test_case all io.grpc.android.integrationtest/.TesterInstrumentation | ||
``` | ||
|
||
If the test passed successfully, it will output: | ||
``` | ||
INSTRUMENTATION_RESULT: grpc test result=Succeed!!! | ||
INSTRUMENTATION_CODE: 0 | ||
``` | ||
otherwise, output something like: | ||
``` | ||
INSTRUMENTATION_RESULT: grpc test result=Failed... : <exception stacktrace if applicable> | ||
INSTRUMENTATION_CODE: 1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 22 | ||
buildToolsVersion '22.0.1' | ||
|
||
defaultConfig { | ||
applicationId "io.grpc.android.integrationtest" | ||
minSdkVersion 18 | ||
targetSdkVersion 22 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile 'com.android.support:appcompat-v7:22.1.1' | ||
compile 'com.google.android.gms:play-services-base:7.3.0' | ||
compile 'com.google.code.findbugs:jsr305:3.0.0' | ||
compile 'com.google.guava:guava:18.0' | ||
compile 'com.squareup.okhttp:okhttp:2.2.0' | ||
testCompile 'junit:junit:4.12' | ||
// You need to build grpc-java to obtain these libraries below. | ||
compile 'io.grpc:grpc-core:0.8.0-SNAPSHOT' | ||
compile 'io.grpc:grpc-protobuf-nano:0.8.0-SNAPSHOT' | ||
compile 'io.grpc:grpc-okhttp:0.8.0-SNAPSHOT' | ||
compile 'io.grpc:grpc-stub:0.8.0-SNAPSHOT' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Users/thagikura/android-sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="io.grpc.android.integrationtest" > | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:theme="@style/Base.V7.Theme.AppCompat.Light" > | ||
<activity | ||
android:name=".TesterActivity" | ||
android:label="@string/app_name" > | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<meta-data | ||
android:name="com.google.android.gms.version" | ||
android:value="@integer/google_play_services_version" /> | ||
</application> | ||
|
||
<instrumentation android:functionalTest="true" | ||
android:label="@string/app_name" | ||
android:name=".TesterInstrumentation" | ||
android:targetPackage="io.grpc.android.integrationtest" /> | ||
|
||
</manifest> |
64 changes: 64 additions & 0 deletions
64
...erop-testing/app/src/main/java/generated/io/grpc/android/integrationtest/EmptyProtos.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.