2 Replies Latest reply on Sep 24, 2009 9:45 AM by shantha

    TestNG

    shantha
      HI all,



      I am having a problem when I run TestNG using new facesRequest().The system.out.println mentioned in the methods below code snippet is not displayed

      @Test
              public void test_test() {
                      System.out.println("Testing in Seam style");
                      try {
                              new FacesRequest() {
                                      @Override
                                      protected void updateModelValues() throws Exception {
                                  
                                              System.out.println(" in updatemodel");
                                      }

                                      @SuppressWarnings("unchecked")
                                      @Override
                                      protected void invokeApplication() {
                                              System.out.println("FacesRequest1");
                                              setValue("#{user.username}", "1ovthafew");
                                              setValue("#{user.name}", "Gavin King");
                                              setValue("#{user.password}", "secret");
                                              System.out.println(" in Invoke");
                                              invokeMethod("#{register.register}");
                                      }

                                      @Override
                                      protected void renderResponse() throws Exception {

                                      }

                              }.run();
                      } catch (Exception e) {
                              e.printStackTrace();
                      }
              }
      }



      But on console the test results shows as passed.My concern is why is the control not passed inside the methods to display the system.out.println

      Below is the result I am getting when I run it.

        [testng] ===============================================
         [testng] Testing in Seam style
         [testng] PASSED: test_""test
         [testng] ===============================================


      Please let me know if I am missing something
        • 1. Re: TestNG
          shantha
          Adding furthur to it, My application is running on weblogic.
          And when I run the same testcase using new ComponentTest() the system.out.println till the method call is displayed.

          try {
                          new ComponentTest() {
                 
                                  protected void testComponents() throws Exception {
                                          System.out.println("in Test compinets *************");
                                     setValue("#{user.username}", "1ovthafew");
                                      setValue("#{user.name}", "Gavin King");
                                      setValue("#{user.password}", "secret");
                                           System.out.println(" in Invoke");
                                       invokeMethod("#{register.register}");
                                  }
                          }.run();
                  }catch (Exception e){
                          e.printStackTrace();
                  }


          Why is new FacesRequest not working?
          • 2. Re: TestNG
            shantha
            adding furthur to it,My applciation is on weblogic.
            And when I use the following way to write testcase,the systemouts and are displayed

            try {
                      new ComponentTest() {
                 
                           protected void testComponents() throws Exception {
                                System.out.println("in Test compinets *************");
                                 setValue("#{user.username}", "1ovthafew");
                                  setValue("#{user.name}", "Gavin King");
                                  setValue("#{user.password}", "secret");
                                    System.out.println(" in Invoke");
                                   invokeMethod("#{register.register}");
                           }
                      }.run();
                 }catch (Exception e){
                      e.printStackTrace();
                 }

            Is there anything missing?