2009-03-23 19:12:36 UTC
Hi,
I just download MockStruts 2.1.4 for use with my Struts 1.3 app. I'm having problems running a JUnit test and was looking for ideas. Here is the JUnit test ...
<target name="run-pc-flow-test" depends="build-tests">
<junit dir="${build}" fork="true" haltonfailure="true">
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.ser.file}" />
<classpath>
<path refid="project.class.path"/>
<pathelement path="${java.class.path}"/>
<pathelement path="${build}/RoutingEngine.war" />
<pathelement path="${build}"/>
</classpath>
<test name="PCFlowTest" todir="${docsDir}" outfile="junit.pc.flow.result">
<formatter type="xml"/>
</test>
</junit>
<cobertura-report format="html" destdir="${docsDir}/cobertura" datafile="${cobertura.ser.file}">
<fileset dir="${srcDir}">
<include name="**/*.java" />
</fileset>
</cobertura-report>
</target>
but I'm getting this error ...
<testcase classname="PCFlowTest" name="testSuccessfulDefaultRedirect" time="1.343">
<failure message="Parsing error processing resource path jar:file:/C:/Temp/RoutingEngine/ui/build/RoutingEngine.war!/WEB-INF/struts-config.xml" type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: Parsing error processing resource path jar:file:/C:/Temp/RoutingEngine/ui/build/RoutingEngine.war!/WEB-INF/struts-config.xml
at servletunit.struts.MockStrutsTestCase.getActionServlet(MockStrutsTestCase.java:244)
at servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:290)
at PCFlowTest.testSuccessfulDefaultRedirect(Unknown Source)
</failure>
</testcase>
I have opened my WAR file and verified that the struts-config.xml is in there . Any ideas? Thanks, - Dave