aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/android
diff options
context:
space:
mode:
authorGravatar cushon <cushon@google.com>2018-04-26 19:48:14 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-04-26 19:49:50 -0700
commita6a9843ddb869d911795bd9a634e725d5952dfb2 (patch)
tree6c2966bde91ed4f18a89d7fc77a5d9d114333d7b /src/test/java/com/google/devtools/build/android
parent968059d59719d7789b4b3fe97fe0d6be0e86682d (diff)
For --checkHashMismatch=ERROR, emit all errors instead of stopping at the first one
PiperOrigin-RevId: 194491274
Diffstat (limited to 'src/test/java/com/google/devtools/build/android')
-rw-r--r--src/test/java/com/google/devtools/build/android/ZipFilterActionTest.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/test/java/com/google/devtools/build/android/ZipFilterActionTest.java b/src/test/java/com/google/devtools/build/android/ZipFilterActionTest.java
index 7af59aebb0..22ce6339b3 100644
--- a/src/test/java/com/google/devtools/build/android/ZipFilterActionTest.java
+++ b/src/test/java/com/google/devtools/build/android/ZipFilterActionTest.java
@@ -132,7 +132,7 @@ public class ZipFilterActionTest {
private List<String> outputEntriesWithArgs(ImmutableList<String> args, File output)
throws IOException {
- ZipFilterAction.main(args.toArray(new String[0]));
+ ZipFilterAction.run(args.toArray(new String[0]));
List<String> filteredEntries = new ArrayList<>();
try (ZipFile zip = new ZipFile(output)) {
Enumeration<? extends ZipEntry> entries = zip.entries();
@@ -216,9 +216,8 @@ public class ZipFilterActionTest {
callback.assertOp(FilterOperation.COPY);
filter.accept("res/R.class", callback);
callback.assertOp(FilterOperation.SKIP);
- thrown.expect(IllegalStateException.class);
- thrown.expectMessage("name matches but the hash does not.");
filter.accept("baz.class", callback);
+ assertThat(filter.sawErrors()).isTrue();
}
@Test public void testFlags() throws Exception {
@@ -240,7 +239,7 @@ public class ZipFilterActionTest {
"--checkHashMismatch", "IGNORE");
thrown.expect(ZipException.class);
thrown.expectMessage("Zip file 'filter1' is malformed");
- ZipFilterAction.main(args.toArray(new String[0]));
+ ZipFilterAction.run(args.toArray(new String[0]));
}
@Test public void testFullIntegration() throws IOException {
@@ -283,9 +282,8 @@ public class ZipFilterActionTest {
"ERROR",
"--outputMode",
"DONT_CARE");
- thrown.expect(IllegalStateException.class);
- thrown.expectMessage("name matches but the hash does not");
- ZipFilterAction.main(args.toArray(new String[0]));
+ int exitCode = ZipFilterAction.run(args.toArray(new String[0]));
+ assertThat(exitCode).isEqualTo(1);
}
@Test