コード例 #1
0
  @Test
  public void testParseIsoFlag() throws IOException, JDOMException {
    final StringBuffer configXml = new StringBuffer();
    configXml.append("<config>");
    configXml.append("  <user-fields>");
    configXml.append("    <address iso='true' />");
    configXml.append("  </user-fields>");
    configXml.append("</config>");
    final Element configEl = JDOMUtil.parseDocument(configXml.toString()).getRootElement();

    final UserStoreConfig config = UserStoreConfigParser.parse(configEl);

    final Collection<UserStoreUserFieldConfig> allUserFieldConfigs = config.getUserFieldConfigs();

    for (final UserStoreUserFieldConfig userFieldConfig : allUserFieldConfigs) {
      if (userFieldConfig.getType().getName().equals("address")) {
        assertEquals(true, userFieldConfig.useIso());
      }
    }
  }