

Public Member Functions | |
| ConvertersTest () | |
| void | testXML () throws Exception |
| void | testCSVConverterAllFields () throws Exception |
| void | testSetWrongColumns () throws Exception |
| void | testColumnsVector () throws Exception |
| void | testSetSeparator () throws Exception |
| void | testCVSSomeFields () throws Exception |
| void | testTextConverter () throws Exception |
| void | testTwikiTableConverter () throws Exception |
| void | testGetHeader () throws Exception |
Protected Member Functions | |
| void | setUp () throws Exception |
| void | tearDown () throws Exception |
Package Attributes | |
| String[] | logFields |
| ILogEntry | logToConvert |
Private Attributes | |
| final String | timeStamp = "\"2006-03-28T00:26:46.149\"" |
| final String | type = "Warning" |
| final String | sourceObject = "\"ARCHIVE/ACC/javaContainer\"" |
| final String | file = "\"alma.acs.container.ContainerSealant\"" |
| final String | line = "\"184\"" |
| final String | routine = "\"invoke\"" |
| final String | host = "\"gas\"" |
| final String | process = "\"TheProcess\"" |
| final String | context = "\"TheContext\"" |
| final String | thread = "\"RequestProcessor-15\"" |
| final String | logId = "\"298\"" |
| final String | priority = "\"3\"" |
| final String | uri = "\"theUri\"" |
| final String | stackId = "\"unknown\"" |
| final String | stackLevel = "\"0\"" |
| final String | message = "checked exception was thrown in functional method 'ARCHIVE_CONNECTION/alma.xmlstore.Operational#retrieve'" |
| final String | audience = "\"operator\"" |
| final String | array = "\"A1\"" |
| final String | antenna = "\"DV01\"" |
| final String | DataName1 = "\"Name\"" |
| final String | DataValue1 = "Value" |
| final String | DataName2 = "\"Pippo\"" |
| final String | DataValue2 = "Pluto" |
| final String | xmlLog |
Test the conversion of a log with the different converters
| alma::acs::jlog::test::tools::ConvertersTest::ConvertersTest | ( | ) | [inline] |
Constructor
| void alma::acs::jlog::test::tools::ConvertersTest::setUp | ( | ) | throws Exception [inline, protected] |
References logToConvert, alma::acs::logging::engine::parser::ACSLogParser::parse(), type, and xmlLog.
| void alma::acs::jlog::test::tools::ConvertersTest::tearDown | ( | ) | throws Exception [inline, protected] |
| void alma::acs::jlog::test::tools::ConvertersTest::testColumnsVector | ( | ) | throws Exception [inline] |
Test the setting of the columns with a collection of LogField
| Exception |
References context, alma::acs::logging::tools::CSVConverter::convert(), logToConvert, alma::acs::logging::tools::LogConverter::setCols(), and uri.
| void alma::acs::jlog::test::tools::ConvertersTest::testCSVConverterAllFields | ( | ) | throws Exception [inline] |
Test the CSV converter whose converted string contains all the log fields
| Exception |
References alma::acs::logging::tools::CSVConverter::convert(), DataName1, DataName2, DataValue1, DataValue2, logFields, logToConvert, message, and type.
| void alma::acs::jlog::test::tools::ConvertersTest::testCVSSomeFields | ( | ) | throws Exception [inline] |
Test the CSV conversion in case a subset of fields is chosen
| Exception |
References audience, alma::acs::logging::tools::CSVConverter::convert(), logToConvert, message, and timeStamp.
| void alma::acs::jlog::test::tools::ConvertersTest::testGetHeader | ( | ) | throws Exception [inline] |
Check the generation of the header for the different log converters.
| Exception |
References alma::acs::logging::tools::TwikiTableConverter::getHeader(), alma::acs::logging::tools::XMLConverter::getHeader(), and alma::acs::logging::tools::CSVConverter::getHeader().
| void alma::acs::jlog::test::tools::ConvertersTest::testSetSeparator | ( | ) | throws Exception [inline] |
Test the setting of the separator
| Exception |
References alma::acs::logging::tools::CSVConverter::convert(), logToConvert, and alma::acs::logging::tools::CSVConverter::setSeparator().
| void alma::acs::jlog::test::tools::ConvertersTest::testSetWrongColumns | ( | ) | throws Exception [inline] |
Test the setting of a wrong columns string i.e. a string that does contain at least one invalid LogField ID.
| Exception |
References alma::acs::logging::tools::LogConverter::setCols().
| void alma::acs::jlog::test::tools::ConvertersTest::testTextConverter | ( | ) | throws Exception [inline] |
Test the text converter.
The test is done on a subset of the columns: it is enough because the conversion is delegated to the already tested CSVConverter
| Exception |
References antenna, array, audience, alma::acs::logging::tools::CSVConverter::convert(), line, logToConvert, and sourceObject.
| void alma::acs::jlog::test::tools::ConvertersTest::testTwikiTableConverter | ( | ) | throws Exception [inline] |
Test the conversion in twiki table format
The test is done on a subset of the columns: it is enough because the conversion is delegated to the already tested CSVConverter
| Exception |
References alma::acs::logging::tools::TwikiTableConverter::convert(), host, logToConvert, routine, stackId, stackLevel, and thread.
| void alma::acs::jlog::test::tools::ConvertersTest::testXML | ( | ) | throws Exception [inline] |
Test the XML conversion
| Exception |
References alma::acs::logging::tools::XMLConverter::convert(), com::cosylab::logging::engine::log::ILogEntry::getAdditionalData(), com::cosylab::logging::engine::log::ILogEntry::getField(), logToConvert, alma::acs::logging::engine::parser::ACSLogParser::parse(), and type.
final String alma::acs::jlog::test::tools::ConvertersTest::antenna = "\"DV01\"" [private] |
Referenced by testTextConverter().
final String alma::acs::jlog::test::tools::ConvertersTest::array = "\"A1\"" [private] |
Referenced by testTextConverter().
final String alma::acs::jlog::test::tools::ConvertersTest::audience = "\"operator\"" [private] |
Referenced by testCVSSomeFields(), and testTextConverter().
final String alma::acs::jlog::test::tools::ConvertersTest::context = "\"TheContext\"" [private] |
Referenced by testColumnsVector().
final String alma::acs::jlog::test::tools::ConvertersTest::DataName1 = "\"Name\"" [private] |
Referenced by testCSVConverterAllFields().
final String alma::acs::jlog::test::tools::ConvertersTest::DataName2 = "\"Pippo\"" [private] |
Referenced by testCSVConverterAllFields().
final String alma::acs::jlog::test::tools::ConvertersTest::DataValue1 = "Value" [private] |
Referenced by testCSVConverterAllFields().
final String alma::acs::jlog::test::tools::ConvertersTest::DataValue2 = "Pluto" [private] |
Referenced by testCSVConverterAllFields().
final String alma::acs::jlog::test::tools::ConvertersTest::file = "\"alma.acs.container.ContainerSealant\"" [private] |
final String alma::acs::jlog::test::tools::ConvertersTest::host = "\"gas\"" [private] |
Referenced by testTwikiTableConverter().
final String alma::acs::jlog::test::tools::ConvertersTest::line = "\"184\"" [private] |
Referenced by testTextConverter().
String [] alma::acs::jlog::test::tools::ConvertersTest::logFields [package] |
{
timeStamp,
type,
sourceObject,
file,
line,
routine,
host,
process,
context,
thread,
logId,
priority,
uri,
stackId,
stackLevel,
message,
audience,
array,
antenna
}
Convenience data used for testing the results
The position of each string is the same of the LogField i.e. LogField.TIMESTAMP.ordinal=0=logFields[0];
Referenced by testCSVConverterAllFields().
final String alma::acs::jlog::test::tools::ConvertersTest::logId = "\"298\"" [private] |
The log to convert
Referenced by setUp(), testColumnsVector(), testCSVConverterAllFields(), testCVSSomeFields(), testSetSeparator(), testTextConverter(), testTwikiTableConverter(), and testXML().
final String alma::acs::jlog::test::tools::ConvertersTest::message = "checked exception was thrown in functional method 'ARCHIVE_CONNECTION/alma.xmlstore.Operational#retrieve'" [private] |
Referenced by testCSVConverterAllFields(), and testCVSSomeFields().
final String alma::acs::jlog::test::tools::ConvertersTest::priority = "\"3\"" [private] |
final String alma::acs::jlog::test::tools::ConvertersTest::process = "\"TheProcess\"" [private] |
final String alma::acs::jlog::test::tools::ConvertersTest::routine = "\"invoke\"" [private] |
Referenced by testTwikiTableConverter().
final String alma::acs::jlog::test::tools::ConvertersTest::sourceObject = "\"ARCHIVE/ACC/javaContainer\"" [private] |
Referenced by testTextConverter().
final String alma::acs::jlog::test::tools::ConvertersTest::stackId = "\"unknown\"" [private] |
Referenced by testTwikiTableConverter().
final String alma::acs::jlog::test::tools::ConvertersTest::stackLevel = "\"0\"" [private] |
Referenced by testTwikiTableConverter().
final String alma::acs::jlog::test::tools::ConvertersTest::thread = "\"RequestProcessor-15\"" [private] |
Referenced by testTwikiTableConverter().
final String alma::acs::jlog::test::tools::ConvertersTest::timeStamp = "\"2006-03-28T00:26:46.149\"" [private] |
Referenced by testCVSSomeFields().
final String alma::acs::jlog::test::tools::ConvertersTest::type = "Warning" [private] |
Referenced by setUp(), testCSVConverterAllFields(), and testXML().
final String alma::acs::jlog::test::tools::ConvertersTest::uri = "\"theUri\"" [private] |
Referenced by testColumnsVector().
final String alma::acs::jlog::test::tools::ConvertersTest::xmlLog [private] |
"<"+type+
" TimeStamp=" +timeStamp +
" File="+file+
" Line="+line+
" Routine="+routine+
" Host="+host+
" SourceObject="+sourceObject+
" Process="+process+
" Context="+context+
" Thread="+thread+
" StackId="+stackId+
" StackLevel="+stackLevel+
" LogId="+logId+
" Priority="+priority+
" URI="+uri+
" Audience="+audience+
" Array="+array+
" Antenna="+antenna+
">" +
"<![CDATA["+message+"]]>" +
"<Data Name="+DataName1+"><![CDATA["+DataValue1+"]]></Data>"+
"<Data Name="+DataName2+"><![CDATA["+DataValue2+"]]></Data>"+
"</"+type+">"
The log used for testing
Referenced by setUp().
1.6.2