You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ca...@usitc.gov on 2006/12/16 03:43:53 UTC
accesing a in code and testing
A page, lets call is PageX, uses a bean with request scope.
The beans configuration requires something more complex that what is
allowed by the lightweight initialization -- so using the annotation is
out. I use the <bean> element in the page specification with a series
of <set> elements.
Now I need to access to the bean in the page's java class . . . And of
course I would like to test it. I can't fine a way to use the @Bean or
@InjectObject annotation I fall back on getBeans().
However, it is pretty awkward to test. My tests must include a nested
subclass of PageX that includes an abstract public abstract
IBeanProvider getBeans() method to trip the Creator into enhancing both
the dummy setter as well as the getter. I use this to exercise the code
in question with a mock IBeanProvider.
Is there a easier way to accomplish this? Can I use an existing
annotation to gain access to a bean defined in the specification file -
similar to @InjectComponent?
Carlos
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org