Hello,
Further to my previous mail , under the same test case I get a
"javax.servlet.ServletException: Error instanciating class
[TestJspTestCase]" error. Again the sceanrios are the same but the
exception name is different.
The StackTrace is so big that I thought it would be better to attach
the text file, archived as zip file. So herewith I have attached a
zip file which contains the TestJspTestCase.java and
InstanceError.txt . Now is there anything wrong with the path of the
file I am referring to ?
I have described the scenario again below.
--- Vincent Massol <[EMAIL PROTECTED]> wrote:
> > > I think what you want to write is :
> > >
> > > public class MyJspTest extends JspTestCase
> > > {
> > > public void testXXX()
> > > {
> > > pageContext.forward("/some/path/myjsp.jsp");
> > >
> > > // (optional) assert values that the JSP would put in the
> > > // session or pageContext or servlet context scope. In your
> > > // example, there are none.
>
> assertEquals("some value", session.getAttribute("some name"));
>
> > > }
Hello I tried the pageContext forwarding as suggested above.
Let me elaborate on that.
My TestJspTestCase.java looked something like this.
public void beginOut(ServletTestRequest str) throws Exception {
}
public void testOut() throws IOException, ServletException {
pageContext.forward("/examplesWebApp/hello.jsp" );
assertEquals( pageContext.getAttribute("name") , "RED" ) ;
}
public void endOut(ServletTestRequest theConnection) throws
IOException {
}
HELLO.JSP:
<body>
<% session.putAttribute("name","Red" ) %>
...
</body>
What I am trying to do here is that I set some attribute in the
session context and am trying to assert in the server. ( in testXX()
i.e. testOut() method ) .
I use WebLogic v6.1 under WinNT v4.0 and I place the
TestJspTestCase.class in /wlserver6.1/config/examples/serverclasses
because it is in CLASSPATH of the server. Also I place hello.jsp
mentioned in the TestCase in
wlserver6.1/config/examples/applications/examplesWebApp .
As mentioned already I get a Instantiating error.
Where have I possibly gone wrong ?
Can somebody help me ?
Thanks.
=====
Thanks.
Rakesh Bhalla.
__________________________________________________
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/
InstanceError.zip