@Test public void testGetDefaultReferenceNameWhenNotDefinedInConfiguration() throws ComponentLookupException { assertEquals("xwiki", this.configuration.getDefaultReferenceValue(EntityType.WIKI)); assertEquals("WebHome", this.configuration.getDefaultReferenceValue(EntityType.DOCUMENT)); assertEquals("Main", this.configuration.getDefaultReferenceValue(EntityType.SPACE)); assertEquals("filename", this.configuration.getDefaultReferenceValue(EntityType.ATTACHMENT)); assertEquals("object", this.configuration.getDefaultReferenceValue(EntityType.OBJECT)); assertEquals("property", this.configuration.getDefaultReferenceValue(EntityType.OBJECT_PROPERTY)); }
@Override public String getDefaultReferenceValue(EntityType type) { String name; try { ConfigurationSource configuration = this.componentManager.getInstance(ConfigurationSource.class, "xwikiproperties"); name = configuration.getProperty(PREFIX + "reference.default." + type.toString().toLowerCase(), DEFAULT_VALUES.get(type)); } catch (ComponentLookupException e) { this.logger .debug("Failed to load [" + ConfigurationSource.class.getName() + "]. Using default Model values", e); name = DEFAULT_VALUES.get(type); } return name; }
DefaultModelConfiguration implements ModelConfiguration { @Override public String getDefaultReferenceValue(EntityType type) { String name; try { ConfigurationSource configuration = this.componentManager.getInstance(ConfigurationSource.class, "xwikiproperties"); name = configuration.getProperty(PREFIX + "reference.default." + type.toString().toLowerCase(), DEFAULT_VALUES.get(type)); } catch (ComponentLookupException e) { this.logger .debug("Failed to load [" + ConfigurationSource.class.getName() + "]. Using default Model values", e); name = DEFAULT_VALUES.get(type); } return name; } }
DefaultModelConfiguration implements ModelConfiguration { @Override public String getDefaultReferenceValue(EntityType type) { String name; try { ConfigurationSource configuration = this.componentManager.getInstance(ConfigurationSource.class, "xwikiproperties"); name = configuration.getProperty(PREFIX + "reference.default." + type.toString().toLowerCase(), DEFAULT_VALUES.get(type)); } catch (ComponentLookupException e) { this.logger .debug("Failed to load [" + ConfigurationSource.class.getName() + "]. Using default Model values", e); name = DEFAULT_VALUES.get(type); } return name; }  }
DefaultModelConfiguration implements ModelConfiguration { @Override public String getDefaultReferenceValue(EntityType type) { String name; try { ConfigurationSource configuration = this.componentManager.getInstance(ConfigurationSource.class, "xwikiproperties"); name = configuration.getProperty(PREFIX + "reference.default." + type.toString().toLowerCase(), DEFAULT_VALUES.get(type)); } catch (ComponentLookupException e) { this.logger .debug("Failed to load [" + ConfigurationSource.class.getName() + "]. Using default Model values", e); name = DEFAULT_VALUES.get(type); } return name; }  @Override String getDefaultReferenceValue(EntityType type); }
DefaultModelConfiguration implements ModelConfiguration { @Override public String getDefaultReferenceValue(EntityType type) { String name; try { ConfigurationSource configuration = this.componentManager.getInstance(ConfigurationSource.class, "xwikiproperties"); name = configuration.getProperty(PREFIX + "reference.default." + type.toString().toLowerCase(), DEFAULT_VALUES.get(type)); } catch (ComponentLookupException e) { this.logger .debug("Failed to load [" + ConfigurationSource.class.getName() + "]. Using default Model values", e); name = DEFAULT_VALUES.get(type); } return name; }  @Override String getDefaultReferenceValue(EntityType type);  }