Hi

Is there any way making sure WicketTester loads my application's web.xml?

Have searched the archives and seen some suggestions about setting the path
in the WicketTester constructor, but unless I missed something while
debugging, it correctly sets the path to the "WAR base" for loading
resources, but does not actually load the web.xml and therefore setup
parameters (in my instance the SWARM HIVE key) are not available.

Am I missing something?  (or should that read, what am I missing ;-)

My Tester
import junit.framework.TestCase;

import org.apache.wicket.util.tester.WicketTester;

import absa.wicket.referenceapplication.IndexPage;
import absa.wicket.referenceapplication.WicketReferenceApplication;

public class TestCore extends TestCase
{
        private WicketTester tester;

        public void setUp()
        {
                // for newsgroup readability
                String webDir = System.getProperty("user.dir") + 
"/src/main/webapp";
                tester = new WicketTester(new WicketReferenceApplication(), 
webDir);
        }

        public void testRenderMyPage()
        {
                //start and render the test page
                 tester.startPage(IndexPage.class);

                //assert rendered page class
                tester.assertRenderedPage(IndexPage.class);

        }

}


Which fails when my getHiveKey in my SWARM Application gets called:

        protected String getHiveKey() {
                String key = (String) 
getServletContext().getInitParameter("hivekey");
                if (key == null) {
                        logger.logp(Level.SEVERE, className, "getHiveKey", 
"Unable to locate
hivekey in web.xml");
                        throw new RuntimeException("Unable to locate hivekey in 
web.xml");
                }
                return key;
        }

Thanks
-- 
View this message in context: 
http://www.nabble.com/WicketTester-not-picking-up-web.xml--tp17510667p17510667.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to