org.jlab.coda.jevio
Class EvioFileTest

java.lang.Object
  extended by org.jlab.coda.jevio.EvioFileTest

public class EvioFileTest
extends java.lang.Object

A set of static functions that test evio files. It also has some other diagnostic methods for getting counts.

Author:
heddle

Nested Class Summary
static class EvioFileTest.TestResult
          This enum is used for file testing.
 
Constructor Summary
EvioFileTest()
           
 
Method Summary
static EvioFileTest.TestResult parseEventsTest(EvioReader reader, int num)
          Tests whether we can parse events from the file.
static EvioFileTest.TestResult readAllBlockHeadersTest(EvioReader reader)
          Tests whether we can look through the file and find all the block headers.
static EvioFileTest.TestResult readAllEventsTest(EvioReader reader)
          Tests whether we can look through the file read all the events.
static int totalBlockCount(EvioReader reader)
          Get a total count of the number of physical records.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EvioFileTest

public EvioFileTest()
Method Detail

totalBlockCount

public static int totalBlockCount(EvioReader reader)
Get a total count of the number of physical records.

Parameters:
reader - reader of the file to be processed.
Returns:
the total count of blocks (physical records.)

readAllBlockHeadersTest

public static EvioFileTest.TestResult readAllBlockHeadersTest(EvioReader reader)
Tests whether we can look through the file and find all the block headers.

Parameters:
reader - reader of the file to be processed.
Returns:
the result of this test, either PASS or FAIL.

readAllEventsTest

public static EvioFileTest.TestResult readAllEventsTest(EvioReader reader)
Tests whether we can look through the file read all the events.

Parameters:
reader - reader of the file to be processed.
Returns:
the result of this test, either TestResult.PASS or TestResult.FAIL.

parseEventsTest

public static EvioFileTest.TestResult parseEventsTest(EvioReader reader,
                                                      int num)
Tests whether we can parse events from the file.

Parameters:
reader - reader of the file to be processed.
num - the number to parse. Will try to parse this many (unless it runs out.) Use -1 to parse all events. Note: if num is greater than the number of events in the file, it doesn't constitute an error.
Returns:
the result of this test, either TestResult.PASS or TestResult.FAIL.