I am trying to create a test for a simple Action that needs to retrieve the "configuration" object from ServletContext. I guess what I need to do is create the Configuration object and set it to ServletContext before testing the perform. How do I set anything to ServletContext in StrutsTestcase? ---------------------------------------- Action perform method
I might be wrong. I guess CactusStrutsTestCase extends ServletTestCase which exposes a config object. U can get to the servlet context through the config. config.getServletContext() HTH. I have a question for you. Are u able to get CactusStrutsTestCase to work from within a war file?? It's not workign for me from within a war which is in a ear. Am using strutstest version 1.9.6 Please let me know. I'm not able to automate the daily build bcos of that reason
Joined: Jan 10, 2002
Thanks karthik, I was sure it something like that but just wasn't looking in the right places for the servletcontext. Not quite sure what problem you are running into when "war"ing the project. I war'd my project and deployed to another context and ran my /ServletTestRunner. Went ok. Have you tried manually deploying the war, instead of having deployed from ear?