LoadProcessor implements Processor { @Override public void execute() throws Exception { List<File> cgroupFiles = procReader.listContainerCgroupFiles(); for (File cgroupFile : cgroupFiles) { calcLoadAndWriteToFile(cgroupFile); } }  @Override void execute(); static Map<String, Load> cgroupLoadMap; }
@Test public void testExecute() throws Exception { for (int i = 0; i < 1000; i++) { loadProcessor.execute(); } String loadAvg = Files.readFirstLine(new File(ROOT_PATH, "/proc/must_contains_2_running_tasks_to_paas_unit_test22222222222222222/loadavg"), Charset.defaultCharset()); Assert.assertTrue(loadAvg.startsWith("2.00")); loadAvg = Files.readFirstLine(new File(ROOT_PATH, "/proc/must_contains_5_running_tasks_to_paas_unit_test55555555555555555/loadavg"), Charset.defaultCharset()); Assert.assertTrue(loadAvg.startsWith("5.00")); }