alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Axis 2 example source code file (build.xml)

This example Axis 2 source code file (build.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Axis 2 tags/keywords

apache, asf, failed, jira, jira, license, license, see, server, server, test, test, this, you

The Axis 2 build.xml source code

<?xml version="1.0"?>

<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements. See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership. The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License. You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied. See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->
<project name="interop-doclit" default="main" basedir=".">
    <description>
        Interop tests for doc-lit, code generated samples
    </description>
    <property name="dir.doclit" value="doclit-interop"/>
    <property name="dir.wsdl" value="./itest-resources/WSDLs"/>
    <property name="dir.temp" value="${dir.doclit}/temp"/>
    <property name="dir.clients" value="${dir.doclit}/clients"/>
    <property environment="env"/>
    <property name="dir.src" value="${dir.doclit}/src"/>
    <property name="dir.classes" value="${dir.doclit}/classes"/>
    <property name="dir.home" value="${user.home}"/>

    <!-- Allthe required jars here -->
    <path id="jarpath.axis2">
        <fileset dir="../../target/lib">
            <include name="*.jar"/>
        </fileset>
<!--        
<!--            
<!--        
    </path>

    <!-- preparing paths -->

    <target name="prepare">

        <mkdir dir="${dir.classes}"/>
        <mkdir dir="${dir.src}"/>
        <mkdir dir="${dir.src}/test"/>
        <mkdir dir="${dir.temp}"/>
    </target>

    <!-- This is where the classes are located for run-1-->
    <path id="interop.path">
        <path refid="classpath.interop"/>
        <path refid="jarpath.axis2"/>
    </path>

    <!-- This is where the classes are located for run-2>-->


    <path id="classpath.interop">
        <pathelement path="${dir.classes}"/>
        <fileset dir="${dir.classes}">
            <include name="**/*.*"/>
        </fileset>
    </path>

    <path id="classpath.interop2">
        <!--        
        <fileset dir="${dir.classes}">
            <include name="**/*.*"/>
        </fileset>
    </path>


    <target name="clean">
        <delete dir="${dir.classes}"/>
        <delete dir="${dir.classes}"/>
        <delete dir="${dir.classes}"/>
        <delete dir="${dir.src}"/>
        <delete dir="${dir.src}"/>
        <delete dir="${dir.src}"/>
    </target>

    <target name="temp-clean">
        <delete dir="${dir.src}/test"/>
        <delete dir="${dir.classes}/schema**/*"/>
        <delete dir="${dir.classes}/test"/>
    </target>

    <description>
    ////////////////////////////////// CodeGen with WSDL2Java /////////////////////////////////////////////////////////////////////////
    </description>

    <!-- generating the first file src files-->
    <target name="gen" depends="prepare">
        <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
            <classpath refid="jarpath.axis2"/>
            <arg value="-uri"/>
            <arg file="./${dir.temp}/current.wsdl"/>
            <arg value="-sd"/>
            <arg value="-o"/>
            <arg file="${dir.src}"/>
            <arg value="-p"/>
            <arg value="test.stub"/>
        </java>
        <move todir="${dir.classes}">
            <fileset dir="${dir.src}">
                <include name="**/schema**/**/*.class"/>
            </fileset>
            <fileset dir="${dir.src}/resources">
                <include name="**/schema**/**/*.xsb"/>
            </fileset>
        </move>
        <delete includeemptydirs="true">
           <!-- 
          <fileset dir="${dir.src}">
                <include name="**/schema**/*.class"/>
                <include name="**/schema**/*.xsb"/>
            </fileset>
        </delete>
        <delete file="${dir.temp}/current.wsdl"/>
    </target>


    <description>
    /////////////////////////////////// Compiling the generated codes ////////////////////////////////////////////////////////////////////////
    </description>

    <!-- compiling the first source generated from gen-1 to be used in run-1-->
    <target name="compile" depends="gen">
        <javac srcdir="${dir.src}" destdir="${dir.classes}">
            <include name="**/*.*"/>
            <classpath refid="interop.path"/>
        </javac>
    </target>


    <description>
    ////////////////////////////////////// Compiling the testcases /////////////////////////////////////////////////////////////////////
    </description>

    <!-- compiling the test case1 to be used in run-1-->
    <target name="compile-client1">
        <javac srcdir="${dir.clients}" destdir="${dir.classes}">
            <include name="**/**/WMRound3Compound1InteropTest.java"/>
            <classpath refid="interop.path1"/>
        </javac>
    </target>


    <description>
    /////////////////////////////////// Running Tests ////////////////////////////////////////////////////////////////////////
    </description>

    <!-- runing first test case -->
    <target name="run-test" depends="compile">
        <junit fork="true" printsummary="false" haltonfailure="false"
            failureproperty="tests.failed" showoutput="true">
            <classpath>
                <pathelement path="${dir.classes}"/>
                <path>
                   <fileset dir="../../target/lib">
                     <include name="*.jar"/>
                    </fileset>
                </path>
            </classpath>
            <formatter type="brief" usefile="false"/>
            <batchtest>
                <fileset dir="${dir.src}">
                    <include name="**/**/*Test.java"/>
                </fileset>
            </batchtest>
        </junit>
        <fail if="tests.failed"/>
        <antcall target="temp-clean"/>
    </target>


    <target name="run" depends="run-test"/>

    <target name="main">
        <antcall target="clean">
        <!-- Server Whitemesa -->
                <copy file="${dir.wsdl}/compound1.wsdl" tofile="${dir.temp}/current.wsdl"/>
                <copy file="${dir.clients}/test/WMRound3Compound1InteropTest.java" todir="${dir.src}/test"  />
                <antcall target="run"/>
                <copy file="${dir.wsdl}/compound2.wsdl" tofile="${dir.temp}/current.wsdl"/>
                <copy file="${dir.clients}/test/WMRound3Compound2InteropTest.java" todir="${dir.src}/test"  />
                <antcall target="run"/>
                <copy file="${dir.wsdl}/interoptestheaders.wsdl" tofile="${dir.temp}/current.wsdl"/>
                <copy file="${dir.clients}/test/Round3DoclitHeadersInteropTest.java" todir="${dir.src}/test"  />
                <antcall target="run"/>

        <!-- Server MS stk v3.0-->
                <copy file="${dir.wsdl}/stkv3Compound1.wsdl" tofile="${dir.temp}/current.wsdl"/>
                <copy file="${dir.clients}/test/MsStkv3Round3Compound1InteropTest.java" todir="${dir.src}/test"  />
                <antcall target="run"/>
                <copy file="${dir.wsdl}/stkv3Compound2.wsdl" tofile="${dir.temp}/current.wsdl"/>
                <copy file="${dir.clients}/test/MsStkv3Round3Compound2InteropTest.java" todir="${dir.src}/test"  />
                <antcall target="run"/>

        <!-- Test Failed, JIRA 238 -->
        <!--        
        <!--        
        <!--        

        <!-- Test Failed, JIRA 233 -->
        <!--        
        <!--        
        <!--        

        <!-- Server ASP.NET -->
                <copy file="${dir.wsdl}/aspnetcompound1.wsdl" tofile="${dir.temp}/current.wsdl"/>
                <copy file="${dir.clients}/test/ASPNetRound3Compound1InteropTest.java" todir="${dir.src}/test"  />
                <antcall target="run"/>
                <copy file="${dir.wsdl}/aspnetcompound2.wsdl" tofile="${dir.temp}/current.wsdl"/>
                <copy file="${dir.clients}/test/AspNetRound3Compound2InteropTest.java" todir="${dir.src}/test"  />
                <antcall target="run"/>
                <copy file="${dir.wsdl}/aspnetInteropTestDocLit.wsdl" tofile="${dir.temp}/current.wsdl"/>
                <copy file="${dir.clients}/test/AspNetRound3DoclitInteropTest.java" todir="${dir.src}/test"  />
                <antcall target="run"/>
        <!-- this test failed, JIRA 233 -->
<!--                
<!--                
<!--                

        <!-- Sun Server -->
                <copy file="${dir.wsdl}/suncompound1.wsdl" tofile="${dir.temp}/current.wsdl"/>
                <copy file="${dir.clients}/test/SunRound3Compound1InteropTest.java" todir="${dir.src}/test"  />
                <antcall target="run"/>
                <copy file="${dir.wsdl}/suncompound2.wsdl" tofile="${dir.temp}/current.wsdl"/>
                <copy file="${dir.clients}/test/SunRound3Compound2InteropTest.java" todir="${dir.src}/test"  />
                <antcall target="run"/>
        <!-- Test failed, JIRA 238 -->
        <!--        
        <!--        
        <!--        
        <!-- Test Failed, JIRA 233 -->
<!--        
<!--        
<!--        


    </target>


</project>

Other Axis 2 examples (source code examples)

Here is a short list of links related to this Axis 2 build.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.