public void testSetTimeZone() {
    Object[] tzs = handler.listTimeZones();
    assertNotNull(tzs);
    assertTrue(tzs.length != 0);
    RhnTimeZone tz = (RhnTimeZone) tzs[0];

    assertEquals(1, handler.setTimeZone(adminKey, admin.getLogin(), tz.getTimeZoneId()));

    RhnTimeZone usersTz = admin.getTimeZone();
    assertNotNull(usersTz);
    assertEquals(tz.getTimeZoneId(), usersTz.getTimeZoneId());
  }
  public void testSetLocaleInvalidLocale() {
    try {
      handler.setLocale(adminKey, admin.getLogin(), "rd_NK");
      fail("rd_NK should be an invalid locale");
    } catch (InvalidLocaleCodeException ilce) {
      // expected exception
    }

    try {
      handler.setLocale(adminKey, admin.getLogin(), null);
      fail("null should be an invalid locale");
    } catch (InvalidLocaleCodeException ilce) {
      // expected exception
    }
  }
 public void testSetLocale() {
   String l = admin.getPreferredLocale();
   assertNull(l);
   System.out.println(l);
   handler.setLocale(adminKey, admin.getLogin(), "en_US");
   assertEquals("en_US", admin.getPreferredLocale());
 }
 public void testListLocales() {
   Object[] o = handler.listLocales();
   assertNotNull(o);
   String[] locales = Config.get().getStringArray("web.supported_locales");
   assertNotNull(locales);
   assertEquals(locales.length, o.length);
 }
 public void testSetTimeZoneInvalidId() {
   try {
     handler.setTimeZone(adminKey, admin.getLogin(), 0);
     fail("Expected an exception for timezoneid = 0");
   } catch (InvalidTimeZoneException itze) {
     // expected exception
   }
 }
 public void testListTimeZone() {
   Object[] tzs = handler.listTimeZones();
   assertNotNull(tzs);
   assertTrue("TimeZone list is empty", tzs.length != 0);
   assertEquals(RhnTimeZone.class, tzs[0].getClass());
 }