Donate Share

StrutsTestCase for JUnit

Code

Programming Languages: Java

License: Apache Software License

Repositories

browse code, statistics, last commit on 2007-11-06 svn co https://strutstestcase.svn.sourceforge.net/svnroot/strutstestcase strutstestcase

Show:

What's happening?

  • Followup: RE: actionPerform() NullPointerException

    Can you check to see if getActionServlet(); is returning null? e.g. In your test case before calling actionPerform(); call assertNotNull(getActionServlet()); Is your Action class in your classpath when running the test? Perhaps if I could see your struts-config.xml and testCase (along with anything in the setUp method) I would have better insight.

    2009-11-11 17:30:04 UTC by crack_phantom

  • Followup: RE: actionPerform() NullPointerException

    Hi, If i change it to setServletConfigFile("WEB-INF/web2.xml"); i got this error: ------ junit.framework.AssertionFailedError: Invalid pathname: WEB-INF/web2.xml at servletunit.struts.MockStrutsTestCase.setServletConfigFile(MockStrutsTestCase.java:602) ---- So i think the path with "WEB-INF/web.xml" is valid. If i remove setServletConfigFile("WEB-INF/web.xml"); I got the...

    2009-11-11 10:24:07 UTC by schatzb

  • Followup: RE: actionPerform() NullPointerException

    You shouldn't have to use setServletConfigFile("WEB-INF/web.xml"); So try removing it. setContextDirectory should find the web.xml on it's own e.g. it takes the Dir specified by setContextDirectory and looks for web.xml at WEB-INF/web.xml So is /home/user/workspace/APP/WEB-INF/web.xml a valid location?.

    2009-11-10 15:52:25 UTC by crack_phantom

  • actionPerform() NullPointerException

    I got a NullPointerException whenever i execute actionPerform() **** servletunit.struts.ExceptionDuringTestError: A NullPointerException was thrown. This may indicate an error in your ActionForm, or it may indicate that the Struts ActionServlet was unable to find struts config file. TestCase is running from /home/user/workspace/APP directory. Context directory is...

    2009-11-10 15:14:33 UTC by schatzb

  • setActionForm in MockStrutsTestCase

    Hi I am using MockStrutsTestCase for my junit testing. When i use setActionForm to set the form ,in action i get form as a new form and get all values null. But instead if i use addrequestparameter and send, it is fine. Please help me .....

    2009-08-07 05:30:59 UTC by jitzash

  • Followup: RE: MockStrutsTestCase web.xml parse error

    I get this as well but MockStrutsTestCase seems to truck on and parses the rest of the web.xml file. I guess because the elements I have are the same as they would be in a 2.3 web.xml file. So you might be able to just ingore this like I am. This seems to be because in 2.4 they changed to schemas. MockStrutsTestCase looks for the 2.3 dtd which is packaged with Struts. But if Struts don“t...

    2009-04-22 07:43:28 UTC by carlballantyne

  • How do I use StrutsTestCase to set this path?

    Hi, I'm using the latest version of MockTestCase with my Struts 1.3 app. I have this in my web.xml file ... <servlet> <servlet-name>RefreshServlet</servlet-name> <servlet-class>com.myco.regui.servlets.RefreshServlet</servlet-class> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping>...

    2009-03-31 20:38:07 UTC by laredotornado

  • MockStrutsTestCase web.xml parse error

    Hi All, Trying to implement MockStrutsTestCase inside Eclipse but cannot get past paring error listed below. Any ideas? 1. Script Segment public class TestLoginAction extends MockStrutsTestCase { public void testSuccessfulLogin() { setServletConfigFile("//C:/OpenSource/workspaces/strutsproject1/RJMCorp/webcontent/WEB-INF/web.xml"); 2. The error SEVERE: Parse...

    2009-03-26 17:19:41 UTC by psdrm98

  • Parsing error processing resource path /strut

    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...

    2009-03-23 19:12:36 UTC by laredotornado

  • Followup: StrutsTestCase

    I am currently receingin this error... org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-datasource.xml]: Initialization of bean failed; nested exception is java.lang.IllegalAccessError: tried to access method net.sf.ehcache.CacheManager.<init>()V from class org.hibernate.cach.

    2009-02-03 15:01:56 UTC by mickey_han

Our Numbers