Testing 使用Jenkins的Ant-SOA测试

Testing 使用Jenkins的Ant-SOA测试,testing,jenkins,ant,soa,Testing,Jenkins,Ant,Soa,我试图通过Jenkins中的Ant脚本测试SOA。我可以在我的PC上运行ant脚本的测试,但当我尝试在Jenkins作业中创建相同的脚本时,它失败了。 当我使用Ant脚本直接在PC上运行时,同样的命令运行良好。 用于部署的Ant命令运行良好,但Ant测试给了我挑战 下面的命令 ant -f ant-sca-test.xml -Dscatest.input=TestSOAAdd -Djndi.properties.input=D:/12c_Ant/ant_soa/jndi.properties

我试图通过Jenkins中的Ant脚本测试SOA。我可以在我的PC上运行ant脚本的测试,但当我尝试在Jenkins作业中创建相同的脚本时,它失败了。 当我使用Ant脚本直接在PC上运行时,同样的命令运行良好。 用于部署的Ant命令运行良好,但Ant测试给了我挑战

下面的命令

ant -f ant-sca-test.xml -Dscatest.input=TestSOAAdd -Djndi.properties.input=D:/12c_Ant/ant_soa/jndi.properties
下面是错误消息

No changes for http://code.sunpowercorp.com/middleware-repo/fmw_12c/code/trunk/TestSOAAdd since the previous build
[ant_soa] $ cmd.exe /C "D:\Jdev1221\Middleware\Oracle_Home\oracle_common\modules\org.apache.ant_1.9.2\bin\ant.bat -file ant-sca-test.xml -DCompositeName=TestSOAAdd -DSVNCodePath=TestSOAAdd -Dtargetenv=proj ant-sca-test.xml -Dscatest.input=TestSOAAdd -Djndi.properties.input=D:\12c_Ant\ant_soa\jndi.properties && exit %%ERRORLEVEL%%"
Buildfile: D:\12c_Ant\ant_soa\ant-sca-test.xml
     [echo] Running scatest using oracle.home = D:\Jdev1221\Middleware\Oracle_Home
BUILD FAILED
Target "ant-sca-test.xml" does not exist in the project "ant-scactest". 
Ant测试文件如下:

