Beispiel #1
0
  private void checkInfo(LocaleInfo info, String match) throws Exception {

    assertGtZeroTrace("id", info.getId());
    assertGtZeroTrace("primary lang", info.getPrimaryLangId());
    assertGtEqZeroTrace("sub lang", info.getSubLangId());
    assertLengthTrace("perflib id", info.getPerflibLangId());
    assertIndexOfTrace("lang", info.toString(), match);
  }
Beispiel #2
0
  public void testInfo() throws Exception {
    Object[][] tests = {
      {new Integer(0x16), "Portuguese"},
      {new Integer(LocaleInfo.makeLangId(0x09, 0x05)), "New Zealand"},
      {new Integer(0x07), "German"},
      {new Integer(LocaleInfo.makeLangId(0x0a, 0x14)), "Puerto Rico"},
    };

    for (int i = 0; i < tests.length; i++) {
      Integer id = (Integer) tests[i][0];
      String lang = (String) tests[i][1];
      LocaleInfo info = new LocaleInfo(id);
      checkInfo(info, lang);
    }

    checkInfo(new LocaleInfo(), "");
  }