Skip to content

Commit

Permalink
Merge pull request square#512 from square/jw/failing-test
Browse files Browse the repository at this point in the history
Add failing test for pruning an included service rpc.
  • Loading branch information
swankjesse committed Nov 11, 2015
2 parents d1d0c41 + 379711e commit 4860783
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions wire-schema/src/test/java/com/squareup/wire/schema/PrunerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.google.common.collect.ImmutableList;
import java.util.Map;
import org.junit.Ignore;
import org.junit.Test;

import static com.google.common.collect.Iterables.getOnlyElement;
Expand Down Expand Up @@ -465,6 +466,29 @@ public final class PrunerTest {
assertThat(pruned.getService("ServiceA").rpc("CallC")).isNull();
}

@Ignore("https://github.com/square/wire/issues/511")
@Test public void excludeRpcExcludesTypes() throws Exception {
Schema schema = new SchemaBuilder()
.add("service.proto", ""
+ "service ServiceA {\n"
+ " rpc CallB (MessageB) returns (MessageB);\n"
+ " rpc CallC (MessageC) returns (MessageC);\n"
+ "}\n"
+ "message MessageB {\n"
+ "}\n"
+ "message MessageC {\n"
+ "}\n")
.build();
Schema pruned = schema.prune(new IdentifierSet.Builder()
.include("ServiceA")
.exclude("ServiceA#CallC")
.build());
assertThat(pruned.getType("MessageB")).isNotNull();
assertThat(pruned.getService("ServiceA").rpc("CallB")).isNotNull();
assertThat(pruned.getType("MessageC")).isNull();
assertThat(pruned.getService("ServiceA").rpc("CallC")).isNull();
}

@Test public void excludedFieldPrunesTopLevelOption() throws Exception {
Schema schema = new SchemaBuilder()
.add("service.proto", ""
Expand Down

0 comments on commit 4860783

Please sign in to comment.