Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::jlog::test::LoadSaveTest Class Reference

List of all members.

Public Member Functions

Override void bytesRead (long bytes)
Override void bytesWritten (long bytes)
void testSaveLoad () throws Exception
void testSaveLoadCompressed () throws Exception
Override void errorReceived (String xml)
Override void logEntryReceived (ILogEntry logEntry)
Override void logsRead (int numOfLogs)
Override void logsWritten (int numOfLogs)
void testLoadingSpecialLogs () throws Exception
void testAppend () throws Exception
void testSaveLoadIterator () throws Exception
void testSaveLoadFields () throws Exception

Protected Member Functions

Override void setUp () throws Exception
Override void tearDown () throws Exception

Private Attributes

final String log1
final String log2
String[] specialLogs = { log1, log2 }
volatile long bytesRead
volatile long bytesWritten
Collection< ILogEntrylogs
Vector< ILogEntrylogsRead
int numOfLogsRead
int numOfLogsWritten
String folder
String fileName
String gzipFileName

Static Private Attributes

final int NUMBER_OF_LOGS = 1500
final String USER_DIR = "user.dir"

Detailed Description

A class testing the load and save facilities

As a general rule, each test of this class

  1. generate some logs with the help of CacheUtils,
  2. save and load the logs.
  3. check if the logs written and those read are equals.

Author:
acaproni


Member Function Documentation

Override void alma::acs::jlog::test::LoadSaveTest::bytesRead long  bytes  )  [inline]
 

See also:
alma.acs.logging.engine.io.IOPorgressListener::bytesRead(long)

Override void alma::acs::jlog::test::LoadSaveTest::bytesWritten long  bytes  )  [inline]
 

See also:
alma.acs.logging.engine.io.IOPorgressListener::bytesWritten(long)

Override void alma::acs::jlog::test::LoadSaveTest::errorReceived String  xml  )  [inline]
 

See also:
com.cosylab.logging.engine.ACS.ACSRemoteErrorListener::errorReceived(java.lang.String)

Override void alma::acs::jlog::test::LoadSaveTest::logEntryReceived ILogEntry  logEntry  )  [inline]
 

See also:
com.cosylab.logging.engine.ACS.ACSRemoteLogListener::logEntryReceived(com.cosylab.logging.engine.log.ILogEntry)

Override void alma::acs::jlog::test::LoadSaveTest::logsRead int  numOfLogs  )  [inline]
 

See also:
alma.acs.logging.engine.io.IOPorgressListener::logsRead(int)

Override void alma::acs::jlog::test::LoadSaveTest::logsWritten int  numOfLogs  )  [inline]
 

See also:
alma.acs.logging.engine.io.IOPorgressListener::logsWritten(int)

Override void alma::acs::jlog::test::LoadSaveTest::setUp  )  throws Exception [inline, protected]
 

See also:
junit.framework.TestCase#setUp()

Override void alma::acs::jlog::test::LoadSaveTest::tearDown  )  throws Exception [inline, protected]
 

See also:
junit.framework.TestCase#tearDown()

void alma::acs::jlog::test::LoadSaveTest::testAppend  )  throws Exception [inline]
 

Test the append switch while saving logs by saving the same collection twice in the same file but with the append switch set to true.

Exceptions:
Exception 

void alma::acs::jlog::test::LoadSaveTest::testLoadingSpecialLogs  )  throws Exception [inline]
 

Load a set of special logs that could be interesting.

Initially this method opens an XML file and writes into it the special logs without using IOHelper. Then it tries to load the file containing the special logs

Exceptions:
Exception 

void alma::acs::jlog::test::LoadSaveTest::testSaveLoad  )  throws Exception [inline]
 

Load and save a collection of logs in uncompressed files

The save is performed by passing the name of the file

Exceptions:
Exception 

void alma::acs::jlog::test::LoadSaveTest::testSaveLoadCompressed  )  throws Exception [inline]
 

Load and save a collection of logs in uncompressed files

The save is performed by passing the name of the file

Exceptions:
Exception 

void alma::acs::jlog::test::LoadSaveTest::testSaveLoadFields  )  throws Exception [inline]
 

Save and Load the special logs then check their fields.

This test is performed comparing the fields of the special logs one by one instead of comparing the XMLs. The test does the following steps:

  1. build vector of logs to save from the XMLs in specialLogs
  2. save the vector of logs with an IOHelper object
  3. load the logs from file
  4. compare each field of the logs read from the file with those in specialLogs
  5. compare the additional data names and values

The test implicitly checks the conversion between XML and ILogEntry too.

void alma::acs::jlog::test::LoadSaveTest::testSaveLoadIterator  )  throws Exception [inline]
 

Check the load and save of logs by passing an Iterator

Exceptions:
Exception 


Member Data Documentation

volatile long alma::acs::jlog::test::LoadSaveTest::bytesRead [private]
 

volatile long alma::acs::jlog::test::LoadSaveTest::bytesWritten [private]
 

String alma::acs::jlog::test::LoadSaveTest::fileName [private]
 

The name of the file used for testing

