-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This refers to `test` rather than `androidTest`.
- Loading branch information
Showing
9 changed files
with
259 additions
and
70 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
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
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
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
34 changes: 34 additions & 0 deletions
34
testProjectAndroid/src/test/java/io/grpc/helloworldexample/UnitTest.java
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 @@ | ||
package io.grpc.helloworldexample; | ||
|
||
import static org.junit.Assert.fail; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.JUnit4; | ||
|
||
@RunWith(JUnit4.class) | ||
public final class UnitTest { | ||
private final HelloworldActivity activity = new HelloworldActivity(); | ||
// From src/test/proto/unittest.proto | ||
private com.example.tutorial.UnitTestMsg msg; | ||
|
||
// From src/main/proto/helloworld.proto | ||
private Helloworld.HelloRequest request; | ||
|
||
// From testProjectLite: src/nano/proto/messages.proto | ||
private io.grpc.testing.Messages.SimpleRequest simpleRequest; | ||
|
||
// From lib/protos.jar | ||
private com.google.protobuf.gradle.test.External.BlobMessage blobMessage; | ||
|
||
@Test | ||
public void ensureAndroidTestProtosNotVisible() throws Exception { | ||
// we should not see the protos from src/androidTest/proto/ | ||
try { | ||
Class<?> ignored = Class.forName("com.example.tutorial.Msg"); | ||
fail(); | ||
} catch (ClassNotFoundException expected){ | ||
// noop | ||
} | ||
} | ||
} |
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
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,18 @@ | ||
syntax = "proto3"; | ||
|
||
option java_package = "com.example.tutorial"; | ||
option java_outer_classname = "OuterLocalTest"; | ||
option java_multiple_files = true; | ||
|
||
// From the main sourceSet | ||
import "helloworld.proto"; | ||
|
||
message UnitTestMsg { | ||
string foo = 1; | ||
UnitTestSecondMsg blah = 2; | ||
} | ||
|
||
message UnitTestSecondMsg { | ||
int32 blah = 1; | ||
helloworld.HelloReply reply = 2; | ||
} |
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
Oops, something went wrong.