copy tests and documentation from core
git-svn-id: https://svn.apache.org/repos/asf/ant/antlibs/dotnet/trunk@437217 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/docs/index.html b/docs/index.html
index 4bddc6c..2f8e25b 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -13,6 +13,9 @@
href="http://nant.sourceforge.net/">NAnt</a> or <a
href="http://www.nunit.org/">NUnit</a> from within Ant.</p>
+ <p>The original .NET support from Ant's core has also been moved
+ to this library.</p>
+
<h2>Requirements</h2>
<p>The current version requires Ant 1.7 or at least a version
@@ -116,6 +119,9 @@
<h2>Tasks</h2>
<ul>
+ <li><a href="old-core.html">The old code .NET tasks</a>
+ including C#, VB.NET and J# compiler tasks.</li>
+
<li><a href="dotnetexec.html">dotnetexec</a> - run a .NET
assembly that's in your PATH. You can chose the framework that
is going to be used - defaults to Mono on non-Windows platforms
diff --git a/docs/old-core.html b/docs/old-core.html
new file mode 100644
index 0000000..0f3ea98
--- /dev/null
+++ b/docs/old-core.html
@@ -0,0 +1,307 @@
+<html>
+<head>
+<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
+<title>.NET Tasks</title>
+</head>
+
+<h1>.NET tasks</h1>
+<h2>Introduction</h2>
+
+Ant support for .NET goes back to before .NET was released, and
+continues to be expanded based on user demand. Users writing nothing but
+a .NET application, may want to look at the .NET-based
+<A href="http://nant.sourceforge.net/">NAnt</A> project, that supports
+both the Microsoft and the Ximian managed <A
+href="http://go-mono.com/">Mono</A> project's implementation of the
+.NET framework.
+<p>
+
+Over time, the .NET tasks in Ant have tended to evolve to meet a few
+limited needs. Firstly, developers working with complex deployment problems may
+want to use ant to use the fairly advanced deployment tasks Ant ships
+with. Secondly, anyone who has a cross-platform project can use these
+tasks to cover the .NET side of the problem. Here, cross-platform can
+mean more than just Java and .NET: the C++ tasks in the ant-contrib
+project on sourceforge can be used with Ant to do native C++ and .NET
+cross development if that is your need. Finally, Ant support for .NET
+lets one automate .NET development under an automated build process,
+such as AntHill or Cruise Control.
+
+<p>
+
+What this means is that the Ant tasks for .NET support do not get as
+much rigorous use as the Java tools, and are evolving more slowly -that
+includes the time for support calls to change. But as a consequence,
+developers working on .NET support have more freedom to play around with
+the code. It also means that the fairly unusual set of tasks supported
+by ant enable a few interesting operations that can not be performed any
+other way:
+<ol>
+
+<li>Integrating with a Java based SOAP Service -generating C# code from
+the server's WSDL and running it against the server.
+</li>
+<li>Building and deploying a C#-based Web Service, then using the Apache
+Axis tasks to create JUnit tests to call the endpoints.
+
+<li>Patching .NET type libraries to work with more complex IDL than the
+basic <code><importtypelib></code> wrapper around tlbimport supports. Hence the
+disassembler and the reassembler.
+</li>
+
+</ol>
+Needless to say, possible does not mean easy.
+<A href="http://www.manning.com/hatcher/chap15.pdf">Chapter 15</A> of
+Java Development with Ant covers the first of these, using the Ant1.5
+version of the tasks. Going the other way -generating Java client
+code and JUnit testcases is covered in
+<A href="http://www.iseran.com/Steve/papers/interop/">The Wondrous curse
+of Interop</A>. The final trick, IDL and Typelib abuse, is not
+documented as we do not want to encourage such an ugly practise. It,
+can, however, be done if absolutely necessary.
+
+<h3>Task List</h3>
+
+<table border="0" >
+<tr>
+ <td><b>Task</b></td>
+ <td><b>Description</b></td>
+</tr>
+<tr>
+ <td><a href="csc.html">csc</a></td>
+ <td>Compiles C# code</td>
+</tr>
+
+<tr>
+ <td><a href="vbc.html">vbc</a></td>
+ <td>Compiles VB.NET code</td>
+</tr>
+
+<tr>
+ <td><a href="jsharpc.html">jsharpc</a></td>
+ <td>Compiles J# files</td>
+</tr>
+
+<tr>
+ <td><a href="ildasm.html">ildasm</a></td>
+ <td>Disassembles .NET executables and libraries</td>
+</tr>
+
+<tr>
+ <td><a href="ilasm.html">ilasm</a></td>
+ <td>Assembles .il files</td>
+</tr>
+
+<tr>
+ <td><a href="wsdltodotnet.html">wsdltodotnet</a></td>
+ <td>Generates .NET code (C# or VB) from a WSDL file</td>
+</tr>
+
+<tr>
+ <td><a href="importtypelib.html">importtypelib</a></td>
+ <td>Imports a COM type library into .NET</td>
+</tr>
+
+</table>
+
+<hr>
+<h3>Common .NET Datatypes </h3>
+
+There are some datatypes that are common to the core compiler classes:
+csc, vbc and jsharpc
+
+<h4>Resource</h4>
+
+This is a resource that is included in the build. Ant uses this for
+dependency checking -if resources included this way have changed, the
+executable or library will be rebuilt.
+<p>
+<table border="1" cellpadding="2" cellspacing="0">
+ <tr>
+ <td valign="top"><b>Attribute</b></td>
+ <td valign="top"><b>Description</b></td>
+ <td align="center" valign="top"><b>Required</b></td>
+ </tr>
+ <tr>
+ <td valign="top">File</td>
+ <td valign="top">the resource to include</td>
+ <td align="center" valign="top">Yes</td>
+ </tr>
+ <tr>
+ <td valign="top">name</td>
+ <td valign="top">the name of the resource.
+ Optional unless the resource is
+ marked as public or private</td>
+ <td align="center" valign="top">No</td>
+ </tr>
+ <tr>
+ <td valign="top">embed</td>
+ <td valign="top">flag to control whether the resource
+ is embedded in the assembly, or just linked to it</td>
+ <td align="center" valign="top">No -default is true</td>
+ </tr>
+ <tr>
+ <td valign="top">public</td>
+ <td valign="top">VB only: flag to control if a resource should be
+ public or private. Set to true for public, false for private
+ and leave undefined for for neither. </td>
+ <td align="center" valign="top">No</td>
+ </tr>
+</table>
+
+<h5>Examples</h5>
+
+<pre>
+<resource file="app.ico" name="icon"/>
+<resource file="splash.jpg"/>
+<resource name="splash" file="splash.jpg" public="false"/>
+</pre>
+
+<h4>Define</h4>
+
+This is a definition; in .NET these can either be defined or undefined,
+unlike C++ #defines, which can be either undefined or arbitrary text.
+The Ant compilation tasks can unconditionally add definitions, or
+conditionally set a compile-time definition if an ant property is
+defined or not.
+<p>
+
+Dependency Logic: the tasks are not (yet) clever enough to remember what
+the last definitions were and trigger a rebuild when they change. Clean
+build the code when the defines are likely to be different.
+<p>
+<table border="1" cellpadding="2" cellspacing="0">
+ <tr>
+ <td valign="top"><b>Attribute</b></td>
+ <td valign="top"><b>Description</b></td>
+ <td align="center" valign="top"><b>Required</b></td>
+ </tr>
+ <tr>
+ <td valign="top">name</td>
+ <td valign="top">the name of the definition</td>
+ <td align="center" valign="top">Yes</td>
+ </tr>
+ <tr>
+ <td valign="top">if</td>
+ <td valign="top">name of a ant property to test for;
+ the definition is only set if this property is defined.</td>
+ <td align="center" valign="top">No</td>
+ </tr>
+ <tr>
+ <td valign="top">unless</td>
+ <td valign="top">name of a ant property to test for;
+ the definition is only set if this property is undefined.</td>
+ <td align="center" valign="top">No</td>
+ </tr>
+</table>
+
+<h5>Examples</h5>
+
+<pre>
+<define name="unsafe"/>
+<define name="debug" if="build.debug"/>
+<define name="dotnet" unless="build.mono"/>
+</pre>
+
+<hr>
+<h3> Change Log </h3>
+
+<h4>Ant1.6</h4>
+This revision goes along with NET 1.1, though there is no reason why
+it should not work on other versions.
+<p>
+
+<ol>
+<li>vbc task</li>
+<li>jsharpc task</li>
+<li>mono support</li>
+<li>ilasm</li>
+<li>tlbimport</li>
+<li>Reference filesets in the compiler tasks</li>
+<li>definitions in the compiler tasks</li>
+<li>multiple source filesets in the compiler tasks. If these are used, the
+implicit fileset is disabled</li>
+</ol>
+
+The compile tasks: vbc, jsharpc, and csc, all contain lots of common code
+in a shared base class: if you can use one you should be able to use
+another.
+
+<h4>Ant 1.5</h4>
+This revision goes along with NET 1.0 (SP1)
+<ol>
+<li>CSC: added filealign</li>
+<li>CSC: added reference to office.dll</li>
+<li>CSC: dependency checking! only if destFile is set!
+<li>WsdlToDotnet written
+</ol>
+
+<h4>Version 0.5</h4>
+This revision goes along with NET 1.0 (SP1)
+<ol>
+<li>CSC: added filealign</li>
+<li>CSC: added reference to office.dll</li>
+<li>CSC: dependency checking! only if destFile is set!
+<li>WsdlToDotnet written
+</ol>
+
+<h4>Version 0.4</h4>
+This is the beta-2 revision of the tasks.
+<ol>
+<li>ILASM: pulled the owner attribute, added keyfile for giving binaries a strong name
+(MD5 hash of the checksum)</li>
+<li>CSC: added win32res , noConfig, utf8output, fullpaths</li>
+<li>CSC: </li>
+</ol>
+
+<h4>Version 0.3</h4>
+
+The changes here reflect Beta-1 of the dotnet SDK and experience of use in
+more complex projects. This build does not work with the older SDK,
+primarily because the automatic reference feature references libraries
+only found in the new SDK version.
+<p>
+External changes</p>
+<ul>
+<li>Recursive inclusion of .cs and .il files</li>
+
+<li>Documentation enhanced, includes examples and details of all parameters</li>
+
+<li>The csc task automatically includes the common dotnet assemblies, so
+there is no need to remember to refer to 'System.dll', 'System.Web.Services',
+ etc. This feature can be disabled by setting the 'includeDefaultReferences'
+ flag to false. </li>
+
+ <li> References can also be referred to using the ReferenceFiles parameter, which
+is an ant path specification. The old 'references' string is still retained.</li>
+<li> An 'extraoptions' attribute enables the build file to include any CSC options
+which are not explicitly supported in the CSC task. </li>
+</ul>
+
+Internal changes
+<ul>
+<li>Some minor refactoring (move common code a method)</li>
+<li>Application of Jedits JavaStyle task resulted in a major reshaping of
+the codebase and the insertion of a blank line every second line. Significant
+effort was required to revert some (but not all) changes.</li>
+<li>Removed throws clause from methods which can't throw exception
+</ul>
+
+The test harness has been expanded to include unicode source file
+(the build works but the rest of the system has 'issues' with high unicode
+package and method names)
+
+<h4>Version 0.2</h4>
+First public edition, added to the ant cvs tree. Tested on the PDC build of
+the dotnet SDK only, and still immature. The command execution code was
+refactored out into a 'NetCommand' class for re-use. The Ilasm task was added
+at this time.
+
+<h4>Version 0.1</h4>
+Initial proof of concept; very rudimentary support for CSC only.
+
+<p align="center">Copyright © 2000-2005 The Apache Software Foundation. All rights
+Reserved.</p>
+
+</body>
+</html>
diff --git a/src/etc/testcases/WsdlToDotnet.xml b/src/etc/testcases/WsdlToDotnet.xml
new file mode 100644
index 0000000..c451693
--- /dev/null
+++ b/src/etc/testcases/WsdlToDotnet.xml
@@ -0,0 +1,226 @@
+<?xml version="1.0"?>
+
+<project name="wsdl-to-java-jtest" basedir="." default="init"
+ xmlns:dn="antlib:org.apache.ant.dotnet">
+
+ <property environment="env"/>
+ <property name="build.dir" location="wsdl/build"/>
+ <property name="cache.dir" location="${build.dir}/cache"/>
+ <property name="src.dir" location="${build.dir}/src"/>
+ <property name="classes.dir" location="${build.dir}/classes"/>
+ <property name="local.wsdl"
+ location="wsdl/StockQuoteService.wsdl" />
+ <property name="out.csc" location="${src.dir}/out.cs"/>
+ <property name="out.app" location="${classes.dir}/out.dll"/>
+ <property name="out.type" value="module"/>
+ <property name="out.vbc" location="${src.dir}/out.vb"/>
+ <property name="endpoint"
+ value="http://nagoya.apache.org:5049/Axis/StockQuoteService.jws" />
+ <property name="endpoint.wsdl"
+ value="http://nagoya.apache.org:5049/Axis/StockQuoteService.jws?wsdl" />
+
+ <property name="vb.references"
+ value="System.Web.dll,System.xml.dll,System.dll,System.Web.Services.dll"/>
+
+ <target name="init" depends="validate">
+ <mkdir dir="${build.dir}"/>
+ <mkdir dir="${cache.dir}"/>
+ <mkdir dir="${src.dir}"/>
+ <mkdir dir="${classes.dir}"/>
+ </target>
+
+ <target name="probe_for_apps" >
+ <condition property="wsdl.found">
+ <or>
+ <available file="wsdl" filepath="${env.PATH}" />
+ <available file="wsdl.exe" filepath="${env.PATH}" />
+ <available file="wsdl.exe" filepath="${env.Path}" />
+ </or>
+ </condition>
+ <echo> wsdl.found=${wsdl.found}</echo>
+ <condition property="csc.found">
+ <or>
+ <available file="mcs" filepath="${env.PATH}" />
+ <available file="csc" filepath="${env.PATH}" />
+ <available file="csc.exe" filepath="${env.PATH}" />
+ <available file="csc.exe" filepath="${env.Path}" />
+ </or>
+ </condition>
+ <echo> csc.found=${csc.found}</echo>
+ <condition property="vbc.found">
+ <or>
+ <available file="vbc" filepath="${env.PATH}" />
+ <available file="vbc.exe" filepath="${env.PATH}" />
+ <available file="vbc.exe" filepath="${env.Path}" />
+ </or>
+ </condition>
+ <echo> vbc.found=${vbc.found}</echo>
+ <condition property="dotnetapps.found">
+ <and>
+ <isset property="csc.found"/>
+ <isset property="wsdl.found"/>
+ </and>
+ </condition>
+ <echo> dotnetapps.found=${dotnetapps.found}</echo>
+ </target>
+
+ <target name="teardown">
+ <delete dir="${build.dir}"/>
+ </target>
+
+ <target name="validate" depends="probe_for_apps" >
+ <fail unless="dotnetapps.found">Needed .net apps are missing</fail>
+ </target>
+
+
+ <target name="testNoParams">
+ <dn:wsdltodotnet/>
+ </target>
+
+ <target name="testNoSrc">
+ <dn:wsdltodotnet destFile="${out.csc}"/>
+ </target>
+
+ <target name="testDestIsDir" depends="init">
+ <dn:wsdltodotnet destFile="${build.dir}"
+ srcFile="${local.wsdl}"/>
+ </target>
+
+ <target name="testBothSrc" depends="init">
+ <dn:wsdltodotnet destFile="${out.csc}"
+ srcFile="${local.wsdl}"
+ url="${endpoint.wsdl}"
+ />
+ </target>
+
+ <target name="testSrcIsDir" depends="init">
+ <dn:wsdltodotnet destFile="${out.csc}"
+ srcFile="${build.dir}"
+ />
+ </target>
+
+ <target name="testSrcIsMissing" depends="init">
+ <dn:wsdltodotnet destFile="${out.csc}"
+ srcFile="${build.dir}/invalidfile.wsdl"
+ />
+ </target>
+
+ <target name="testLocalWsdl" depends="init">
+ <dn:wsdltodotnet destFile="${out.csc}"
+ srcFile="${local.wsdl}"
+ />
+ <dn:csc
+ srcDir="${src.dir}"
+ destFile="${out.app}"
+ targetType="${out.type}"
+ references="System.Web.Services.dll"
+ />
+ <available property="app.created" file="${out.app}"/>
+ <fail unless="app.created">No app created</fail>
+ </target>
+
+ <target name="testLocalWsdlServer" depends="init">
+ <dn:wsdltodotnet destFile="${out.csc}"
+ srcFile="${local.wsdl}"
+ server="true"
+ />
+ <dn:csc
+ srcDir="${src.dir}"
+ destFile="${out.app}"
+ targetType="${out.type}"
+ fileAlign="512"
+ references="System.Web.Services.dll"
+ />
+ <available property="app.created" file="${out.app}"/>
+ <fail unless="app.created">No app created</fail>
+ </target>
+
+ <target name="testInvalidExtraOps" depends="init">
+ <dn:wsdltodotnet destFile="${out.csc}"
+ srcFile="${local.wsdl}"
+ extraOptions="/newOption:not-one-known-of"
+ />
+ </target>
+
+
+
+ <target name="testLocalWsdlVB" depends="init" if="vbc.found">
+ <dn:wsdltodotnet destFile="${out.vbc}"
+ language="VB"
+ srcFile="${local.wsdl}"
+ />
+ <dn:vbc
+ srcDir="${src.dir}"
+ destFile="${out.app}"
+ targetType="${out.type}"
+ references="${vb.references}"
+ >
+
+ </dn:vbc>
+ <available property="app.created" file="${out.app}"/>
+ <fail unless="app.created">No app created</fail>
+ </target>
+
+ <target name="testLocalWsdlServerVB"
+ depends="init" if="vbc.found">
+ <dn:wsdltodotnet destFile="${out.vbc}"
+ language="VB"
+ srcFile="${local.wsdl}"
+ server="true"
+ />
+ <dn:vbc
+ srcDir="${src.dir}"
+ destFile="${out.app}"
+ targetType="${out.type}"
+ optionExplicit="true"
+ optionStrict="false"
+ optionCompare="text"
+ references="${vb.references}"
+ />
+ <available property="app.created" file="${out.app}"/>
+ <fail unless="app.created">No app created</fail>
+ </target>
+
+ <target name="testInvalidExtraOpsVB" depends="init">
+ <dn:wsdltodotnet destFile="${out.vbc}"
+ language="VB"
+ srcFile="${local.wsdl}"
+ extraOptions="/newOption:not-one-known-of"
+ />
+ </target>
+
+
+ <target name="testideErrorsIgnoredWhenFalse" depends="init">
+ <dn:wsdltodotnet destFile="${out.csc}"
+ srcFile="${local.wsdl}"
+ ideErrors="false"
+ >
+ </dn:wsdltodotnet>
+ </target>
+
+ <target name="testSchemaMustBeSet" depends="init">
+ <dn:wsdltodotnet destFile="${out.csc}"
+ srcFile="${local.wsdl}"
+ >
+ <schema/>
+ </dn:wsdltodotnet>
+ </target>
+
+ <target name="testSchemaFileMustExist" depends="init">
+ <dn:wsdltodotnet destFile="${out.csc}"
+ srcFile="${local.wsdl}"
+ >
+ <schema file="this-file-does-not-exist.xsd"/>
+ </dn:wsdltodotnet>
+ </target>
+
+ <target name="testSchemaFileMustHaveOneOptionOnly" depends="init">
+ <dn:wsdltodotnet destFile="${out.csc}"
+ srcFile="${local.wsdl}"
+ >
+ <schema file="WsdlToDotnet.xml"
+ url="http://ant.apache.org/xml/AntSchema.xsd"/>
+ </dn:wsdltodotnet>
+ </target>
+
+</project>
diff --git a/src/etc/testcases/old-core.xml b/src/etc/testcases/old-core.xml
new file mode 100644
index 0000000..93ee68f
--- /dev/null
+++ b/src/etc/testcases/old-core.xml
@@ -0,0 +1,443 @@
+<?xml version="1.0"?>
+
+<project name="dotnet" basedir="." default="init"
+ xmlns:dn="antlib:org.apache.ant.dotnet">
+ <property environment="env"/>
+ <property name="build.dir" location="build"/>
+ <property name="src.dir" location="src"/>
+
+ <property name="out.csc" location="${src.dir}/out.cs"/>
+ <property name="out.app" location="${build.dir}/out.exe"/>
+ <property name="out.type" value="exe"/>
+
+ <target name="probe_for_apps" >
+ <condition property="ilasm.found">
+ <or>
+ <available file="ilasm" filepath="${env.PATH}" />
+ <available file="ilasm.exe" filepath="${env.PATH}" />
+ <available file="ilasm.exe" filepath="${env.Path}" />
+ </or>
+ </condition>
+ <echo> ilasm.found=${ilasm.found}</echo>
+ <condition property="csc.found">
+ <or>
+ <available file="csc" filepath="${env.PATH}" />
+ <available file="csc.exe" filepath="${env.PATH}" />
+ <available file="csc.exe" filepath="${env.Path}" />
+ </or>
+ </condition>
+ <echo> csc.found=${csc.found}</echo>
+ <!-- visual basic compiler -->
+ <condition property="vbc.found">
+ <or>
+ <available file="vbc" filepath="${env.PATH}" />
+ <available file="vbc.exe" filepath="${env.PATH}" />
+ <available file="vbc.exe" filepath="${env.Path}" />
+ </or>
+ </condition>
+ <echo> vbc.found=${vbc.found}</echo>
+ <!-- visual J# compiler -->
+ <condition property="jsharp.found">
+ <or>
+ <available file="vjc" filepath="${env.PATH}" />
+ <available file="vjc.exe" filepath="${env.PATH}" />
+ <available file="vjc.exe" filepath="${env.Path}" />
+ </or>
+ </condition>
+ <echo> jsharp.found=${jsharp.found}</echo>
+
+ <!-- Mono C# compiler -->
+ <condition property="mcs.found">
+ <available file="mcs" filepath="${env.PATH}" />
+ </condition>
+ <echo> mcs.found=${mcs.found}</echo>
+
+ <!-- any C# compiler -->
+ <condition property="c#.found">
+ <or>
+ <isset property="csc.found"/>
+ <isset property="mcs.found"/>
+ </or>
+ </condition>
+
+ <!-- Mono's ilasm -->
+ <condition property="mono.ilasm.found">
+ <available file="ilasm" filepath="${env.PATH}" />
+ </condition>
+ <echo> mono.ilasm.found=${mono.ilasm.found}</echo>
+
+ <condition property="ildasm.found">
+ <or>
+ <available file="ildasm" filepath="${env.PATH}" />
+ <available file="ildasm.exe" filepath="${env.PATH}" />
+ <available file="ildasm.exe" filepath="${env.Path}" />
+ </or>
+ </condition>
+ <echo> ildasm.found=${ildasm.found}</echo>
+
+ <condition property="dotnetapps.found">
+ <or>
+ <and>
+ <isset property="mcs.found"/>
+ <isset property="mono.ilasm.found"/>
+ </and>
+ <and>
+ <isset property="csc.found"/>
+<!-- <isset property="vbc.found"/> -->
+ <isset property="ilasm.found"/>
+ </and>
+ </or>
+ </condition>
+ <echo> dotnetapps.found=${dotnetapps.found}</echo>
+
+ <condition property="mono.executable" value="mono">
+ <or>
+ <available file="mono" filepath="${env.PATH}" />
+ <available file="mono.exe" filepath="${env.PATH}" />
+ </or>
+ </condition>
+ <property name="mono.executable" value="mint"/>
+
+ <!-- now set a prop of the compiler name to whatever we found -->
+ <condition property="cs.compiler" value="csc">
+ <isset property="csc.found"/>
+ </condition>
+
+ <condition property="cs.compiler" value="mcs">
+ <isset property="mcs.found"/>
+ </condition>
+
+ </target>
+
+ <target name="init" depends="probe_for_apps">
+ <mkdir dir="${build.dir}"/>
+ </target>
+
+ <target name="teardown">
+ <delete dir="${build.dir}"/>
+ </target>
+
+ <target name="validate_csc" depends="init">
+ <fail unless="c#.found">Needed C# compiler is missing</fail>
+ </target>
+
+ <target name="validate_ilasm" depends="init">
+ <fail unless="ilasm.found">Needed ilasm is missing</fail>
+ </target>
+
+ <target name="validate_jsharp" depends="init">
+ <fail unless="jsharp.found">No vjc on the path</fail>
+ </target>
+
+
+ <target name="testCSC" depends="testCSC-Mono,testCSC-MS"/>
+
+ <target name="testCSC-MS" depends="validate_csc" if="csc.found">
+ <property name="testCSC.exe"
+ location="${build.dir}/ExampleCsc.exe" />
+ <dn:csc
+ destFile="${testCSC.exe}"
+ targetType="exe"
+ srcDir="${src.dir}"
+ >
+ </dn:csc>
+ <available property="app.created" file="${testCSC.exe}"/>
+ <fail unless="app.created">No app ${testCSC.exe} created</fail>
+ <exec executable="${testCSC.exe}" failonerror="true" />
+ <delete file="${testCSC.exe}"/>
+ </target>
+
+ <target name="testCSC-Mono" depends="validate_csc" if="mcs.found">
+ <property name="testCSC.exe"
+ location="${build.dir}/ExampleCsc.exe" />
+ <dn:csc
+ destFile="${testCSC.exe}"
+ targetType="exe"
+ includedefaultreferences="true"
+ srcDir="${src.dir}"
+ >
+ </dn:csc>
+ <available property="app.created" file="${testCSC.exe}"/>
+ <fail unless="app.created">No app ${testCSC.exe} created</fail>
+ <exec executable="${mono.executable}" failonerror="true">
+ <arg value="${testCSC.exe}"/>
+ </exec>
+ <delete file="${testCSC.exe}"/>
+ </target>
+
+ <target name="testCSCResources" depends="testCSCResources-Mono,testCSCResources-MS"/>
+
+ <target name="testCSCResources-MS" depends="validate_csc" if="csc.found">
+ <property name="testCSCRes.exe"
+ location="${build.dir}/ExampleCscRes.exe" />
+ <dn:csc
+ destFile="${testCSCRes.exe}"
+ targetType="exe"
+ srcDir="${src.dir}"
+ >
+ <resource file="${src.dir}/res.resources"/>
+ </dn:csc>
+ <available property="app-res.created" file="${testCSCRes.exe}"/>
+ <fail unless="app-res.created">No app ${testCSC.exe} created</fail>
+ <exec executable="${testCSCRes.exe}" failonerror="true" />
+ <delete file="${testCSCRes.exe}"/>
+ <dn:csc
+ destFile="${testCSCRes.exe}"
+ targetType="exe"
+ srcDir="${src.dir}"
+ >
+ <resource namespace="some.namespace" embed="true">
+ <fileset file="${src.dir}/res.resources"/>
+ </resource>
+ </dn:csc>
+ <available property="app-res-2.created" file="${testCSCRes.exe}"/>
+ <fail unless="app-res-2.created">No app ${testCSC.exe} created</fail>
+ <exec executable="${testCSCRes.exe}" failonerror="true" />
+ <delete file="${testCSCRes.exe}"/>
+ </target>
+
+ <target name="testCSCResources-Mono" depends="validate_csc" if="mcs.found">
+ <property name="testCSCRes.exe"
+ location="${build.dir}/ExampleCscRes.exe" />
+ <dn:csc
+ destFile="${testCSCRes.exe}"
+ targetType="exe"
+ includedefaultreferences="true"
+ srcDir="${src.dir}"
+ >
+ <resource file="${src.dir}/res.resources"/>
+ </dn:csc>
+ <available property="app-res.created" file="${testCSCRes.exe}"/>
+ <fail unless="app-res.created">No app ${testCSC.exe} created</fail>
+ <exec executable="${mono.executable}" failonerror="true">
+ <arg value="${testCSCRes.exe}"/>
+ </exec>
+ <delete file="${testCSCRes.exe}"/>
+ </target>
+
+ <target name="testCSCintrinsicFileset"
+ depends="testCSCintrinsicFileset-MS,testCSCintrinsicFileset-Mono"/>
+
+ <target name="testCSCintrinsicFileset-MS" depends="validate_csc" if="csc.found">
+ <property name="testCSC.exe"
+ location="${build.dir}/ExampleCsc.exe"/>
+ <dn:csc
+ destFile="${testCSC.exe}"
+ targetType="exe"
+ srcDir="${src.dir}"
+ includes="**/*.cs"
+ >
+ </dn:csc>
+ <available property="app.created" file="${testCSC.exe}"/>
+ <fail unless="app.created">No app ${testCSC.exe} created</fail>
+ <exec executable="${testCSC.exe}" failonerror="true" />
+ <delete file="${testCSC.exe}"/>
+ </target>
+
+ <target name="testCSCintrinsicFileset-Mono" depends="validate_csc" if="mcs.found">
+ <property name="testCSC.exe"
+ location="${build.dir}/ExampleCsc.exe"/>
+ <dn:csc
+ destFile="${testCSC.exe}"
+ targetType="exe"
+ srcDir="${src.dir}"
+ includes="**/*.cs"
+ includedefaultreferences="true"
+ >
+ </dn:csc>
+ <available property="app.created" file="${testCSC.exe}"/>
+ <fail unless="app.created">No app ${testCSC.exe} created</fail>
+ <exec executable="${mono.executable}" failonerror="true">
+ <arg value="${testCSC.exe}"/>
+ </exec>
+ <delete file="${testCSC.exe}"/>
+ </target>
+
+ <target name="testCSCdll" depends="testCSCdll-MS,testCSCdll-Mono"/>
+
+ <target name="testCSCdll-MS" depends="validate_csc" if="csc.found">
+ <property name="testCSC.dll"
+ location="${build.dir}/Example2.dll" />
+ <dn:csc
+ destFile="${testCSC.dll}"
+ targetType="library"
+ executable="csc"
+ >
+ <src dir="${src.dir}" includes="example2.cs"/>
+ </dn:csc>
+ <available property="dll.created" file="${testCSC.dll}"/>
+ <fail unless="dll.created">No file ${testCSC.dll} created</fail>
+ <property name="testCSC2.dll"
+ location="${build.dir}/folder with dir/Example3.dll" />
+ <mkdir dir="${build.dir}/folder with dir"/>
+ <dn:csc
+ destFile="${testCSC2.dll}"
+ targetType="library"
+ executable="csc"
+ >
+ <src dir="${src.dir}" includes="example3.cs"/>
+ </dn:csc>
+ <available property="dll2.created" file="${testCSC2.dll}"/>
+ <fail unless="dll2.created">No file ${testCSC2.dll} created</fail>
+ </target>
+
+ <target name="testCSCdll-Mono" depends="validate_csc" if="mcs.found">
+ <property name="testCSC.dll"
+ location="${build.dir}/Example2.dll" />
+ <dn:csc
+ destFile="${testCSC.dll}"
+ targetType="library"
+ includedefaultreferences="true"
+ >
+ <src dir="${src.dir}" includes="example2.cs"/>
+ </dn:csc>
+ <available property="dll.created" file="${testCSC.dll}"/>
+ <fail unless="dll.created">No file ${testCSC.dll} created</fail>
+ </target>
+
+ <target name="testCscReferences"
+ depends="testCscReferences-MS,testCscReferences-Mono"/>
+
+ <target name="testCscReferences-MS" depends="validate_csc,testCSCdll-MS"
+ if="csc.found">
+ <property name="testCscReferences.exe"
+ location="${build.dir}/ExampleCsc2.exe" />
+ <dn:csc
+ destFile="${testCscReferences.exe}"
+ targetType="exe"
+ >
+ <src file="${src.dir}/example.cs"/>
+ <reference file="${testCSC.dll}" />
+ <reference file="${testCSC2.dll}" />
+ <define name="RELEASE" />
+ <define name="DEBUG" if="undefined.property"/>
+ <define name="def3" unless="undefined.property"/>
+ </dn:csc>
+ <available property="refapp.created" file="${testCscReferences.exe}"/>
+ <fail unless="refapp.created">No app ${testCscReferences.exe} created</fail>
+ <copy file="${testCSC2.dll}" todir="${build.dir}"/>
+ <exec executable="${testCscReferences.exe}" failonerror="true" />
+ </target>
+
+ <target name="testCscReferences-Mono" depends="validate_csc,testCSCdll-Mono"
+ if="mcs.found">
+ <property name="testCscReferences.exe"
+ location="${build.dir}/ExampleCsc2.exe" />
+ <dn:csc
+ destFile="${testCscReferences.exe}"
+ targetType="exe"
+ includedefaultreferences="true"
+ >
+ <src file="${src.dir}/example.cs"/>
+ <reference file="${testCSC.dll}" />
+ <define name="RELEASE" />
+ <define name="DEBUG" if="undefined.property"/>
+ <define name="def3" unless="undefined.property"/>
+ </dn:csc>
+ <available property="refapp.created" file="${testCscReferences.exe}"/>
+ <fail unless="refapp.created">No app ${testCscReferences.exe} created</fail>
+ <exec executable="${mono.executable}" failonerror="true">
+ <arg value="${testCscReferences.exe}"/>
+ </exec>
+ </target>
+
+ <target name="testILASM"
+ depends="testILASM-Mono,testILASM-MS"
+ if="ilasm.found"/>
+
+ <target name="ilasm" depends="validate_ilasm"
+ if="ilasm.found">
+ <property name="testILASM.exe"
+ location="${build.dir}/ExampleIlasm.exe" />
+ <dn:ilasm
+ destFile="${testILASM.exe}"
+ targetType="exe"
+ >
+ <src dir="${src.dir}" includes="*.il"/>
+ </dn:ilasm>
+ <available property="ilasm.created" file="${testILASM.exe}"/>
+ <fail unless="ilasm.created">No app ${testILASM.exe} created</fail>
+ </target>
+
+ <target name="testILASM-MS" depends="ilasm"
+ if="ilasm.found" unless="mono.ilasm.found">
+ <exec executable="${testILASM.exe}"
+ failonerror="true"/>
+ </target>
+
+ <target name="testILASM-Mono" depends="ilasm"
+ if="mono.ilasm.found">
+ <exec executable="${mono.executable}"
+ failonerror="true">
+ <arg value="${testILASM.exe}"/>
+ </exec>
+ </target>
+
+ <!-- not including this in the test as it creates an exe in the src dir -->
+
+ <target name="testIlasmNoDestFile" depends="validate_ilasm">
+ <dn:ilasm
+ targetType="exe"
+ >
+ <src dir="${src.dir}" includes="**/*.il"/>
+ </dn:ilasm>
+ </target>
+
+ <!-- just here to look at fileset refid conversion by hand -->
+ <target name="echoFileset">
+ <fileset id="ilasm" dir="${src.dir}" includes="**/*.il" />
+ <property name="ilasm.string" refid="ilasm"/>
+ <echo>${ilasm.string}</echo>
+ </target>
+
+ <target name="testILDASM" depends="testILASM" if="ildasm.found">
+ <property name="testILDASM.il"
+ location="${build.dir}/ExampleIldasm.il" />
+ <dn:ildasm
+ srcFile="${testILASM.exe}"
+ destFile="${testILDASM.il}"
+ metadata="true"
+ header="true"
+ linenumbers="true"
+ encoding="ascii"
+ />
+ <available property="ildasm.created" file="${testILDASM.il}"/>
+ <fail unless="ildasm.created">No file ${testILDASM.il} created</fail>
+ </target>
+
+ <!-- this is an error -->
+ <target name="testILDASM_empty" depends="validate_ilasm" >
+ <dn:ildasm/>
+ </target>
+
+ <target name="jsharp" depends="init" if="jsharp.found" >
+ <property name="jsharp.exe"
+ location="${build.dir}/jsharp.exe" />
+ <dn:jsharpc
+ destFile="${jsharp.exe}"
+ targetType="exe"
+ >
+ <src dir="${src.dir}" includes="*.java"/>
+ </dn:jsharpc>
+ <exec executable="${jsharp.exe}" failonerror="true" />
+ </target>
+
+ <target name="testCSCresponseFile" depends="validate_csc" >
+ <property name="testCSCresponseFile.exe"
+ location="${build.dir}/testCSCresponseFile.exe" />
+ <dn:csc
+ destFile="${testCSCresponseFile.exe}"
+ targetType="exe"
+ executable="${cs.compiler}"
+ useResponseFile="true"
+ srcDir="${src.dir}"
+ >
+ </dn:csc>
+ <available property="app.created" file="${testCSCresponseFile.exe}"/>
+ <fail unless="app.created">No app ${testCSCresponseFile.exe} created</fail>
+ <delete file="${testCSCresponseFile.exe}"/>
+ </target>
+
+
+</project>
+
diff --git a/src/etc/testcases/src/HelloWorld.wsdl b/src/etc/testcases/src/HelloWorld.wsdl
new file mode 100644
index 0000000..c776e54
--- /dev/null
+++ b/src/etc/testcases/src/HelloWorld.wsdl
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="HelloWorld"
+targetNamespace="http://hello.jaxrpc.samples/"
+xmlns:tns="http://hello.jaxrpc.samples/"
+xmlns="http://schemas.xmlsoap.org/wsdl/"
+xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+ <types />
+
+ <message name="sayHello">
+ <part name="String_1" type="xsd:string" />
+ </message>
+
+ <message name="sayHelloResponse">
+ <part name="result" type="xsd:string" />
+ </message>
+
+ <portType name="Hello">
+ <operation name="sayHello" parameterOrder="String_1">
+ <input message="tns:sayHello" />
+
+ <output message="tns:sayHelloResponse" />
+ </operation>
+ </portType>
+
+ <binding name="HelloBinding" type="tns:Hello">
+ <operation name="sayHello">
+ <input>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded" namespace="http://hello.jaxrpc.samples/" />
+ </input>
+
+ <output>
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ use="encoded" namespace="http://hello.jaxrpc.samples/" />
+ </output>
+
+ <soap:operation soapAction="" />
+ </operation>
+
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
+ style="rpc" />
+ </binding>
+
+ <service name="HelloWorld">
+ <port name="HelloPort" binding="tns:HelloBinding">
+ <soap:address
+ location="http://localhost:8080/axis/Hello" />
+ </port>
+ </service>
+</definitions>
+
diff --git a/src/etc/testcases/src/example.il b/src/etc/testcases/src/example.il
new file mode 100644
index 0000000..5a0ac74
--- /dev/null
+++ b/src/etc/testcases/src/example.il
@@ -0,0 +1,78 @@
+//created from ildasm of example.cs
+
+
+
+.assembly extern /*23000001*/ mscorlib
+{
+ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
+ .ver 1:0:3300:0
+}
+.assembly /*20000001*/ example
+{
+ // --- The following custom attribute is added automatically, do not uncomment -------
+ // .custom /*0C000001:0A000001*/ instance void [mscorlib/* 23000001 */]System.Diagnostics.DebuggableAttribute/* 01000002 */::.ctor(bool,
+ // bool) /* 0A000001 */ = ( 01 00 00 01 00 00 )
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+.module example.exe
+// MVID: {641E4709-F7B6-4BB0-BC5D-49C2CF1F1CF8}
+.imagebase 0x00400000
+.subsystem 0x00000003
+.file alignment 512
+.corflags 0x00000001
+// Image base: 0x03180000
+//
+// ============== CLASS STRUCTURE DECLARATION ==================
+//
+.class /*02000002*/ public auto ansi beforefieldinit Example
+ extends [mscorlib/* 23000001 */]System.Object/* 01000001 */
+{
+} // end of class Example
+
+
+// =============================================================
+
+
+// =============== GLOBAL FIELDS AND METHODS ===================
+
+
+// =============================================================
+
+
+// =============== CLASS MEMBERS DECLARATION ===================
+// note that class flags, 'extends' and 'implements' clauses
+// are provided here for information only
+
+.class /*02000002*/ public auto ansi beforefieldinit Example
+ extends [mscorlib/* 23000001 */]System.Object/* 01000001 */
+{
+ .method /*06000001*/ public hidebysig static
+ void Main(string[] args) cil managed
+ // SIG: 00 01 01 1D 0E
+ {
+ .entrypoint
+ // Method begins at RVA 0x2050
+ // Code size 11 (0xb)
+ .maxstack 1
+ IL_0000: /* 72 | (70)000001 */ ldstr "hello, I look like Java, but I'm really .NET" /* 70000001 */
+ IL_0005: /* 28 | (0A)000002 */ call void [mscorlib/* 23000001 */]System.Console/* 01000003 */::WriteLine(string) /* 0A000002 */
+ IL_000a: /* 2A | */ ret
+ } // end of method Example::Main
+
+ .method /*06000002*/ public hidebysig specialname rtspecialname
+ instance void .ctor() cil managed
+ // SIG: 20 00 01
+ {
+ // Method begins at RVA 0x2068
+ // Code size 7 (0x7)
+ .maxstack 1
+ IL_0000: /* 02 | */ ldarg.0
+ IL_0001: /* 28 | (0A)000003 */ call instance void [mscorlib/* 23000001 */]System.Object/* 01000001 */::.ctor() /* 0A000003 */
+ IL_0006: /* 2A | */ ret
+ } // end of method Example::.ctor
+
+} // end of class Example
+
+
+
diff --git a/src/etc/testcases/src/example2.il b/src/etc/testcases/src/example2.il
new file mode 100644
index 0000000..9c6897a
--- /dev/null
+++ b/src/etc/testcases/src/example2.il
@@ -0,0 +1,31 @@
+
+.class public auto ansi beforefieldinit Example2
+ extends [mscorlib]System.Object
+{
+} // end of class Example2
+
+// =============== CLASS MEMBERS DECLARATION ===================
+// note that class flags, 'extends' and 'implements' clauses
+// are provided here for information only
+
+.class public auto ansi beforefieldinit Example2
+ extends [mscorlib]System.Object
+{
+ .field public int32 some_variable
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor() cil managed
+ {
+ // Code size 14 (0xe)
+ .maxstack 2
+ IL_0000: ldarg.0
+ IL_0001: ldc.i4.3
+ IL_0002: stfld int32 Example2::some_variable
+ IL_0007: ldarg.0
+ IL_0008: call instance void [mscorlib]System.Object::.ctor()
+ IL_000d: ret
+ } // end of method Example2::.ctor
+
+} // end of class Example2
+
+
+
diff --git a/src/etc/testcases/src/example3.cs b/src/etc/testcases/src/example3.cs
new file mode 100644
index 0000000..698d7c9
--- /dev/null
+++ b/src/etc/testcases/src/example3.cs
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed 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.
+ *
+ */
+
+using System;
+
+/**
+ * this is just here to create confusion
+ */
+public class Example3 {
+
+ public static void echo() {
+ Console.WriteLine("hello, I look like Java, but I'm really .NET");
+ }
+
+}
diff --git a/src/etc/testcases/src/jsharp.java b/src/etc/testcases/src/jsharp.java
new file mode 100644
index 0000000..67e7bad
--- /dev/null
+++ b/src/etc/testcases/src/jsharp.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ * Licensed 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.
+ *
+ */
+
+
+/**
+ * this is a j# class, not a java one.
+ */
+public class jsharp {
+
+ public static void main(String args[]) {
+ System.out.println("hello, I look like Java, but I'm really J#");
+ }
+
+}
diff --git a/src/etc/testcases/src/res.resources b/src/etc/testcases/src/res.resources
new file mode 100644
index 0000000..20e265d
--- /dev/null
+++ b/src/etc/testcases/src/res.resources
Binary files differ
diff --git a/src/etc/testcases/wsdl/StockQuoteService.wsdl b/src/etc/testcases/wsdl/StockQuoteService.wsdl
new file mode 100644
index 0000000..19f0eba
--- /dev/null
+++ b/src/etc/testcases/wsdl/StockQuoteService.wsdl
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://localhost:8080/axis/StockQuoteService.jws" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:impl="http://localhost:8080/axis/StockQuoteService.jws-impl" xmlns:intf="http://localhost:8080/axis/StockQuoteService.jws" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:message name="getQuoteResponse">
+ <wsdl:part name="return" type="xsd:float"/>
+ </wsdl:message>
+ <wsdl:message name="getQuoteRequest">
+ <wsdl:part name="symbol" type="xsd:string"/>
+ </wsdl:message>
+ <wsdl:message name="Exception">
+ </wsdl:message>
+ <wsdl:portType name="StockQuoteService">
+ <wsdl:operation name="getQuote" parameterOrder="symbol">
+ <wsdl:input message="intf:getQuoteRequest"/>
+ <wsdl:output message="intf:getQuoteResponse"/>
+ <wsdl:fault message="intf:Exception" name="Exception"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="StockQuoteServiceSoapBinding" type="intf:StockQuoteService">
+ <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="getQuote">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input>
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/StockQuoteService.jws" use="encoded"/>
+ </wsdl:input>
+ <wsdl:output>
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/StockQuoteService.jws" use="encoded"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="StockQuoteServiceService">
+ <wsdl:port binding="intf:StockQuoteServiceSoapBinding" name="StockQuoteService">
+ <wsdlsoap:address location="http://localhost:8080/axis/StockQuoteService.jws"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
diff --git a/src/tests/junit/org/apache/ant/dotnet/compile/DotnetTest.java b/src/tests/junit/org/apache/ant/dotnet/compile/DotnetTest.java
new file mode 100644
index 0000000..84d8ba2
--- /dev/null
+++ b/src/tests/junit/org/apache/ant/dotnet/compile/DotnetTest.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright 2002-2006 The Apache Software Foundation
+ *
+ * Licensed 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.
+ *
+ */
+package org.apache.ant.dotnet.compile;
+
+import org.apache.tools.ant.BuildFileTest;
+
+/**
+ * Tests the Dotnet tasks, based off WsdlToDotnetTest
+ *
+ * @since Ant 1.6
+ */
+public class DotnetTest extends BuildFileTest {
+
+ /**
+ * Description of the Field
+ */
+ private final static String TASKDEFS_DIR = "src/etc/testcases/";
+
+
+ /**
+ * Constructor
+ *
+ * @param name testname
+ */
+ public DotnetTest(String name) {
+ super(name);
+ }
+
+
+ /**
+ * The JUnit setup method
+ */
+ public void setUp() {
+ configureProject(TASKDEFS_DIR + "old-core.xml");
+ }
+
+
+ /**
+ * The teardown method for JUnit
+ */
+ public void tearDown() {
+ executeTarget("teardown");
+ }
+
+
+ /**
+ * A unit test for JUnit
+ */
+ public void testCSC() throws Exception {
+ executeTarget("testCSC");
+ }
+
+
+ /**
+ * A unit test for JUnit
+ */
+ public void testCSCintrinsicFileset() throws Exception {
+ executeTarget("testCSCintrinsicFileset");
+ }
+
+
+ /**
+ * A unit test for JUnit
+ */
+ public void testCSCdll() throws Exception {
+ executeTarget("testCSCdll");
+ }
+
+ /**
+ * A unit test for JUnit
+ */
+ public void testCscReferences() throws Exception {
+ executeTarget("testCscReferences");
+ }
+
+ /**
+ * A unit test for JUnit
+ */
+ public void testCscResources() throws Exception {
+ executeTarget("testCSCResources");
+ }
+
+ /**
+ * test we can assemble
+ */
+ public void testILASM() throws Exception {
+ executeTarget("testILASM");
+ }
+
+ /**
+ * test we can disassemble
+ */
+ public void testILDASM() throws Exception {
+ executeTarget("testILDASM");
+ }
+
+ /**
+ * test we can disassemble
+ */
+ public void testILDASM_empty() throws Exception {
+ expectBuildExceptionContaining("testILDASM_empty",
+ "parameter validation",
+ "invalid");
+ }
+
+ /**
+ * test we can handle jsharp (if found)
+ */
+ public void testJsharp() throws Exception {
+ executeTarget("jsharp");
+ }
+
+ /**
+ * test we can handle jsharp (if found)
+ */
+ public void testResponseFile() throws Exception {
+ executeTarget("testCSCresponseFile");
+ }
+
+}
+
diff --git a/src/tests/junit/org/apache/ant/dotnet/compile/WsdlToDotnetTest.java b/src/tests/junit/org/apache/ant/dotnet/compile/WsdlToDotnetTest.java
new file mode 100644
index 0000000..83ed795
--- /dev/null
+++ b/src/tests/junit/org/apache/ant/dotnet/compile/WsdlToDotnetTest.java
@@ -0,0 +1,199 @@
+/*
+ * Copyright 2002,2004,2006 The Apache Software Foundation
+ *
+ * Licensed 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.
+ *
+ */
+package org.apache.ant.dotnet.compile;
+
+import org.apache.tools.ant.BuildFileTest;
+
+/**
+ * Tests the WsdlToDotnet task.
+ *
+ * @since Ant 1.5
+ */
+public class WsdlToDotnetTest extends BuildFileTest {
+
+ /**
+ * dir for taskdefs
+ */
+ private final static String TASKDEFS_DIR = "src/etc/testcases/";
+
+ /**
+ * message from exec
+ */
+ private static final String WSDL_FAILED = "WSDL returned:";
+
+
+ /**
+ * Constructor
+ *
+ * @param name testname
+ */
+ public WsdlToDotnetTest(String name) {
+ super(name);
+ }
+
+
+ /**
+ * The JUnit setup method
+ */
+ public void setUp() {
+ configureProject(TASKDEFS_DIR + "WsdlToDotnet.xml");
+ }
+
+
+ /**
+ * The teardown method for JUnit
+ */
+ public void tearDown() {
+ executeTarget("teardown");
+ }
+
+
+
+ /**
+ * A unit test for JUnit
+ */
+ public void testNoParams() throws Exception {
+ expectBuildExceptionContaining("testNoParams",
+ "expected failure",
+ WsdlToDotnet.ERROR_NO_DEST_FILE);
+ }
+
+ /**
+ * A unit test for JUnit
+ */
+ public void testNoSrc() throws Exception {
+ expectBuildExceptionContaining("testNoSrc",
+ "expected failure",
+ WsdlToDotnet.Schema.ERROR_NONE_DECLARED);
+ }
+
+ /**
+ * A unit test for JUnit
+ */
+ public void testDestIsDir() throws Exception {
+ expectBuildExceptionContaining("testDestIsDir",
+ "expected failure",
+ WsdlToDotnet.ERROR_DEST_FILE_IS_DIR);
+ }
+
+ /**
+ * A unit test for JUnit
+ */
+ public void testBothSrc() throws Exception {
+ expectBuildExceptionContaining("testBothSrc",
+ "expected failure",
+ WsdlToDotnet.Schema.ERROR_BOTH_DECLARED);
+ }
+ /**
+ * A unit test for JUnit
+ */
+ public void testSrcIsDir() throws Exception {
+ expectBuildExceptionContaining("testSrcIsDir",
+ "expected failure",
+ WsdlToDotnet.Schema.ERROR_FILE_IS_DIR);
+ }
+
+ /**
+ * A unit test for JUnit
+ */
+ public void testSrcIsMissing() throws Exception {
+ expectBuildExceptionContaining("testSrcIsMissing",
+ "expected failure",
+ WsdlToDotnet.Schema.ERROR_FILE_NOT_FOUND);
+ }
+
+ /**
+ * A unit test for JUnit
+ */
+ public void testLocalWsdl() throws Exception {
+ executeTarget("testLocalWsdl");
+ }
+ /**
+ * A unit test for JUnit
+ */
+ public void testLocalWsdlServer() throws Exception {
+ executeTarget("testLocalWsdlServer");
+ }
+ /**
+ * A unit test for JUnit
+ */
+ public void testInvalidExtraOps() throws Exception {
+ expectBuildExceptionContaining("testInvalidExtraOps",
+ "expected failure",
+ WSDL_FAILED);
+ }
+
+ /**
+ * A unit test for JUnit
+ */
+ public void testLocalWsdlVB() throws Exception {
+ executeTarget("testLocalWsdlVB");
+ }
+ /**
+ * A unit test for JUnit
+ */
+ public void testLocalWsdlServerVB() throws Exception {
+ executeTarget("testLocalWsdlServerVB");
+ }
+ /**
+ * A unit test for JUnit
+ */
+ public void testInvalidExtraOpsVB() throws Exception {
+ expectBuildExceptionContaining("testInvalidExtraOpsVB",
+ "expected failure",
+ WSDL_FAILED);
+ }
+
+ /**
+ * as if parseable errors were not ignored, mono and WSE1.0 would
+ * crash and burn. So here we verify the property exists,
+ * and that it is not passed to the app when false
+ */
+ public void testParseableErrorsIgnoredWhenFalse() throws Exception {
+ executeTarget("testLocalWsdl");
+ }
+
+ /**
+ * A unit test for JUnit
+ */
+ public void testSchemaFileMustExist() throws Exception {
+ expectBuildExceptionContaining("testSchemaFileMustExist",
+ "expected failure",
+ WsdlToDotnet.Schema.ERROR_FILE_NOT_FOUND);
+ }
+
+ /**
+ * A unit test for JUnit
+ */
+ public void testSchemaFileMustHaveOneOptionOnly() throws Exception {
+ expectBuildExceptionContaining("testSchemaFileMustHaveOneOptionOnly",
+ "expected failure",
+ WsdlToDotnet.Schema.ERROR_BOTH_DECLARED);
+ }
+
+ /**
+ * A unit test for JUnit
+ */
+ public void testSchemaMustBeSet() throws Exception {
+ expectBuildExceptionContaining("testSchemaMustBeSet",
+ "expected failure",
+ WsdlToDotnet.Schema.ERROR_NONE_DECLARED);
+ }
+
+
+}
+