<?xml version="1.0" encoding="iso-8859-1" ?>
<project name="ant-scactest" default="test">
  <!--  must have these properties available 
  -->
  <!-- oracle.home -->
  <condition property="oracle.home" value="D:\Oracle\Middleware\Oracle_Home">
    <not><isset property="oracle.home"/></not>
  </condition>
  <fail message="oracle.home is not available. Please provide this property.">
    <condition>
      <not>
        <isset property="oracle.home"/>
      </not>
    </condition>
  </fail>

  <import file="ant-soa-common.xml"/>

  <property environment="env"/>
  <fail message="JAVA_HOME is not available. Please provide this property.">
    <condition>
      <and>
        <not>
          <isset property="env.JAVA_HOME"/>
        </not>
        <not>
          <isset property="java.passed.home"/>
        </not>
      </and>
    </condition>
  </fail>
  <condition property="java.passed.home" value="${env.JAVA_HOME}">
    <isset property="env.JAVA_HOME"/>
  </condition>
  <condition property="scatest.format" value="native">
    <not>
      <isset property="scatest.format"/>
    </not>
  </condition>
  <condition property="scatest.result" value="${java.io.tmpdir}/out">
    <not>
      <isset property="scatest.result"/>
    </not>
  </condition>
  <condition property="scatest.timeout" value="300">
    <not>
      <isset property="scatest.timeout"/>
    </not>
  </condition>
  <property name="scatest.partition" value="default"/>
  <!-- if wl_home is not provided use the default -->
  <condition property="wl_home" value="${mw.home}/wlserver">
    <not>
      <isset property="wl_home"/>
    </not>
  </condition>

  <!--  jars needed to run scatest ant task -->
  <path id="scatest.tasks.class.path">
    <fileset dir="${mw.home}/soa/soa/modules/oracle.soa.fabric_11.1.1">
      <include name="fabric-runtime.jar"/>
      <include name="fabric-ext.jar"/>      <include name="oracle-soa-client-api.jar"/>
    </fileset>
    <fileset dir="${oracle.soa.mgmt.home}/soa/modules/oracle.soa.mgmt_11.1.1">
      <include name="soa-infra-mgmt.jar"/>
    </fileset>
    <fileset dir="${mw.home}/soa/soa/modules/oracle.soa.bpel_11.1.1">
      <include name="orabpel.jar"/>
      <include name="orabpel-common.jar"/>
    </fileset>
    <pathelement location="${wl_home}/server/lib/weblogic.jar" />
    <pathelement location="${wl_home}/server/lib/wlclient.jar" />
    <fileset dir="${common.components.home}/modules">
      <include name="oracle.jps/jps-api.jar"/>
      <include name="oracle.jps/jps-internal.jar"/>
      <include name="oracle.jps/jps-common.jar"/>
      <include name="oracle.jrf/jrf-api.jar"/>
    </fileset>
    <!-- was specific files -->
    <pathelement location="${oracle.soa.mgmt.home}/soa/modules/oracle.soa.mgmt_11.1.1/soa-client-stubs-was.jar"/>
    <pathelement location="${was.home}/runtimes/com.ibm.ws.ejb.thinclient_8.0.0.jar"/>
    <pathelement location="${was.home}/runtimes/com.ibm.ws.orb_8.0.0.jar"/>
    <pathelement location="${was.home}/plugins/com.ibm.ws.runtime.jar"/>
    <pathelement location="${was.home}/runtimes/com.ibm.ws.admin.client_8.0.0.jar"/>
    <!--
    <pathelement location="${was.home}/runtimes/com.ibm.ws.webservices.thinclient_8.0.0.jar"/>
    -->
    <!-- end was specific files -->
  </path>
  <property name="scatest.tasks.class.path" refid="scatest.tasks.class.path"/>
  <echo message="Running scatest using oracle.home = ${oracle.home} "></echo>
  <taskdef name="scatest"
    classname="oracle.integration.platform.testfwk.ant.ScaTestTask">
    <classpath>
      <pathelement path="${scatest.tasks.class.path}"/>
    </classpath>
  </taskdef>
  <target name="test" description="Run a composite test">
    <echo message="Classpth = ${scatest.tasks.class.path}"/>
    <echo message="Running scatest using oracle.home = ${oracle.home} ${scatest.input}"></echo>
    <echo message="Using context = build.properties"></echo>
    <echo message="Using path = ${scatest.tasks.class.path}"></echo>
    <input message="Please enter composite name to test:"
      addproperty="scatest.input"/>
    <input message="Please enter the path to the jndi properties:"
      addproperty="jndi.properties.input"/>
    <scatest compositedn="${scatest.partition}/${scatest.input}" timeout="${scatest.timeout}"
      xsl="${scatest.format}" runname="antRun-TestFwk"
      resultsdir="${scatest.result}"
      context="${jndi.properties.input}">
      <!-- provide , separated list of suite names, defaults to all suites
      <suite name="${scatestsuite.input}"/>
      -->
    </scatest>
  </target>
  <target name="report" description="Generate junit report for a composite test" >
    <echo message="Generate report to ${scatest.result}"/>
    <junitreport todir="${scatest.result}/xml">
      <fileset dir="${scatest.result}">
        <include name="BPEL-*.xml" />
      </fileset>
      <report format="frames" todir="${scatest.result}/html" />
    </junitreport>  
  </target>
</project>
我面临调用junit生成报告的问题。
无论我为“testreport XMLs”提供什么输入,它都会失败,没有匹配错误。

看起来
antsoa
任务将文件名“antscatest.xml”传递为目标,而不仅仅是“antscatest”,感谢Austin的帮助。我已经尝试了更改命令,正如您所指出的。我将命令命名为“test”,而不是“antscatest.xml”,它的工作原理与charm.CAustin类似。感谢您对调用测试脚本的帮助。你能看到我更新的帖子吗。我正在尝试调用junit,但失败。请尝试添加一些
行以调试属性。特别是,我建议在将
${scatest.result}
用于junit之前检查它的值。还要注意的是,由于属性不变性,在Ant中有许多带有
条件的
任务是不必要的。换句话说,您可以使用普通的
任务设置默认值,如果属性已经设置,则不会更改。
test -Dscatest.input=TestSOAAdd -Djndi.properties.input=D:/12c_Ant/ant_soa/jndi.properties