You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (JIRA)" <ji...@apache.org> on 2014/08/23 09:17:11 UTC

[jira] [Commented] (WW-4392) Unable to get datasource in StrutsTestCase

    [ https://issues.apache.org/jira/browse/WW-4392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14107910#comment-14107910 ] 

Lukasz Lenart commented on WW-4392:
-----------------------------------

{{StrutsTestCase}} was designed to support testing Struts related pieces of users' application, not any kind of JEE element.

I just did quick search over internet and found these two links, maybe they will help
http://stackoverflow.com/questions/10837839/how-to-mock-stub-java-container-in-unit-testing
http://stackoverflow.com/questions/10615377/unittesting-with-servletcontextlistener

> Unable to get datasource in StrutsTestCase
> ------------------------------------------
>
>                 Key: WW-4392
>                 URL: https://issues.apache.org/jira/browse/WW-4392
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Unit Tests
>    Affects Versions: 2.3.16.3
>         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
(v6.2#6252)