diff options
Diffstat (limited to 'src/test/java/com/google/devtools/build/android/ConvertersTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/android/ConvertersTest.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/java/com/google/devtools/build/android/ConvertersTest.java b/src/test/java/com/google/devtools/build/android/ConvertersTest.java index 92c9cf2f22..0e7385171c 100644 --- a/src/test/java/com/google/devtools/build/android/ConvertersTest.java +++ b/src/test/java/com/google/devtools/build/android/ConvertersTest.java @@ -58,9 +58,9 @@ public final class ConvertersTest { @Test public void testPathConverter_invalid() throws Exception { String arg = "\u0000"; + PathConverter converter = new PathConverter(); expected.expect(OptionsParsingException.class); expected.expectMessage(String.format("%s is not a valid path:", arg)); - PathConverter converter = new PathConverter(); converter.convert(arg); } @@ -74,9 +74,9 @@ public final class ConvertersTest { @Test public void testExistingPathConverter_nonExisting() throws Exception { String arg = "test_file"; + ExistingPathConverter converter = new ExistingPathConverter(); expected.expect(OptionsParsingException.class); expected.expectMessage(String.format("%s is not a valid path: it does not exist.", arg)); - ExistingPathConverter converter = new ExistingPathConverter(); converter.convert(arg); } @@ -101,38 +101,38 @@ public final class ConvertersTest { @Test public void testExisingPathListConverter() throws Exception { String arg = "non-existing"; + ExistingPathListConverter converter = new ExistingPathListConverter(); Path existingFile = tmp.newFile("existing").toPath(); expected.expect(OptionsParsingException.class); expected.expectMessage(String.format("%s is not a valid path: it does not exist.", arg)); - ExistingPathListConverter converter = new ExistingPathListConverter(); converter.convert(Joiner.on(SEPARATOR).join(existingFile.toString(), arg)); } @Test public void testStringDictionaryConverter_emptyEntry() throws Exception { + StringDictionaryConverter converter = new StringDictionaryConverter(); expected.expect(OptionsParsingException.class); expected.expectMessage("Dictionary entry [] does not contain both a key and a value."); - StringDictionaryConverter converter = new StringDictionaryConverter(); converter.convert("foo:bar,,baz:bar"); } @Test public void testStringDictionaryConverter_missingKeyOrValue() throws Exception { String badEntry = "foo"; + StringDictionaryConverter converter = new StringDictionaryConverter(); expected.expect(OptionsParsingException.class); expected.expectMessage(String.format( "Dictionary entry [%s] does not contain both a key and a value.", badEntry)); - StringDictionaryConverter converter = new StringDictionaryConverter(); converter.convert(badEntry); } @Test public void testStringDictionaryConverter_extraFields() throws Exception { String badEntry = "foo:bar:baz"; + StringDictionaryConverter converter = new StringDictionaryConverter(); expected.expect(OptionsParsingException.class); expected.expectMessage(String.format( "Dictionary entry [%s] contains too many fields.", badEntry)); - StringDictionaryConverter converter = new StringDictionaryConverter(); converter.convert(badEntry); } @@ -140,10 +140,10 @@ public final class ConvertersTest { public void testStringDictionaryConverter_duplicateKey() throws Exception { String key = "foo"; String arg = String.format("%s:%s,%s:%s", key, "bar", key, "baz"); + StringDictionaryConverter converter = new StringDictionaryConverter(); expected.expect(OptionsParsingException.class); expected.expectMessage(String.format( "Dictionary already contains the key [%s].", key)); - StringDictionaryConverter converter = new StringDictionaryConverter(); converter.convert(arg); } |