Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9CC0E112F7 for ; Sat, 23 Aug 2014 08:17:11 +0000 (UTC) Received: (qmail 9067 invoked by uid 500); 23 Aug 2014 08:17:11 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 9031 invoked by uid 500); 23 Aug 2014 08:17:11 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 9021 invoked by uid 99); 23 Aug 2014 08:17:11 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Aug 2014 08:17:11 +0000 Date: Sat, 23 Aug 2014 08:17:11 +0000 (UTC) From: "Sanjay (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Reopened] (WW-4392) Unable to get datasource in StrutsTestCase MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] 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: 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)