简体   繁体   中英

How to test struts 2.0.x applications

How do we test action classes of Applications written in 2.0.x version?

I read through this link and found out that, struts-junit plugin is only available for struts 2.1.1 or later.

My application is written using struts 2.0.11 and I don't think upgrading the version is easy in my project.

How do we unit test Action classes,given these limitations ?

Is there any special aspects of your action classes that you would like to test?

As long as your action classes are written as POJOs, you can test them as ordinary Java classes using any testing framework of your choice.

EDIT: Give a try this custom class which extends JUnit's TestCase class. You will need dependency to org.springframework: spring-mock .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM