Hello,
I am using Cactus version 1.2 with Tomcat 3.2.3, the test's are being run
using Ant.
The test appears to run fine except that I get this error message:
run_tests:
[junit] Running uk.co.servsoft.servc.test.CreateAccountTest
[junit] [warning] Failed to configure logging system : Could not find
file [C:\projects\jez_appcode\src\conf\log_client.properties]
[junit] log4j:ERROR No appenders could be found for category
(uk.co.servsoft.servc.test.CreateAccountTest).
[junit] log4j:ERROR Please initialize the log4j system properly.
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 1.612 sec
[junit] Testsuite: uk.co.servsoft.servc.test.CreateAccountTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 1.612 sec
[junit]
[junit] Testcase: testCreateAccount took 1.612 sec
BUILD SUCCESSFUL
Here is the log_client.properties file, where I allocate the test category
an appender:
log4j.appender.cactus = org.apache.log4j.FileAppender
log4j.appender.cactus.File = cactus_server.log
log4j.appender.cactus.Append = false
log4j.appender.cactus.layout = org.apache.log4j.PatternLayout
log4j.appender.cactus.layout.ConversionPattern = %r [%t] %-5p %c{2} %x - %m
%n
log4j.category.org.apache.cactus = INFO, cactus
log4j.category.uk.co.servsoft.servc.test = DEBUG, cactus
This is the code that is causing the errors.
public CreateAccountTest(String theName)
{
super(theName);
LogService.getInstance().init("C:\\projects\\jez_appcode\\src\\conf\\log_cli
ent.properties");
logger =
LogService.getInstance().getLog(CreateAccountTest.class.getName());
}
JAVADOC for the method org.apache.cactus.util.log.LogService.init():
public void init(java.lang.String theFileName)
Initialize the logging system. Need to be called once before calling
getLog().
Parameters:
theFileName - the file name (Ex: "/log_client.properties") or null to
initialize a dummy logging system, meaning that all log calls will have no
effect. This is useful for unit testing for instance where the goal is not
to verify that logs are printed.
I have read the Javadoc for this class, and I have removed the reference to
the log_client.properties file, I have also
changed the back slashes in the file name to forward slashes, single forward
slashes, back slashes etc.
Even when making these changes and redoing the test's I still get the same
error.
Also I have checked that the file is in the correct path ;-)
I have looked in the mail archive but have not found any emails about this
error.
Thank you for your time.
Kind Regards,
Alastair Wilcox