IngoHofmann
|
Posted: May 25, 2009 14:42 by IngoHofmann
|
|
Hi, For some test cases I would like to have the possibility to "reset" the faces context. Until, I guess, release 0.2 I could invoke: facesTester.getFacesTester() .. what always created a new context. Now you fixed the mistakable behavior of this method (what is a good idea, actually). However, my tests don't run green any more. ![]() How do I "reset" the faces context now, without initializing the whole other stuff? If there is no way, a method like this would be awesome: public FacesContext createNewFacesContext() { return facesContextBuilder.createFacesContext("/dummyPage.xhtml", "GET", lifecycle); } Greets, Ingo |
"Reset" the faces context
Replies: 7 - Last Post: May 29, 2009 07:22
by: IngoHofmann
by: IngoHofmann
showing 1 - 8 of 8
IngoHofmann
|
Posted: May 26, 2009 14:37 by IngoHofmann
|
|
I am sorry: facesTester.getFacesTester() should mean: facesTester.getFacesContext() |
Jason Lee
|
Posted: May 28, 2009 13:54 by Jason Lee
|
|
I typically create a new FacesTester object for each test. The Mojarra initialization is done only on the first instantiation, so subsequent creations are very quick: @Before public void setUp() { facesTester = new FacesTester(); } Seems to do the trick for me. |
IngoHofmann
|
Posted: May 28, 2009 14:47 by IngoHofmann
|
| Hmm, in our case not that suitable. However, we could already change our tests, so a "reset" wasn't really necessary. |
IngoHofmann
|
Posted: May 28, 2009 16:05 by IngoHofmann
|
|
Since the FacesTester does not pass the requests through our filters, I tinkered a sort of facade that, more or less, do that. The FacesTester itself must be initialized only once by using the @BeforeClass annotation (instead of @Before). A better solution is just to get listeners and filters working.
|
IngoHofmann
|
Posted: May 29, 2009 07:22 by IngoHofmann
|
| thumbs up! |
showing 1 - 8 of 8
Replies: 7 - Last Post: May 29, 2009 07:22
by: IngoHofmann
by: IngoHofmann



how that's not suitable? I'd like to understand your situation to see if we can come up with a better solution WRT the FacesTester code.




