Re: samples servlet test classes
Ive now trying a different strategy. I have an integration module which has the test classes and does the cactus/cargo thing but refers to the war build in the web project. On Fri, 2008-09-26 at 13:44 +0200, [EMAIL PROTECTED] wrote: as far as I can see, you have to treat test and production versions differently anyway, at least in my case, because for example the database -- regards Martin West 07879 680096 skype:amartinwest - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: samples servlet test classes
Thanks On Wed, 2008-09-24 at 16:30 +0300, Petar Tahchiev wrote: If you want to try it, please update the integration/maven2 module and the samples/servlet module and recompile. -- regards Martin West 07879 680096 skype:amartinwest - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: samples servlet test classes
The better way to address this problem is add the test classes to the cactified war as part of the cactify task. Otherwise you have to have special processing to build test and producton versions of the applicaton war. On Mon, 2008-09-22 at 21:53 +0100, Martin West wrote: Another observation, all the test classes are in src/main/java. You can move them to the standard location, then remove the testSource and testClass from surefire plugin configuration and add the following plugin to the pom at the start of the plugins section. -- regards Martin West 07879 680096 skype:amartinwest - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cactus 1.8.1
On Tue, 2008-09-23 at 01:13 +0300, Petar Tahchiev wrote: 2.The test-classes should be placed in src/test/java/ and they would automatically go in the WEB-INF/classes of the cactified archive. Not in the source I have. The Test* classes are in samples/servlet/src/main/java and sure-fire is configured as such. I have made some local changes to move them to the standard directory. See my earlier append. -- regards Martin West - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
maven2 cargo logs
another observation: The cargo logs get overwritten by the second execution ie the stop, which is sort of OK because the stop goal doesnt get executed when there is a build failure, so the run logs are still there. Is there a way to get different log names for the start/stop goal executions? -- regards Martin West - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
maven2 catalina.home
In my log4j.xml I have ${catalina.home}/logs/mylog.log but the catalina.home does not get resolved/defined automatically in the cargo invocation. I suppose I could define it as a system property in the configuration. -- regards Martin West 07879 680096 skype:amartinwest - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cactus 1.8.1
Checkout my earlier append on how to run with a standard directory structure. You have to add an antrun execution to copy the test-classes to the WEB_INF/classes. I could not figure out a way to get the war plugin to include the test-classes in the war. On Tue, 2008-09-23 at 11:10 +0200, [EMAIL PROTECTED] wrote: In agree with Martin. I've put my test classes in the src/test/java directory, and they don't seem to be included in the cactified war, so they have to be in the src/main/java directory.. -- regards Martin West 07879 680096 skype:amartinwest - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cactus and servletconnection
Does anyone have a sample of testing SerlvetConnection with Cactus aka ... URLConnection servletConnection = servletURL.openConnection(); // to allow us to write to the URL ... servletConnection.setDoOutput(true); // to ensure that we do contact // the servlet and don't get // anything from the browser's cache servletConnection.setUseCaches(false); servletConnection.setDefaultUseCaches(false); // Write the message to the servlet PrintStream out = new PrintStream(servletConnection .getOutputStream()); out.println(cmd); out.println(subcmd); out.println(s); out.close(); // Now read in the response StringBuffer buffer = new StringBuffer(); InputStream in = servletConnection.getInputStream(); int chr; while ((chr = in.read()) != -1) { buffer.append((char) chr); } in.close(); Could not see anything in the docs/samples Thanks -- regards Martin West - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
samples servlet test classes
Another observation, all the test classes are in src/main/java. You can move them to the standard location, then remove the testSource and testClass from surefire plugin configuration and add the following plugin to the pom at the start of the plugins section. plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-antrun-plugin/artifactId executions execution idtest-compile/id phasetest-compile/phase configuration tasks property name=finalName value=${pom.build.finalName} / ant antfile=${basedir}/build-antrun.xml target name=copy-test-classes / /ant /tasks /configuration goals goalrun/goal /goals /execution /executions dependencies dependency groupIdant/groupId artifactIdant-jsch/artifactId version1.6.5/version /dependency dependency groupIdjsch/groupId artifactIdjsch/artifactId version0.1.25/version /dependency /dependencies /plugin then create build-antrun.xml ... project name=antrun default=default target name=default echo message=default/ /target target name=copy-test-classes copy todir=target/${finalName}/WEB-INF/classes fileset dir=target/test-classes/ /copy /target /project -- regards Martin West - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cactus 1.8.1
Mine runs ok from samples/servlet directory out of the box using the 1.8.1-SNAPSHOT from svn. Results : Tests run: 115, Failures: 2, Errors: 1, Skipped: 0 The failures are in the authentication area. On Mon, 2008-09-22 at 19:22 +0200, [EMAIL PROTECTED] wrote: Cargo starts the webserver now, but no tests are ran. -- regards Martin West 07879 680096 skype:amartinwest - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cactus with ant
Hello, I have a question which may be simple, but I'm an new cactus user and didn't find the right information yet. I use cactus with Tomcat 5.5 with ant 1.6.5. The tomcat5x-Task requires the tomcat installation directory, where it puts the cactified war to and starts the server. Is it also possible to a use a running server without the file based deploying? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
EJB Persistance Testing
Newly test infected, however don't see how to create CMP and BMP test. My lack of testing experience is raising questions like what should I be testing, how do I design good test for EJB persistence. It's either in the DB or not, what's there to test? Are there good article and/or books that go into detail about designing test cases specifically for EJB persistence layer testing? Thanks! __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cactus and j2ee 1.4
Hello, Can anyone tell me when j2ee 1.4 will be supported by cactus? Thanks in advance, Julien. - Visit our Internet site at http://www.reuters.com To find out more about Reuters Products and Services visit http://www.reuters.com/productinfo Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Reuters Ltd.
RE: Cactus 12-1.5rc1 Weblogic 6.1
Hi Vince, I hahe not solved the problem so far but to tell you the truth I have not persevered with it. I find myself with a little more time now and renewed enthusiasm soI plan to get a much smaller and more controlled environment in place on another machine to try to get to know Cactus properly under 'lab' conditions, away from the grind of commercial software development. First I will try with JBoss 3.0.x then port to Weblogic 6.1, do you think maybe it is a Weblogic 6.1 specific problem ? I know there were some classloader problems with Weblogic 6.1 and I am not sure that my Service Pack level fixes them. A clean machine will help me besure of my environment. This is the first message I have received from the Cactus mailing list, are we the only subscribers ? Thanks for the response Martin Newstead From: Vincent Massol [EMAIL PROTECTED] Reply-To: Cactus Users List [EMAIL PROTECTED] To: 'Cactus Users List' [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: RE: Cactus 12-1.5rc1 Weblogic 6.1 Date: Sun, 25 Jan 2004 19:51:18 +0100 Hi Martin, Have you solved your issue? Thanks -Vincent -Original Message- From: Skank Martin [mailto:[EMAIL PROTECTED] Sent: 16 December 2003 12:01 To: [EMAIL PROTECTED] Subject: Cactus 12-1.5rc1 Weblogic 6.1 I am a newbie with cactus so please bear with me. I have used JUnit in Action and the Cactus docs to build a simple demo web app using the cactify ant task containing a test for one of my server side components. The four jars required by cactus are in WEB-INF/lib and my test case under WEB-INF/classes. The war deploys OK in Weblogic, in the console I can see the ServletRedirector servlet. When I run a test using the cactus task ( when I paste the URL into a browser) I get the following message in my weblogic console javax.servlet.ServletException: Servlet class: 'org.apache.cactus.server.ServletTestRedirector' cou ld not be loaded - the requested class wasn't found in the classpath: 'C:\bea\wlserver6.1\config\m y21domain\applications\.wlnotdelete\wl_comp9819.war;C:\bea\wlserver6.1\c on fig\my21domain\applicatio ns\.wlnotdelete\WEB- INF\_tmp_war_myserver_myserver_TestWebClient\cls9820.jar;C:\bea\wlserver 6. 1\con fig\my21domain\applications\.wlnotdelete\WEB- INF\_tmp_war_myserver_myserver_TestWebClient' Seems it can't find the cactus jar containing ServletTestRedirector, it IS in my war when I deploy it. I'd be grateful if anyone can give me any pointers. Martin _ Browse styles for all ages, from the latest looks to cozy weekend wear at MSN Shopping. And check out the beauty products! http://shopping.msn.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Rethink your business approach for the new year with the helpful tips here. http://special.msn.com/bcentral/prep04.armx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Exception in constructor: testSaveToSessionOK
make sure your own classes are included in the WAR.. in other words EVERYTHING the app uses/references should be included in the WAR .. -Martin - Original Message - From: Pujari, Ashis [EMAIL PROTECTED] To: Cactus Users List [EMAIL PROTECTED] Sent: Sunday, January 04, 2004 5:26 PM Subject: RE: Exception in constructor: testSaveToSessionOK Thanks for the pointers. I added the cactus jars to my war file and deployed. However, this does not solve the error. Please let me know if you want to see the war file. I need to get this running. Thanks, Ashis -Original Message- From: J. B. Rainsberger [mailto:[EMAIL PROTECTED] Sent: Sunday, January 04, 2004 4:54 PM To: Cactus Users List Subject: Re: Exception in constructor: testSaveToSessionOK Martin Gainty wrote: Add the cactus jars to your war and re-deploy -Martin This works for now. In general, I suggest you deploy two web-apps: one with your production code, the other with your Cactus tests. Only the Cactus test one needs the Cactus libraries. This helps avoid dependency problems in your application and makes it easy to deploy the production application without the tests, as in the field. -- J. B. Rainsberger, Diaspar Software Services http://www.diasparsoftware.com :: +1 416 791-8603 Let's write software that people understand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Exception in constructor: testSaveToSessionOK
Ashis- Do you mean your class is located in the WAR? or in a jar thats on the classpath? I guess I dont know what you mean by in the application? Regards, Martin - Original Message - From: Pujari, Ashis [EMAIL PROTECTED] To: Cactus Users List [EMAIL PROTECTED] Sent: Saturday, January 03, 2004 2:58 PM Subject: RE: Exception in constructor: testSaveToSessionOK TestSampleServlet.class , SampleServlet.class are in the same package inside my application. -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Saturday, January 03, 2004 2:42 PM To: Cactus Users List Subject: Re: Exception in constructor: testSaveToSessionOK is TestSampleServlet.class is on your classpath? -Martin - Original Message - From: Pujari, Ashis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, January 03, 2004 2:39 PM Subject: Exception in constructor: testSaveToSessionOK Hi, I tired to use the testcase - TestSampleServlet given as example on Cactus website. Added the following jars to my web application running on jboss-3.2.1_tomcat 4.1.24: aspectjrt-1.1.1.jar cactus-1.5.jar cactus-ant-1.5.jar commons-httpclient-2.0-rc2.jar commons-logging-1.0.3.jar httpunit-1.5.3.jar junit-3.8.1.jar nekohtml-0.7.4.jar servletapi-2.3.jar I compiled the file TestCase using these jars. But on accessing the URL http://localhost:8080/ashtest/ServletTestRunner?suite=com.ash.test.TestS ampleServlet I am getting the exception below. I do not have any older versions of junit. Any solutions ? Thanks Ashis == ?xml version=1.0 encoding=UTF-8 ? - testsuites - testsuite name=com.ash.test.TestSampleServlet tests=1 failures=1 errors=0 time=0 - testcase name=warning time=0 failure message=Exception in constructor: testSaveToSessionOK (java.lang.NoClassDefFoundError at org.apache.cactus.ServletTestCase.init(ServletTestCase.java:188) at org.apache.cactus.ServletTestCase.init(ServletTestCase.java:164) at com.ash.test.TestSampleServlet.init(TestSampleServlet.java:13) at java.lang.reflect.Constructor.newInstance(Native Method) at junit.framework.TestSuite.createTest(TestSuite.java:135) at junit.framework.TestSuite.addTestMethod(TestSuite.java:114) at junit.framework.TestSuite.init(TestSuite.java:75) at com.ash.test.TestSampleServlet.suite(TestSampleServlet.java:18) at java.lang.reflect.Method.invoke(Native Method) at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:111) at - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cactus 12-1.5rc1 Weblogic 6.1
I am a newbie with cactus so please bear with me. I have used JUnit in Action and the Cactus docs to build a simple demo web app using the cactify ant task containing a test for one of my server side components. The four jars required by cactus are in WEB-INF/lib and my test case under WEB-INF/classes. The war deploys OK in Weblogic, in the console I can see the ServletRedirector servlet. When I run a test using the cactus task ( when I paste the URL into a browser) I get the following message in my weblogic console javax.servlet.ServletException: Servlet class: 'org.apache.cactus.server.ServletTestRedirector' cou ld not be loaded - the requested class wasn't found in the classpath: 'C:\bea\wlserver6.1\config\m y21domain\applications\.wlnotdelete\wl_comp9819.war;C:\bea\wlserver6.1\config\my21domain\applicatio ns\.wlnotdelete\WEB-INF\_tmp_war_myserver_myserver_TestWebClient\cls9820.jar;C:\bea\wlserver6.1\con fig\my21domain\applications\.wlnotdelete\WEB-INF\_tmp_war_myserver_myserver_TestWebClient' Seems it can't find the cactus jar containing ServletTestRedirector, it IS in my war when I deploy it. I'd be grateful if anyone can give me any pointers. Martin _ Browse styles for all ages, from the latest looks to cozy weekend wear at MSN Shopping. And check out the beauty products! http://shopping.msn.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Automated cactus generation tool (was RE: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found))
Vincent-It does seem like a good idea when you have 500 Testcases to generate and you are being pressured for end of the day results Mark-will the eclipse plugin support Automatic cactus testcase generation by discovering JNDI names by parsing server.xml? Thanks Martin - Original Message - From: Mark Lybarger [EMAIL PROTECTED] To: 'Cactus Users List' [EMAIL PROTECTED] Sent: Monday, November 24, 2003 8:49 AM Subject: RE: Automated cactus generation tool (was RE: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found)) I think this does seem like a decent idea for the eclipse plugin to handle. Eclipse allows creating a new junit test case, and about the only other thing a cactus plugin would need is the jndi name of the bean. Given that, it could possibly create even a sample test case just to get something running. -Original Message- From: Vincent Massol [mailto:[EMAIL PROTECTED] Sent: Monday, November 24, 2003 1:38 AM To: 'Cactus Users List' Subject: RE: Automated cactus generation tool (was RE: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found)) Hi Martin, No I don't know any. I personally don't see the need for one for 2 reasons: 1/ I don't what is difficult in typing: public class MyclassTest extends ServletTestCase 2/ This can be done with a macro in your IDE Or do you mean other advanced feature? What I don't like with generators is that they tend to be verbose. I'm sure that instead of what I've written in 1/, your generator would have written instead: public class MyclassTest extends ServletTestCase { public MyclassTest(String name) { super(name); } public static Test suite() { return new TestSuite(MyclassTest.class); } public static void main(String[] args) { no? ;-) -Vincent -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: 24 November 2003 05:47 To: Cactus Users List; [EMAIL PROTECTED] Subject: Re: Automated cactus generation tool (was RE: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found)) Vincent I have used Artur Hefcyz testsgen to generate skeleton code for 2 differing situations and in both cases they worked extremely well I was looking for a like minded Cactus TestCase generator if you know of one I would appreciate a link Many Thanks, Martin - Original Message - From: Vincent Massol [EMAIL PROTECTED] To: 'Cactus Users List' [EMAIL PROTECTED] Sent: Sunday, November 23, 2003 3:33 PM Subject: Automated cactus generation tool (was RE: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found)) Hi Martin, Sorry but I don't know what an automated junit generation tool is. Do you mean a tool that generates skeleton TestCase? Thanks -Vincent -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: 24 November 2003 02:26 To: Cactus Users List Subject: Re: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found) On the same note is there a automated cactus generation tool such as the one for junit? Thanks, Martin From: Eric Pugh Reply-To: To: 'Cactus Users List' Subject: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found) Date: Sun, 23 Nov 2003 14:11:10 +0100 MIME-Version: 1.0 Received: from mail.apache.org ([208.185.179.12]) by mc3- f34.hotmail.com with Microsoft SMTPSVC(5.0.2195.6713); Sun, 23 Nov 2003 05:11:14 -0800 Received: (qmail 33135 invoked by uid 500); 23 Nov 2003 13:11:10 - Received: (qmail 33122 invoked from network); 23 Nov 2003 13:11:09 - Received: from unknown (HELO hqexch01.upstate.com) (205.160.101.145) by daedalus.apache.org with SMTP; 23 Nov 2003 13:11:09 - Received: from IQUITOS (ciaranlaptop.ltd.upstate.com [172.17.1.100]) by hqexch01.upstate.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13)id XCTZ3QH3; Sun, 23 Nov 2003 08:12:08 -0500 X-Message-Info: JGTYoYF78jG1z8iUJ+kGbDb/g/AcfLAS Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: Cactus Users List Delivered-To: mailing list [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) In-Reply-To: [EMAIL PROTECTED] Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X
Re: Automated cactus generation tool (was RE: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found))
I see TestCases being generated for each of n environments (see earlier posting of eclipse plug-in TestCase generator configured according to JNDI name) Then I see n TestCases being run against o Test Data Scenarios In other words a vector where JNDI Bean1 is run against TestSuite1 (positive test scenario TestCases case should work) JNDI Bean1 is run against TestSuite2..(this could be a negative test because JNDI Bean1 is not confgured to handle TestSuite2) JDND2 is run against TestSuite1..(this could be a negative test because JNDI Bean2 is not configurd tohandle TestSuite1) Suggestions are welcome Thanks, Martin - Original Message - From: J. B. Rainsberger [EMAIL PROTECTED] To: Cactus Users List [EMAIL PROTECTED] Sent: Monday, November 24, 2003 10:44 AM Subject: Re: Automated cactus generation tool (was RE: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found)) Martin Gainty wrote: Vincent, I would prefer Data Driven (in an automated fashion) The earlier suggestion of using an eclipse plugin interrogating xml files for JNDI names to generate Bean TestCases is of great interest to me I don't understand why you want to generate test cases. Maybe it's a terminology problem. Do you want to generate test case source code? or merely execute the same test cases on a variety of data? If it's the latter, then there are JUnit implementation patterns you can use for this. -- J. B. Rainsberger, Diaspar Software Services http://www.diasparsoftware.com :: +1 416 791-8603 Let's write software that people understand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found)
On the same note is there a automated cactus generation tool such as the one for junit? Thanks, Martin From: Eric Pugh Reply-To: To: 'Cactus Users List' Subject: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found) Date: Sun, 23 Nov 2003 14:11:10 +0100 MIME-Version: 1.0 Received: from mail.apache.org ([208.185.179.12]) by mc3-f34.hotmail.com with Microsoft SMTPSVC(5.0.2195.6713); Sun, 23 Nov 2003 05:11:14 -0800 Received: (qmail 33135 invoked by uid 500); 23 Nov 2003 13:11:10 - Received: (qmail 33122 invoked from network); 23 Nov 2003 13:11:09 - Received: from unknown (HELO hqexch01.upstate.com) (205.160.101.145) by daedalus.apache.org with SMTP; 23 Nov 2003 13:11:09 - Received: from IQUITOS (ciaranlaptop.ltd.upstate.com [172.17.1.100]) by hqexch01.upstate.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13)id XCTZ3QH3; Sun, 23 Nov 2003 08:12:08 -0500 X-Message-Info: JGTYoYF78jG1z8iUJ+kGbDb/g/AcfLAS Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: Cactus Users List Delivered-To: mailing list [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) In-Reply-To: [EMAIL PROTECTED] Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-MS-TNEF-Correlator: 3F7DA61201DEFA4D8CC4384DDEAFB94164F0D200 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Return-Path: [EMAIL PROTECTED] X-OriginalArrivalTime: 23 Nov 2003 13:11:14.0075 (UTC) FILETIME=[4596B6B0:01C3B1C3] Just a heads up on Mock objects.. they seem simple, they aren't. There are a lot of weird subtleness issues with the order of setting up expected results. And the concept of using generic objects to record a series of expected results, and then verifing the expected results occur with a real object? Egads..! Cactus has lots of setup issues, that is where most bugs/heartache comes from. MockObjects, especially once you get beyonnd the super simple onces, have a lot of difficult concepts to grok instead.. The two technologies are both difficult, simple on the surface, but more complex as you get deeper. Something that may help with learning cactus is to A) buy the book. b) Start over with much simpler use cases. When i tried Cactus the first time, I tried to apply it to a very complex database driven, xml parsing, coffee brewing app! Well, it didn't brew coffee, but almost. It was very frustrating. So then I went and tried out cactus testing with the JNDI code for commons-configuration, and it was much simpler.. Contributing that code helped me get a success under my belt and made getting deeper into cactus much more enjoyable. I do think my motto: Nothing is ever easy... is very applicable to software development..! Eric -Original Message- From: Tarek M. Nabil [mailto:[EMAIL PROTECTED] Sent: Sunday, November 23, 2003 11:19 AM To: Cactus Users List Subject: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found) Vincent, AFAIK, there are not many known bugs. 99.99% of the time it is an error from its users. J2EE stuff is complex. Maybe that's because there are a lot of subtle things that you need to do to get it to work, and they're never mentioned in the documentation. There are other ways to pay back apart from money, like giving your time to help the others and contributing. I can tell you that if you're recognized for doing this others will more likely help you out. That's how things work in life. It's also true for open source. That's easier said than done. How can you contribute to something you can't understand? If you have a problem and you never find out how to solve it, what do you have to contribute? Anyway, thanks to everyone. And, BTW, mock objects are my next trial, so wish me luck. Thanks, Tarek Nabil -Original Message- From: Vincent Massol [mailto:[EMAIL PROTECTED] Sent: Sunday, November 23, 2003 12:06 PM To: 'Cactus Users List' Subject: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found) -Original Message- From: Tarek M. Nabil [mailto:[EMAIL PROTECTED] Sent: 23 November 2003 10:22 To: Cactus Users List Subject: RE: REPOST: RE: Authentication Failure -- Problem Found Hi Andrew, Thanks for your support. I hope that you and everyone else will have better luck with your efforts. As for me, I've decided to drop
Re: Automated cactus generation tool (was RE: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found))
Vincent I have used Artur Hefcyz testsgen to generate skeleton code for 2 differing situations and in both cases they worked extremely well I was looking for a like minded Cactus TestCase generator if you know of one I would appreciate a link Many Thanks, Martin - Original Message - From: Vincent Massol [EMAIL PROTECTED] To: 'Cactus Users List' [EMAIL PROTECTED] Sent: Sunday, November 23, 2003 3:33 PM Subject: Automated cactus generation tool (was RE: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found)) Hi Martin, Sorry but I don't know what an automated junit generation tool is. Do you mean a tool that generates skeleton TestCase? Thanks -Vincent -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: 24 November 2003 02:26 To: Cactus Users List Subject: Re: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found) On the same note is there a automated cactus generation tool such as the one for junit? Thanks, Martin From: Eric Pugh Reply-To: To: 'Cactus Users List' Subject: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found) Date: Sun, 23 Nov 2003 14:11:10 +0100 MIME-Version: 1.0 Received: from mail.apache.org ([208.185.179.12]) by mc3- f34.hotmail.com with Microsoft SMTPSVC(5.0.2195.6713); Sun, 23 Nov 2003 05:11:14 -0800 Received: (qmail 33135 invoked by uid 500); 23 Nov 2003 13:11:10 - Received: (qmail 33122 invoked from network); 23 Nov 2003 13:11:09 - Received: from unknown (HELO hqexch01.upstate.com) (205.160.101.145) by daedalus.apache.org with SMTP; 23 Nov 2003 13:11:09 - Received: from IQUITOS (ciaranlaptop.ltd.upstate.com [172.17.1.100]) by hqexch01.upstate.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13)id XCTZ3QH3; Sun, 23 Nov 2003 08:12:08 -0500 X-Message-Info: JGTYoYF78jG1z8iUJ+kGbDb/g/AcfLAS Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: Cactus Users List Delivered-To: mailing list [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) In-Reply-To: [EMAIL PROTECTED] Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-MS-TNEF-Correlator: 3F7DA61201DEFA4D8CC4384DDEAFB94164F0D200 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Return-Path: cactus-user-return-4852- [EMAIL PROTECTED] X-OriginalArrivalTime: 23 Nov 2003 13:11:14.0075 (UTC) FILETIME=[4596B6B0:01C3B1C3] Just a heads up on Mock objects.. they seem simple, they aren't. There are a lot of weird subtleness issues with the order of setting up expected results. And the concept of using generic objects to record a series of expected results, and then verifing the expected results occur with a real object? Egads..! Cactus has lots of setup issues, that is where most bugs/heartache comes from. MockObjects, especially once you get beyonnd the super simple onces, have a lot of difficult concepts to grok instead.. The two technologies are both difficult, simple on the surface, but more complex as you get deeper. Something that may help with learning cactus is to A) buy the book. b) Start over with much simpler use cases. When i tried Cactus the first time, I tried to apply it to a very complex database driven, xml parsing, coffee brewing app! Well, it didn't brew coffee, but almost. It was very frustrating. So then I went and tried out cactus testing with the JNDI code for commons-configuration, and it was much simpler.. Contributing that code helped me get a success under my belt and made getting deeper into cactus much more enjoyable. I do think my motto: Nothing is ever easy... is very applicable to software development..! Eric -Original Message- From: Tarek M. Nabil [mailto:[EMAIL PROTECTED] Sent: Sunday, November 23, 2003 11:19 AM To: Cactus Users List Subject: RE: Good bye Tarek (was RE: REPOST: RE: Authentication Failure -- Problem Found) Vincent, AFAIK, there are not many known bugs. 99.99% of the time it is an error from its users. J2EE stuff is complex. Maybe that's because there are a lot of subtle things that you need to do to get it to work, and they're never mentioned in the documentation. There are other ways to pay back apart from money, like giving your time to help the others and contributing. I can tell you that if you're recognized for doing this others will more likely help
Re: ServletTestCase - Error looking up EJB
If this happens again attach the cactus.properties file Regards, -Martin - Original Message - From: Daniel Lehmann [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, October 13, 2003 6:36 AM Subject: RE: ServletTestCase - Error looking up EJB Hi Vincent, Thanks for the tips. I added the task to eclipse and the old error is gone(it can find the Cactus task it seems). I got another one instead (cannot find tools.jar - which is strange), but I think I can figure that one out by myself. Thanks. The stack trace for the EJB lookup problem now looks as follows: error message=null type=org.apache.cactus.client.ServletExceptionWrapperjavax.naming.Communi cationException. Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.net.MalformedURLException: no protocol: and at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292) at sun.rmi.transport.Transport$1.run(Transport.java:148) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:144) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7 01) at java.lang.Thread.run(Thread.java:536) at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteC all.java:247) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133) at org.jnp.server.NamingServer_Stub.lookup(Unknown Source) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471) at javax.naming.InitialContext.lookup(InitialContext.java:347) at pizzaTraderTest.SessionTest.setUp(SessionTest.java:46) at org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:276) at org.apache.cactus.ServletTestCase.runBare(ServletTestCase.java:251) at org.apache.cactus.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller. java:156) at org.apache.cactus.server.AbstractWebTestController.dispatch133_handleRequest (AbstractWebTestController.java;org/apache/cactus/util/log/LogAspect.aj[1k]: 130) at org.apache.cactus.server.AbstractWebTestController.around133_handleRequest(A bstractWebTestController.java;org/apache/cactus/util/log/LogAspect.aj[1k]:11 58) at org.apache.cactus.server.AbstractWebTestController.handleRequest(AbstractWeb TestController.java;org/apache/cactus/util/log/LogAspect.aj[1k]:101) at org.apache.cactus.server.ServletTestRedirector.dispatch160_doPost(ServletTes tRedirector.java;org/apache/cactus/util/log/LogAspect.aj[1k]:125) at org.apache.cactus.server.ServletTestRedirector.around160_doPost(ServletTestR edirector.java;org/apache/cactus/util/log/LogAspect.aj[1k]:1158) at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector. java;org/apache/cactus/util/log/LogAspect.aj[1k]:109) at org.apache.cactus.server.ServletTestRedirector.dispatch159_doGet(ServletTest Redirector.java;org/apache/cactus/util/log/LogAspect.aj[1k]:96) at org.apache.cactus.server.ServletTestRedirector.around159_doGet(ServletTestRe director.java;org/apache/cactus/util/log/LogAspect.aj[1k]:1158) at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.j ava;org/apache/cactus/util/log/LogAspect.aj[1k]:92) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) at org.apache.catalina.core.StandardPipeline
RE: Server Side Testing ejb implementation code
I'm not so sure. I think class visibility does matter. Maybe I'm not understanding you (or you're not understanding me :) ) For example, we have data access (DAO) classes that are only deployed in the EJB jar file, because they are an implementation detail of the EJB. However, we want to use Cactus to unit test these DAO classes directly. e.g. public void testDAO() { MYDAOClass instance = new MyDAOClass(); MyResult result = instance.methodToTest(param1); // assert results assertXXX[_]; } The problem is that when we deploy, the testcase gets deployed to the web tier (so that it can be called by the cactus servlet redirector, but the dao class only gets deployed to the EJB jar. Currently, our development build uses an exploded WAR format, but jar'd EJBs and its not using an EAR. We're using WebLogic which (I think), in this configuration, loads the WAR and EJBs in sibling class loaders. This means that the Test class (in the web tier) cannot see the DAO class(in the EJB jar). I realize that this is paricular to the way we are deploying, and that other deployment schemes might get around this issue, but my basic point was that in an environment where you want to limit the visibility of certain classes through the use of class loading schemes, it becomes difficult to test the classes that are not normally visible from the web tier, because Cactus depends upon the web tier (the redirector servlet) being able to see the test cases and therefore the classes under test. I was wondering if anyone had come across this issue before, and had come up with a good solution. The only solution I can see at the moment, is to deploy differently when creating a build that needs to run cactus tests. But this seems inappropriate, as then our development build is too different to our production build, so other testing and the general running of the app may be compromised. e.g. someone may write some regular domain code which depends on the class loader configuration set up in the development build, and that code would fail to run in the production build. Sorry if I'm not making this very clear. Thanks Martin -Original Message- From: Vincent Massol [mailto:[EMAIL PROTECTED] Sent: September 14, 2003 5:10 AM To: 'Cactus Users List' Cc: Bayly, Martin Subject: RE: Server Side Testing ejb implementation code Hi Martin, In that regards, Cactus works in the same way than JUnit does. Whatever your class to unit test is, do the following: public void testXXX() { MyClassToTest instance = new MyClassToTest(); // whatever else needs to be set up MyResult result = instance.methodToTest(param1, ..., paramN); // asserts results assertXXX[...] } EJB visibility or any other class visibility does not matter at all. Cactus is about unit testing, not functional testing, thus you are not hindered whether the class is visible remotely or not... That's the beauty of it ;-) Hope it helps, -Vincent -Original Message- From: Bayly, Martin [mailto:[EMAIL PROTECTED] Sent: 24 June 2003 19:56 To: [EMAIL PROTECTED] Subject: Server Side Testing ejb implementation code Hi We're looking into using Cactus to improve integration unit testing. We're planning on using Cactus primarily for testing our ejb interfaces, but ideally we'd like to use it for server side testing of lower level classes in the ejb implementations e.g. data access classes for example. This raises the issue of visibility of those classes to the web tier where the cactus unit tests run. Currently, our deployed build is pretty loose and everything can see pretty much everything else. However, we're in the process of tightening this up with the intention being that the web tier will only be able to see the ejb interfaces and the classes exposed by those interfaces. However, it won't 'conceptually' be able to see ejb implementation details. To a certain extent this depends on the class loading scheme used by the container - we're currently using weblogic 6 and in the current weblogic class loading scheme the web app can see all the classes in the ejb, as all ejbs are loaded using a single class loader, and the web app is loaded as a child class loader of the ejb class loader. However, we don't particularly want to be tied to the current weblogic scheme. I was just wondering if other people have come across this issue and how have they tackled it. Does it mean we're going to have to deploy with a different structure for running server unit tests? I was kind of hoping the only difference in our test/production build would be the deployed test cases and cactus jars. Cheers, Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Logo proposition
Julien (from one francophone to another), The word you are looking for is leaves not sheets (they both translate to feuilles in french). Even better would be thorns (epines) So: The thorns may sting, but the Cactus's water is crystal clear... is what I think you meant :-) regards, Martin --- gresse julien [EMAIL PROTECTED] wrote: Hi, I'm very happy to see that you enjoy my logo ! For the meaning of the drop: at the beginning it was just for design, I thought that a piece of Cactus would bleed some water. We can imagine that the cactus represent the application we need to Test and the drop is the result of testing: the result is clear like water ! Logo's Explanation: The Sheets of your JavaCode's Cactus will stung you, but with CACTUS tests you could drew every drop of you code's essence. Thanks for all your attention, PS: I'm french, I live in the south on France, so if my english is bad please correct me... thanks a lot. -Message d'origine- De: Vincent Massol [SMTP:[EMAIL PROTECTED] Date: vendredi 11 juillet 2003 11:25 A:'Cactus Users List'; [EMAIL PROTECTED] Objet:RE: Logo proposition Wow... Thanks Julien. I really like it and I think it's one of our best ones... Could you explain the signification of the water drop? I've added it to CVS and it be published automatically by the Cactus nightly build. Do you think you could provide a sentence explaining the logo? I would put it beside the logo on the logos page. Thanks! -Vincent -Original Message- From: gresse julien [mailto:[EMAIL PROTECTED] Sent: 11 July 2003 09:13 To: '[EMAIL PROTECTED]' Subject: Logo propositions Hi, I'm the Frenchy One. I've worked on this logo with great passion, I hope it would have a good rate from jakarta users. Bye ! Julien GRESSE. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = Martin Leclerc Franc-Nord Informatique [EMAIL PROTECTED] +1 (514) 572-0343 __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Server Side Testing ejb implementation code
Title: Server Side Testing ejb implementation code Hi We're looking into using Cactus to improve integration unit testing. We're planning on using Cactus primarily for testing our ejb interfaces, but ideally we'd like to use it for server side testing of lower level classes in the ejb implementations e.g. data access classes for example. This raises the issue of visibility of those classes to the web tier where the cactus unit tests run. Currently, our deployed build is pretty loose and everything can see pretty much everything else. However, we're in the process of tightening this up with the intention being that the web tier will only be able to see the ejb interfaces and the classes exposed by those interfaces. However, it won't 'conceptually' be able to see ejb implementation details. To a certain extent this depends on the class loading scheme used by the container - we're currently using weblogic 6 and in the current weblogic class loading scheme the web app can see all the classes in the ejb, as all ejbs are loaded using a single class loader, and the web app is loaded as a child class loader of the ejb class loader. However, we don't particularly want to be tied to the current weblogic scheme. I was just wondering if other people have come across this issue and how have they tackled it. Does it mean we're going to have to deploy with a different structure for running server unit tests? I was kind of hoping the only difference in our test/production build would be the deployed test cases and cactus jars. Cheers, Martin
Looking for 1.5 builds
Hello all, I am interested in using the ServletTestSuite, part of the 1.5 release, for which I do not find any nightly build, or distributions. 1. Do I have to build it from CVS, or are there nightly builds somewhere ? 2. If not, is there a recommended way of invoking my existing JUnit UnitTest/suite from within my ServletTestCase sub-class under 1.4.1 ? Thanks in advance ! Martin Leclerc Franc Nord Informatique [EMAIL PROTECTED] +1 (514) 572-0343 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Looking for 1.5 builds
Hi Vincent, Indeed, that is where I looked. In the release section there is no 1.5. In the nightly build sections, there is only eclipse integration stuff. ??? Martin -Original Message- From: Vincent Massol [mailto:[EMAIL PROTECTED] Sent: June 11, 2003 1:03 PM To: 'Cactus Users List' Subject: RE: Looking for 1.5 builds Hi Martin, Check http://jakarta.apache.org/cactus/downloads.html -Vincent -Original Message- From: Martin Leclerc [mailto:[EMAIL PROTECTED] Sent: 11 June 2003 18:46 To: [EMAIL PROTECTED] Subject: Looking for 1.5 builds Hello all, I am interested in using the ServletTestSuite, part of the 1.5 release, for which I do not find any nightly build, or distributions. 1. Do I have to build it from CVS, or are there nightly builds somewhere ? 2. If not, is there a recommended way of invoking my existing JUnit UnitTest/suite from within my ServletTestCase sub-class under 1.4.1 ? Thanks in advance ! Martin Leclerc Franc Nord Informatique [EMAIL PROTECTED] +1 (514) 572-0343 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WebRequest Disappears?
Thats what we're here forRegards, Martin Gainty __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relating to the official business of Laconia Data Systems (LDS) is proprietary to the company. It is confidential, legally privileged and protected by law.LDS does not own and endorse any other content. From: "Ronnie" <[EMAIL PROTECTED]> Reply-To: "Cactus Users List" <[EMAIL PROTECTED]> To: "Cactus Users List" <[EMAIL PROTECTED]> Subject: Re: WebRequest Disappears? Date: Mon, 7 Apr 2003 09:47:12 +0800 MIME-Version: 1.0 Received: from apache.org ([208.185.179.12]) by mc6-f42.law1.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Sun, 6 Apr 2003 19:01:03 -0700 Received: (qmail 18825 invoked by uid 500); 7 Apr 2003 02:00:49 - Received: (qmail 18814 invoked from network); 7 Apr 2003 02:00:49 - Received: from smtp014.mail.yahoo.com (216.136.173.58) by daedalus.apache.org with SMTP; 7 Apr 2003 02:00:49 - Received: from unknown (HELO ronnie) ([EMAIL PROTECTED] with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 7 Apr 2003 02:00:45 - X-Message-Info: JGTYoYF78jEHjJx36Oi8+Q1OJDRSDidP Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:[EMAIL PROTECTED]> List-Subscribe: <mailto:[EMAIL PROTECTED]> List-Help: <mailto:[EMAIL PROTECTED]> List-Post: <mailto:[EMAIL PROTECTED]> List-Id: "Cactus Users List" Delivered-To: mailing list [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] References: [EMAIL PROTECTED] <[EMAIL PROTECTED]>[EMAIL PROTECTED] <[EMAIL PROTECTED]>[EMAIL PROTECTED] <[EMAIL PROTECTED]> X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600. X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600. X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Return-Path: [EMAIL PROTECTED] X-OriginalArrivalTime: 07 Apr 2003 02:01:03.0312 (UTC) FILETIME=[8B18B500:01C2FCA9] This is too much for me! I don't understand the principle of reflection. Bty, I've managed to solve the problem. My beginXXX() method was wrongly named as beginTestXXX() for my second test below... I apologise for the obvious mistake and troubling you guys. Regards, Ronnie - Original Message - From: Martin To: Cactus Users List Sent: Monday, 07 April, 2003 12:49 AM Subject: Re: WebRequest Disappears? So you are using reflection ..here is an example from the intelligent folks at Brandeis University in Waltham package elf; import java.lang.reflect.*; //needed for reflection import java.util.Hashtable; //our class that will manipulate public class Reflect { public static void main(String[] args) { try { //watch how we use Hashtable.class.get methods to gain access to our class' meta-data // Hashtable ht = new Hashtable(10); //get the classes constructor Constructor c = Hashtable.class.getConstructor (new Class[] { Integer.TYPE }); //identify that we will be populating hashtable with Integers //this is how we create a new Instance and indentify new Integers Hashtable ht = (Hashtable) c.newInstance (new Object[] { new Integer(10) }); // ht.put("Three", new Integer(3)); //we use Hashtable.class get methods to gain access to our class' meta data Method m = Hashtable.class.getMethod ("put", new Class[] { Object.class, Object.class }); //gain access to the put method m.invoke(ht, new Object[] { "Three", new Integer(3) }); //put three Integers in and instantiate System.out.println(ht); // Prints: {Three=3} } catch (Exception e) { e.printStackTrace(); }}} Make sense? Martin - Original Message - From: Ronnie To: Cactus Users List Sent: Saturday, April 05, 2003 11:07 PM Subject: Re: WebRequest Disappears? The setUp is called before every testXXX() right? But the beginXXX() is called only when starting the XXX test case. So I thought putting the request initialisation parameters relevant to the test case in the beginXXX() would be the correct way to do it. And it worked for my first test case why shouldn't it work for my second test case in the same class? I'm really stumped by this... Here's my entire test class, everything works in testAddCustomer() but the testLogin() has all null values for "request.getParameter("")" and "config.getInitParameter("")" public class TestDispatcher1 extends ServletTestCase { public TestDispatcher1(String name){ super(name); } public void setUp() throws Exception { jndiName = "ass2DB"; addAccount(CUSTOMER2_FIRSTNAME, CUSTOMER2_LASTNAME, CUSTOMER2_ADDRESS, CUSTOMER2_USERNAME, CUSTOMER2_PASSWORD, CUSTOMER2_EMAIL); }//setUp() public void tearDown() throws Exception { deleteAccoun
Re: WebRequest Disappears?
Can you show us the code that calls TestDispatcher1 as well as addAccount? Martin - Original Message - From: Ronnie To: Cactus Users List Sent: Saturday, April 05, 2003 8:48 PM Subject: WebRequest Disappears? Hi all, I've swiftly met another problem in my testing of servlet. I managed to user WebRequest in my first test but in my second test in the same class, everything that was set disappears and was replaced by null! I tried putting the test in another class but the result occurs. Here's how my code was written: public class TestDispatcher1 extends ServletTestCase { public void setUp() throws Exception { jndiName = "ass2DB"; addAccount(CUSTOMER2_FIRSTNAME, CUSTOMER2_LASTNAME, CUSTOMER2_ADDRESS, CUSTOMER2_USERNAME, CUSTOMER2_PASSWORD, CUSTOMER2_EMAIL); }//setUp() public void tearDown() throws Exception { deleteAccounts(); session.invalidate();}//tearDown() public void beginTestLogin(WebRequest request) throws Exception { request.addParameter("userName", CUSTOMER2_USERNAME); request.addParameter("password", CUSTOMER2_PASSWORD); request.addParameter("action", "login1");}//beginTestLogin() public void testLogin() throws Exception { System.out.println("User Name: "+request.getParameter("userName")); System.out.println("Password: "+request.getParameter("password")); System.out.println("Action: "+request.getParameter("action")); System.out.println("login1: "+config.getInitParameter("login1")); }//testLogin() } All the "request.getParameter()" returns null and so does the config.getInitParameter(). I have another test in this class which is set up the same way andworks perfectly. Any help is greatly appreciated! Ronnie
Re: WebRequest Disappears?
Ok-setUp is like init as it is called only once before the Test case is executedIn fact ifyour initialisation code was moved from setUptothe constructorthe initialasation code wouldbe executedon every invocationleaving the setUp to handle just the setup for the test case.Hth, Martin - Original Message - From: Ronnie To: Cactus Users List Sent: Saturday, April 05, 2003 9:58 PM Subject: Re: WebRequest Disappears? Here's my addAccount method. //Add an account into the database private void addAccount(String firstName, String lastName, String address, String userName, String password, String email) throws Exception { Connection dbConnection = null; try { dbConnection = getConnection(); add(dbConnection, firstName, lastName, address, userName, password, email); } catch (SQLException e) { System.out.println("SQLException caught: "+e); System.out.println(e.getMessage()); while ((e = e.getNextException()) != null) { System.out.println(" next "+e.getMessage()); } throw e; // Re-throw the SQLException } finally { closeConnection(dbConnection); } } and my add() method: private void add(Connection conn, String firstName, String lastName, String address, String userName, String password, String email) throws Exception{ PreparedStatement ps = null; String admin = "FALSE"; // Build the SQL statement StringBuffer sql = new StringBuffer(); sql.append("INSERT INTO ACCOUNTS "); sql.append("(firstName, lastName, address, username, password, email, admin)" ); sql.append("VALUES (?, ?, ?, ?, ?, ?, ?)"); // Execute SQL statement try { ps = conn.prepareStatement(sql.toString()); ps.setString(1, firstName); // Set the missing values in the prepared statement ps.setString(2, lastName); ps.setString(3, address); ps.setString(4, userName); ps.setString(5, password); ps.setString(6, email); ps.setString(7, admin); count = ps.executeUpdate(); } catch (SQLException e) { count = 0; // So we know the operation was not successful System.out.println("Caught SQLException: "+ e); System.out.println(e.getMessage()); // Print any other nested exceptions while ((e = e.getNextException()) != null) { System.out.println(" next "+e.getMessage()); } throw e; // Re-throw the SQLException } finally { ps.close(); } } // add() Here how I called my test class: public class AllTests extends TestCase { public static Test suite() { TestSuite suite = new TestSuite("All Books.com Tests"); suite.addTestSuite(TestDispatcher1.class); return suite; } // suite() public static void main(String[] args) { junit.textui.TestRunner.run(suite()); } } - Original Message - From: Martin To: Cactus Users List Sent: Sunday, 06 April, 2003 12:13 PM Subject: Re: WebRequest Disappears? Can you show us the code that calls TestDispatcher1 as well as addAccount? Martin - Original Message - From: Ronnie To: Cactus Users List Sent: Saturday, April 05, 2003 8:48 PM Subject: WebRequest Disappears? Hi all, I've swiftly met another problem in my testing of servlet. I managed to user WebRequest in my first test but in my second test in the same class, everything that was set disappears and was replaced by null! I tried putting the test in another class but the result occurs. Here's how my code was written: public class TestDispatcher1 extends ServletTestCase { public void setUp() throws Exception { jndiName = "ass2DB"; addAccount(CUSTOMER2_FIRSTNAME, CUSTOMER2_LASTNAME, CUSTOMER2_ADDRESS, CUSTOMER2_USERNAME, CUSTOMER2_PASSWORD, CUSTOMER2_EMAIL); }//setUp() public void tearDown() throws Exception { deleteAccounts(); session.invalidate();}//tearDown() public void beginTestLogin(WebRequest request) throws Exception { request.addParameter("userName", CUSTOMER2_USERNAME); request.addParameter("password", CUSTOMER2_PASSWORD); request.addParameter("action", "login1");}//beginTestLogin() public void testLogin() throws Exception
Re: Stopping the Server at the Beginning of Tests
if you implement the solution thru Ant build.xml and put in a StartApache Target and exec the Apache start e.g. G:\Program Files\Apache Group\Apache2\bin\Apache.exe -w -f G:\Program Files\Apache Group\Apache2\conf\httpd.conf -d G:\Program Files\Apache Group\Apache2\. Hope this helps, Martin Gainty __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relating to the official business of Laconia Data Systems (LDS) is proprietary to the company. It is confidential, legally privileged and protected by law. LDS does not own and endorse any other content. - Original Message - From: Robertson, Jason [EMAIL PROTECTED] To: 'Cactus Users List' [EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 6:31 PM Subject: RE: Stopping the Server at the Beginning of Tests If you start the server manually before running your build process, the runsservertests will detect this and not try to start the server. Subsequently, it won't try to stop it when it is done since it wasn't the one who started it. Does this solve your problem? Jason -Original Message- From: Clint Shank [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 2:57 PM To: [EMAIL PROTECTED] Subject: Stopping the Server at the Beginning of Tests Hi, I'm trying to do this kind of automated testing: stop a running server instance get the latest code and build start the server run the tests wait for the next build cycle which is a few hours away I'm actually using CruiseControl for this and am using the runservertests Ant task. The ultimate goal is to keep the server up until the next build cycle for manual testing. I first tried removing the stopTarget of runservertests, but the build fails saying this is required. Any suggestions? I'm using 1.4b1. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Simple test for my login JSP
Lets start with the simple stuff what is Port 8081configured for? -M - Original Message - From: White, Melissa [EMAIL PROTECTED] To: 'Cactus Users List' [EMAIL PROTECTED] Sent: Friday, March 14, 2003 4:23 PM Subject: RE: Simple test for my login JSP Trying that attachment again ... -Original Message- From: White, Melissa [mailto:[EMAIL PROTECTED] Sent: Friday, March 14, 2003 5:17 PM To: 'Cactus Users List' Subject: RE: Simple test for my login JSP Hmmm... that results in even more problems. Here is the XML output from ServletTestRunner. I've also attached my cactus.log file. ?xml version=1.0 encoding=UTF-8 ?testsuitestestsuite name=com.triactive.webapps.mgr.LoginWebTest tests=2 failures=0 errors=2 time=1.063testcase name=testGetJsessionid time=0.875error message=String index out of range: 100 type=java.lang.StringIndexOutOfBoundsExceptionjava.lang.StringIndexOutOfB oundsException: String index out of range: 100 at java.lang.String.substring(String.java:1517) at org.apache.cactus.client.WebTestResultParser.readRootElement(WebTestResultPa rser.java;org/apache/cactus/util/log/LogAspect.aj(1k):149) at org.apache.cactus.client.WebTestResultParser.dispatch56_parse(WebTestResultP arser.java;org/apache/cactus/util/log/LogAspect.aj(1k):101) at org.apache.cactus.client.WebTestResultParser.around56_parse(WebTestResultPar ser.java;org/apache/cactus/util/log/LogAspect.aj(1k):1222) at org.apache.cactus.client.WebTestResultParser.parse(WebTestResultParser.java; org/apache/cactus/util/log/LogAspect.aj(1k):96) at org.apache.cactus.client.connector.http.DefaultHttpClient.callGetResult(Defa ultHttpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):247) at org.apache.cactus.client.connector.http.DefaultHttpClient.dispatch48_doTest( DefaultHttpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):126) at org.apache.cactus.client.connector.http.DefaultHttpClient.around48_doTest(De faultHttpClient.java;org/apache/cactus/util/log/LogAspect.aj(1k):1222) at org.apache.cactus.client.connector.http.DefaultHttpClient.doTest(DefaultHttp Client.java;org/apache/cactus/util/log/LogAspect.aj(1k):115) at org.apache.cactus.AbstractWebServerTestCase.runWebTest(AbstractWebServerTest Case.java:261) at org.apache.cactus.AbstractWebServerTestCase.runGenericTest(AbstractWebServer TestCase.java:203) at org.apache.cactus.AbstractWebServerTestCase.runTest(AbstractWebServerTestCas e.java:277) at org.apache.cactus.AbstractClientTestCase.runBare(AbstractClientTestCase.java :286) at org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java ;org/apache/cactus/util/log/LogAspect.aj(1k):313) at org.apache.cactus.server.runner.ServletTestRunner.dispatch75_doGet(ServletTe stRunner.java;org/apache/cactus/util/log/LogAspect.aj(1k):209) at org.apache.cactus.server.runner.ServletTestRunner.around75_doGet(ServletTest Runner.java;org/apache/cactus/util/log/LogAspect.aj(1k):1151) at org.apache.cactus.server.runner.ServletTestRunner.doGet(ServletTestRunner.ja va;org/apache/cactus/util/log/LogAspect.aj(1k):185) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1416) at allaire.jrun.session.JRunSessionService.service(../session/JRunSessionServic e.java:1082) at allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:1270) at allaire.jrun.servlet.JRunRequestDispatcher.forward(../servlet/JRunRequestDis patcher.java:89) at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1552) at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1542) at allaire.jrun.servlet.JvmContext.dispatch(../servlet/JvmContext.java:364) at allaire.jrun.http.WebEndpoint.run(../http/WebEndpoint.java:115) at allaire.jrun.ThreadPool.run(../ThreadPool.java:272) at allaire.jrun.WorkerThread.run(../WorkerThread.java:75) /error/testcasetestcase name=testLogin time=0.032error message=null type=java.lang.NullPointerExceptionjava.lang.NullPointerException at org.apache.cactus.client.connector.http.AbstractConnectionHelper.dispatch32_ getCookieString(AbstractConnectionHelper.java;org/apache/cactus/util/log/Log Aspect.aj(1k):186) at org.apache.cactus.client.connector.http.AbstractConnectionHelper.around32_ge tCookieString(AbstractConnectionHelper.java;org/apache/cactus/util/log/LogAs pect.aj(1k):1222) at org.apache.cactus.client.connector.http.AbstractConnectionHelper.getCookieSt ring(AbstractConnectionHelper.java;org/apache/cactus/util/log/LogAspect.aj(1 k):167) at org.apache.cactus.client.connector.http.HttpClientConnectionHelper.dispatch4 9_connect(HttpClientConnectionHelper.java;org/apache/cactus/util/log/LogAspe ct.aj(1k):151) at org.apache.cactus.client.connector.http.HttpClientConnectionHelper.around49_ connect(HttpClientConnectionHelper.java;org/apache/cactus/util/log/LogAspect
Re: Can't get authenticated using JDBC Realm
Mark/Vincent Looks like a configuration problem with server.xml here is a helpful link http://www.tccybersoft.com/docs/appserver/config/basic-realm.html if you can let us know what your JDBC Realm from server.xml looks like we'll take a look. Regards, -Martin - Original Message - From: Vincent Massol [EMAIL PROTECTED] To: 'Cactus Users List' [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, February 22, 2003 11:59 AM Subject: RE: Can't get authenticated using JDBC Realm Hi Mark, I have personally never tried using the JDBC realm in Tomcat and I'm not sure I can help you much. I can only tell you (as you already know) that Cactus supports Basic and Form based authentications and this should be completely independent on the underlying mechanism provided by the container. I would say this is a setup issue but who knows. Thanks and sorry for not helping you much... -Vincent -Original Message- From: Mark [mailto:[EMAIL PROTECTED] Sent: 07 January 2003 21:37 To: [EMAIL PROTECTED] Subject: Can't get authenticated using JDBC Realm I'm new to Cactus and trying to get a grip on using it with Ant. Cactus is a GREAT tool and everything was going fine - I was able to run a servlet test case, and by following the Cactus 'Security Howto' I got authenticated using a Tomcat 4.1.12 Basic authentication and a Memory Realm. However, using the same test case I'm not able to get authenticated using a JDBC realm after modifying Tomcat's server.xml. I know the JDBC realm works since it's being used daily and I can use it interactively in our application. I verified the username/password I'm using in my ServletTestCase's BasicAuthentication() method and verified the Realm information in my server.xml matches what's defined for the working application. The name of the realm in web.xml is test realm. When I attempt to run my test cases I get an http 401 error result, and in my cactus log I see thes log4j messages: 15:23:57,587 [main] DEBUG httpclient.Authenticator- Authenticator.authenticate(HttpMethod, HttpState) 15:23:57,597 [main] DEBUG httpclient.Authenticator- Parsed realm test realm from challenge Basic realm=test realm. 15:23:57,597 [main] DEBUG httpclient.Authenticator- Authenticator.basic(String,HttpState) 15:23:57,597 [main] INFO httpclient.Authenticator- No credentials found for realm test realm, attempting to use default credentials. 15:23:57,597 [main] DEBUG httpclient.HttpMethod - HttpMethodBase.execute(): Server demands authentication credentials, but none are available, so aborting. Is there something I'm missing, or is using a JDBC realm not possible with Cactus/Tomcat? I wanted our test cases to emulate real-life container use as much as possible. Any help will be greatly appreciated. TIA -- 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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:
Got it
Vincent- excluded.properties got it Curious as to why junit classloader loads before System classloader. Thanks,
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 probl 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 -- 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
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.fireAc 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, Martin RE: Cactus test case problem, Vincent Massol
How to test stateless session beans which access entity beans
Is there an approach how to test stateless session beans which access entity beans? (e.g. for this reference example http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Ebank.html) My idea was to write a JNDILookup method, (e.g. object JNDILookup(String jndiname)) to get the home interface of the entity bean inside a session bean. If I want to test this, I have to exchange this method, so it offers me a mockobject which give me back a mocked entity home interface. (Good idea, isn't it;)) But how to realize this for a stateless session bean? It could not be the way to pass the JNDILookup Interface for every method call! It is not possible to add another ejbCreate in stateless session beans... Are there some other suggestions? jens martin -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]