diff options
Diffstat (limited to 'libphonenumber/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java')
-rw-r--r-- | libphonenumber/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/libphonenumber/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java b/libphonenumber/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java index 1f98c036..725a5904 100644 --- a/libphonenumber/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java +++ b/libphonenumber/test/com/google/i18n/phonenumbers/PhoneNumberUtilTest.java @@ -132,26 +132,6 @@ public class PhoneNumberUtilTest extends TestMetadataTestCase { assertNull(phoneUtil.getMetadataForNonGeographicalRegion(-1)); } - public void testMissingMetadataFileThrowsRuntimeException() { - // In normal usage we should never get a state where we are asking to load metadata that doesn't - // exist. However if the library is packaged incorrectly in the jar, this could happen and the - // best we can do is make sure the exception has the file name in it. - try { - phoneUtil.loadMetadataFromFile( - "no/such/file", "XX", -1, PhoneNumberUtil.DEFAULT_METADATA_LOADER); - fail("expected exception"); - } catch (RuntimeException e) { - assertTrue("Unexpected error: " + e, e.toString().contains("no/such/file_XX")); - } - try { - phoneUtil.loadMetadataFromFile("no/such/file", PhoneNumberUtil.REGION_CODE_FOR_NON_GEO_ENTITY, - 123, PhoneNumberUtil.DEFAULT_METADATA_LOADER); - fail("expected exception"); - } catch (RuntimeException e) { - assertTrue("Unexpected error: " + e, e.getMessage().contains("no/such/file_123")); - } - } - public void testGetInstanceLoadUSMetadata() { PhoneMetadata metadata = phoneUtil.getMetadataForRegion(RegionCode.US); assertEquals("US", metadata.getId()); |