0 Replies Latest reply on Nov 25, 2008 11:37 PM by Raghunath Nandy

    Seam Testing doubts

    Raghunath Nandy Newbie
      Hi ALL,
      I'm working on seam testing.. here is my samples.

      public class CollegeHome{

      Integer id;

      College college;

      //Adtion method
      public void foo(){
      System.out.println(id); //prints id
      System.out.println(college); // problem: prints null
      // will print object

      public CollegeTest extends SeamTest{
      public void testFoo(){
              new FacesRequest(){
                              protected void beforeRequest() {
                                      setParameter("id", "2");
                              protected void updateModelValues()  throws Exception {
                                  College col=new College();
                              //will print value


                       protected void invokeApplication() {
                                      //call action methods here


      Here I have simple test case , my intention here is to inject test data into page context in updateModelValues, and im referring to those in the collegeHome foo() action method.
      Here I'm facing lot of problems .. primarily it's giving

      `@In attribute requires non-null value: collegeHome.college`

      if I chage @In (required=false) , it's not printing null value in foo method.

      My doubt is ,
      1) Is it possible to inject values to different scopes in testing lifecycle
      2) is there any difference in  component lifecycle in testing time and normal time
      3) In which method injection is going to happen in testing lifecycle.

      please bare my doubts.