String alma::acs::jlog::test::LoadSaveTest::folder [private]
 

The directory where the logs are read and written.

It comes form the user.dir property.

String alma::acs::jlog::test::LoadSaveTest::gzipFileName [private]
 

The name of the file used for testing compressed load and save

final String alma::acs::jlog::test::LoadSaveTest::log1 [private]
 

Initial value:

"<Trace TimeStamp=\"2008-04-14T17:53:22.445\" SourceObject=\"CONTROL/ACC/cppContainer-GL\" "+ "File=\"Unavailable\" Line=\"0\" Routine=\"\" Host=\"gas01\" Process=\"CONTROL/ACC/cppContainer\" "+ "Context=\"\" Thread=\"CONTROL/Array002/DELAYSERVERServiceThread\">"+ "<![CDATA[AlarmSupplier::publishEvent()\n"+ "About to send XML of:\n"+ "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"+ "<ASI-message xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" backup=\"false\" version=\"0.9\" xsi:type=\"ASI-message\">\n"+ "<source-name>ALARM_SYSTEM_SOURCES</source-name>\n"+ "<source-hostname>gas01</source-hostname>\n"+ "<source-timestamp seconds=\"1208195602\" microseconds=\"433703\"/>\n"+ "<fault-states>\n"+ "<fault-state family=\"DelayServer\" member=\"CONTROL/Array002\" code=\"1\">\n"+ "<descriptor>TERMINATE</descriptor>\n"+ "<user-timestamp seconds=\"1208195602\" microseconds=\"433103\"/>\n"+ "</fault-state>\n"+ "</fault-states>\n"+ "</ASI-message>\n"+ "]]></Trace>\n"

final String alma::acs::jlog::test::LoadSaveTest::log2 [private]
 

Initial value:

"<Warning TimeStamp=\"2005-12-13T15:09:12.041\" SourceObject=\"ARCHIVE_MASTER_COMP\" " + "File=\"alma.ACS.MasterComponentImpl.MasterComponentImplBase\" "+ "Line=\"164\" Routine=\"doTransition\" Host=\"gas\" Process=\"LoggerName: alma.component.ARCHIVE_MASTER_COMP\" "+ "Thread=\"RequestProcessor-10\" StackId=\"unknown\" StackLevel=\"0\" LogId=\"140\">"+ "<![CDATA[Illegal event.]]><Data Name=\"LoggedException\">alma.acs.genfw.runtime.sm.AcsStateIllegalEventException: illegal event 'initPass1' in state 'ONLINE'.\n"+ "at alma.ACS.MasterComponentImpl.statemachine.AlmaSubsystemContext.illegalEvent(AlmaSubsystemContext.java:248)\n"+ "at alma.ACS.MasterComponentImpl.statemachine.AvailableSubStateAbstract.initPass1(AvailableSubStateAbstract.java:30)\n"+ "at alma.ACS.MasterComponentImpl.statemachine.AvailableState.initPass1(AvailableState.java:60)\n"+ "at alma.ACS.MasterComponentImpl.statemachine.AlmaSubsystemContext.initPass1(AlmaSubsystemContext.java:135)\n"+ "at alma.ACS.MasterComponentImpl.MasterComponentImplBase.doTransition(MasterComponentImplBase.java:134)\n"+ "at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n"+ "at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n"+ "at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n"+ "at java.lang.reflect.Method.invoke(Method.java:324)\n"+ "at alma.acs.container.ContainerSealant.invoke(ContainerSealant.java:134)\n"+ "at $Proxy0.doTransition(Unknown Source)\n"+ "at alma.archive.ArchiveSubsystemMasterIFPOATie.doTransition(ArchiveSubsystemMasterIFPOATie.java:63)\n"+ "at alma.archive.ArchiveSubsystemMasterIFPOA._invoke(ArchiveSubsystemMasterIFPOA.java:76)\n"+ "at org.jacorb.poa.RequestProcessor.invokeOperation(Unknown Source)\n"+ "at org.jacorb.poa.RequestProcessor.process(Unknown Source)\n"+ "at org.jacorb.poa.RequestProcessor.run(Unknown Source)\n"+ "</Data></Warning>"

Collection<ILogEntry> alma::acs::jlog::test::LoadSaveTest::logs [private]
 

The logs to read and write

Vector<ILogEntry> alma::acs::jlog::test::LoadSaveTest::logsRead [private]
 

The logs read form a file

This collection is filled by logEntryReceived().

final int alma::acs::jlog::test::LoadSaveTest::NUMBER_OF_LOGS = 1500 [static, private]
 

The number of logs in logs to load/save

int alma::acs::jlog::test::LoadSaveTest::numOfLogsRead [private]
 

The number of logs read since the beginning of a load

int alma::acs::jlog::test::LoadSaveTest::numOfLogsWritten [private]
 

The number of logs read since the beginning of a load

String [] alma::acs::jlog::test::LoadSaveTest::specialLogs = { log1, log2 } [private]
 

final String alma::acs::jlog::test::LoadSaveTest::USER_DIR = "user.dir" [static, private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:53:35 2009 for ACS Java API by doxygen 1.3.8