struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Lenart (JIRA)" <>
Subject [jira] [Closed] (WW-4392) Unable to get datasource in StrutsTestCase
Date Sun, 24 Aug 2014 09:42:38 GMT


Lukasz Lenart closed WW-4392.

    Resolution: Not a Problem

As I already wrote - it is out of scope of Struts framework.

Another thing you are registering your question as a bug - there are better places to ask
for help. JIRA is used to handle real issues not questions. 

Next problem, if you are unittesting Action you should mock all the externals dependencies
and not depend on them because in that case it isn't unit test anymore - it's a integration

> Unable to get datasource in StrutsTestCase
> ------------------------------------------
>                 Key: WW-4392
>                 URL:
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Unit Tests
>    Affects Versions:
>         Environment: Windows 7
>            Reporter: Sanjay
> I have servletcontextlinstner defined in web.xml. This listener get the datasource from
web.xml and initialise the datasource.
> Now, I am trying to create Unit Test case and extending StrutsTestCase.  Here I am getting
datasource as NULL while from browser, application working correctly.
> Appreciate if you can help in calling Listner class in testcase or initialise web.xml

This message was sent by Atlassian JIRA

View raw message