1 Reply Latest reply on Aug 11, 2008 11:31 AM by gerry N/A

    JSFUnit

    gerry N/A Newbie

      Hi
      I am using JSFUniit with ant and am getting an error message "ViewBankDetailsTest (wrong name: uk/co/slc/cst/jsfunit/ViewBankDetailsTest)" coming out when the script runs the tests.

      Can anyone offer any ideas as to what I am doing wrong?

      Thanks

      Gerry


      This is the build.xml

      
      <?xml version="1.0" encoding="windows-1252" ?>
      <project basedir="." default="default" xmlns:oracle="antlib:oracle" xmlns="antlib:org.apache.tools.ant">
      
      <!-- ========================================================== -->
      <!-- build properties -->
      <!-- ========================================================== -->
      <property name="work.files" value="c:/workingfiles" />
      <property name="war.src.dir" value="${work.files}/CST/Applications/Desktop-Applications/cst-bankdetails-war/target"/>
      <property name="ear.src.dir" value="${work.files}/CST/Applications/Desktop-Applications/cst-bankdetails-ear/target"/>
      <property name="lib.dir" value="${ant.home}/lib/jsfunit" />
      <property name="maven.dir" value="${work.files}/Maven" />
      
      <!-- ========================================================== -->
      <!-- jsfunit target dir -->
      <!-- ========================================================== -->
      <property name="jsfunit.target" value="${work.files}/jsfunit-target" />
      
      <!-- ========================================================== -->
      <!-- war and ear properties -->
      <!-- ========================================================== -->
      <property name="jsf.dir" value="${work.files}/jsfunit-target" />
      <property name="cst.war" value="${war.src.dir}/cst-bankdetails-war" />
      <property name="jsf.cst.war" value="${work.files}/jsfunit-target/war" />
      <property name="jsf.cst.war.web-inf" value="${jsf.cst.war}/WEB-INF" />
      <property name="jsf.cst.war.lib" value="${jsf.cst.war}/WEB-INF/lib" />
      <property name="jsf.cst.ear" value="${work.files}/jsfunit-target/ear" />
      <property name="war.dest" value="${jsf.cst.war}/cst-bankdetails-war-0.1.war" />
      <property name="ear.dest" value="${jsfunit.target}/cst-bankdetails-ear-0.1.ear" />
      <property name="meta-inf" value="${work.files}/CST/Applications/Desktop-Applications/cst-bankdetails-ear/src/conf/META-INF" />
      <property name="meta-inf-web.manifest" value="${work.files}/tmp/wars/cst-bankdetails-war/META-INF/MANIFEST.MF" />
      <property name="jsf.cst.ear.appxml" value="${meta-inf}/application.xml" />
      <property name="remote.jsfunit.lib" value="F:/.maven/repository/jsfunit-jars" />
      
      <!-- ========================================================== -->
      <!-- deploy properties -->
      <!-- ========================================================== -->
      <property name="oc4j.deploy.ormi" value="" />
      <property name="application.name" value="cst-bankdetails-ear-0.1" />
      <property name="oracle.home.dir" value="C:/oracle/oc4j10.1.3.3.0/j2ee/home" />
      <property name="deployer.uri" value="deployer:oc4j:localhost" />
      <property name="app.name" value="cst-bankdetails-ear-0.1" />
      <property name="web.name" value="cst-bankdetails-war-0.1" />
      <property name="oc4j.binding.module" value="default-web-site" />
      <property name="oc4j.admin.port" value="23791" />
      <property name="oc4j.admin.user" value="oc4jadmin" />
      <property name="oc4j.http.port" value="8888" />
      <property name="oc4j.admin.password" value="password" />
      <property name="oc4j.host" value="localhost" />
      
      <!-- ========================================================== -->
      <!-- test properties -->
      <!-- ========================================================== -->
      <property name="test.lib.dir" value="${oracle.home.dir}/applications/cst-bankdetails-ear-0.1/cst-bankdetails-war-0.1/WEB-INF/lib" />
      <property name="test.classes" value="${oracle.home.dir}/applications/cst-bankdetails-ear-0.1/cst-bankdetails-war-0.1/WEB-INF/classes/uk/co/slc/cst/jsfunit" />
      <property name="test.url" value="${oc4j.host}:${oc4j.http.port}/BankDetails/ServletTestRunner?suite=uk.co.slc.cst.jsfunit" />
      <property name="junit.xml.dir" value="${oracle.home.dir}/junit-report" />
      <property name="junit.report.file" value="cactus-report.xsl" />
      <property name="report.junit-test.dir" value="C:/junit-report"/>
      
       <!-- ========================================================== -->
       <!-- jsfunit.exploded.war target -->
       <!-- ========================================================== -->
       <target name="jsfunit.exploded.war" depends="clean" description="builds a JSFUnified war from the out put of the maven goal local-build">
       <echo>Running jsfunit exloded war target</echo>
      
       <taskdef
       name="jsfunitwar"
       classname="org.jboss.jsfunit.ant.JSFUnitWarTask"/>
      
       <jsfunitwar srcfile="${cst.war}" destfile="${jsf.cst.war}" autoAddJars="false">
       <lib dir="${remote.jsfunit.lib}">
       <include name="*.jar"/>
       </lib>
      
       <TestRunner/>
       </jsfunitwar>
       </target>
      
       <!-- ========================================================== -->
       <!-- test.war target -->
       <!-- ========================================================== -->
       <target name="test.war" depends="jsfunit.exploded.war" description="builds a test war file from the JSFUnified war">
       <echo>Running test.war target</echo>
      
       <war destfile="${war.dest}" webxml="${jsf.cst.war}/WEB-INF/web.xml" manifest="${meta-inf-web.manifest}">
       <fileset dir="${jsf.cst.war}"/>
       </war>
      
       <copy todir="${jsf.cst.war}/WEB-INF/classes/uk/co/slc/cst/jsfunit">
       <fileset dir="${jsf.cst.war}/WEB-INF/classes/uk/co/slc/cst/jsfunit">
       <include name="**/*.class"/>
       </fileset>
       </copy>
      
       </target>
      
      
       <!-- ========================================================== -->
       <!-- test.ear target -->
       <!-- ========================================================== -->
       <target name="test.ear" depends="test.war" description="builds an ear file from the test war">
      
       <echo>${maven.dir}</echo>
       <echo>${jsf.cst.ear}</echo>
       <echo>${jsf.cst.ear.appxml}</echo>
      
       <!--<ear destfile="${jsf.cst.ear}/cst-bankdetails.ear" appxml="${jsf.cst.ear.appxml}">-->
       <!--temp destination file-->
       <ear destfile="${ear.dest}" appxml="${jsf.cst.ear.appxml}">
      
       <fileset dir="${work.files}/tmp/ears/cst-bankdetails-ear" includes="*.**" excludes="**/*.war"/>
      
       <!-- now copy the JSFUnified war into the ear-->
       <fileset dir="${jsf.cst.war}">
       <include name="*.war"/>
       </fileset>
      
       <!-- include the orion-application.xml -->
       <metainf dir="${meta-inf}">
       <include name="orion-application.xml"/>
       </metainf>
       </ear>
       </target>
      
      
       <!-- ========================================================== -->
       <!-- clean target -->
       <!-- ========================================================== -->
       <target name="clean" description="cleans the jsfunit-target directory">
       <echo>Running clean target</echo>
       <delete dir="${jsf.dir}/war" />
       <delete file="${jsf.dir}/cst-bankdetails-ear-0.1.ear" />
       <!--<delete dir="${jsf.cst.ear}" />-->
       </target>
      
      
       <!-- ========================================================== -->
       <!-- deploy.test.app target -->
       <!-- ========================================================== -->
       <target name="deploy.test.app" depends="test.ear"
       description="Deploys the test ear to oc4j - NOTE** OC$J MUST BE RUNNING!!">
      
       <echo>Running deploy.test.app </echo>
       <oracle:deploy
       deployerUri="${deployer.uri}"
       userid="${oc4j.admin.user}"
       password="${oc4j.admin.password}"
       file="${ear.dest}"
       deploymentname="${app.name}" />
      
       <oracle:bindWebApp
       deployerUri="${deployer.uri}"
       userid="${oc4j.admin.user}"
       password="${oc4j.admin.password}"
       deploymentName="${app.name}"
       webModule="cst-bankdetails-war-0.1"
       webSiteName="default-web-site"
       contextRoot="/BankDetails"/>
      
       </target>
      
       <!-- ========================================================== -->
       <!-- start.oc4j target -->
       <!-- ========================================================== -->
       <target name="start.oc4j" depends="deploy.test.app" description="starts your local oc4j instance">
       <oracle:shutdownServer
       deployerUri="${deployer.uri}"
       userid="${oc4j.admin.user}"
       password="${oc4j.admin.password}"/>
       </target>
      
       <!-- ========================================================== -->
       <!-- stop.oc4j target -->
       <!-- ========================================================== -->
       <target name="stop.oc4j" depends="test.ear" description="stops your local oc4j instance">
       <oracle:shutdownServer debug="true"
       deployerUri="${deployer.uri}"
       userid="${oc4j.admin.user}"
       password="${oc4j.admin.password}"/>
       </target>
      
      
       <!-- ========================================================== -->
       <!-- test.classpath -->
       <!-- ========================================================== -->
       <path id="test.classpath">
       <pathelement path="${test.lib.dir}" />
       <pathelement path="${test.classes}" />
       <pathelement path="${oracle.home.dir}/${app.name}" />
       </path>
      
      
      
       <!-- ========================================================== -->
       <!-- run.full.suite target -->
       <!-- ========================================================== -->
       <target name="run.full.suite" depends="">
      
       <echo>${test.classes}</echo>
      
       <junit showoutput="yes"
       fork="yes"
       printsummary="yes"
       haltonfailure="no"
       haltonerror="no">
      
       <classpath>
       <path refid="test.classpath"/>
       </classpath>
      
       <jvmarg value="-Dcactus.contextURL=http://${test.url}" />
      
       <formatter type="xml" />
      
       <!--<test name="uk.co.slc.cst.jsfunit.ViewBankDetailsTest" todir="${report.junit-test.dir}"/>-->
       <!--<test name="uk.co.slc.cst.jsfunit.JSFPageInstrumentationTest" todir="${report.junit-test.dir}"/>-->
      
       <batchtest todir="${report.junit-test.dir}">
       <!--<fileset dir="${test.classes}" includes="uk.co.slc.cst.jsfunit./**Test.class" />-->
       <fileset dir="${test.classes}" />
       </batchtest>
       </junit>
      
       <junitreport todir="${report.junit-test.dir}">
       <fileset dir="${report.junit-test.dir}">
       <include name="TEST-*.xml"/>
       </fileset>
       <report format="frames" todir="${report.junit-test.dir}/html"/>
       </junitreport>
      
       </target>
      
      </project>