jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@pivolis.com>
Subject RE: Error running test from ant [ejb testing]
Date Fri, 29 Aug 2003 11:47:47 GMT
Hi Anthony,

I believe this is a known problem with Cactus and JBoss 4. It seems
JBoss is using an old version of Commons-httpclient and Cactus has been
compiled with a newer version. Hence the error. The solution is to
replace JBoss 4 version of commons-httpclient  by cactus’s.

Thanks
-Vincent

-----Original Message-----
From: Anthony Cheung [mailto:crosscourt_ac@yahoo.com] 
Sent: 29 August 2003 10:56
To: cactus-user@jakarta.apache.org
Subject: Error running test from ant [ejb testing]

Hi,
 
I am getting the following errors for my first cactus test case and i
don't know whats going on.
 
I am using jboss4 which i start manually and i have placed the jar files
and tdstest.war into the deployment directory.
 
This is probably something simple like a classpath problem but i have no
idea.
 
===============================================
test:
   [cactus] Testsuite: tds.tests.UserValidatorTest
   [cactus] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.313
sec
   [cactus] Testcase:
testValidation(com.cmcrc.tds.tests.UserValidatorTest):    Caused an
ERROR
   [cactus]
org.apache.commons.httpclient.HttpMethod.setRequestHeader(Ljava/lang/Str
ing;Ljava/lang/String;)V
   [cactus] java.lang.NoSuchMethodError:
org.apache.commons.httpclient.HttpMethod.setRequestHeader(Ljava/lang/Str
ing;Ljava/lang/String;)V
   [cactus]     at
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.dispa
tch50_connect(HttpClientConnectionHelper.java;org/apache/cactus/util/log
/LogAspect.aj[1k]:152)
   [cactus]     at
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.aroun
d50_connect(HttpClientConnectionHelper.java;org/apache/cactus/util/log/L
ogAspect.aj[1k]:1240)
   [cactus]     at
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.conne
ct(HttpClientConnectionHelper.java;org/apache/cactus/util/log/LogAspect.
aj[1k]:114)
   [cactus]     at
org.apache.cactus.client.connector.http.DefaultHttpClient.callRunTest(De
faultHttpClient.java;org/apache/cactus/util/log/LogAspect.aj[1k]:201)
   [cactus]     at
org.apache.cactus.client.connector.http.DefaultHttpClient.dispatch49_doT
est(DefaultHttpClient.java;org/apache/cactus/util/log/LogAspect.aj[1k]:1
19)
   [cactus]     at
org.apache.cactus.client.connector.http.DefaultHttpClient.around49_doTes
t(DefaultHttpClient.java;org/apache/cactus/util/log/LogAspect.aj[1k]:124
0)
   [cactus]     at
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest(Default
HttpClient.java;org/apache/cactus/util/log/LogAspect.aj[1k]:115)
   [cactus]     at
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runWebTest(W
ebClientTestCaseDelegate.java;org/apache/cactus/util/log/LogAspect.aj[1k
]:334)
   [cactus]     at
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runGenericTe
st(WebClientTestCaseDelegate.java;org/apache/cactus/util/log/LogAspect.a
j[1k]:282)
   [cactus]     at
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runTest(WebC
lientTestCaseDelegate.java;org/apache/cactus/util/log/LogAspect.aj[1k]:2
58)
   [cactus]     at
org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:289)
   [cactus]     at
org.apache.cactus.ServletTestCase.runBare(ServletTestCase.java:251)
 
===============================================
cactus.properties:
 
cactus.contextURL = http://localhost:8080/tdstest
 
===============================================
 
<web-app>
    <servlet>
      <servlet-name>ServletRedirector</servlet-name>
     
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-c
lass>
    </servlet>
 
    <servlet>
      <servlet-name>ServletTestRunner</servlet-name>
     
<servlet-class>org.apache.cactus.server.runner.ServletTestRunner</servle
t-class>
    </servlet>
    <servlet-mapping>
      <servlet-name>ServletRedirector</servlet-name>
      <url-pattern>/ServletRedirector</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
      <servlet-name>ServletTestRunner</servlet-name>
      <url-pattern>/ServletTestRunner</url-pattern>
    </servlet-mapping>
    <ejb-local-ref>
      <ejb-ref-name>ejb/user/UserValidator</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      <local-home>tds.interfaces.UserValidatorLocalHome</local-home>
      <local>tds.interfaces.UserValidatorLocal</local>
      <ejb-link>TDS.jar#user/UserValidator</ejb-link>
    </ejb-local-ref>
</web-app>
===============================================
build.xml
 
<target name="test.prepare" depends="dist, compile.cactus">
  
    <!-- Cactify the web-app archive -->
    <cactifywar srcfile="${dist.dir}/${ant.project.name}.war"
        destfile="${dist.dir}/tdstest.war"
        mergewebxml="${src.webapp.dir}/WEB-INF/cactus-web.xml">
      <classes dir="${build.classes.dir}">
        <include name="**/tests/**" />
        <exclude name="/webapp"/>
      </classes>
      <!-- <lib file="${httpunit.jar}"/> -->
    </cactifywar>
    <!-- Prepare the directories for the JUnit reports -->
    <mkdir dir="${build.testreports.dir}"/>
    
    <ear destfile="${dist.dir}/tds.ear"
appxml="${resources.dir}/ear/META-INF/application.xml">
      <fileset dir="${dist.dir}" includes="*.jar,*.war"/>
    </ear>
 
  </target>
  <!-- depends="test.prepare" -->
  <target name="test" depends="test.prepare"
      description="Run the tests on the defined containers">
    <!-- Run the tests -->
    <cactus warfile="${dist.dir}/tdstest.war" fork="yes"
        failureproperty="tests.failed">
      <classpath>
        <path refid="classpath"/>
        <pathelement location="${build.classes.dir}"/>
        <pathelement location="${resources.dir}/properties"/>
      </classpath>
      <!--
      <containerset>
        <generic name="jboss4">
          <startup target="jboss.start"/>
          <shutdown target="jboss.stop"/>
        </generic>
      </containerset>
      -->
      
      <formatter type="brief" usefile="false"/>
      <formatter type="xml"/>
            
      <batchtest>
        <fileset dir="${src.dir}">
          <include name="**/tests/*Test*.java"/>
          <exclude name="**/tests/Test*All.java"/>
        </fileset>
      </batchtest>
      
    </cactus>
    <!-- Generate the JUnit reports
    <junitreport todir="${build.testreports.dir}">
      <fileset dir="${target.testreports.dir}"
          includes="TEST-*.xml"/>
      <report todir="${target.testreports.dir}"
          format="frames"/>
    </junitreport>
     -->
    <fail if="tests.failed">At least one test failed!</fail>
  </target>
===============================================
 
thanks

Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger


Mime
View raw message