Return-Path: list-help: list-unsubscribe: List-Post: List-Id: Mailing-List: contact cactus-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list cactus-user@jakarta.apache.org Received: (qmail 12305 invoked from network); 10 Feb 2004 14:04:40 -0000 Received: from unknown (HELO smtp-ft4.fr.colt.net) (213.41.78.203) by daedalus.apache.org with SMTP; 10 Feb 2004 14:04:40 -0000 Received: from vma (host.244.109.41.213.rev.coltfrance.com [213.41.109.244]) by smtp-ft4.fr.colt.net with ESMTP id i1AE4Tu19025 for ; Tue, 10 Feb 2004 15:04:37 +0100 From: "Vincent Massol" To: "'Cactus Users List'" Subject: RE: Assesrtion Failed Error while JSP Testing Date: Tue, 10 Feb 2004 15:04:12 +0100 Message-ID: <072d01c3efde$c999e4b0$2502a8c0@vma> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <20040210070939.9091A3AA42D@ws5-8.us4.outblaze.com> Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi Dinesh, You need to call this JSP somewhere in your test! :-) -Vincent > -----Original Message----- > From: Dinesh N [mailto:gnavsupe@india.com] > Sent: 10 February 2004 08:10 > To: Cactus Users List > Subject: RE: Assesrtion Failed Error while JSP Testing > > > Hi Vincent, > I will give you my JSP which i want to test. > > It is: > > <%@page import="com.arraytest.StringArray"%> > > <% > StringArray stringArray1 = new StringArray(); > stringArray1.add("itemForStringArray1"); > pageContext.setAttribute("stringArray1", > stringArray1); > StringArray stringArray2 = new StringArray(); > stringArray2.add("itemForStringArray2"); > stringArray2.delete(0); > pageContext.setAttribute("stringArray2", stringArray2, > PageContext.SESSION_SCOPE); > StringArray stringArray3 = new StringArray(); > stringArray3.add("itemForStringArray3"); > pageContext.setAttribute("stringArray3Count", > String.valueOf(stringArray3.count()), PageContext.APPLICATION_SCOPE); > %> > > This is JSP wich is doing some StringList Inser add delete operation. And > this "itemForStringArray3Count" and infact all others also i want to > access in TestClass which i mentioned in previous mail. > > In this TestStringArray3() -- I want to test the correct value is returned > and asdet in JSP. > Thats all. Its just preliminary level. > > If you could help me i will be very happy. > > ----- Original Message ----- > From: "Vincent Massol" > Date: Mon, 9 Feb 2004 21:09:19 +0100 > To: "'Cactus Users List'" > Subject: RE: Assesrtion Failed Error while JSP Testing > > > Hi Dinesh, > > > > Can you please show us your test case? The teststringArray3() method > > does not call anything that sets your stringArrya3Count attribute in the > > servlet context. Where is that set? > > > > Thanks > > -Vincent > > > > > -----Original Message----- > > > From: Dinesh N [mailto:gnavsupe@india.com] > > > Sent: 09 February 2004 08:06 > > > To: cactus-user@jakarta.apache.org > > > Subject: Assesrtion Failed Error while JSP Testing > > > > > > Hi Friends, > > > I am new to this technology. I am testing a jsp page which do some > > > operation on java compiled class. > > > > > > Now i have created some test case like: > > > > > > public void teststringArray3() > > > { > > > System.out.println("Value is > > > "+session.getServletContext().getAttribute("stringArray3Count")); > > > assertSame("This should be > > > > > same","1",session.getServletContext().getAttribute("stringArray3Count")) > > ; > > > > > > } > > > > > > ****stringArray3Count is an veriable which is set to proper value in > > JSP > > > Page. > > > > > > But i am not able to access the Value in Test class. It is returning > > NULL. > > > CAn anybody help me...? > > > Please let me know where is problem in my Code or what..? > > > > > > I also tried with. pageContext.include("/test.jsp"); > > > and then pageContext.getAttribute(stringArray3Count()); > > > But still it returns null. > > > > > > After running the Result is: > > > > > > This should be same expected same:<1> was not: > > > > > > junit.framework.AssertionFailedError: This should be same expected > > > same:<1> was not: > > > at: > > > arraytest.StringArrayJSPTest.teststringArray3 > > > > > > CAn anybody tell me what is the problem ? > > > > > > Thanking You, > > > > > > Ragards, > > > Dinesh N. > > > > > > -- > > > India.com free e-mail - www.india.com. > > > Check out our value-added Premium features, such as an extra 20MB for > > mail > > > storage, POP3, e-mail forwarding, and ads-free mailboxes! > > > > > > Powered by Outblaze > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org > > > For additional commands, e-mail: cactus-user-help@jakarta.apache.org > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: cactus-user-help@jakarta.apache.org > > > > > > Thanking You, > > Ragards, > Dinesh N. > > -- > India.com free e-mail - www.india.com. > Check out our value-added Premium features, such as an extra 20MB for mail > storage, POP3, e-mail forwarding, and ads-free mailboxes! > > Powered by Outblaze > > --------------------------------------------------------------------- > To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: cactus-user-help@jakarta.apache.org