Add gTech commands for dealing with DotAppRegistrarInfo

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123529640
This commit is contained in:
mcilwain 2016-05-29 07:06:56 -07:00 committed by Ben McIlwain
parent 4876d09d6c
commit ca585dd0b5
2 changed files with 9 additions and 5 deletions

View file

@ -10,7 +10,9 @@ load("//java/com/google/testing/builddefs:GenTestRules.bzl", "GenTestRules")
java_library( java_library(
name = "tools", name = "tools",
srcs = glob(["*.java"]), srcs = glob([
"*.java",
]),
resources = glob(["testdata/*.*"]), resources = glob(["testdata/*.*"]),
deps = [ deps = [
"//java/com/google/common/annotations", "//java/com/google/common/annotations",

View file

@ -93,12 +93,12 @@ public abstract class CommandTestCase<C extends Command> {
} }
} }
void runCommand(String... args) throws Exception { protected void runCommand(String... args) throws Exception {
runCommandInEnvironment(RegistryToolEnvironment.UNITTEST, args); runCommandInEnvironment(RegistryToolEnvironment.UNITTEST, args);
} }
/** Adds "--force" as the first parameter, then runs the command. */ /** Adds "--force" as the first parameter, then runs the command. */
void runCommandForced(String... args) throws Exception { protected void runCommandForced(String... args) throws Exception {
runCommand(ObjectArrays.concat("--force", args)); runCommand(ObjectArrays.concat("--force", args));
} }
@ -149,8 +149,10 @@ public abstract class CommandTestCase<C extends Command> {
return ofy().load().type(PollMessage.class).count(); return ofy().load().type(PollMessage.class).count();
} }
void assertInStdout(String expected) throws Exception { protected void assertInStdout(String... expected) throws Exception {
assertThat(stdout.toString(UTF_8.toString())).contains(expected); for (String line : expected) {
assertThat(stdout.toString(UTF_8.toString())).contains(line);
}
} }
void assertNotInStdout(String expected) throws Exception { void assertNotInStdout(String expected) throws Exception {