I am working on struts 1.x application and need to implement junit 4 test cases in it. I have struts2-junit-plugin jars for using StutsTestCase to create test cases for Action classes. Is this possible ? Struts 1.x app using struts2-junit jars . When i am trying to run test case , its giving error - InitializationError When i check failure Trace - its showing java.lang.noclassdeffounderror org/springframework/core/io/resourceloader
Can anyone help me with cause . Is it something with version of junit jars or using struts2 jar in struts 1 app. Or i need to add something more or any other mistake. Please help
No.
This makes no sense--Struts 2 is a completely different framework. There is zero overlap in functionality, supporting libraries, architecture, etc.
You might be able to rework the Struts 1 StrutsTestCase
to support any explicitly-JUnit 4 functionality, if it doesn't out-of-the-box, or simply build up the supporting objects (e.g., ActionForm
, ActionMapping
, and the normal HTTP stuff) and run "bare" tests.
There's a reason Struts 1 was EOL'd over five years ago: the architecture is antiquated and tightly coupled to itself and to HTTP, which made testing difficult. If you search around you may find some resources for updating the testing infrastructure.