@Test public void testLoadNonExistentFile() { String testFile = "nonExistent"; InputStream in = getClass().getResourceAsStream(testFile); String out = aggregationLoader.loadJavascriptFile(in); assertEquals("", out); }
protected String loadJavascriptFile(InputStream in) { try { if (in == null) { return ""; } StringBuffer fileData = new StringBuffer(); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String temp = br.readLine(); while (temp != null) { fileData.append(temp); fileData.append("\n"); temp = br.readLine(); } br.close(); fileData.append("\n"); return fileData.toString(); } catch (IOException ioe) { LOG.debug("Failed to load definition file"); return ""; } }
AggregationLoader { protected String loadJavascriptFile(InputStream in) { try { if (in == null) { return ""; } StringBuffer fileData = new StringBuffer(); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String temp = br.readLine(); while (temp != null) { fileData.append(temp); fileData.append("\n"); temp = br.readLine(); } br.close(); fileData.append("\n"); return fileData.toString(); } catch (IOException ioe) { LOG.debug("Failed to load definition file"); return ""; } } }
AggregationLoader { protected String loadJavascriptFile(InputStream in) { try { if (in == null) { return ""; } StringBuffer fileData = new StringBuffer(); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String temp = br.readLine(); while (temp != null) { fileData.append(temp); fileData.append("\n"); temp = br.readLine(); } br.close(); fileData.append("\n"); return fileData.toString(); } catch (IOException ioe) { LOG.debug("Failed to load definition file"); return ""; } }  }
AggregationLoader { protected String loadJavascriptFile(InputStream in) { try { if (in == null) { return ""; } StringBuffer fileData = new StringBuffer(); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String temp = br.readLine(); while (temp != null) { fileData.append(temp); fileData.append("\n"); temp = br.readLine(); } br.close(); fileData.append("\n"); return fileData.toString(); } catch (IOException ioe) { LOG.debug("Failed to load definition file"); return ""; } }  void init(); }
AggregationLoader { protected String loadJavascriptFile(InputStream in) { try { if (in == null) { return ""; } StringBuffer fileData = new StringBuffer(); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String temp = br.readLine(); while (temp != null) { fileData.append(temp); fileData.append("\n"); temp = br.readLine(); } br.close(); fileData.append("\n"); return fileData.toString(); } catch (IOException ioe) { LOG.debug("Failed to load definition file"); return ""; } }  void init();  }