简体   繁体   English

Mockstrutstestcase 测试 Struts 1.2 App

[英]Mockstrutstestcase testing Struts 1.2 App

I am using strutstestcase for testing my web application on struts 1.2.我正在使用 strutstestcase 在 struts 1.2 上测试我的 web 应用程序。 When test runs and control goes to my action the request.getSession(false), i called in my action, returns null.当测试运行并且控制转到我的操作时,request.getSession(false),我在我的操作中调用,返回 null。

could Anyone one help me what i am missing?任何人都可以帮助我我所缺少的吗?

The problem was at my end.问题出在我的最后。 I am calling request.getSession(false) which returns null if session is not exist.如果 session 不存在,我正在调用request.getSession(false) ,它返回 null。 request.getSession() gives me session and code works. request.getSession()给了我 session 并且代码有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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