@Test public void testUpdate() throws Exception { File rrdFile = createRrdFile(); String openedFile = m_strategy.openFile(rrdFile.getAbsolutePath()); long currentTimeInSeconds = (long) (new Date().getTime() / 100); m_strategy.updateFile( openedFile, "huh?", String.valueOf(currentTimeInSeconds - 9) + ":1.234234"); m_strategy.updateFile( openedFile, "oh ", String.valueOf(currentTimeInSeconds - 8) + ":1.234234"); m_strategy.updateFile( openedFile, "ok ", String.valueOf(currentTimeInSeconds - 7) + ":1.234234"); // Sleep in between updates so that we don't underrun the 1-second step size Thread.sleep(5000); currentTimeInSeconds = (long) (new Date().getTime() / 100); m_strategy.updateFile( openedFile, "lol ", String.valueOf(currentTimeInSeconds - 6) + ":1.234234"); m_strategy.updateFile( openedFile, "lolz", String.valueOf(currentTimeInSeconds - 5) + ":1.234234"); m_strategy.updateFile( openedFile, "lolz", String.valueOf(currentTimeInSeconds - 4) + ":1.234234"); m_strategy.updateFile( openedFile, "zzzz", String.valueOf(currentTimeInSeconds - 3) + ":1.234234"); m_strategy.closeFile(openedFile); Thread.sleep(1000); }
@Test public void testCreate() throws Exception { File rrdFile = createRrdFile(); String openedFile = m_strategy.openFile(rrdFile.getAbsolutePath()); // m_strategy.updateFile(openedFile, "huh?", "N:1,234234"); m_strategy.closeFile(openedFile); }