DSpaceConfigurationService implements ConfigurationService { @Override public String[] getArrayProperty(String name) { return getArrayProperty(name, new String[0]); } DSpaceConfigurationService();  DSpaceConfigurationService(String providedHome); @Override Properties getProperties(); @Override List<String> getPropertyKeys(); @Override List<String> getPropertyKeys(String prefix); @Override Configuration getConfiguration(); @Override Object getPropertyValue(String name); @Override String getProperty(String name); @Override String getProperty(String name, String defaultValue); @Override String[] getArrayProperty(String name); @Override String[] getArrayProperty(String name, String[] defaultValue); @Override boolean getBooleanProperty(String name); @Override boolean getBooleanProperty(String name, boolean defaultValue); @Override int getIntProperty(String name); @Override int getIntProperty(String name, int defaultValue); @Override long getLongProperty(String name); @Override long getLongProperty(String name, long defaultValue); @Override T getPropertyAsType(String name, Class<T> type); @Override T getPropertyAsType(String name, T defaultValue); @Override T getPropertyAsType(String name, T defaultValue, boolean setDefaultIfNotFound); @Override boolean hasProperty(String name); @Override synchronized boolean addPropertyValue(String name, Object value); @Override synchronized boolean setProperty(String name, Object value); String[] loadConfiguration(Map<String, Object> properties); boolean loadConfig(String key, Object value); void clear(); void clearConfig(String key); @Override synchronized void reloadConfig(); @Override String toString(); static final String DSPACE; static final String EXT_CONFIG; static final String DOT_CONFIG; static final String DSPACE_HOME; static final String DEFAULT_CONFIG_DIR; static final String DEFAULT_CONFIG_DEFINITION_FILE; static final String DSPACE_CONFIG_DEFINITION_PATH; static final String DSPACE_CONFIG_PATH; static final String DSPACE_SERVER_ID; static final char CONFIG_LIST_DELIMITER; }
@Test public void testGetArrayProperty() { String[] array = configurationService.getArrayProperty("sample.array"); assertNotNull(array); assertEquals(3, array.length); assertEquals("itemA", array[0]); assertEquals("itemB", array[1]); assertEquals("itemC", array[2]); array = configurationService.getArrayProperty("sample.array", new String[] {"Hey"}); assertEquals(3, array.length); array = configurationService.getArrayProperty("XXXXX"); assertEquals(0, array.length); array = configurationService.getArrayProperty("XXXXX", new String[] {"Hey"}); assertEquals(1, array.length); assertEquals("Hey", array[0]); configurationService.loadConfig("new.array", "A\\,B\\,C"); array = configurationService.getArrayProperty("new.array"); assertEquals(1, array.length); assertEquals("A,B,C", array[0]); configurationService.clearConfig("new.array"); DSpaceConfigurationService dscs = new DSpaceConfigurationService(); array = dscs.getArrayProperty("prop.multiline.array"); assertNotNull(array); assertEquals(3, array.length); assertEquals("line1", array[0]); assertEquals("line2", array[1]); assertEquals("line3", array[2]); dscs.clear(); }