ARgh! It turned out that the version of the maven cactus plugin was a local copy. As I just recieved committer status, I applied my various patches that made the plugin work. I can just imagine how frustrating it was to use the old broken one.
If you feel like testing the new version, download maven cvs head. Build it. In the cactus/plugin-resources/sample is a sample project. Run that and verify the SampleServlet test works. Then you should be good. The sampleFilter and sampleTag are not working, some sort of web.xml issue that I don't understand. Good luck, Eric Pugh -----Original Message----- From: Akmal Sarhan [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 2:30 AM To: Turbine Users List Subject: Re: Testing with maven/cactus Thank you Eric, The reason why I wanted to use maven, is that I did not want to write a property here and a property there, change this file and copy that file.. you know but as you pointed out the maven plugin does not seem to be "finished" so I'd rather stick to my old cactus skeleton for the moment and hope that I can use the plugin and perhaps, the eclipse one as well, at some point. regards Akmal PS. my code is nearly identical to yours, thank you! ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 11, 2003 1:08 PM Subject: RE: Testing with maven/cactus > okay, well, here is the current situation with the cvs head maven cactus > plugin. This is a little OT for the turbine list, but may help others! > Right now, if you do not start up Turbine yourself in your setUp method, but > instead rely on the web.xml to startup turbine, then nothing happens. The > reason is that the maven cactus plugin doesn't merge your web.xml with the > default web.xml. That means that turbine never gets started. Temporariily, > there is a web.cactus.xml file that you can customize and will be used > instead of your web.xml. Alternatively, you can just start up Turbine. > Take a look at this (also there is something on the wiki): > > > protected RunData data = null; > protected Context context = null; > private Turbine turbine = null; > > public void setUp() throws Exception { > super.setUp(); > config.setInitParameter("properties", "/WEB-INF/conf/" + > getTurbinePropertiesFileName()); > turbine = new Turbine(); > > turbine.init(config); > > data = RunDataFactory.getRunData(request, response, config); > context = TurbineVelocity.getContext(data); > System.out.println("Setup: Resetting Data"); > > // initialize your database connection here > IDatabaseConnection connection = new > DatabaseConnection(Torque.getConnection("default")); > > // initialize your dataset here > IDataSet dataSet = null; > String xmlFile = > TurbineServlet.getServletContext().getRealPath("WEB-INF/data/export_simple_w > orkorders.xml"); > dataSet = new FlatXmlDataSet(new FileInputStream(xmlFile)); > > try { > > InsertIdentityOperation.CLEAN_INSERT.execute(connection, dataSet); > } > finally { > connection.close(); > } > > auditAction = (Audit) > ActionLoader.getInstance().getInstance("Audit"); > > } > > public void testNoDataAvailable() throws Exception { > > // Add parameters to the RunData that will be used to login > a non existent user. > data.getParameters().setString("object_id", "636"); > data.getParameters().setString("object_name", "workorder"); > context.put("criteria", new > Criteria().add(WorkorderPeer.WORKORDER_ID, Integer.valueOf("636"))); > context.put("followupURL", "www.sun.com"); > auditAction.doPerform(data, context); > assertNotNull("Make sure we have an confirmation message.", > data.getMessages().getFormMessages("", "CONFIRM")); > > } > > Also, bump me your testcase and I'll look at it. > > Eric > > -----Original Message----- > From: Akmal Sarhan [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 11, 2003 7:00 AM > To: Turbine Users List > Subject: Re: Testing with maven/cactus > > > well, I have no problems using the classical way with cactus but when I try > with maven I get this result: > Testsuite: de.byteaction.taskwatcher.test.modules.actions.TaskActionTest > Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0,42 sec > > Testcase: testDoTaketask took 0,39 sec > Caused an ERROR > Failed to get the test results. This is probably due to an error that > happened on the server side when trying to execute the tests. Here is what > was returned by the server : [<html><head><title>Apache > Tomcat/4.1.18-LE-jdk14 - Error report</title><STYLE><!--H1{font-family : > sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;} > H3{font-family : sans-serif,Arial,Tahoma;color : white;background-color : > #0086b2;} BODY{font-family : sans-serif,Arial,Tahoma;color : > black;background-color : white;} B{color : white;background-color : > #0086b2;} HR{color : #0086b2;} --></STYLE> </head><body><h1>HTTP Status > 404 - /test/ServletRedirector</h1><HR size="1" noshade><p><b>type</b> Status > report</p><p><b>message</b> > <u>/test/ServletRedirector</u></p><p><b>description</b> <u>The requested > resource (/test/ServletRedirector) is not available.</u></p><HR size="1" > noshade><h3>Apache Tomcat/4.1.18-LE-jdk14</h3></body></html>] > org.apache.cactus.util.ChainedRuntimeException: Failed to get the test > results. This is probably due to an error that happened on the server side > when trying to execute the tests. Here is what was returned by the server : > [<html><head><title>Apache Tomcat/4.1.18-LE-jdk14 - Error > report</title><STYLE><!--H1{font-family : sans-serif,Arial,Tahoma;color : > white;background-color : #0086b2;} H3{font-family : > sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;} > BODY{font-family : sans-serif,Arial,Tahoma;color : black;background-color : > white;} B{color : white;background-color : #0086b2;} HR{color : > #0086b2;} --></STYLE> </head><body><h1>HTTP Status 404 - > /test/ServletRedirector</h1><HR size="1" noshade><p><b>type</b> Status > report</p><p><b>message</b> > <u>/test/ServletRedirector</u></p><p><b>description</b> <u>The requested > resource (/test/ServletRedirector) is not available.</u></p><HR size="1" > noshade><h3>Apache Tomcat/4.1.18-LE-jdk14</h3></body></html>] > at > org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(AbstractHttpCli > ent.java;org/apache/cactus/util/log/LogAspect.aj(1k):120) > at > org.apache.cactus.client.AbstractHttpClient.around2_doTest(AbstractHttpClien > t.java;org/apache/cactus/util/log/LogAspect.aj(1k):1236) > at > org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient.java;o > rg/apache/cactus/util/log/LogAspect.aj(1k):104) > at > org.apache.cactus.AbstractWebTestCase.runGenericTest(AbstractWebTestCase.jav > a:260) > at org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133) > at org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:195) > org.apache.cactus.client.ParsingException: Not a valid response > at > org.apache.cactus.client.WebTestResultParser.readRootElement(WebTestResultPa > rser.java;org/apache/cactus/util/log/LogAspect.aj(1k):140) > at > org.apache.cactus.client.WebTestResultParser.dispatch29_parse(WebTestResultP > arser.java;org/apache/cactus/util/log/LogAspect.aj(1k):101) > at > org.apache.cactus.client.WebTestResultParser.around29_parse(WebTestResultPar > ser.java;org/apache/cactus/util/log/LogAspect.aj(1k):1236) > at > org.apache.cactus.client.WebTestResultParser.parse(WebTestResultParser.java; > org/apache/cactus/util/log/LogAspect.aj(1k):96) > at > org.apache.cactus.client.AbstractHttpClient.callGetResult(AbstractHttpClient > .java;org/apache/cactus/util/log/LogAspect.aj(1k):230) > at > org.apache.cactus.client.AbstractHttpClient.dispatch2_doTest(AbstractHttpCli > ent.java;org/apache/cactus/util/log/LogAspect.aj(1k):114) > at > org.apache.cactus.client.AbstractHttpClient.around2_doTest(AbstractHttpClien > t.java;org/apache/cactus/util/log/LogAspect.aj(1k):1236) > at > org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient.java;o > rg/apache/cactus/util/log/LogAspect.aj(1k):104) > at > org.apache.cactus.AbstractWebTestCase.runGenericTest(AbstractWebTestCase.jav > a:260) > at org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133) > at org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:195) > > Testcase: testDoTaketask > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, March 11, 2003 12:01 PM > Subject: RE: Testing with maven/cactus > > > > Interesting. Can you send me a copy of your stack trace plus your cactus > > test? What app server are you using? Can you get the sample for the > plugin > > to run? > > > > Eric Pugh > > > > -----Original Message----- > > From: Akmal Sarhan [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, March 11, 2003 2:47 AM > > To: [EMAIL PROTECTED] > > Subject: Testing with maven/cactus > > > > > > I am trying to get my tests running using cactus plugin for maven, but > > somehow I can not get it to work, has anyone tried this and if yes, could > > you contribute a small howto(step by step) of what exactly should be > changed > > to automate the tests > > I am using the CVS head of maven > > regards > > Akmal > > > > > --------------------------------------------------------------------- > 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]
