@Test public void shouldReadSingleThresholds() throws IOException{ String fileName = ClassLoader.getSystemResource("SingleThresholdEvaluationDaemonConfig.yml").getFile(); SingleThreshold threshold1 = new SingleThreshold("load_one",SingleThreshold.MAX,1); List<SingleThreshold> expectedList = new ArrayList<SingleThreshold>(); expectedList.add(threshold1); List<AbstractThreshold> thresholds = YamlParser.getThresholdsFromFile(fileName); assertEquals(1, thresholds.size()); assertEquals(threshold1, thresholds.get(0)); }
public static List<AbstractThreshold> getThresholdsFromFile(String fileName) throws IOException { File file = new File(fileName); String fileContents = FileUtils.readFileToString(file); List<AbstractThreshold> returnValue = getThresholdsFromString(fileContents); return returnValue; }
YamlParser { public static List<AbstractThreshold> getThresholdsFromFile(String fileName) throws IOException { File file = new File(fileName); String fileContents = FileUtils.readFileToString(file); List<AbstractThreshold> returnValue = getThresholdsFromString(fileContents); return returnValue; } }
YamlParser { public static List<AbstractThreshold> getThresholdsFromFile(String fileName) throws IOException { File file = new File(fileName); String fileContents = FileUtils.readFileToString(file); List<AbstractThreshold> returnValue = getThresholdsFromString(fileContents); return returnValue; }  }
YamlParser { public static List<AbstractThreshold> getThresholdsFromFile(String fileName) throws IOException { File file = new File(fileName); String fileContents = FileUtils.readFileToString(file); List<AbstractThreshold> returnValue = getThresholdsFromString(fileContents); return returnValue; }  static List<AbstractThreshold> getThresholdsFromFile(String fileName); static List<AbstractThreshold> getThresholdsFromStream(InputStream data); }
YamlParser { public static List<AbstractThreshold> getThresholdsFromFile(String fileName) throws IOException { File file = new File(fileName); String fileContents = FileUtils.readFileToString(file); List<AbstractThreshold> returnValue = getThresholdsFromString(fileContents); return returnValue; }  static List<AbstractThreshold> getThresholdsFromFile(String fileName); static List<AbstractThreshold> getThresholdsFromStream(InputStream data);  }