Unittest fail due to changed default of xmlLayout->setLocationInfo
------------------------------------------------------------------

                 Key: LOG4PHP-85
                 URL: https://issues.apache.org/jira/browse/LOG4PHP-85
             Project: Log4php
          Issue Type: Bug
          Components: Tests
            Reporter: Christian Hammers


Currently the unit tests on my working copy fail with:

1) testSocketXml(LoggerAppenderSocketTest)
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ -1,5 +1,4 @@
 DRY MODE OF SOCKET APPENDER: <log4php:event logger="TEST" level="ERROR" 
thread="11857" timestamp="1252964319758">
 <log4php:message><![CDATA[testmessage]]></log4php:message>
-<log4php:locationInfo class="LoggerLoggingEvent" file="NA" line="NA" 
method="getLocationInformation" />
 </log4php:event>

They do not on the current trunk at r814880. On further investigation I found 
that the output of a LoggerAppenderSocket, which internally uses an 
LoggerLayoutXML is compared to a pure LoggerLayoutXML.
The first LoggerAppenderSocket though has locationInfo=false as default and 
passes this on to the layout. The newly created layout still has this value on 
true.

So in fact the test should have failed all the time and does now as I already 
have the new toBoolean method (see bug 81). A patch would be:

--- src/test/php/appenders/LoggerAppenderSocketTest.php (Revision 814880)
+++ src/test/php/appenders/LoggerAppenderSocketTest.php (Arbeitskopie)
@@ -50,6 +50,7 @@

                $appender->setDry(true);
                $appender->setUseXml(true);
+               $appender->setLocationInfo(true);
                $appender->activateOptions();
                $event = new LoggerLoggingEvent("LoggerAppenderSocketTest", new 
Logger("TEST"), LoggerLevel::getLevelError(), "testmessage");




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to