//-----------------------------------------------------------------------
public void testProvider() {
try {
assertNotNull(DateTimeZone.getProvider());
Provider provider = DateTimeZone.getProvider();
DateTimeZone.setProvider(null);
assertEquals(provider.getClass(), DateTimeZone.getProvider().getClass());
try {
DateTimeZone.setProvider(new MockNullIDSProvider());
fail();
} catch (IllegalArgumentException ex) {}
try {
DateTimeZone.setProvider(new MockEmptyIDSProvider());
fail();
} catch (IllegalArgumentException ex) {}
try {
DateTimeZone.setProvider(new MockNoUTCProvider());
fail();
} catch (IllegalArgumentException ex) {}
try {
DateTimeZone.setProvider(new MockBadUTCProvider());
fail();
} catch (IllegalArgumentException ex) {}
Provider prov = new MockOKProvider();
DateTimeZone.setProvider(prov);
assertSame(prov, DateTimeZone.getProvider());
assertEquals(2, DateTimeZone.getAvailableIDs().size());
assertTrue(DateTimeZone.getAvailableIDs().contains("UTC"));
assertTrue(DateTimeZone.getAvailableIDs().contains("Europe/London"));