Skip to main content

Source code file content

Revision: 114

» Project Revision History

» Checkout URL

soatestingutilities / SOAInstallationTester / edn-validator.xml

Size: 23108 bytes, 1 line
<?xml version="1.0" encoding="US-ASCII" ?>
<project default="help" basedir=".">

  <!--
   !  Oliv fecit, A.D. 2010
   +-->
  <property file="master.properties"/>
  <property environment="env"/>
  <condition property="soa.home" value="${env.SOA_HOME}">
    <not>
      <isset property="soa.home"/>
    </not>
  </condition>
  <condition property="mds.integration.home" value="${env.MDS_INTEGRATION_HOME}">
    <!-- Ex: /scratch/software/mw_local/olediour/FMWTOOLS_DROP7.APPS_GENERIC_090530.1629.D07B07A/mw_home/jdeveloper -->
    <not>
      <isset property="mds.integration.home"/>
    </not>
  </condition>
  <condition property="mw.home" value="${env.MW_HOME}">
    <not>
      <isset property="mw.home"/>
    </not>
  </condition>
  
  <property name="jar.location" value="validator-lib"/>
  
  <property name="serverURL" value="http://${proxy.name}:${soa.port.number}"/>
  <property name="user" value="${admin.user}"/>
  <property name="password" value="${admin.password}"/>

  <property name="oracle.home" value="${mds.integration.home}"/>
  
  <property name="top.dir" value="${basedir}/.."/>

  <path id="library.JUnit.4.Runtime">
    <!--pathelement location="${mw.home}/wlserver_10.3/samples/server/medrec-spring/lib/test/junit-4.4.jar"/-->
    <pathelement location="${jar.location}/junit-4.4.jar"/>
  </path>
  <path id="library.Oracle.XML.Parser.v2">
    <pathelement location="${soa.home}/modules/oracle.xdk_11.1.0/xmlparserv2.jar"/>
    <pathelement location="${soa.home}/modules/oracle.xdk_11.1.0/xml.jar"/>
  </path>
  <path id="library.SOA.Runtime">
    <pathelement location="${soa.home}/soa/modules/oracle.soa.fabric_11.1.1/fabric-runtime.jar"/>
    <pathelement location="${soa.home}/modules/oracle.fabriccommon_11.1.1/fabric-common.jar"/>
  </path>
  <path id="library.BPM.Workflow">
    <pathelement location="${soa.home}/soa/modules/oracle.soa.workflow_11.1.1/bpm-services.jar"/>
    <pathelement location="${soa.home}/soa/modules/oracle.soa.fabric_11.1.1/bpm-infra.jar"/>
    <pathelement location="${soa.home}/integration/lib/orabpel.jar"/>
    <pathelement location="${soa.home}/lib/xml.jar"/>
    <pathelement location="${soa.home}/lib/xmlparserv2.jar"/>
  </path>
  <path id="library.WebLogic.10.3.Remote-Client">
    <pathelement location="${mw.home}/wlserver_10.3/server/lib/weblogic.jar"/>
  </path>
  <path id="library.Oracle.JAX-WS.Client">
    <pathelement location="${soa.home}/modules/oracle.webservices_11.1.1/wsclient.jar"/>
  </path>
  <path id="library.Soa-infra-mgmt.jar">
    <pathelement location="${soa.home}/soa/modules/oracle.soa.mgmt_11.1.1/soa-infra-mgmt.jar"/>
  </path>
  <path id="library.Java.EE.1.5">
    <pathelement location="${mw.home}/modules/javax.activation_1.1.0.0_1-1.jar"/>
    <pathelement location="${mw.home}/modules/javax.ejb_3.0.1.jar"/>
    <pathelement location="${mw.home}/modules/javax.jms_1.1.1.jar"/>
    <pathelement location="${mw.home}/modules/javax.transaction_1.0.0.0_1-1.jar"/>
    <pathelement location="${mw.home}/modules/javax.mail_1.1.0.0_1-1.jar"/>
    <pathelement location="${mw.home}/modules/javax.servlet_1.0.0.0_2-5.jar"/>
    <pathelement location="${mw.home}/modules/javax.jsp_1.1.0.0_2-1.jar"/>
    <pathelement location="${mw.home}/modules/javax.xml.rpc_1.2.1.jar"/>
    <pathelement location="${soa.home}/modules/oracle.http_client_11.1.1.jar"/>
    <pathelement location="${soa.home}/modules/oracle.webservices_11.1.1/wsclient.jar"/>
    <pathelement location="${soa.home}/modules/oracle.webservices_11.1.1/wsserver.jar"/>
    <pathelement location="${soa.home}/modules/oracle.webservices_11.1.1/wssecurity.jar"/>
    <pathelement location="${soa.home}/modules/oracle.webservices_11.1.1/orawsdl.jar"/>
    <pathelement location="${soa.home}/modules/oracle.webservices_11.1.1/orasaaj.jar"/>
    <pathelement location="${soa.home}/modules/oracle.webservices_11.1.1/orawsrm.jar"/>
    <pathelement location="${soa.home}/webservices/lib/orawsrel.jar"/>
    <pathelement location="${mw.home}/modules/javax.management.j2ee_1.0.jar"/>
    <pathelement location="${mw.home}/modules/com.bea.core.weblogic.saaj_1.3.1.0.jar"/>
    <pathelement location="${soa.home}/webservices/lib/xsdlib.jar"/>
    <pathelement location="${soa.home}/modules/oracle.webservices_11.1.1/wsif.jar"/>
    <pathelement location="${mw.home}/modules/javax.xml.stream_1.0.0.0.jar"/>
    <pathelement location="${soa.home}/webservices/lib/oc4j-schemas.jar"/>
    <pathelement location="${soa.home}/modules/oracle.odl_11.1.1/ojdl.jar"/>
    <pathelement location="${soa.home}/modules/oracle.odl_11.1.1/ojdl2.jar"/>
    <pathelement location="${soa.home}/modules/oracle.osdt_11.1.1/jsr106.jar"/>
    <pathelement location="${soa.home}/modules/oracle.osdt_11.1.1/jsr105.jar"/>
    <pathelement location="${soa.home}/modules/oracle.osdt_11.1.1/osdt_wss.jar"/>
    <pathelement location="${soa.home}/modules/oracle.osdt_11.1.1/osdt_xmlsec.jar"/>
    <pathelement location="${soa.home}/modules/oracle.osdt_11.1.1/osdt_core.jar"/>
    <pathelement location="${soa.home}/modules/oracle.osdt_11.1.1/osdt_cert.jar"/>
    <pathelement location="${soa.home}/modules/oracle.osdt_11.1.1/osdt_saml.jar"/>
    <pathelement location="${soa.home}/modules/oracle.osdt_11.1.1/osdt_saml2.jar"/>
    <pathelement location="${soa.home}/modules/org.jaxen_1.1.1.jar"/>
    <pathelement location="${soa.home}/modules/oracle.iau_11.1.1/fmw_audit.jar"/>
    <pathelement location="${mw.home}/modules/javax.management.remote_1.0.1.3.jar"/>
    <pathelement location="${soa.home}/modules/oracle.jmx_11.1.1/jmxframework.jar"/>
    <pathelement location="${soa.home}/modules/oracle.jmx_11.1.1/jmxspi.jar"/>
    <pathelement location="${soa.home}/modules/oracle.dms_11.1.1/dms.jar"/>
    <pathelement location="${soa.home}/modules/oracle.fabriccommon_11.1.1/fabric-common.jar"/>
    <pathelement location="${soa.home}/modules/oracle.nlsrtl_11.1.0/orai18n.jar"/>
    <pathelement location="${soa.home}/modules/org.apache.commons.digester_1.7.jar"/>
    <pathelement location="${soa.home}/modules/org.springframework_2.0.jar"/>
    <pathelement location="${soa.home}/modules/oracle.javatools_11.1.1/javamodel-rt.jar"/>
    <pathelement location="${soa.home}/modules/oracle.javatools_11.1.1/javatools-nodeps.jar"/>
    <pathelement location="${mw.home}/modules/org.eclipse.persistence_1.0.0.0_1-1-0.jar"/>
    <pathelement location="${soa.home}/modules/commonj.sdo_2.1.0.jar"/>
    <pathelement location="${mw.home}/modules/javax.mail_1.4.jar"/>
  </path>
  <path id="library.JarServiceUnitTest.jar">
    <pathelement location="${jar.location}/JarServiceUnitTest.jar"/>
  </path>
  <path id="library.JarTestingGenericUtilities.jar">
    <pathelement location="${jar.location}/JarTestingGenericUtilities.jar"/>
  </path>
  <path id="classpath">
    <path refid="library.JUnit.4.Runtime"/>
    <path refid="library.Oracle.XML.Parser.v2"/>
    <path refid="library.SOA.Runtime"/>
    <path refid="library.BPM.Workflow"/>
    <path refid="library.WebLogic.10.3.Remote-Client"/>
    <path refid="library.Oracle.JAX-WS.Client"/>
    <path refid="library.Soa-infra-mgmt.jar"/>
    <path refid="library.Java.EE.1.5"/>
    <path refid="library.JarServiceUnitTest.jar"/>
    <path refid="library.JarTestingGenericUtilities.jar"/>
    <path path="classes"/>
  </path>

  <taskdef name="event-unit-test" 
           classname="event.task.CustomTask" 
           classpathref="classpath"/>
           
     <!-- classpath="./deploy/customtask.jar"/> -->
   
  <target name="all" 
          depends="init, make, deploy.all, unit.test, undeploy.all" 
          description="Deploy the required composites, runs the unit tests, and undeploy.">
    <echo message="Done!"/>
  </target>
  
  <target name="init">
    <echo message="Several variables are required for the deployment steps."/>
    <echo message="Java Runtime Environment version: ${java.version}"/>
    <echo message="Java Home: ${java.home}"/>
    <!--echo message="Classpath: ${java.class.path}"/-->

    <fail message="MW_HOME is not set. It must contain a user_projects, utils, wlserver_10.3, directories, among others.">
      <condition>
        <not><isset property="env.MW_HOME"/></not>
      </condition>
    </fail>

    <fail message="SOA_HOME is not set. It must contain a bin directory with the ant-sca.*.xml scripts in it.">
      <condition>
        <not><isset property="env.SOA_HOME"/></not>
      </condition>
    </fail>
    
    <!-- Ex: /scratch/software/mw_local/olediour/FMWTOOLS_DROP7.APPS_GENERIC_090530.1629.D07B07A/mw_home/jdeveloper -->
    <fail message="MDS_INTEGRATION_HOME is not set. It must contain an integration directory with seed/soa/shared/ sub-directories in it. Typically something like /scratch/software/mw_local/your-name/FMWTOOLS_DROP7.APPS_GENERIC_090530.1629.D07B07A/mw_home/jdeveloper">
      <condition>
        <not><isset property="env.MDS_INTEGRATION_HOME"/></not>
      </condition>
    </fail>

    
    <fail message="serverURL is not set!">
      <condition>
        <not><isset property="serverURL"/></not>
      </condition>
    </fail>
    <fail message="user is not set!">
      <condition>
        <not><isset property="user"/></not>
      </condition>
    </fail>
    <fail message="password is not set!">
      <condition>
        <not><isset property="password"/></not>
      </condition>
    </fail>
    <available property="sca.package.exists" type="file" file="${soa.home}/bin/ant-sca-package.xml"/>
    <fail message="ant-sca-package.xml not found where expected, at ${soa.home}/bin/ant-sca-package.xml">
      <condition>
        <not><istrue value="${sca.package.exists}"/></not>
      </condition>
    </fail>    
    <available property="sca.deploy.exists" type="file" file="${soa.home}/bin/ant-sca-deploy.xml"/>
    <fail message="ant-sca-deploy.xml not found where expected, at ${soa.home}/bin/ant-sca-deploy.xml">
      <condition>
        <not><istrue value="${sca.deploy.exists}"/></not>
      </condition>
    </fail>
    <echo message="...required variables are set, moving on."/>
    <mkdir dir="${output.dir}"/>
  </target>
  
  <target name="make" description="Build the project" depends="compile,copy"/>
  
  <target name="clean" depends="clean.classes, clean.composites" description="Clean the project, composites and classes"/>
  
  <target name="clean.classes">
    <delete includeemptydirs="true" quiet="false">
      <fileset dir="${output.dir}" includes="**/*"/>
    </delete>
  </target>

  <target name="clean.composites">
    <delete includeemptydirs="true" quiet="false">
      <fileset dir="${top.dir}" includes="**/deploy/sca*.jar"/>
    </delete>
  </target>

  <target name="compile" depends="init">
    <javac destdir="${output.dir}" classpathref="classpath"
           debug="${javac.debug}" nowarn="${javac.nowarn}"
           deprecation="${javac.deprecation}" encoding="ASCII" source="1.6"
           target="1.6" verbose="no">
      <!--compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter" value="-g"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter" value="-warn"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-nowarn:320"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-nowarn:372"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-nowarn:412"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-nowarn:413"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-nowarn:415"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-nowarn:486"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-nowarn:487"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-nowarn:489"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-nowarn:556"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-nowarn:558"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-nowarn:560"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-nowarn:561"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-nowarn:705"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-Xlint:-fallthrough"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-Xlint:-serial"/>
      <compilerarg compiler="oracle.ojc.ant.taskdefs.OjcAdapter"
                   value="-Xlint:-unchecked"/-->
      <src path="src"/>
      <exclude name="**/.ade_path/"/>
    </javac>
  </target>
  <target name="copy"
          depends="init">
    <patternset id="copy.patterns">
      <include name="**/*.gif"/>
      <include name="**/*.GIF"/>
      <include name="**/*.jpg"/>
      <include name="**/*.JPG"/>
      <include name="**/*.jpeg"/>
      <include name="**/*.JPEG"/>
      <include name="**/*.png"/>
      <include name="**/*.PNG"/>
      <include name="**/*.properties"/>
      <include name="**/*.xml"/>
      <include name="**/*-apf.xml"/>
      <include name="**/*.ejx"/>
      <include name="**/*.xcfg"/>
      <include name="**/*.cpx"/>
      <include name="**/*.dcx"/>
      <include name="**/*.sva"/>
      <include name="**/*.wsdl"/>
      <include name="**/*.ini"/>
      <include name="**/*.tld"/>
      <include name="**/*.tag"/>
      <include name="**/*.xlf"/>
      <include name="**/*.xsl"/>
      <include name="**/*.xsd"/>
    </patternset>
    <copy todir="${output.dir}">
      <fileset dir="src">
        <patternset refid="copy.patterns"/>
      </fileset>
    </copy>
  </target>
  
  <target name="package.one" unless="jar.one.exists">
    <echo message="Packaging Composite EventTriggeredComposite"/>
    <ant antfile="${soa.home}/bin/ant-sca-package.xml" dir="${soa.home}/bin" inheritall="false">
      <property name="oracle.home" value="${oracle.home}/"/>
      <property name="scac.application.home" value="${top.dir}"/>
      <property name="compositeDir" value="${top.dir}/EventTriggeredComposite"/>
      <property name="compositeName" value="EventTriggeredComposite"/>
      <property name="revision" value="1.0"/>
    </ant>
  </target>
  
  <target name="package.two" unless="jar.two.exists">
    <echo message="Packaging Composite EventGeneratorComposite"/>
    <ant antfile="${soa.home}/bin/ant-sca-package.xml" dir="${soa.home}/bin" inheritall="false">
      <property name="oracle.home" value="${oracle.home}"/>
      <property name="scac.application.home" value="${top.dir}"/>
      <property name="compositeDir" value="${top.dir}/EventGeneratorComposite"/>
      <property name="compositeName" value="EventGeneratorComposite"/>
      <property name="revision" value="1.0"/>
    </ant>
  </target>
  
  <target name="deploy.one" depends="init">
    <property name="sar.file.one" value="../EventTriggeredComposite/deploy/sca_EventTriggeredComposite_rev1.0.jar"/>
    <available property="jar.one.exists" type="file" file="${sar.file.one}"/>
    <antcall target="package.one"/>
    <echo>
      ==========================
       Step 1
       Deploying Composite EventTriggeredComposite
      ==========================
    </echo>
    <ant antfile="${soa.home}/bin/ant-sca-deploy.xml" inheritall="true" target="deploy">
      <property name="sarLocation" value="${sar.file.one}"/>
      <property name="overwrite" value="true"/>
      <!--property name="sysPropFile" value="sys-prop.properties"/-->
    </ant>
  </target>
  
  <target name="deploy.two" depends="init, deploy.one">
    <property name="sar.file.two" value="../EventGeneratorComposite/deploy/sca_EventGeneratorComposite_rev1.0.jar"/>
    <available property="jar.two.exists" type="file" file="${sar.file.two}"/>
    <antcall target="package.two"/>
    <echo>
      ==========================
       Step 2
       Deploying Composite EventGeneratorComposite
      ==========================
    </echo>
    <ant antfile="${soa.home}/bin/ant-sca-deploy.xml" inheritall="true" target="deploy">
      <property name="sarLocation" value="${sar.file.two}"/>
      <property name="overwrite" value="true"/>
    </ant>
  </target>
  
  <target name="undeploy.one" depends="init">
    <echo>
      ==========================
       Step 1bis
       Undeploying Composite EventTriggeredComposite
      ==========================
    </echo>
    <ant antfile="${soa.home}/bin/ant-sca-deploy.xml" inheritall="false" target="undeploy">
      <property name="serverURL" value="${serverURL}"/>
      <property name="user" value="${user}"/>
      <property name="password" value="${password}"/>
      <property name="compositeName" value="EventTriggeredComposite"/>
      <property name="revision" value="1.0"/>
    </ant>
  </target>
  
  <target name="undeploy.two" depends="init">
    <echo>
      ==========================
       Step 2bis
       Undeploying Composite EventGeneratorComposite
      ==========================
    </echo>
    <ant antfile="${soa.home}/bin/ant-sca-deploy.xml" inheritall="false" target="undeploy">
      <property name="serverURL" value="${serverURL}"/>
      <property name="user" value="${user}"/>
      <property name="password" value="${password}"/>
      <property name="compositeName" value="EventGeneratorComposite"/>
      <property name="revision" value="1.0"/>
    </ant>
  </target>
  
  <!--
   !  Main targets
   +-->
  <target name="deploy.all" 
          depends="init, deploy.one, deploy.two"
          description="Deploy all the composites to test later on."/>
  
  <target name="unit.test" 
          depends="make, unit.test.one"
          description="Unit tests on the deployed composites."/>
  
  <target name="undeploy.all" 
          depends="init, undeploy.one, undeploy.two"
          description="Undeploy all the composites tested before."/>
  
  <!--
   !  Unitary targets
   +-->
  <target name="all.for.events" depends="deploy.one,make,unit.test.one,undeploy.one"/>
  <!-- End of Unitary targets --> 
  
  <!-- property name="custom.fails" value="false"/-->
  
  <target name="unit.test.one" depends="make">
    <echo>
    =========================================
    Testing Business Event Raising (SOA Side)
    =========================================
    outputfile: event.txt
    </echo>
    <!-- Custom task -->
    <event-unit-test properties="event.txt" 
                     verbose="true" 
                     haltonfailure="no" 
                     failureproperty="event.fails" 
                     outfile="event.txt"/>
    <echo message="From event-unit-test:CustomFails is set to ${event.fails}"/>    
    <antcall target="in.case.event.fails"/>
  </target>

  <target name="in.case.event.fails" if="event.fails">
    <echo message="failure variable is set to ${event.fails}"/>
    <echo>
      The Business Event test failed.
      The reason could be the Data Sources used to raise it, the name of the server,...
      Here is the output of the test:
    </echo>
    <java classname="testing.util.GnlUtilities" classpath="./classes">
      <arg value="event.txt"/>
    </java>
    <!-- fail message="Business Event Test failed..."/ -->
  </target>
  
  <target name="event.generator.test" depends="make,deploy.two">
    <echo>
    ===============================================
    Testing Business Event Raising from a Composite
    ===============================================
    outputfile: event2.txt
    </echo>
    <junit printsummary="yes" fork="yes" showoutput="yes">      
      <classpath refid="classpath"/>
      <formatter type="plain"/>
      <test name="service.unit.testing.EventGeneratorService" haltonfailure="yes" outfile="event2"/>        
    </junit>    
  </target>
  
  <target name="help">
    <echo encoding="UTF-8">
      ==========================================================================
      Usage is:
        ant -f soa-validator.xml all
        ant -f soa-validator.xml deploy.all
        ant -f soa-validator.xml unit.test
        ant -f soa-validator.xml undeploy.all
      
      Warning!  
      Configuration files to modify before running anything:
      - master.properties          
      
      All the following ones depend on it:
      - server.properties
      - service-test-06.properties
      
      Also check out the event payload: event.xml
      
      Other sub-targets also exist:
      - all.for.events
      
      ... and more!
      For details, use ant -f soa-validator.xml -verbose -projecthelp
      
      ==========================================================================
      
      Note:
      1. The first time you run that script, keeping an eye on the console of the server 
         you are working on is probably a good idea.
      2. For the HumanWorkflow Task, sometime the test fails because the task has not
         been initialized yet. It happens to take some time for the plumbing to
         get moving...
         If that would be the case, try to re-run the test.
         Keep the sub-targets mentioned above in mind, that can help.                 
      3. Some environment variables need to be set:
         SOA_HOME - Contains the bin directory where the ant-sca-*.xml scripts live
         MW_HOME  - Contains user_projects, utils,om  d wlserver_10.3, among others.
         MDS_INTEGRATION_HOME - Contains the integration directory where the MDS repositories are.
                                Typically the directory structure under MDS_INTEGRATION_HOME looks like this:
                                
                                MDS_INTEGRATION_HOME
                                 +- integration
                                 |   +- bpel
                                 |   +- bpm
                                 |   +- lib
                                 |   +- seed
                                 |      +- soa
                                 |          +- configuration
                                 |          +- shared
                                 |              +- activityguide
                                 |              +- ...
                                 |              +- workflow
                                 |                  +- *.edl
                                 |                  +- *.wsdl                                                    
                                 +- modules
                                     +- ...
         MDS_INTEGRATION_HOME must match the value of the ${oracle.home} mentionned in the adf-config.xml file,
         in the attribute :
         /adf-config/adf-mds-config/mds-config/persistence-config/metadata-store-usages/metadata-store-usage/metadata-store/property[./@name='metadata-path']/@value
         This file is located under the Composite (Application, Workspace) directory, under .adf/META-INF.
    </echo>
  </target>
  
</project>
 
 
Close
loading
Please Confirm
Close