ActionBeanContext has a bogus toString
--------------------------------------

                 Key: STS-712
                 URL: http://www.stripesframework.org/jira/browse/STS-712
             Project: Stripes
          Issue Type: Bug
          Components: Context Management
    Affects Versions: Release 1.5.1
         Environment: java 1.6
            Reporter: Rusty Wright


If I use the built in toString and subclass ActionBeanContext, when I log the 
ActionBeanContext I get

DEBUG: 10:44:14,021: 
com.objecteffects.sample.web.action.TestStartActionBean.submitTest(TestStartActionBean.java:77):
 context: ActionBeanContext{eventName='submit', validationErrors={}}

But it's telling me that it's the wrong class.  My ActionBeanContext subclasses 
my abstract BaseActionBeanContext;

class StartActionBeanContextFake extends BaseActionBeanContext {

When I add toString to my BaseActionBeanContext:

  import org.apache.commons.lang.builder.ReflectionToStringBuilder;
  ...
   @Override
    public String toString() {
        return (new ReflectionToStringBuilder(this).toString());
    }

Then the log message shows the correct class:

DEBUG: 10:48:34,460: 
com.objecteffects.sample.web.action.TestStartActionBean.submitTest(TestStartActionBean.java:77):
 context: 
com.objecteffects.sample.web.action.startactionbeancontextf...@4865ce[desireddate=com.objecteffects.sample.domain.desireddate@d3c6a3[year=2009,month=2,day=3],request=net.sourceforge.stripes.controller.stripesrequestwrap...@1d95da8,response=net.sourceforge.stripes.mock.mockhttpservletrespo...@193f6e2,servletcontext=net.sourceforge.stripes.mock.mockservletcont...@1385660,eventName=submit,validationErrors={}]

This is important when you're testing and you need to be sure that the correct 
ActionBeanContext class was used.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to