@Test public void testLoadConfigurationWithReplacement() throws Exception { System.setProperty("multicastGroupPort", "4446"); File file = new File(TEST_CONFIG_DIR + "ehcache-replacement.xml"); Configuration configuration = ConfigurationFactory.parseConfiguration(file); ConfigurationHelper configurationHelper = new ConfigurationHelper(manager, configuration); assertNotSame(System.getProperty("java.io.tmpdir"), configurationHelper.getDiskStorePath()); assertTrue(configuration.getCacheManagerPeerProviderFactoryConfiguration().get(0) .getProperties().indexOf("multicastGroupPort=4446") != -1); }
public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuration = null; InputStream input = null; try { input = new BufferedInputStream(new FileInputStream(file)); configuration = parseConfiguration(input); } catch (Exception e) { throw new CacheException("Error configuring from " + file + ". Initial cause was " + e.getMessage(), e); } finally { try { if (input != null) { input.close(); } } catch (IOException e) { LOG.log(Level.SEVERE, "IOException while closing configuration input stream. Error was " + e.getMessage()); } } return configuration; }
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuration = null; InputStream input = null; try { input = new BufferedInputStream(new FileInputStream(file)); configuration = parseConfiguration(input); } catch (Exception e) { throw new CacheException("Error configuring from " + file + ". Initial cause was " + e.getMessage(), e); } finally { try { if (input != null) { input.close(); } } catch (IOException e) { LOG.log(Level.SEVERE, "IOException while closing configuration input stream. Error was " + e.getMessage()); } } return configuration; } }
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuration = null; InputStream input = null; try { input = new BufferedInputStream(new FileInputStream(file)); configuration = parseConfiguration(input); } catch (Exception e) { throw new CacheException("Error configuring from " + file + ". Initial cause was " + e.getMessage(), e); } finally { try { if (input != null) { input.close(); } } catch (IOException e) { LOG.log(Level.SEVERE, "IOException while closing configuration input stream. Error was " + e.getMessage()); } } return configuration; } private  ConfigurationFactory(); }
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuration = null; InputStream input = null; try { input = new BufferedInputStream(new FileInputStream(file)); configuration = parseConfiguration(input); } catch (Exception e) { throw new CacheException("Error configuring from " + file + ". Initial cause was " + e.getMessage(), e); } finally { try { if (input != null) { input.close(); } } catch (IOException e) { LOG.log(Level.SEVERE, "IOException while closing configuration input stream. Error was " + e.getMessage()); } } return configuration; } private  ConfigurationFactory(); static Configuration parseConfiguration(final File file); static Configuration parseConfiguration(final URL url); static Configuration parseConfiguration(); static Configuration parseConfiguration(final InputStream inputStream); }
ConfigurationFactory { public static Configuration parseConfiguration(final File file) throws CacheException { if (file == null) { throw new CacheException("Attempt to configure ehcache from null file."); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Configuring ehcache from file: " + file.toString()); } Configuration configuration = null; InputStream input = null; try { input = new BufferedInputStream(new FileInputStream(file)); configuration = parseConfiguration(input); } catch (Exception e) { throw new CacheException("Error configuring from " + file + ". Initial cause was " + e.getMessage(), e); } finally { try { if (input != null) { input.close(); } } catch (IOException e) { LOG.log(Level.SEVERE, "IOException while closing configuration input stream. Error was " + e.getMessage()); } } return configuration; } private  ConfigurationFactory(); static Configuration parseConfiguration(final File file); static Configuration parseConfiguration(final URL url); static Configuration parseConfiguration(); static Configuration parseConfiguration(final InputStream inputStream);  }