[opencms-dev] Using Cactus to tests OpenCms

DuĊĦan Saiko dusan at saiko.cz
Tue Dec 21 15:33:52 CET 2004


Hi, has already anybody tried integration of OpenCms testing using j2ee 
server testing technology, like Cactus ?

I would like to set up the server testing environment for OpenCms, but I 
do not like to use OpenCmsTestCase which is
included in OpenCms sources, because it does not use existing OpenCms 
environment, but reads the opencms.properties file again,
logins as Admin (from sourcecode), it is very compex file (100 kB)  etc.

In our tests of Java code, I would like to be able to use for example the
new CmsJspActionElement(pageContext, request, response);
I was looking at JUnitee, but it does not support using the JSP objects 
like pageContext,
so I have set up Cactus, but it uses jspRedirector.jsp, which, if I 
place this JSP directly
in the webapp/opencms/ forlder, throws me
"org.opencms.jsp.CmsJspActionElement is usable only on a OpenCms 
controlled JSP page"

But if I place jspRedirector.jsp to the OpenCms VFS, I am not so far 
able to configure the web.xml properly.
It seems to me (?) that the servlet definition in server.xml may need to 
point to physical jsp file.
not any of these two variants work for me

<servlet>
        <servlet-name>JspRedirector</servlet-name>
        <jsp-file>/opencms/sites/default/test/jspRedirector.jsp</jsp-file>
</servlet>

<servlet>
        <servlet-name>JspRedirector</servlet-name>
        
<jsp-file>/opencms/opencms/sites/default/test/jspRedirector.jsp</jsp-file>
</servlet>

If somebody could help me, it would be great.

Thanx



More information about the opencms-dev mailing list