alma::acs::jlog::test::tools::ConvertersTest Class Reference

Inheritance diagram for alma::acs::jlog::test::tools::ConvertersTest:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::jlog::test::tools::ConvertersTest:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

Test the conversion of a log with the different converters

Author:
acaproni

Constructor & Destructor Documentation

alma::acs::jlog::test::tools::ConvertersTest::ConvertersTest (  )  [inline]

Constructor


Member Function Documentation

void alma::acs::jlog::test::tools::ConvertersTest::setUp (  )  throws Exception [inline, protected]
See also:
junit.framework.TestCase::setUp()

References logToConvert, alma::acs::logging::engine::parser::ACSLogParser::parse(), type, and xmlLog.

void alma::acs::jlog::test::tools::ConvertersTest::tearDown (  )  throws Exception [inline, protected]
See also:
junit.framework.TestCase::tearDown()
void alma::acs::jlog::test::tools::ConvertersTest::testColumnsVector (  )  throws Exception [inline]

Test the setting of the columns with a collection of LogField

Exceptions:
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

Exceptions:
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

Exceptions:
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.

Exceptions:
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

Exceptions:
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.

Exceptions:
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

Exceptions:
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

Exceptions:
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]

Member Data Documentation

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]
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]
final String alma::acs::jlog::test::tools::ConvertersTest::DataName2 = "\"Pippo\"" [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().

Initial value:

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]
final String alma::acs::jlog::test::tools::ConvertersTest::message = "checked exception was thrown in functional method 'ARCHIVE_CONNECTION/alma.xmlstore.Operational#retrieve'" [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().

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]
final String alma::acs::jlog::test::tools::ConvertersTest::uri = "\"theUri\"" [private]

Referenced by testColumnsVector().

Initial value:
 
                "<"+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().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2