public void testParsesOptionPositive() throws IOException {
   TypedEntryMap pMap = new TypedEntryMap();
   pMap.setMapElement("html-parser-select-attrs", ListUtil.list("value"));
   mau.setPropertyMap(pMap);
   singleTagShouldParse(
       "http://www.example.com/web_link.jpg", "<option  value=", "</option>", mau);
   singleTagShouldParse(
       "http://www.example.com/web_link.jpg", "<option a=b value=", "</option>", mau);
 }
Ejemplo n.º 2
0
 /** If in testing mode FOO, copy values from FOO_override map, if any, to main map */
 void processOverrides(TypedEntryMap map) {
   String testMode = getTestingMode();
   if (StringUtil.isNullString(testMode)) {
     return;
   }
   Object o = map.getMapElement(testMode + DefinableArchivalUnit.SUFFIX_OVERRIDE);
   if (o == null) {
     return;
   }
   if (o instanceof Map) {
     Map overrideMap = (Map) o;
     for (Map.Entry entry : (Set<Map.Entry>) overrideMap.entrySet()) {
       String key = (String) entry.getKey();
       Object val = entry.getValue();
       log.debug(getDefaultPluginName() + ": Overriding " + key + " with " + val);
       map.setMapElement(key, val);
     }
   }
 }