jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicholas Dierauf" <nicholas.dier...@autodesk.com>
Subject RE: Can I pass parameters to ServletTestCase ?
Date Wed, 22 Nov 2006 18:22:14 GMT
I believe that you would have to modify the ServletTestRunner servlet in order to accept parameters.
 
You may want to look into writing a data-driven test instead. When I need configurable test
like this, I add a suite() method to the Cactus test to read from a configuration file, such
as an XML file. You can then iterate through the configuration file and generate a test case
for each item. This way you can just modify the configuration file instead of updating and
recompiling the java file every time you want to add a new test case. J.B. Rainsberger's JUnit
Recipes has a great chapter on writing data-driven tests.
 
Good luck,
Nick.
 

	-----Original Message----- 
	From: Dan.Doyle@cexp.com [mailto:Dan.Doyle@cexp.com] 
	Sent: Wed 11/22/2006 8:13 AM 
	To: cactus-user@jakarta.apache.org 
	Cc: 
	Subject: RE: Can I pass parameters to ServletTestCase ?
	
	

	If you are interested in passing parameters, take a look at this page,
	http://jakarta.apache.org/cactus/writing/howto_testcase.html, under Step
	6. I haven't actually used this functionality.
	
	I am still having a problem running cactus tests from a JUnit
	TestRunner. The only test runner I can use at this point is
	ServletTestRunner. So, it is not looking like Cactus will be used if I
	can't resolve the problem of running cactus tests from the command line.
	
	I think this forum is sort of dead.
	
	Hope that helps,
	Dan
	
	-----Original Message-----
	From: Jean-Charles Giardina [mailto:jc.giardina@gmail.com]
	Sent: Wednesday, November 22, 2006 8:26 AM
	To: Cactus User
	Subject: Can I pass parameters to ServletTestCase ?
	
	Hi,
	
	Can I pass URL parameters to a ServletTestCase ?
	I want to test more and more value with the same test method.
	I don't want to recompile to change value.
	
	I want to use an URL like :
	  http://localhost/ServletTestRunner?suite=my.tests.MyTest&foo=bar
	where "foo" is the parameter name and "bar" is the parameter value.
	
	Thks
	
	---------------------------------------------------------------------
	To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
	For additional commands, e-mail: cactus-user-help@jakarta.apache.org
	
	
	---------------------------------------------------------------------
	To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
	For additional commands, e-mail: cactus-user-help@jakarta.apache.org
	
	

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message