You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by "Patwa, Priyank (Cognizant)" <PP...@pun.cognizant.com> on 2003/12/05 11:03:41 UTC

AbstractWebTestCaller - -Error instantiating class for JspTestCase


 
Hi,
    i am trying to write a sample code for JspTestCase ...
I have the cactus 1.5 jars (latest vewrsion) in my lib and am using Websphere 4.0 
i had earlier writtena code with simialr config for CactusStrutsTestCase which is working fine.
 
Now to start with jspTestCase i hae written the following sample code
 
 
public class TestJspOut extends JspTestCase 
{
      public TestJspOut(String theName) {
        super(theName);
      }
 
     public static Test suite() {
       return new TestSuite(TestJspOut.class);
     }
 
     public void beginOut(WebRequest theRequest)throws IOException  {
         theRequest.setURL("localhost", "/cac", "/test.jsp", null,
                 null);
     }
 

     public void testOut() throws IOException {
        assertEquals("/test.jsp", request.getRequestURI());
        assertEquals("localhost", request.getServerName());
        assertEquals(9080, request.getServerPort());
    }
 
}
 
 
when i 

Thanx & Regards, 
Priyank Patwa. 
Cognizant Technology Solutions India Pvt. Ltd. 
Infotech Park, 
Hinjawadi, 
Pune 411027, 
India. 
Ph. 2931100 extn: 2476 

 


RE: AbstractWebTestCaller - -Error instantiating class for JspTestCase

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Patwa,

You do realize you have not asked any question, right? :-)

Thanks
-Vincent

-----Original Message-----
From: Patwa, Priyank (Cognizant) [mailto:PPriyank@pun.cognizant.com] 
Sent: 05 December 2003 11:04
To: cactus-user@jakarta.apache.org
Subject: AbstractWebTestCaller - -Error instantiating class for
JspTestCase




Hi,
    i am trying to write a sample code for JspTestCase ...
I have the cactus 1.5 jars (latest vewrsion) in my lib and am using
Websphere 4.0 
i had earlier writtena code with simialr config for CactusStrutsTestCase
which is working fine.
 
Now to start with jspTestCase i hae written the following sample code
 
 
public class TestJspOut extends JspTestCase 
{
      public TestJspOut(String theName) {
        super(theName);
      }
 
     public static Test suite() {
       return new TestSuite(TestJspOut.class);
     }
 
     public void beginOut(WebRequest theRequest)throws IOException  {
         theRequest.setURL("localhost", "/cac", "/test.jsp", null,
                 null);
     }
 

     public void testOut() throws IOException {
        assertEquals("/test.jsp", request.getRequestURI());
        assertEquals("localhost", request.getServerName());
        assertEquals(9080, request.getServerPort());
    }
 
}
 
 
when i 
Thanx & Regards, 
Priyank Patwa. 
Cognizant Technology Solutions India Pvt. Ltd. 
Infotech Park, 
Hinjawadi, 
Pune 411027, 
India. 
Ph. 2931100 extn: 2476 
 


Re: AbstractWebTestCaller - -Error instantiating class for JspTestCase

Posted by Christopher Lenz <cm...@gmx.de>.
Am 05.12.2003 um 17:17 schrieb Bret Kumler:
> I think
>
> public static Test suite() {
>        return new TestSuite(TestJspOut.class);
>      }
>
> needs to be
>
>
>   public static Test suite() {
>        return new ServletTestSuite(TestJspOut.class);
>      }

Nope, ServletTestSuite is only needed for test cases that do not derive 
from ServletTestCase, JspTestCase or FilterTestCase. The intent is to 
allow "plain" JUnit test cases to be executed inside of the J2EE 
container, where they have access to the JNDI context and so forth.

--
Christopher Lenz
/=/ cmlenz at gmx.de

>   -----Original Message-----
>   From: Patwa, Priyank (Cognizant) [mailto:PPriyank@pun.cognizant.com]
>   Sent: Friday, December 05, 2003 2:04 AM
>   To: cactus-user@jakarta.apache.org
>   Subject: AbstractWebTestCaller - -Error instantiating class for
> JspTestCase
>
>   Hi,
>       i am trying to write a sample code for JspTestCase ...
>   I have the cactus 1.5 jars (latest vewrsion) in my lib and am using
> Websphere 4.0
>   i had earlier writtena code with simialr config for 
> CactusStrutsTestCase
> which is working fine.
>
>   Now to start with jspTestCase i hae written the following sample code
>
>
>   public class TestJspOut extends JspTestCase
>   {
>         public TestJspOut(String theName) {
>           super(theName);
>         }
>
>        public static Test suite() {
>          return new TestSuite(TestJspOut.class);
>        }
>
>        public void beginOut(WebRequest theRequest)throws IOException  {
>            theRequest.setURL("localhost", "/cac", "/test.jsp", null,
>                    null);
>        }
>
>
>        public void testOut() throws IOException {
>           assertEquals("/test.jsp", request.getRequestURI());
>           assertEquals("localhost", request.getServerName());
>           assertEquals(9080, request.getServerPort());
>       }
>
>   }


RE: AbstractWebTestCaller - -Error instantiating class for JspTestCase

Posted by Bret Kumler <bk...@firstam.com>.
I think

public static Test suite() {
       return new TestSuite(TestJspOut.class);
     }

needs to be


  public static Test suite() {
       return new ServletTestSuite(TestJspOut.class);
     }
  -----Original Message-----
  From: Patwa, Priyank (Cognizant) [mailto:PPriyank@pun.cognizant.com]
  Sent: Friday, December 05, 2003 2:04 AM
  To: cactus-user@jakarta.apache.org
  Subject: AbstractWebTestCaller - -Error instantiating class for
JspTestCase





  Hi,
      i am trying to write a sample code for JspTestCase ...
  I have the cactus 1.5 jars (latest vewrsion) in my lib and am using
Websphere 4.0
  i had earlier writtena code with simialr config for CactusStrutsTestCase
which is working fine.

  Now to start with jspTestCase i hae written the following sample code


  public class TestJspOut extends JspTestCase
  {
        public TestJspOut(String theName) {
          super(theName);
        }

       public static Test suite() {
         return new TestSuite(TestJspOut.class);
       }

       public void beginOut(WebRequest theRequest)throws IOException  {
           theRequest.setURL("localhost", "/cac", "/test.jsp", null,
                   null);
       }


       public void testOut() throws IOException {
          assertEquals("/test.jsp", request.getRequestURI());
          assertEquals("localhost", request.getServerName());
          assertEquals(9080, request.getServerPort());
      }

  }


  when i
  Thanx & Regards,
  Priyank Patwa.
  Cognizant Technology Solutions India Pvt. Ltd.
  Infotech Park,
  Hinjawadi,
  Pune 411027,
  India.
  Ph. 2931100 extn: 2476