@Test public void testCategoryElementIsInXml() { for ( final PwmSettingCategory pwmSettingCategory : PwmSettingCategory.values() ) { final XmlElement element = PwmSettingXml.readCategoryXml( pwmSettingCategory ); Assert.assertNotNull( "no XML category node in PwmSetting.xml for setting " + pwmSettingCategory.getKey(), element ); } }
static XmlElement readCategoryXml( final PwmSettingCategory category ) { final String expression = "/settings/category[@key=\"" + category.toString() + "\"]"; return xmlDocCache.get().evaluateXpathToElement( expression ) .orElseThrow( () -> new IllegalStateException( "PwmSetting.xml is missing category for key '" + category.getKey() + "'" ) ); }
PwmSettingXml { static XmlElement readCategoryXml( final PwmSettingCategory category ) { final String expression = "/settings/category[@key=\"" + category.toString() + "\"]"; return xmlDocCache.get().evaluateXpathToElement( expression ) .orElseThrow( () -> new IllegalStateException( "PwmSetting.xml is missing category for key '" + category.getKey() + "'" ) ); } }
PwmSettingXml { static XmlElement readCategoryXml( final PwmSettingCategory category ) { final String expression = "/settings/category[@key=\"" + category.toString() + "\"]"; return xmlDocCache.get().evaluateXpathToElement( expression ) .orElseThrow( () -> new IllegalStateException( "PwmSetting.xml is missing category for key '" + category.getKey() + "'" ) ); }  }
PwmSettingXml { static XmlElement readCategoryXml( final PwmSettingCategory category ) { final String expression = "/settings/category[@key=\"" + category.toString() + "\"]"; return xmlDocCache.get().evaluateXpathToElement( expression ) .orElseThrow( () -> new IllegalStateException( "PwmSetting.xml is missing category for key '" + category.getKey() + "'" ) ); }   }
PwmSettingXml { static XmlElement readCategoryXml( final PwmSettingCategory category ) { final String expression = "/settings/category[@key=\"" + category.toString() + "\"]"; return xmlDocCache.get().evaluateXpathToElement( expression ) .orElseThrow( () -> new IllegalStateException( "PwmSetting.xml is missing category for key '" + category.getKey() + "'" ) ); }   static final String SETTING_XML_FILENAME; }