struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sanjay (JIRA)" <>
Subject [jira] [Reopened] (WW-4392) Unable to get datasource in StrutsTestCase
Date Sat, 23 Aug 2014 08:17:11 GMT


Sanjay reopened WW-4392:

This is web application using struts 2.3.16. I am unit testing struts action.
Action is using datasource which is defined in web.xml and initialised in ServletContextLinstner.

When running the action from test case, datasource is null.

> 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