Hi, It is taking me a while to get going with Cactus :( I am trying to get the an example in _Java Tools for Extreme Programming_ (Writing Cactus Tests starting on page 227).
I have been searching for answers in the archives, but have not found anything similar. I have taken the properties posted by Vincent Massol for log4j-1.2beta4.jar (http://www.mail-archive.com/cactus-user%40jakarta.apache.org/msg01536.html). I get the following error (test case is below - hitting the servlet alone returns the expected result): $ java com.livestoryboard.MapperServletTest .E Time: 0.047 There was 1 error: 1) testDoGet(com.livestoryboard.MapperServletTest) java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:42) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:28) at org.apache.cactus.AbstractTestCase.callBeginMethod(AbstractTestCase.j ava:227) at org.apache.cactus.AbstractTestCase.runGenericTest(AbstractTestCase.ja va:433) at org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133) at org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:400) at com.livestoryboard.MapperServletTest.main(MapperServletTest.java:49) FAILURES!!! Tests run: 1, Failures: 0, Errors: 1 // MapperServletTest.java package com.livestoryboard; import org.apache.cactus.*; import junit.framework.*; public class MapperServletTest extends ServletTestCase { private MapperServlet servlet; public MapperServletTest(String name) { super(name); } public void beginDoGet(ServletTestRequest request) { request.addParameter("foo", "manchu"); } public void setUp() throws Exception { this.config.setInitParameter("ALL_CAPS", "true"); servlet = new MapperServlet(); servlet.init(config); } public void testDoGet() throws Exception { servlet.doGet(request, response); String value = (String)session.getAttribute("foo"); assertEquals("request param not mapped into session", "manchu", value); } public void tearDown() {} //public void testUseAllCaps() { //assertTrue("servlet set to use all cpas", servletUseAllCaps()); //} public void endDoGet(WebResponse respons) { String responseString = respons.getText(); System.out.println(responseString); boolean paramInResponse = responseString.indexOf("FOO=MANCHU") > -1; assertTrue("param not foound in response", paramInResponse); } public static TestSuite suite() { TestSuite suite = new TestSuite(MapperServletTest.class); return suite; } public static void main(String[] args) { junit.textui.TestRunner.run(suite()); } } -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
