You mean this static block right?
> // This static block ensures that Spring's BeanFactory is only loaded
> // once for all tests
> static {
>
> String pkg =
> ClassUtils.classPackageAsResourcePath(Constants.class);
> String[] paths = {
> "classpath*:/" + pkg + "/dao/applicationContext-*.xml",
> "classpath*:META-INF/applicationContext-*.xml",
> "/WEB-INF/applicationContext-validation.xml",
> "/WEB-INF/action-servlet.xml"
> };
>
> ctx = new XmlWebApplicationContext();
> ctx.setConfigLocations(paths);
> ctx.setServletContext(new MockServletContext(""));
> ctx.refresh();
> }
>
Matt Raible-3 wrote:
>
> Are you loading the action-servlet.xml in your BaseControllerTestCase?
> That seems strange that it's not being initialized by Spring. I
> suspect it's something minor, like a typo or something.
>
> Matt
>
> On 1/22/07, maskkkk <[EMAIL PROTECTED]> wrote:
>>
>> Why is it that none of the properties are getting set inside of my
>> Controller
>> when I retrieve it from the WebApplicationContext, inside a unit test?
>>
>> (Appfuse 1.9.4)
>>
>>
>> My Controller Unit Test wrote:
>> >
>> > protected void setUp() throws Exception {
>> > // needed to initialize a user
>> > super.setUp();
>> > c = (MCPMainPageController)
>> ctx.getBean("mcpMainPageController");
>> >
>> > // For whatever reason, the commandName is not getting set...
>> > c.setCommandName("mainPageControllerForm");
>> >
>> > // (and none of the other values are either...
>> >
>> > appStateLoadListener = new AppStateSessionLoadListener();
>> > }
>> >
>>
>>
>> action-servlet.xml wrote:
>> >
>> > <!-- Main Page Controller and Associated Beans -->
>> > <bean id="mcpMainPageController"
>> > class="com.app.MCPMainPageController">
>> > <property name="environmentManager" ref="environmentManager"/>
>> > <property name="logEntryManager" ref="logEntryManager"/>
>> > <property name="commandClass"
>> > value="com.app.commandobject.McpMainPageControllerForm"/>
>> > <property name="commandName"
>> value="mainPageControllerForm"/>
>> > <property name="successView"
>> value="redirect:/mcp_main_page.html" />
>> > <!-- successView is redirected to a URL -->
>> > <property name="formView" value="index_mcp"/> <!--
>> Formview is
>> > redirected to a tiles definition -->
>> > </bean>
>> >
>> --
>> View this message in context:
>> http://www.nabble.com/Controller-Values-not-gettting-set-in-JUnit-test.-tf3058989s2369.html#a8505403
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> http://raibledesigns.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Controller-Values-not-gettting-set-in-JUnit-test.-tf3058989s2369.html#a8506852
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]