

Public Member Functions | |
| void | bytesRead (long bytes) |
| void | bytesWritten (long bytes) |
| void | testSaveLoad () throws Exception |
| void | testSaveLoadCompressed () throws Exception |
| void | errorReceived (String xml) |
| void | logEntryReceived (ILogEntry logEntry) |
| void | logsRead (int numOfLogs) |
| void | logsWritten (int numOfLogs) |
| void | testLoadingSpecialLogs () throws Exception |
| void | testAppend () throws Exception |
| void | testSaveLoadIterator () throws Exception |
| void | testSaveLoadFields () throws Exception |
Protected Member Functions | |
| void | setUp () throws Exception |
| void | tearDown () throws Exception |
Private Attributes | |
| final String | log1 |
| final String | log2 |
| String[] | specialLogs = { log1, log2 } |
| volatile long | bytesRead |
| volatile long | bytesWritten |
| Collection< ILogEntry > | logs |
| Vector< ILogEntry > | logsRead |
| int | numOfLogsRead |
| int | numOfLogsWritten |
| String | folder |
| String | fileName |
| String | gzipFileName |
Static Private Attributes | |
| static final int | NUMBER_OF_LOGS = 1500 |
| static final String | USER_DIR = "user.dir" |
A class testing the load and save facilities
As a general rule, each test of this class
CacheUtils, | void alma::acs::jlog::test::LoadSaveTest::bytesRead | ( | long | bytes | ) | [inline] |
Implements alma::acs::logging::engine::io::IOPorgressListener.
References bytesRead.
| void alma::acs::jlog::test::LoadSaveTest::bytesWritten | ( | long | bytes | ) | [inline] |
Implements alma::acs::logging::engine::io::IOPorgressListener.
References bytesWritten.
| void alma::acs::jlog::test::LoadSaveTest::errorReceived | ( | String | xml | ) | [inline] |
Implements com::cosylab::logging::engine::ACS::ACSRemoteErrorListener.
| void alma::acs::jlog::test::LoadSaveTest::logEntryReceived | ( | ILogEntry | logEntry | ) | [inline] |
| void alma::acs::jlog::test::LoadSaveTest::logsRead | ( | int | numOfLogs | ) | [inline] |
Implements alma::acs::logging::engine::io::IOPorgressListener.
References numOfLogsRead.
| void alma::acs::jlog::test::LoadSaveTest::logsWritten | ( | int | numOfLogs | ) | [inline] |
Implements alma::acs::logging::engine::io::IOPorgressListener.
References numOfLogsWritten.
| void alma::acs::jlog::test::LoadSaveTest::setUp | ( | ) | throws Exception [inline, protected] |
References bytesRead, bytesWritten, fileName, folder, gzipFileName, logs, logsRead, NUMBER_OF_LOGS, numOfLogsRead, and USER_DIR.
| void alma::acs::jlog::test::LoadSaveTest::tearDown | ( | ) | throws Exception [inline, protected] |
| 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.
| Exception |
References fileName, alma::acs::logging::engine::io::IOHelper::loadLogs(), logs, logsRead, numOfLogsRead, and alma::acs::logging::engine::io::IOHelper::saveLogs().
| 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
| Exception |
References fileName, alma::acs::logging::engine::io::IOHelper::loadLogs(), logsRead, and specialLogs.
| 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
| Exception |
References bytesRead, bytesWritten, fileName, alma::acs::logging::engine::io::IOHelper::loadLogs(), logs, logsRead, numOfLogsRead, numOfLogsWritten, and alma::acs::logging::engine::io::IOHelper::saveLogs().
| 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
| Exception |
References gzipFileName, alma::acs::logging::engine::io::IOHelper::loadLogs(), logs, logsRead, numOfLogsRead, numOfLogsWritten, and alma::acs::logging::engine::io::IOHelper::saveLogs().
| 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:
specialLogs IOHelper object specialLogs The test implicitly checks the conversion between XML and ILogEntry too.
References fileName, com::cosylab::logging::engine::log::ILogEntry::getAdditionalData(), com::cosylab::logging::engine::log::ILogEntry::getField(), com::cosylab::logging::engine::log::ILogEntry::hasDatas(), alma::acs::logging::engine::io::IOHelper::loadLogs(), logsRead, com::cosylab::logging::engine::log::ILogEntry::AdditionalData::name, numOfLogsWritten, alma::acs::logging::engine::parser::ACSLogParser::parse(), alma::acs::logging::engine::io::IOHelper::saveLogs(), specialLogs, and com::cosylab::logging::engine::log::ILogEntry::AdditionalData::value.
| void alma::acs::jlog::test::LoadSaveTest::testSaveLoadIterator | ( | ) | throws Exception [inline] |
Check the load and save of logs by passing an Iterator
| Exception |
References bytesWritten, fileName, alma::acs::logging::engine::io::IOHelper::loadLogs(), logs, numOfLogsRead, numOfLogsWritten, and alma::acs::logging::engine::io::IOHelper::saveLogs().
volatile long alma::acs::jlog::test::LoadSaveTest::bytesRead [private] |
Referenced by bytesRead(), setUp(), and testSaveLoad().
volatile long alma::acs::jlog::test::LoadSaveTest::bytesWritten [private] |
Referenced by bytesWritten(), setUp(), testSaveLoad(), and testSaveLoadIterator().
String alma::acs::jlog::test::LoadSaveTest::fileName [private] |
The name of the file used for testing
Referenced by setUp(), tearDown(), testAppend(), testLoadingSpecialLogs(), testSaveLoad(), testSaveLoadFields(), and testSaveLoadIterator().
String alma::acs::jlog::test::LoadSaveTest::folder [private] |
The directory where the logs are read and written.
It comes form the user.dir property.
Referenced by setUp().
String alma::acs::jlog::test::LoadSaveTest::gzipFileName [private] |
The name of the file used for testing compressed load and save
Referenced by setUp(), and testSaveLoadCompressed().
final String alma::acs::jlog::test::LoadSaveTest::log1 [private] |
"<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] |
"<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
Referenced by setUp(), tearDown(), testAppend(), testSaveLoad(), testSaveLoadCompressed(), and testSaveLoadIterator().
Vector<ILogEntry> alma::acs::jlog::test::LoadSaveTest::logsRead [private] |
The logs read form a file
This collection is filled by logEntryReceived().
Referenced by logEntryReceived(), setUp(), tearDown(), testAppend(), testLoadingSpecialLogs(), testSaveLoad(), testSaveLoadCompressed(), and testSaveLoadFields().
final int alma::acs::jlog::test::LoadSaveTest::NUMBER_OF_LOGS = 1500 [static, private] |
The number of logs in logs to load/save
Referenced by setUp().
int alma::acs::jlog::test::LoadSaveTest::numOfLogsRead [private] |
The number of logs read since the beginning of a load
Referenced by logsRead(), setUp(), testAppend(), testSaveLoad(), testSaveLoadCompressed(), and testSaveLoadIterator().
int alma::acs::jlog::test::LoadSaveTest::numOfLogsWritten [private] |
The number of logs read since the beginning of a load
Referenced by logsWritten(), testSaveLoad(), testSaveLoadCompressed(), testSaveLoadFields(), and testSaveLoadIterator().
String [] alma::acs::jlog::test::LoadSaveTest::specialLogs = { log1, log2 } [private] |
Referenced by testLoadingSpecialLogs(), and testSaveLoadFields().
final String alma::acs::jlog::test::LoadSaveTest::USER_DIR = "user.dir" [static, private] |
Referenced by setUp().
1.6.2