This has been the best solution that we've found for getting parameters with Server Side tests.

Nicholas Dierauf wrote:
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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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:[EMAIL PROTECTED]
        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: [EMAIL PROTECTED]
        For additional commands, e-mail: [EMAIL PROTECTED]
        
        
        ---------------------------------------------------------------------
        To unsubscribe, e-mail: [EMAIL PROTECTED]
        For additional commands, e-mail: [EMAIL PROTECTED]
        
        


--

If you apply Ohms Law, e=mc2, to the hypotenuse and add to that a catalyst 
consisting of a set of struts and a gigahertz, you will theoretically arrive at 
an answer yesterday...

Shay Thompson - Lead Computer Scientist
Adobe Systems, Inc. - Titan Core QE Voice: x34728 or 612.251.5415


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to