Search in sources :

Example 1 with FileHelper

use of alma.acs.logging.archive.zoom.FileHelper in project ACS by ACS-Community.

the class FileHelperTest method testLoadFilterAll.

/**
	 * Test the loading of logs between a defined time interval
	 * and a definit log level interval
	 */
public void testLoadFilterAll() throws Exception {
    IsoDateFormat dateFormat = new IsoDateFormat();
    Date startDate = dateFormat.parse("2008-09-19T11:21:49.500");
    Date endDate = dateFormat.parse("2008-09-19T11:21:49.600");
    fileHelper = new FileHelper(testFile, startDate.getTime(), endDate.getTime(), LogTypeHelper.DEBUG, LogTypeHelper.NOTICE);
    numOfLogsRead = 0;
    assertTrue(fileHelper.loadLogs(this, this, this));
    assertEquals(15, numOfLogsRead);
}
Also used : FileHelper(alma.acs.logging.archive.zoom.FileHelper) IsoDateFormat(alma.acs.util.IsoDateFormat) Date(java.util.Date)

Example 2 with FileHelper

use of alma.acs.logging.archive.zoom.FileHelper in project ACS by ACS-Community.

the class FileHelperTest method testLoadLevelRange.

/**
	 * Test the loading of logs between a defined range of levels
	 */
public void testLoadLevelRange() throws Exception {
    fileHelper = new FileHelper(testFile, 0L, System.currentTimeMillis(), LogTypeHelper.TRACE, LogTypeHelper.INFO);
    numOfLogsRead = 0;
    assertTrue(fileHelper.loadLogs(this, this, this));
    assertEquals(68, numOfLogsRead);
}
Also used : FileHelper(alma.acs.logging.archive.zoom.FileHelper)

Example 3 with FileHelper

use of alma.acs.logging.archive.zoom.FileHelper in project ACS by ACS-Community.

the class FileHelperTest method testLoadTimelRange.

/**
	 * Test the loading of logs between a defined time interval
	 */
public void testLoadTimelRange() throws Exception {
    IsoDateFormat dateFormat = new IsoDateFormat();
    Date startDate = dateFormat.parse("2008-09-19T11:21:49.500");
    Date endDate = dateFormat.parse("2008-09-19T11:21:49.600");
    fileHelper = new FileHelper(testFile, startDate.getTime(), endDate.getTime(), LogTypeHelper.values()[0], LogTypeHelper.values()[LogTypeHelper.values().length - 1]);
    numOfLogsRead = 0;
    assertTrue(fileHelper.loadLogs(this, this, this));
    assertEquals(45, numOfLogsRead);
}
Also used : FileHelper(alma.acs.logging.archive.zoom.FileHelper) IsoDateFormat(alma.acs.util.IsoDateFormat) Date(java.util.Date)

Example 4 with FileHelper

use of alma.acs.logging.archive.zoom.FileHelper in project ACS by ACS-Community.

the class FileHelperTest method testLoadAll.

/**
	 * Test loading with no times and no levels restrictions
	 */
public void testLoadAll() throws Exception {
    fileHelper = new FileHelper(testFile, 0L, System.currentTimeMillis(), LogTypeHelper.values()[0], LogTypeHelper.values()[LogTypeHelper.values().length - 1]);
    numOfLogsRead = 0;
    assertTrue(fileHelper.loadLogs(this, this, this));
    assertEquals(totalLogsInFile, numOfLogsRead);
}
Also used : FileHelper(alma.acs.logging.archive.zoom.FileHelper)

Aggregations

FileHelper (alma.acs.logging.archive.zoom.FileHelper)4 IsoDateFormat (alma.acs.util.IsoDateFormat)2 Date (java.util.Date)2