Re: Cactus test case problem
Hello Vincent- Is this anomaly specific to Swing What about AWT Could we use commons-logging with AWT or should AWT implementations exclude commons-logging as with Swing? Many Thanks, -Martin - Original Message - From: Vincent Massol [EMAIL PROTECTED] To: 'Cactus Users List' [EMAIL PROTECTED] Cc: 'Martin' [EMAIL PROTECTED] Sent: Saturday, February 01, 2003 4:48 AM Subject: RE: Cactus test case problem Hi Martin, I think I know what the error is (see http://jakarta.apache.org/cactus/faq.html#faq8). It has to do with the fact that Kumar is using the Swing Test Runner and this later is using a reloadable class runner that has classloading issues with commons-logging. Thus commons-logging needs to be excluded from that loader. Thanks for your help! -Vincent -Original Message- From: Martin [mailto:[EMAIL PROTECTED]] Sent: 02 September 2002 03:26 To: Cactus Users List Cc: [EMAIL PROTECTED] Subject: Re: Cactus test case problem Kumar- Can we see the code for class SophiewebServlet() Something in the constructor is causing your new SophiewebServlet constructor to fail and return a null -Martin - Original Message - From: Vincent Massol [EMAIL PROTECTED] To: 'Cactus Users List' [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, January 31, 2003 4:20 PM Subject: RE: Cactus test case problem Hi Kumar, See the Cactus FAQ: http://jakarta.apache.org/cactus/faq.html#faq8 -Vincent -Original Message- From: Kumar, Kiran (MED, TCS) [mailto:[EMAIL PROTECTED]] Sent: 29 January 2003 04:21 To: 'Cactus Users List' Subject: Cactus test case problem Hi I am new to JUnit frame work as such and cactus in particular. I have installed cactus and set all the class paths correctly. But when i run the test class for my servlet it threw me this exception. Can somebody help me out in finding the exact root cause of the problem. junit.framework.AssertionFailedError: Exception in constructor: testDefaultConstructor (org.apache.commons.logging.LogConfigurationException: java.lang.ClassCastException: org.apache.commons.logging.impl.LogFactoryImpl at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:506) at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:350) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:381) at org.apache.cactus.util.JUnitVersionHelper.around146_getTestCaseName(JUni tVersionHelper.java;org/apache/cactus/util/log/LogAspect.aj(1k):1170) Cactus test case problem, Kumar, Kiran (MED, TCS) Re: Cactus test case problem, Martin Re: Cactus test case problem, Martin RE: Cactus test case problem, Vincent Massol Re: Cactus test case problem, Martin RE: Cactus test case problem, Vincent Massol -- Chronological -- -- Thread -- [EMAIL PROTECTED]"> Reply via email to Cactus test case problem, Kumar, Kiran (MED, TCS) Re: Cactus test case problem, Martin Re: Cactus test case problem, Martin RE: Cactus test case problem, Vincent Massol Re: Cactus test case problem, Martin RE: Cactus test case problem, Vincent Massol -- Chronological -- -- Thread -- [EMAIL PROTECTED]"> Reply via email to Cactus test case problem, Kumar, Kiran (MED, TCS) Re: Cactus test case problem, Martin Re: Cactus test case problem, Martin RE: Cactus test case problem, Vincent Massol Re: Cactus test case problem, Martin RE: Cactus test case problem, Vincent Massol -- Chronological -- -- Thread -- [EMAIL PROTECTED]"> Reply via email to Cactus test case problem, Kumar, Kiran (MED, TCS) Re: Cactus test case problem, Martin Re: Cactus test case problem, Martin RE: Cactus test case problem, Vincent Massol Re: Cactus test case problem, Martin RE: Cactus test case problem, Vincent Massol -- Chronological -- -- Thread -- [EMAIL PROTECTED]"> Reply via email to Cactus test case problem, Kumar, Kiran (MED, TCS) Re: Cactus test case problem, Martin Re: Cactus test case problem, Martin RE: Cactus test case problem, Vincent Massol Re: Cactus test case problem, Martin RE: Cactus test case problem, Vincent Massol -- Chronological -- -- Thread -- [EMAIL PROTECTED]"> Reply via email to Cactus test case problem, Kumar, Kiran (MED, TCS) Re: Cactus test case problem, Martin Re: Cactus test case problem, Martin RE: Cactus test case problem, Vincent Massol
RE: Cactus test case problem
Hi Martin, Please have a look at the FAQ entry: http://junit.sourceforge.net/doc/faq/faq.htm#running_8 To answer your question: - it is not an anomaly of JUnit. It is by design :-) - you can use commons-logging with any JUnit Test Runner (simply put it in the excluded list) - I believe it is the same with the AWT Runner as the JUnit FAQ says GUI Runners. If you want to be sure, you'll need to check the sources... ;-) -Vincent -Original Message- From: Martin [mailto:[EMAIL PROTECTED]] Sent: 02 September 2002 15:41 To: Cactus Users List Subject: Re: Cactus test case problem Hello Vincent- Is this anomaly specific to Swing What about AWT Could we use commons-logging with AWT or should AWT implementations exclude commons-logging as with Swing? Many Thanks, -Martin - Original Message - From: Vincent Massol [EMAIL PROTECTED] To: 'Cactus Users List' [EMAIL PROTECTED] Cc: 'Martin' [EMAIL PROTECTED] Sent: Saturday, February 01, 2003 4:48 AM Subject: RE: Cactus test case problem Hi Martin, I think I know what the error is (see http://jakarta.apache.org/cactus/faq.html#faq8). It has to do with the fact that Kumar is using the Swing Test Runner and this later is using a reloadable class runner that has classloading issues with commons-logging. Thus commons-logging needs to be excluded from that loader. Thanks for your help! -Vincent -Original Message- From: Martin [mailto:[EMAIL PROTECTED]] Sent: 02 September 2002 03:26 To: Cactus Users List Cc: [EMAIL PROTECTED] Subject: Re: Cactus test case problem Kumar- Can we see the code for class SophiewebServlet() Something in the constructor is causing your new SophiewebServlet constructor to fail and return a null -Martin - Original Message - From: Vincent Massol [EMAIL PROTECTED] To: 'Cactus Users List' [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, January 31, 2003 4:20 PM Subject: RE: Cactus test case problem Hi Kumar, See the Cactus FAQ: http://jakarta.apache.org/cactus/faq.html#faq8 -Vincent -Original Message- From: Kumar, Kiran (MED, TCS) [mailto:[EMAIL PROTECTED]] Sent: 29 January 2003 04:21 To: 'Cactus Users List' Subject: Cactus test case problem Hi I am new to JUnit frame work as such and cactus in particular. I have installed cactus and set all the class paths correctly. But when i run the test class for my servlet it threw me this exception. Can somebody help me out in finding the exact root cause of the problem. junit.framework.AssertionFailedError: Exception in constructor: testDefaultConstructor (org.apache.commons.logging.LogConfigurationException: java.lang.ClassCastException: org.apache.commons.logging.impl.LogFactoryImpl at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:506) at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:350) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:381) at org.apache.cactus.util.JUnitVersionHelper.around146_getTestCaseName(JUni tVersionHelper.java;org/apache/cactus/util/log/LogAspect.aj(1k):1170) at org.apache.cactus.util.JUnitVersionHelper.getTestCaseName(JUnitVersionHe lper.java;org/apache/cactus/util/log/LogAspect.aj(1k):103) at org.apache.cactus.AbstractTestCase.init(AbstractTestCase.java:124) at org.apache.cactus.AbstractWebTestCase.init(AbstractWebTestCase.java:86 ) at org.apache.cactus.ServletTestCase.init(ServletTestCase.java:119) at com.ge.sophieweb.controler.test.TestSophiewebServlet.init(TestSophiewe bServlet.java:26) at java.lang.reflect.Constructor.newInstance(Native Method) at & RE: A question cactus-user -- Chronological -- Find -- Thread -- RE: A question From: Vincent Massol Subject: RE: A question Date: Fri, 31 Jan 2003 12:21:06 -0800 RE: Cactus test case problem Vincent Massol Sat, 01 Feb 2003 13:27:56 -0800 Hi Tony, You should have a look at the following FAQ entry: http://jakarta.apache.org/cactus/faq.html#faq4 Cactus is about unit testing and there is no order of execution of the JUnit testXXX() methods (same principle as JUnit). You shouldn't rely on a first call setting up some state. Consequently, Cactus starts a new Session for each test. If you need to set up some object in the session, you can do it either in the setUp() method or at the beginning of your testXXX() method. Note that in Cactus 1.5, I have added a new API called WebRequest.getSessionCookie() which allows you to get a cookie before the test begins as shown below. But this is only to support
Got it
Vincent- excluded.properties got it Curious as to why junit classloader loads before System classloader. Thanks,
RE: Cactus test case problem
Hi Martin, I think I know what the error is (see http://jakarta.apache.org/cactus/faq.html#faq8). It has to do with the fact that Kumar is using the Swing Test Runner and this later is using a reloadable class runner that has classloading issues with commons-logging. Thus commons-logging needs to be excluded from that loader. Thanks for your help! -Vincent -Original Message- From: Martin [mailto:[EMAIL PROTECTED]] Sent: 02 September 2002 03:26 To: Cactus Users List Cc: [EMAIL PROTECTED] Subject: Re: Cactus test case problem Kumar- Can we see the code for class SophiewebServlet() Something in the constructor is causing your new SophiewebServlet constructor to fail and return a null -Martin - Original Message - From: Vincent Massol [EMAIL PROTECTED] To: 'Cactus Users List' [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, January 31, 2003 4:20 PM Subject: RE: Cactus test case problem Hi Kumar, See the Cactus FAQ: http://jakarta.apache.org/cactus/faq.html#faq8 -Vincent -Original Message- From: Kumar, Kiran (MED, TCS) [mailto:[EMAIL PROTECTED]] Sent: 29 January 2003 04:21 To: 'Cactus Users List' Subject: Cactus test case problem Hi I am new to JUnit frame work as such and cactus in particular. I have installed cactus and set all the class paths correctly. But when i run the test class for my servlet it threw me this exception. Can somebody help me out in finding the exact root cause of the problem. junit.framework.AssertionFailedError: Exception in constructor: testDefaultConstructor (org.apache.commons.logging.LogConfigurationException: java.lang.ClassCastException: org.apache.commons.logging.impl.LogFactoryImpl at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:506) at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:350) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:381) at org.apache.cactus.util.JUnitVersionHelper.around146_getTestCaseName(JUni tVersionHelper.java;org/apache/cactus/util/log/LogAspect.aj(1k):1170) at org.apache.cactus.util.JUnitVersionHelper.getTestCaseName(JUnitVersionHe lper.java;org/apache/cactus/util/log/LogAspect.aj(1k):103) at org.apache.cactus.AbstractTestCase.init(AbstractTestCase.java:124) at org.apache.cactus.AbstractWebTestCase.init(AbstractWebTestCase.java:86 ) at org.apache.cactus.ServletTestCase.init(ServletTestCase.java:119) at com.ge.sophieweb.controler.test.TestSophiewebServlet.init(TestSophiewe bServlet.java:26) at java.lang.reflect.Constructor.newInstance(Native Method) at com.ge.sophieweb.controler.test.TestSophiewebServlet.suite(TestSophieweb Servlet.java:39) at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:53) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450) at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractB utton.java:1504) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.ja va:378) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonList ener.java:216) at java.awt.Component.processMouseEvent(Component.java:3715) at java.awt.Component.processEvent(Component.java:3544) at java.awt.Container.processEvent(Container.java:1164) at java.awt.Component.dispatchEventImpl(Component.java:2593) at java.awt.Container.dispatchEventImpl(Container.java:1213) at java.awt.Component.dispatchEvent(Component.java:2497) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125) at java.awt.Container.dispatchEventImpl(Container.java:1200) at java.awt.Window.dispatchEventImpl(Window.java:926) at java.awt.Component.dispatchEvent(Component.java:2497) at java.awt.EventQueue.dispatchEvent(EventQueue.java:339) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThrea d.java:131) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread. java:98) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:85) ) this is the line of code which actually failed... public void testDefaultConstructor() { assertNotNull(new SophiewebServlet()); } Thanks and Regards Kiran Kumar -Original Message- From: Vincent Massol [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 7:17 PM To: 'Cactus Users List' Subject: RE: getRequestDispatcher()/JSP Test problem - more... Hi Franck,
RE: Can't get client side logging to work
Hi Mark, I think the name should be log4j.properties, unless you have passed the log4j.configuration System property. See the Log4j manual at http://jakarta.apache.org/log4j/docs/manual.html (search for log4j.properties). Hope it helps, -Vincent -Original Message- From: Mark Allen [mailto:[EMAIL PROTECTED]] Sent: 07 January 2003 02:43 To: [EMAIL PROTECTED] Subject: Can't get client side logging to work I'm having real trouble getting the client side logging to work. I know that log4jconfig.properties is in by class path since it is right beside cactus.properties and that is found. Here is the error message I'm getting: [junit] log4j:WARN No appenders could be found for logger (org.apache.cactus.util.JUnitVersionHelper). [junit] log4j:WARN Please initialize the log4j system properly. Here's by log4jconfig.properties log4j.rootCategory=DEBUG, cactus # Properties for configuring Log4j # This is the configuring for logging on the JUnit side (i.e. the client side) log4j.appender.cactus = org.apache.log4j.FileAppender log4j.appender.cactus.File = ./log/cactus_client.log log4j.appender.cactus.Append = false log4j.appender.cactus.layout = org.apache.log4j.PatternLayout log4j.appender.cactus.layout.ConversionPattern = %d{ABSOLUTE} [%t] %-5p %-30.30c{2} %x - %m %n # By default we don't log at the DEBUG level for Cactus log, in order not to generate too # many logs. However, should a problem arise and logs need to be sent to the Cactus dev team, # then we will ask you to change this to DEBUG. log4j.category.org.apache.cactus = WARN, cactus #log4j.additivity.org.apache.cactus=false # Don't show debug logs for HttpClient log4j.category.org.apache.commons.httpclient = WARN, cactus log4j.additivity.org.apache.commons.httpclient=false log4j.category.httpclient = WARN, cactus log4j.additivity.httpclient=false Thanks in advance. Mark. Mark Allen Pangaea Systems Inc. 5th Floor - 353 Water St. Vancouver, BC, V6B 1B8 email: [EMAIL PROTECTED] phone: (604) 692-4700 direct: (604) 692-4703 fax: (604) 681-4656 -- To unsubscribe, e-mail: mailto:cactus-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:cactus-user- [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]