jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From PUTHENVILA P Johnson <PJohn...@qtech.com.au>
Subject Re: Help: Error during running cactus testclass
Date Tue, 03 Feb 2004 22:50:36 GMT
Hi Dinesh,
It is the problem with ur classpath and also include the cactus.properties 
file dir in your classpath "not the file".You have to add the jar files 
comes along with cactus.
Johnson




"Dinesh N" <gnavsupe@india.com> 
03/02/2004 10:49 PM
Please respond to
"Cactus Users List" <cactus-user@jakarta.apache.org>


To
"'Cactus Users List'" <cactus-user@jakarta.apache.org>
cc

Subject
Help: Error during running  cactus testclass






Hi Friends,

While Running Testcase, I am facing following problems,'
 
1)  I had writing testcase for Cactus as bellow  and Run it gives me
an error as,
                                        " 
junit.framework.AssertionFailedError:
Exception in constructor: testStringArrayJSPTest
(java.lang.NoClassDefFoundError:
 
org/apache/commons/httpclient/HttpMethod"

2) If I add Lib File  commons-httpclient-2.0-rc2.jar in classpath
above error get removed and i got new one as,
 
"org.apache.cactus.util.ChainedRuntimeException: Missing Cactus
property [cactus.contextURL]" 

If  I use the same compiled class file of code in  classes folder of
WEB-INF and tried to check. it gives Success as a result.
Can you tell me Is there any problem in code..Or class path library
problem?

The Code I started with:

import junit.framework.Test;
import junit.framework.TestSuite;

import org.apache.cactus.JspTestCase;
import org.apache.cactus.WebRequest;
import org.apache.cactus.WebResponse;


public class StringArrayJSPTest extends JspTestCase {

 public void beginStringArrayJSPTest(WebRequest request){
 
  }
 
  public StringArrayJSPTest()
  {
                 super();
  }
 
 
  public void testStringArrayJSPTest(){
 
                 try{
 
                           pageContext.include("/StringArrayJSP.jsp");
                                   int mVal =
((StringArray)pageContext.getAttribute("stringArray1")).count();

                           System.out.println("This"+mVal);
                                   assertEquals("The Function should Add 
ELement
Properly",3,mVal);
 
                 }
                 catch(Exception ex)
                 {
                                 System.out.println("Exception: "+ 
ex.getMessage());
                 }
 
  }
 
  public void endStringArrayJSPTest(WebResponse responce){
 
  }
 
 
  public void setUP(){
                 System.out.println("Before Test");
 
  }
 
  public void tearDown(){
                 System.out.println("After Test");
  }
 
  public static void main(String[] theArgs)
                  {
                                  junit.awtui.TestRunner.main(new String[]
{StringArrayJSPTest.class.getName()});
                  }


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

}


CAn anybody help me..? 
If possible please tell me how we are using client side lib file.
Where we store those?

Thanking You,

Ragards,
Ganesh 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



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message